You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2012/03/02 20:32:38 UTC

DO NOT REPLY [Bug 52814] New: Fix java warnings (with patch)

https://issues.apache.org/bugzilla/show_bug.cgi?id=52814

             Bug #: 52814
           Summary: Fix java warnings (with patch)
           Product: JMeter
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Main
        AssignedTo: issues@jmeter.apache.org
        ReportedBy: immanuel.hayden@gmail.com
    Classification: Unclassified


Created attachment 28413
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28413
more typesafety proposal patch

Hi all!

After finally managing to set up jmeter in eclipse (don't ask, my work eclipse
setup is really messed up) I played around a little bit and noticed quite a
bunch of warnings regarding type safety and generics (mostly for gui elements
such as jcomboboxes and so on) ... so I fixed them ... and attached a patch ...
the only changes are adding the generics and rewrite some
(String[])asdf.toArray() into asdf.toArray(new String[0]) ;)


TAKE NOTE that there are still two files with warnings left (at least here):
- [...]protocol.http.util.WSDLHelper: the warning says the "idx++" in line 145
is useless (though I'm pretty sure it is not ;))
- [...]testbeans.gui.ComboStringEditor: once we insert these UniqueObjects into
the list and the other time just strings ... didn't feel comfortable to meddle
with that yet ;)


BEWARE: I didn't really much test what I did there, just check that it compiles
and click around in the interface a bit after that, but as the job of generics
is to provide compile-time safety it should have no impact anyhow.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52814] Fix java warnings (with patch)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52814

--- Comment #4 from Philippe Mouawad <p....@ubik-ingenierie.com> 2012-03-03 09:20:07 UTC ---
You must install a jdk5 otherwise you Will use methods That are only available
in your current Jdk.
Setting jdk5 compliance is not enough.
So I am afraid the current patch Will have to wait a migration to jdk6 at least

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52814] Fix java warnings (with patch)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52814

Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |LATER

--- Comment #6 from Sebb <se...@apache.org> 2012-03-03 12:49:46 UTC ---
Java source and binary versions only relate to the language syntax and binary
format.

These are entirely separate from the Java run-time library; however Eclipse
does normally warn you if there is a discrepancy between the library version
and the compiler flags.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52814] Fix java warnings (with patch)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52814

--- Comment #2 from Sebb <se...@apache.org> 2012-03-02 20:08:41 UTC ---
What compiler version are you using?

I don't see the same errors in Eclipse, and I just checked that JComboBox is
not generic in Java 5 (which is what JMeter currently targets) or indeed in
Java 6.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52814] Fix java warnings (with patch)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52814

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om

--- Comment #1 from Philippe Mouawad <p....@ubik-ingenierie.com> 2012-03-02 19:47:47 UTC ---
Thanks Immanuel, but It would be better to test the submitted patch and ensure
that you enter in debug into each modified line.

Regards
Philippe

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52814] Fix java warnings (with patch)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52814

--- Comment #5 from immanuel.hayden@gmail.com 2012-03-03 10:00:35 UTC ---
whoever thought that up (that is: that compliance does not take care of that):
fail ;)
will install the jdk5 and report back, but only later today.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52814] Fix java warnings (with patch)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52814

--- Comment #7 from immanuel.hayden@gmail.com 2012-03-04 11:36:57 UTC ---
ok, just checked with the jdk5, and it doesn't like the patch (aka: it marks
the lines as errors) ... way to go, Oracle :P

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52814] Fix java warnings (with patch)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52814

--- Comment #3 from immanuel.hayden@gmail.com 2012-03-03 09:03:19 UTC ---
@Sebb: jdk7u3, but tried both the compliance levels 1.5 and 1.6 and still see
the same warnings. Maybe you have that specific warning disabled in eclipse?
Mine is set to the default settings ...

@Philippe: will see what I can do (but will have to understand where what is
used first ;)) Generally adding the wrong specific types instead of the raw
types should result in compile time errors as the whole purpose is that the
compiler can check if everything is okay instead of having to do so at runtime
...

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 52814] Fix java warnings (with patch)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52814

immanuel.hayden@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #28413|0                           |1
           is patch|                            |
  Attachment #28413|application/octet-stream    |text/plain
          mime type|                            |

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.