[15] RFR: 8214694: cleanup rawtypes warnings in open jndi tests
Hello Please review following simple changes to cleanup raw types warning for open jndi tests (under test/jdk/com/sun/jndi and test/jdk/javax/naming), thanks Bug: https://bugs.openjdk.java.net/browse/JDK-8214694 Webrev: http://cr.openjdk.java.net/~xyin/8214694/webrev.00/ The changes should be straightforward, only fix raw types warnings, no test logic change, no code optimization or cleanup. Minor change to each test file, just a little surprised about the affected tests count, hope this covers all. Run related jndi tests on 4 platforms for total 200 times, all passed. Thanks, Chris
Hi Chris, The changes don't appear incorrect, but at least from a cursory inspection, they don't appear as precise as they could be. Usually generifying a classes like this will next yield a round of redundant "cast" warnings; in my cleanup efforts, getting cast warnings was usually a sign the right generifiation was found. HTH, -Joe On 3/25/2020 12:57 AM, Chris Yin wrote:
Hello
Please review following simple changes to cleanup raw types warning for open jndi tests (under test/jdk/com/sun/jndi and test/jdk/javax/naming), thanks
Bug: https://bugs.openjdk.java.net/browse/JDK-8214694 Webrev: http://cr.openjdk.java.net/~xyin/8214694/webrev.00/
The changes should be straightforward, only fix raw types warnings, no test logic change, no code optimization or cleanup. Minor change to each test file, just a little surprised about the affected tests count, hope this covers all. Run related jndi tests on 4 platforms for total 200 times, all passed.
Thanks, Chris
Hi, Joe Thank you for reviewing and comments. I agree that some part of the change could be as precise as they could be, and yes, after fix them, a round of redundant “cast” warnings just show up as you mentioned, both fixed now For rest of them, I could see most are due to the API return value or parameter are imprecise (such as Class.forName, Context.getEnvironment etc), to avoid useless cast, just kept the same declaration, please kindly advise if you have any suggestion about that too, thanks. Updated webrev as below http://cr.openjdk.java.net/~xyin/8214694/webrev.01/ Regards, Chris
On 27 Mar 2020, at 4:41 AM, Joe Darcy <joe.darcy@oracle.com> wrote:
Hi Chris,
The changes don't appear incorrect, but at least from a cursory inspection, they don't appear as precise as they could be. Usually generifying a classes like this will next yield a round of redundant "cast" warnings; in my cleanup efforts, getting cast warnings was usually a sign the right generifiation was found.
HTH,
-Joe
On 3/25/2020 12:57 AM, Chris Yin wrote:
Hello
Please review following simple changes to cleanup raw types warning for open jndi tests (under test/jdk/com/sun/jndi and test/jdk/javax/naming), thanks
Bug: https://bugs.openjdk.java.net/browse/JDK-8214694 Webrev: http://cr.openjdk.java.net/~xyin/8214694/webrev.00/
The changes should be straightforward, only fix raw types warnings, no test logic change, no code optimization or cleanup. Minor change to each test file, just a little surprised about the affected tests count, hope this covers all. Run related jndi tests on 4 platforms for total 200 times, all passed.
Thanks, Chris
Hi Chris, Revised version looks better; thanks, -Joe On 3/27/2020 1:30 AM, Chris Yin wrote:
Hi, Joe
Thank you for reviewing and comments.
I agree that some part of the change could be as precise as they could be, and yes, after fix them, a round of redundant “cast” warnings just show up as you mentioned, both fixed now For rest of them, I could see most are due to the API return value or parameter are imprecise (such as Class.forName, Context.getEnvironment etc), to avoid useless cast, just kept the same declaration, please kindly advise if you have any suggestion about that too, thanks. Updated webrev as below
http://cr.openjdk.java.net/~xyin/8214694/webrev.01/
Regards, Chris
On 27 Mar 2020, at 4:41 AM, Joe Darcy <joe.darcy@oracle.com> wrote:
Hi Chris,
The changes don't appear incorrect, but at least from a cursory inspection, they don't appear as precise as they could be. Usually generifying a classes like this will next yield a round of redundant "cast" warnings; in my cleanup efforts, getting cast warnings was usually a sign the right generifiation was found.
HTH,
-Joe
On 3/25/2020 12:57 AM, Chris Yin wrote:
Hello
Please review following simple changes to cleanup raw types warning for open jndi tests (under test/jdk/com/sun/jndi and test/jdk/javax/naming), thanks
Bug: https://bugs.openjdk.java.net/browse/JDK-8214694 Webrev: http://cr.openjdk.java.net/~xyin/8214694/webrev.00/
The changes should be straightforward, only fix raw types warnings, no test logic change, no code optimization or cleanup. Minor change to each test file, just a little surprised about the affected tests count, hope this covers all. Run related jndi tests on 4 platforms for total 200 times, all passed.
Thanks, Chris
Thank you, Joe Regards, Chris
On 31 Mar 2020, at 11:49 PM, Joe Darcy <joe.darcy@oracle.com> wrote:
Hi Chris,
Revised version looks better; thanks,
-Joe
On 3/27/2020 1:30 AM, Chris Yin wrote:
Hi, Joe
Thank you for reviewing and comments.
I agree that some part of the change could be as precise as they could be, and yes, after fix them, a round of redundant “cast” warnings just show up as you mentioned, both fixed now For rest of them, I could see most are due to the API return value or parameter are imprecise (such as Class.forName, Context.getEnvironment etc), to avoid useless cast, just kept the same declaration, please kindly advise if you have any suggestion about that too, thanks. Updated webrev as below
http://cr.openjdk.java.net/~xyin/8214694/webrev.01/
Regards, Chris
On 27 Mar 2020, at 4:41 AM, Joe Darcy <joe.darcy@oracle.com> wrote:
Hi Chris,
The changes don't appear incorrect, but at least from a cursory inspection, they don't appear as precise as they could be. Usually generifying a classes like this will next yield a round of redundant "cast" warnings; in my cleanup efforts, getting cast warnings was usually a sign the right generifiation was found.
HTH,
-Joe
On 3/25/2020 12:57 AM, Chris Yin wrote:
Hello
Please review following simple changes to cleanup raw types warning for open jndi tests (under test/jdk/com/sun/jndi and test/jdk/javax/naming), thanks
Bug: https://bugs.openjdk.java.net/browse/JDK-8214694 Webrev: http://cr.openjdk.java.net/~xyin/8214694/webrev.00/
The changes should be straightforward, only fix raw types warnings, no test logic change, no code optimization or cleanup. Minor change to each test file, just a little surprised about the affected tests count, hope this covers all. Run related jndi tests on 4 platforms for total 200 times, all passed.
Thanks, Chris
Hi Chris, I have one question to you, is there is any specific reason for using wildcard(?) ?. In your change we can avoid "?" at most of the places. Please see the below methods signatures. ####################################################################### public NamingEnumeration<Binding> listBindings(Name name) throws NamingException; public NamingEnumeration<NameClassPair> list(Name name) throws NamingException; public NamingEnumeration<SearchResult> search(Name name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException; ##################################################################### thanks, Vyom On Wed, Mar 25, 2020 at 1:28 PM Chris Yin <xu.y.yin@oracle.com> wrote:
Hello
Please review following simple changes to cleanup raw types warning for open jndi tests (under test/jdk/com/sun/jndi and test/jdk/javax/naming), thanks
Bug: https://bugs.openjdk.java.net/browse/JDK-8214694 Webrev: http://cr.openjdk.java.net/~xyin/8214694/webrev.00/
The changes should be straightforward, only fix raw types warnings, no test logic change, no code optimization or cleanup. Minor change to each test file, just a little surprised about the affected tests count, hope this covers all. Run related jndi tests on 4 platforms for total 200 times, all passed.
Thanks, Chris
-- Thanks, Vyom
Hi, Vyom
On 27 Mar 2020, at 12:08 PM, Vyom Tiwari <vyommani@gmail.com> wrote:
Hi Chris,
I have one question to you, is there is any specific reason for using wildcard(?) ?.
Thank you for reviewing and comments. I just replaced most of the wildcard(?) with specified type as precise as they could be in latest webrev.01, the rest of them may fall into below scenarios. 1. API return value or parameter with wildcard(?), such as Hashtable<?,?> in test/jdk/com/sun/jndi/dns/EnvTests/AddInherited.java 2. Cannot find the precise type from code, such as ScheduledFuture<?> in test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java
In your change we can avoid "?" at most of the places. Please see the below methods signatures.
####################################################################### public NamingEnumeration<Binding> listBindings(Name name) throws NamingException; public NamingEnumeration<NameClassPair> list(Name name) throws NamingException; public NamingEnumeration<SearchResult> search(Name name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException; #####################################################################
Thank you for the detailed signatures info, yes, now all fixed in the latest webrev http://cr.openjdk.java.net/~xyin/8214694/webrev.01/ Regards, Chris
thanks, Vyom
On Wed, Mar 25, 2020 at 1:28 PM Chris Yin <xu.y.yin@oracle.com <mailto:xu.y.yin@oracle.com>> wrote: Hello
Please review following simple changes to cleanup raw types warning for open jndi tests (under test/jdk/com/sun/jndi and test/jdk/javax/naming), thanks
Bug: https://bugs.openjdk.java.net/browse/JDK-8214694 <https://bugs.openjdk.java.net/browse/JDK-8214694> Webrev: http://cr.openjdk.java.net/~xyin/8214694/webrev.00/ <http://cr.openjdk.java.net/~xyin/8214694/webrev.00/>
The changes should be straightforward, only fix raw types warnings, no test logic change, no code optimization or cleanup. Minor change to each test file, just a little surprised about the affected tests count, hope this covers all. Run related jndi tests on 4 platforms for total 200 times, all passed.
Thanks, Chris
-- Thanks, Vyom
Hi Chris, Latest changes look good to me. I can see that there are couple of unused imports in files(DeadServerTimeoutSSLTest.java) but unused imports are separate issue. Thanks, Vyom On Fri, Mar 27, 2020 at 2:48 PM Chris Yin <xu.y.yin@oracle.com> wrote:
Hi, Vyom
On 27 Mar 2020, at 12:08 PM, Vyom Tiwari <vyommani@gmail.com> wrote:
Hi Chris,
I have one question to you, is there is any specific reason for using wildcard(?) ?.
Thank you for reviewing and comments. I just replaced most of the wildcard(?) with specified type as precise as they could be in latest webrev.01, the rest of them may fall into below scenarios.
1. API return value or parameter with wildcard(?), such as Hashtable<?,?> in test/jdk/com/sun/jndi/dns/EnvTests/AddInherited.java 2. Cannot find the precise type from code, such as ScheduledFuture<?> in test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java
In your change we can avoid "?" at most of the places. Please see the below methods signatures.
####################################################################### public NamingEnumeration<Binding> listBindings(Name name) throws NamingException; public NamingEnumeration<NameClassPair> list(Name name) throws NamingException; public NamingEnumeration<SearchResult> search(Name name, Attributes matchingAttributes,
String[] attributesToReturn) throws NamingException; #####################################################################
Thank you for the detailed signatures info, yes, now all fixed in the latest webrev http://cr.openjdk.java.net/~xyin/8214694/webrev.01/
Regards, Chris
thanks, Vyom
On Wed, Mar 25, 2020 at 1:28 PM Chris Yin <xu.y.yin@oracle.com> wrote:
Hello
Please review following simple changes to cleanup raw types warning for open jndi tests (under test/jdk/com/sun/jndi and test/jdk/javax/naming), thanks
Bug: https://bugs.openjdk.java.net/browse/JDK-8214694 Webrev: http://cr.openjdk.java.net/~xyin/8214694/webrev.00/
The changes should be straightforward, only fix raw types warnings, no test logic change, no code optimization or cleanup. Minor change to each test file, just a little surprised about the affected tests count, hope this covers all. Run related jndi tests on 4 platforms for total 200 times, all passed.
Thanks, Chris
-- Thanks, Vyom
-- Thanks, Vyom
Thank you, Vyom Regards, Chris
On 27 Mar 2020, at 6:06 PM, Vyom Tiwari <vyommani@gmail.com> wrote:
Hi Chris,
Latest changes look good to me. I can see that there are couple of unused imports in files(DeadServerTimeoutSSLTest.java) but unused imports are separate issue.
Thanks, Vyom
On Fri, Mar 27, 2020 at 2:48 PM Chris Yin <xu.y.yin@oracle.com <mailto:xu.y.yin@oracle.com>> wrote: Hi, Vyom
On 27 Mar 2020, at 12:08 PM, Vyom Tiwari <vyommani@gmail.com <mailto:vyommani@gmail.com>> wrote:
Hi Chris,
I have one question to you, is there is any specific reason for using wildcard(?) ?.
Thank you for reviewing and comments. I just replaced most of the wildcard(?) with specified type as precise as they could be in latest webrev.01, the rest of them may fall into below scenarios.
1. API return value or parameter with wildcard(?), such as Hashtable<?,?> in test/jdk/com/sun/jndi/dns/EnvTests/AddInherited.java 2. Cannot find the precise type from code, such as ScheduledFuture<?> in test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java
In your change we can avoid "?" at most of the places. Please see the below methods signatures.
####################################################################### public NamingEnumeration<Binding> listBindings(Name name) throws NamingException; public NamingEnumeration<NameClassPair> list(Name name) throws NamingException; public NamingEnumeration<SearchResult> search(Name name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException; #####################################################################
Thank you for the detailed signatures info, yes, now all fixed in the latest webrev http://cr.openjdk.java.net/~xyin/8214694/webrev.01/ <http://cr.openjdk.java.net/~xyin/8214694/webrev.01/>
Regards, Chris
thanks, Vyom
On Wed, Mar 25, 2020 at 1:28 PM Chris Yin <xu.y.yin@oracle.com <mailto:xu.y.yin@oracle.com>> wrote: Hello
Please review following simple changes to cleanup raw types warning for open jndi tests (under test/jdk/com/sun/jndi and test/jdk/javax/naming), thanks
Bug: https://bugs.openjdk.java.net/browse/JDK-8214694 <https://bugs.openjdk.java.net/browse/JDK-8214694> Webrev: http://cr.openjdk.java.net/~xyin/8214694/webrev.00/ <http://cr.openjdk.java.net/~xyin/8214694/webrev.00/>
The changes should be straightforward, only fix raw types warnings, no test logic change, no code optimization or cleanup. Minor change to each test file, just a little surprised about the affected tests count, hope this covers all. Run related jndi tests on 4 platforms for total 200 times, all passed.
Thanks, Chris
-- Thanks, Vyom
-- Thanks, Vyom
participants (3)
-
Chris Yin
-
Joe Darcy
-
Vyom Tiwari