It seems that specifying "java:package:whatever" in a .ice file has a different effect than specifying it on the slice2java command line, at least when the built-in datatypes like ::Ice::StringSeq are used.
Here's a sample file:
If I run slice2java on this as it is (with the appropriate -I argument to find Ice/StringSeq), I get generated Java that refers to Ice.StringSeqHelper. However, if I delete the metadata line in the ice file and specify instead '--meta "java:package:de.tum.in"', the generated file refers (incorrectly) to de.tum.in.Ice.StringSeqHelper. Here's a diff of the generated code from the two cases.Code:#ifndef SPEECHRECOGNITIONLISTENER_ICE #define SPEECHRECOGNITIONLISTENER_ICE [["java:package:de.tum.in"]] #include <Ice/BuiltinSequences.ice> module jast { module listener { interface SpeechRecognitionListener { void recognizedTurn (string top, ::Ice::StringSeq alternatives); }; }; }; #endif
Is this the intended effect? I'd rather use one metadata directive on the command line rather than one per file ...Code:--- test/de/tum/in/jast/listener/_SpeechRecognitionListenerDelM.java 2007-05- 11 15:39:06.000000000 +0100 +++ test2/de/tum/in/jast/listener/_SpeechRecognitionListenerDelM.java 2007-05- 11 15:39:29.000000000 +0100 @@ -24,7 +24,7 @@ { IceInternal.BasicStream __os = __og.os(); __os.writeString(top); - de.tum.in.Ice.StringSeqHelper.write(__os, alternatives); + Ice.StringSeqHelper.write(__os, alternatives); } catch(Ice.LocalException __ex) { diff -ur test/de/tum/in/jast/listener/_SpeechRecognitionListenerDisp.java test2/ de/tum/in/jast/listener/_SpeechRecognitionListenerDisp.java --- test/de/tum/in/jast/listener/_SpeechRecognitionListenerDisp.java 2007-05- 11 15:39:06.000000000 +0100 +++ test2/de/tum/in/jast/listener/_SpeechRecognitionListenerDisp.java 2007-05- 11 15:39:29.000000000 +0100 @@ -82,7 +82,7 @@ String top; top = __is.readString(); String[] alternatives; - alternatives = de.tum.in.Ice.StringSeqHelper.read(__is); + alternatives = Ice.StringSeqHelper.read(__is); __obj.recognizedTurn(top, alternatives, __current); return IceInternal.DispatchStatus.DispatchOK; }
MEF

Reply With Quote