Thursday, August 4, 2016

System.getProperty(...) - compile vs Eclipse plug-in difference (2.8b1)

Hi there,

Pretty simple example, but seems like possibly a bug or oddity in GWT 2.8b1 between the command line and the Eclipse plug in.

Setup: In a Module.gwt.xml file we define a property like so:
<define-property values="true,false" name="myProperty" />
<set-property name="myProperty" value="false" />

In a class we use it like so (paraphrased):
public class MyClass {
  
   public static final String STR_PROP = "myProperty";

   <SNIPS>

    public void foo() {
        String propValue = System.getProperty(STR_PROP);
        ....
    }
}

Behavior difference!
 - When we compile this on our command line, there is no error.
 - When we run thru SDM, the following error pops up:  [ERROR] Line 37: Only string constants may be used as property name in System.getProperty()

Does SDM just have an issue with the String constant used whereas the compiler itself does not? Bug? Intended? Suggestions? Thanks!

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment