Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    EventHoverHTMLEvent - GWT Compiler Warning - Referencing deprecated class

    hi isomorphic,

    i get this gwt compiler warning
    Code:
    Warnings in 'jar:file:/..../smartgwtpower-4.1p/lib/smartgwtpower.jar!/com/smartgwt/client/widgets/calendar/Calendar.java'
    Referencing deprecated class 'com.smartgwt.client.widgets.calendar.events.EventHoverHTMLEvent'
    with every build. As you can see -in the ant task javac- I just use the deprecated method Page.RegisterKey and not the class EventHoverHTMLEvent. In my application I use the class EventHoverHTMLEvent never directly.

    Code:
    Buildfile: C:\Projects\.eclipse372\xxxpay\build.xml
    clean:
       [delete] Deleting directory C:\Projects\.eclipse372\xxxpay\war\WEB-INF\classes
       [delete] Deleting directory C:\Projects\.eclipse372\xxxpay\gwt-unitCache
    libs:
    javac:
        [mkdir] Created dir: C:\Projects\.eclipse372\xxxpay\war\WEB-INF\classes
        [javac] C:\Projects\.eclipse372\xxxpay\build.xml:66: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
        [javac] Compiling 112 source files to C:\Projects\.eclipse372\xxxpay\war\WEB-INF\classes
        [javac] C:\Projects\.eclipse372\xxxpay\src\com\xxxpay\client\MainEntryPoint.java:106: warning: [deprecation] registerKey(com.smartgwt.client.core.KeyIdentifier,com.smartgwt.client.util.KeyCallback) in com.smartgwt.client.util.Page has been deprecated
        [javac] 			Page.registerKey(debugKey, new KeyCallback() {
        [javac] 			    ^
        [javac] C:\Projects\.eclipse372\xxxpay\src\com\xxxpay\client\test\BuiltInDS.java:66: warning: [deprecation] registerKey(com.smartgwt.client.core.KeyIdentifier,com.smartgwt.client.util.KeyCallback) in com.smartgwt.client.util.Page has been deprecated
        [javac] 		Page.registerKey(debugKey, new KeyCallback() {
        [javac] 		    ^
        [javac] Note: Some input files use unchecked or unsafe operations.
        [javac] Note: Recompile with -Xlint:unchecked for details.
        [javac] 2 warnings
         [copy] Copying 155 files to C:\Projects\.eclipse372\xxxpay\war\WEB-INF\classes
    gwtc:
         [java] Compiling module com.xxxpay.xxxpay
         [java]    Validating units:
         [java]       [WARN] Warnings in 'jar:file:/C:/Projects/.eclipse372/xxxpay/3rdparty/isomporphic/smartgwtpower-4.1p/lib/smartgwtpower.jar!/com/smartgwt/client/widgets/calendar/Calendar.java'
         [java]          [WARN] Line 3298: Referencing deprecated class 'com.smartgwt.client.widgets.calendar.events.EventHoverHTMLEvent'
         [java]    Compiling 6 permutations
         [java]       Compiling permutation 0...
         [java]       Compiling permutation 1...
         [java]       Compiling permutation 2...
         [java]       Compiling permutation 3...
         [java]       Compiling permutation 4...
         [java]       Compiling permutation 5...
         [java]    Compile of permutations succeeded
         [java] Linking into C:\Projects\.eclipse372\xxxpay\war\xxxpay
         [java]    Link succeeded
         [java]    Compilation succeeded -- 142,246s
    build:
    BUILD SUCCESSFUL
    Total time: 2 minutes 37 seconds
    This is just an information to you. I have no problem with that.

    i used: Isomorphic SmartClient/SmartGWT Framework (v9.1p_2014-03-11/PowerEdition Deployment 2014-03-11)

    Best regards,
    Mirko

    #2
    There do not appear to be any internal references to this class.

    If you can show how to get a deprecation warning without referencing this class in your own code, please let us know.

    Comment


      #3
      you use the deprecated EventHoverHTMLEvent code in your deprecated addEventHoverHTMLHandler code :-)

      please have a look at line 3287 within com.smartgwt.client.widgets.calendar.Calendar.java at build v9.1p_2014-03-11/PowerEdition Deployment 2014-03-11

      Code:
          public HandlerRegistration addEventHoverHTMLHandler(com.smartgwt.client.widgets.calendar.events.EventHoverHTMLHandler handler) {
              if(getHandlerCount(com.smartgwt.client.widgets.calendar.events.EventHoverHTMLEvent.getType()) == 0) setupEventHoverHTMLEvent();
              return doAddHandler(handler, com.smartgwt.client.widgets.calendar.events.EventHoverHTMLEvent.getType());
          }
      I think that's the problem

      Comment


        #4
        That would be why addEventHoverHTMLHandler() is also deprecated.

        Don't call this (deprecated) method and you will not receive deprecation warnings.

        Comment


          #5
          My build produces the same warning, though there is no reference in my application to com.smartgwt.client.widgets.calendar.anything.

          Using gwtc in GWT 2.5.1.

          Using SmartClient Version: v9.1p_2014-03-03/Pro Deployment (built 2014-03-03)

          Comment


            #6
            We're not reproducing that. Try creating a standalone test case.

            Comment


              #7
              steps to reproduce:
              1) Download and unzip Smart GWT Power Edition (2014-03-11 nightly)
              2) Import BuiltInDS example into eclipse
              3) change build.xml:
              3a) inside task "javac": change to source="1.6" target="1.6" and insert <compilerarg value="-Xlint:deprecation"/>
              3b) inside task gwtc: insert <arg value="-strict" />
              3c) insert gwt.sdk path (optional)
              5) run the build task in eclipse

              modified build.xml
              Code:
              <?xml version="1.0" encoding="utf-8" ?>
              <project name="BuiltInDS" default="build" basedir=".">
                <!-- Configure path to GWT SDK -->
                <property environment="env"/>
                <property name="gwt.sdk" value="D:/ecli372cfg/standard/plugins/com.google.gwt.eclipse.sdkbundle_2.5.1/gwt-2.5.1" /> 
              
              
                <fail unless="gwt.sdk" message="You must set the GWT_HOME environment variable to point to your GWT SDK"/>
              
                <path id="project.class.path">
                  <pathelement location="war/WEB-INF/classes"/>
                  <pathelement location="${gwt.sdk}/gwt-user.jar"/>
                  <pathelement location="${gwt.sdk}/validation-api-1.0.0.GA.jar" />
                  <pathelement location="${gwt.sdk}/validation-api-1.0.0.GA-sources.jar" />
                  <fileset dir="${gwt.sdk}" includes="gwt-dev*.jar"/>
                  <!-- Add any additional non-server libs (such as JUnit) -->
                  <fileset dir="war/WEB-INF/lib" includes="*.jar"/>
                  <fileset dir="${basedir}/../../lib" includes="*.jar"/>
                </path>
              
                <target name="libs" description="Copy libs to WEB-INF/lib">
                  <mkdir dir="war/WEB-INF/lib" />
                  <copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet.jar" overwrite="true"/>
                  <!-- Add any additional server libs that need to be copied -->
                  <copy todir="war/WEB-INF/lib">
              		<fileset dir="${basedir}/../../lib" includes="**/*.jar">
              			<exclude name="smartgwt*.jar"/>
              		</fileset>	
              	</copy>
                </target>
              
                <target name="javac" depends="libs" description="Compile java source">
                  <mkdir dir="war/WEB-INF/classes"/>
                  <javac srcdir="src" includes="**" encoding="utf-8"
                      destdir="war/WEB-INF/classes"
                      source="1.6" target="1.6" nowarn="true"
                      debug="true" debuglevel="lines,vars,source">
                    <classpath refid="project.class.path"/>
              	<compilerarg value="-Xlint:deprecation"/>
              
                  </javac>
                  <copy todir="war/WEB-INF/classes">
                    <fileset dir="src" excludes="**/*.java"/>
                  </copy>
                </target>
              
                <target name="gwtc" depends="javac" description="GWT compile to JavaScript">
                  <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
                    <classpath>
                      <pathelement location="src"/>
                      <path refid="project.class.path"/>
                    </classpath>
                    <!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
                    <jvmarg value="-Xmx1G"/>
              	<arg value="-strict" />
                    <!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
                    <arg value="com.smartgwt.sample.BuiltInDS"/>
                  </java>
                </target>
              
                <target name="hosted" depends="javac" description="Run hosted mode">
                  <java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode">
                    <classpath>
                      <pathelement location="src"/>
                      <path refid="project.class.path"/>
                    </classpath>
                    <jvmarg value="-Xmx384M"/>
                    <arg value="-startupUrl"/>
                    <arg value="BuiltInDS.html"/>
                    <!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
                    <arg value="com.smartgwt.sample.BuiltInDS"/>
                  </java>
                </target>
              
                <target name="build" depends="gwtc" description="Build this project" />
              
                <target name="war" depends="build" description="Create a war file">
                  <copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet.jar" />
                  <copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet-deps.jar" />
                  <zip destfile="BuiltInDS.war" basedir="war"/>
                </target>
              
                <target name="clean" description="Cleans this project">
                  <delete dir="war/WEB-INF/classes" failonerror="false" />
              	<delete failonerror="false">
              		<fileset dir="war/WEB-INF/lib" includes="**/*.jar" />
              	</delete>
                  <delete dir="war/builtinds" failonerror="false" />
                  <delete dir="gwt-unitCache" failonerror="false" />
                </target>
              
              </project>
              eclipse output:
              Code:
              Buildfile: D:\smartgwtpower-4.1p\smartgwtpower-4.1p\samples\built-in-ds\build.xml
              libs:
                   [copy] Copying 1 file to D:\smartgwtpower-4.1p\smartgwtpower-4.1p\samples\built-in-ds\war\WEB-INF\lib
                   [copy] Copying 78 files to D:\smartgwtpower-4.1p\smartgwtpower-4.1p\samples\built-in-ds\war\WEB-INF\lib
              javac:
                  [javac] D:\smartgwtpower-4.1p\smartgwtpower-4.1p\samples\built-in-ds\build.xml:37: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
              gwtc:
                   [java] Compiling module com.smartgwt.sample.BuiltInDS
                   [java]    Validating units:
                   [java]       [WARN] Warnings in 'jar:file:/D:/smartgwtpower-4.1p/smartgwtpower-4.1p/lib/smartgwtpower.jar!/com/smartgwt/client/widgets/calendar/Calendar.java'
                   [java]          [WARN] Line 3298: Referencing deprecated class 'com.smartgwt.client.widgets.calendar.events.EventHoverHTMLEvent'
              as you can see, the method is used nowhere!

              i used:
              Eclipse Java EE IDE for Web Developers.
              Version: Indigo Service Release 2
              Build id: 20120216-1857

              Comment


                #8
                I am still not able to reproduce this. I've tried both with power edition and the enterprise eval. What version of GWT are you using? Is it customized at all?

                Code:
                Buildfile: C:\Users\Matt\Downloads\smartgwtpower-4.1p\samples\built-in-ds\build.xml
                libs:
                     [copy] Copying 1 file to C:\Users\Matt\Downloads\smartgwtpower-4.1p\samples\built-in-ds\war\WEB-INF\lib
                javac:
                    [javac] C:\Users\Matt\Downloads\smartgwtpower-4.1p\samples\built-in-ds\build.xml:37: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
                gwtc:
                     [java] Compiling module com.smartgwt.sample.BuiltInDS
                     [java]    Compiling 6 permutations
                     [java]       Compiling permutation 0...
                     [java]       Compiling permutation 1...
                     [java]       Compiling permutation 2...
                     [java]       Compiling permutation 3...
                     [java]       Compiling permutation 4...
                     [java]       Compiling permutation 5...
                     [java]    Compile of permutations succeeded
                     [java] Linking into C:\Users\Matt\Downloads\smartgwtpower-4.1p\samples\built-in-ds\war\builtinds
                     [java]    Link succeeded
                     [java]    Compilation succeeded -- 36.086s
                build:
                BUILD SUCCESSFUL
                Total time: 39 seconds
                Code:
                <?xml version="1.0" encoding="utf-8" ?>
                <project name="BuiltInDS" default="build" basedir=".">
                  <!-- Configure path to GWT SDK -->
                  <property environment="env"/>
                  <property name="gwt.sdk" value="..."/>
                
                  <fail unless="gwt.sdk" message="You must set the GWT_HOME environment variable to point to your GWT SDK"/>
                
                  <path id="project.class.path">
                    <pathelement location="war/WEB-INF/classes"/>
                    <pathelement location="${gwt.sdk}/gwt-user.jar"/>
                    <pathelement location="${gwt.sdk}/validation-api-1.0.0.GA.jar" />
                    <pathelement location="${gwt.sdk}/validation-api-1.0.0.GA-sources.jar" />
                    <fileset dir="${gwt.sdk}" includes="gwt-dev*.jar"/>
                    <!-- Add any additional non-server libs (such as JUnit) -->
                    <fileset dir="war/WEB-INF/lib" includes="*.jar"/>
                    <fileset dir="${basedir}/../../lib" includes="*.jar"/>
                  </path>
                
                  <target name="libs" description="Copy libs to WEB-INF/lib">
                    <mkdir dir="war/WEB-INF/lib" />
                    <copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet.jar" overwrite="true"/>
                    <!-- Add any additional server libs that need to be copied -->
                    <copy todir="war/WEB-INF/lib">
                		<fileset dir="${basedir}/../../lib" includes="**/*.jar">
                			<exclude name="smartgwt*.jar"/>
                		</fileset>	
                	</copy>
                  </target>
                  
                
                  <target name="javac" depends="libs" description="Compile java source">
                    <mkdir dir="war/WEB-INF/classes"/>
                    <javac srcdir="src" includes="**" encoding="utf-8"
                        destdir="war/WEB-INF/classes"
                        source="1.6" target="1.6" nowarn="true"
                        debug="true" debuglevel="lines,vars,source">
                      <classpath refid="project.class.path"/>
                      <compilerarg value="-Xlint:deprecation"/>
                    </javac>
                    <copy todir="war/WEB-INF/classes">
                      <fileset dir="src" excludes="**/*.java"/>
                    </copy>
                  </target>
                
                  <target name="gwtc" depends="javac" description="GWT compile to JavaScript">
                    <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
                      <classpath>
                        <pathelement location="src"/>
                        <path refid="project.class.path"/>
                      </classpath>
                      <!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
                      <jvmarg value="-Xmx1G"/>
                      <arg value="-strict" />
                      <!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
                      <arg value="com.smartgwt.sample.BuiltInDS"/>
                      <arg value="-strict" />
                    </java>
                  </target>
                
                  <target name="hosted" depends="javac" description="Run hosted mode">
                    <java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode">
                      <classpath>
                        <pathelement location="src"/>
                        <path refid="project.class.path"/>
                      </classpath>
                      <jvmarg value="-Xmx384M"/>
                      <arg value="-startupUrl"/>
                      <arg value="BuiltInDS.html"/>
                      <!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
                      <arg value="com.smartgwt.sample.BuiltInDS"/>
                    </java>
                  </target>
                
                  <target name="build" depends="gwtc" description="Build this project" />
                
                  <target name="war" depends="build" description="Create a war file">
                    <copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet.jar" />
                    <copy todir="war/WEB-INF/lib" file="${gwt.sdk}/gwt-servlet-deps.jar" />
                    <zip destfile="BuiltInDS.war" basedir="war"/>
                  </target>
                
                  <target name="clean" description="Cleans this project">
                    <delete dir="war/WEB-INF/classes" failonerror="false" />
                	<delete failonerror="false">
                		<fileset dir="war/WEB-INF/lib" includes="**/*.jar" />
                	</delete>
                    <delete dir="war/builtinds" failonerror="false" />
                    <delete dir="gwt-unitCache" failonerror="false" />
                  </target>
                
                </project>

                Comment


                  #9
                  did you delete your gwt-unitCache directory before? I found out that the message only appears if the directory has been recreated.

                  Comment

                  Working...
                  X