Skip to content

Commit aba017f

Browse files
author
Chris Yin
committed
8214694: cleanup rawtypes warnings in open jndi tests
Reviewed-by: darcy, vtewari
1 parent 35f4df5 commit aba017f

30 files changed

+101
-93
lines changed

test/jdk/com/sun/jndi/dns/CheckAccess.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,7 @@
3838
public class CheckAccess {
3939
public static final void main(String[] args) throws Exception {
4040
try {
41-
Class clazz = Class.forName("com.sun.jndi.dns.DnsContext");
41+
Class<?> clazz = Class.forName("com.sun.jndi.dns.DnsContext");
4242
Field field = clazz.getField("debug");
4343
if (Modifier.isPublic(field.getModifiers())) {
4444
throw new Exception(

test/jdk/com/sun/jndi/dns/EnvTests/AddInherited.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -55,8 +55,8 @@ public static void main(String[] args) throws Exception {
5555

5656
Context child = (Context) context().lookup(getKey());
5757

58-
Hashtable envParent = context().getEnvironment();
59-
Hashtable envChild = child.getEnvironment();
58+
Hashtable<?,?> envParent = context().getEnvironment();
59+
Hashtable<?,?> envChild = child.getEnvironment();
6060

6161
DNSTestUtils.debug(child);
6262
DNSTestUtils.debug("Parent env: " + envParent);

test/jdk/com/sun/jndi/dns/EnvTests/GetEnv.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -53,8 +53,8 @@ public static void main(String[] args) throws Exception {
5353

5454
Context child = (Context) context().lookup(getKey());
5555

56-
Hashtable envParent = context().getEnvironment();
57-
Hashtable envChild = child.getEnvironment();
56+
Hashtable<?,?> envParent = context().getEnvironment();
57+
Hashtable<?,?> envChild = child.getEnvironment();
5858

5959
DNSTestUtils.debug(child);
6060
DNSTestUtils.debug("Parent env: " + envParent);

test/jdk/com/sun/jndi/dns/EnvTests/RemoveInherited.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -67,8 +67,8 @@ public static void main(String[] args) throws Exception {
6767

6868
Context child = (Context) context().lookup(getKey());
6969

70-
Hashtable envParent = context().getEnvironment();
71-
Hashtable envChild = child.getEnvironment();
70+
Hashtable<?,?> envParent = context().getEnvironment();
71+
Hashtable<?,?> envChild = child.getEnvironment();
7272

7373
DNSTestUtils.debug(child);
7474
DNSTestUtils.debug("Parent env: " + envParent);

test/jdk/com/sun/jndi/dns/EnvTests/SubcontextAdd.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -57,8 +57,8 @@ public static void main(String[] args) throws Exception {
5757
addToEnvAndVerifyOldValIsNull(child, "some.irrelevant.property",
5858
"somevalue");
5959

60-
Hashtable envParent = context().getEnvironment();
61-
Hashtable envChild = child.getEnvironment();
60+
Hashtable<?,?> envParent = context().getEnvironment();
61+
Hashtable<?,?> envChild = child.getEnvironment();
6262

6363
DNSTestUtils.debug(child);
6464
DNSTestUtils.debug("Parent env: " + envParent);

test/jdk/com/sun/jndi/dns/EnvTests/SubcontextRemove.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -62,8 +62,8 @@ public static void main(String[] args) throws Exception {
6262
+ val);
6363
}
6464

65-
Hashtable envParent = context().getEnvironment();
66-
Hashtable envChild = child.getEnvironment();
65+
Hashtable<?,?> envParent = context().getEnvironment();
66+
Hashtable<?,?> envChild = child.getEnvironment();
6767

6868
DNSTestUtils.debug(child);
6969
DNSTestUtils.debug("Parent env: " + envParent);

test/jdk/com/sun/jndi/dns/FactoryTests/TestDnsObject.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@ public class TestDnsObject {
3131
public TestDnsObject(Attribute attr) {
3232
StringBuilder buf = new StringBuilder();
3333
try {
34-
NamingEnumeration enumObj = attr.getAll();
34+
NamingEnumeration<?> enumObj = attr.getAll();
3535
while (enumObj.hasMore()) {
3636
buf.append(enumObj.next());
3737
}

test/jdk/com/sun/jndi/dns/FedTests/ListFedBase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -46,15 +46,15 @@ public ListFedBase() {
4646
* @param expectedCount given expected count
4747
* @throws NamingException
4848
*/
49-
public void verifyNamingEnumeration(NamingEnumeration enumObj,
49+
public void verifyNamingEnumeration(NamingEnumeration<Binding> enumObj,
5050
int expectedCount) throws NamingException {
5151
DNSTestUtils.debug("Enum is: " + enumObj);
5252

5353
int count = 0;
5454
Binding res;
5555

5656
while (enumObj.hasMore()) {
57-
res = (Binding) enumObj.next();
57+
res = enumObj.next();
5858
DNSTestUtils.debug(res);
5959
++count;
6060
}

test/jdk/com/sun/jndi/dns/FedTests/ListNns.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -21,6 +21,7 @@
2121
* questions.
2222
*/
2323

24+
import javax.naming.Binding;
2425
import javax.naming.Context;
2526
import javax.naming.NamingEnumeration;
2627
import javax.naming.directory.InitialDirContext;
@@ -52,7 +53,7 @@ public void runTest() throws Exception {
5253
env().put(Context.OBJECT_FACTORIES, "FedObjectFactory");
5354
setContext(new InitialDirContext(env()));
5455

55-
NamingEnumeration enumObj = context().listBindings(getKey() + "/");
56+
NamingEnumeration<Binding> enumObj = context().listBindings(getKey() + "/");
5657
verifyNamingEnumeration(enumObj, COUNT_LIMIT);
5758
}
5859
}

test/jdk/com/sun/jndi/dns/FedTests/ListSubInterior.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -21,6 +21,7 @@
2121
* questions.
2222
*/
2323

24+
import javax.naming.Binding;
2425
import javax.naming.Context;
2526
import javax.naming.NamingEnumeration;
2627
import javax.naming.directory.InitialDirContext;
@@ -54,7 +55,7 @@ public void runTest() throws Exception {
5455
env().put(Context.OBJECT_FACTORIES, "FedObjectFactory");
5556
setContext(new InitialDirContext(env()));
5657

57-
NamingEnumeration enumObj = context().listBindings(getKey() + "/a/b");
58+
NamingEnumeration<Binding> enumObj = context().listBindings(getKey() + "/a/b");
5859
verifyNamingEnumeration(enumObj, COUNT_LIMIT);
5960
}
6061
}

0 commit comments

Comments
 (0)