8031651: Remove unneeded -source and -target flags in jdk repo regression tests
authordarcy
Tue, 14 Jan 2014 10:08:24 -0800
changeset 22277 1d3a2cb3552f
parent 22276 7fc4c8b08e49
child 22278 a32375f9a4b5
8031651: Remove unneeded -source and -target flags in jdk repo regression tests Reviewed-by: dfuchs, mullan
jdk/test/demo/jvmti/hprof/StackMapTableTest.java
jdk/test/java/lang/reflect/OldenCompilingWithDefaults.java
jdk/test/java/security/cert/PKIXBuilderParameters/InvalidParameters.java
jdk/test/java/security/cert/PKIXParameters/InvalidParameters.java
jdk/test/java/util/Locale/Bug4175998Test.java
jdk/test/javax/imageio/metadata/GetObjectMinValue.java
jdk/test/javax/sound/midi/MidiDeviceConnectors/TestAllDevices.java
jdk/test/javax/sound/sampled/AudioFormat/PCM_FLOAT_support.java
jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java
--- a/jdk/test/demo/jvmti/hprof/StackMapTableTest.java	Tue Jan 14 16:23:49 2014 +0000
+++ b/jdk/test/demo/jvmti/hprof/StackMapTableTest.java	Tue Jan 14 10:08:24 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
  * @summary Test jvmti hprof and java_crw_demo with StackMapTable attributes
  *
  * @compile ../DemoRun.java
- * @compile -source 7 -g:lines HelloWorld.java
+ * @compile -g:lines HelloWorld.java
  * @build StackMapTableTest
  * @run main StackMapTableTest HelloWorld
  */
--- a/jdk/test/java/lang/reflect/OldenCompilingWithDefaults.java	Tue Jan 14 16:23:49 2014 +0000
+++ b/jdk/test/java/lang/reflect/OldenCompilingWithDefaults.java	Tue Jan 14 10:08:24 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,6 @@
  * @test
  * @bug 8009267
  * @summary Verify uses of isAnnotationPresent compile under older source versions
- * @compile -source 1.5 -target 1.5 OldenCompilingWithDefaults.java
  * @compile -source 1.6 -target 1.6 OldenCompilingWithDefaults.java
  * @compile -source 1.7 -target 1.7 OldenCompilingWithDefaults.java
  * @compile                         OldenCompilingWithDefaults.java
--- a/jdk/test/java/security/cert/PKIXBuilderParameters/InvalidParameters.java	Tue Jan 14 16:23:49 2014 +0000
+++ b/jdk/test/java/security/cert/PKIXBuilderParameters/InvalidParameters.java	Tue Jan 14 10:08:24 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,16 +21,17 @@
  * questions.
  */
 
-/**
+/*
  * @test
  * @test 4422738
- * @compile -source 1.4 InvalidParameters.java
+ * @compile InvalidParameters.java
  * @run main InvalidParameters
  * @summary Make sure PKIXBuilderParameters(Set) detects invalid
  *          parameters and throws correct exceptions
  */
 import java.security.InvalidAlgorithmParameterException;
 import java.security.cert.PKIXBuilderParameters;
+import java.security.cert.TrustAnchor;
 import java.util.Collections;
 import java.util.Set;
 
@@ -53,8 +54,10 @@
 
         // make sure Set of invalid objects throws ClassCastException
         try {
+            @SuppressWarnings("unchecked") // Knowingly do something bad
+            Set<TrustAnchor> badSet = (Set<TrustAnchor>) (Set) Collections.singleton(new String());
             PKIXBuilderParameters p =
-                new PKIXBuilderParameters(Collections.singleton(new String()), null);
+                new PKIXBuilderParameters(badSet, null);
             throw new Exception("should have thrown ClassCastException");
         } catch (ClassCastException cce) { }
     }
--- a/jdk/test/java/security/cert/PKIXParameters/InvalidParameters.java	Tue Jan 14 16:23:49 2014 +0000
+++ b/jdk/test/java/security/cert/PKIXParameters/InvalidParameters.java	Tue Jan 14 10:08:24 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@
 /**
  * @test
  * @test 4422738
- * @compile -source 1.4 InvalidParameters.java
+ * @compile InvalidParameters.java
  * @run main InvalidParameters
  * @summary Make sure PKIXParameters(Set) and setTrustAnchors() detects invalid
  *          parameters and throws correct exceptions
@@ -64,12 +64,14 @@
         } catch (NullPointerException npe) { }
 
         // make sure Set of invalid objects throws ClassCastException
+        @SuppressWarnings("unchecked") // Knowingly do something bad
+        Set<TrustAnchor> badSet = (Set<TrustAnchor>) (Set) Collections.singleton(new String());
         try {
-            PKIXParameters p = new PKIXParameters(Collections.singleton(new String()));
+            PKIXParameters p = new PKIXParameters(badSet);
             throw new Exception("should have thrown ClassCastException");
         } catch (ClassCastException cce) { }
         try {
-            params.setTrustAnchors(Collections.singleton(new String()));
+            params.setTrustAnchors(badSet);
             throw new Exception("should have thrown ClassCastException");
         } catch (ClassCastException cce) { }
     }
--- a/jdk/test/java/util/Locale/Bug4175998Test.java	Tue Jan 14 16:23:49 2014 +0000
+++ b/jdk/test/java/util/Locale/Bug4175998Test.java	Tue Jan 14 10:08:24 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -20,13 +20,15 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
 /*
-    @test
-    @summary test ISO639-2 language codes
-    @compile -encoding ascii -source 5 Bug4175998Test.java
-    @run main Bug4175998Test
-    @bug 4175998
-*/
+ * @test
+ * @summary test ISO639-2 language codes
+ * @compile -encoding ascii Bug4175998Test.java
+ * @run main Bug4175998Test
+ * @bug 4175998
+ */
+
 /*
  *
  *
@@ -731,7 +733,7 @@
 pon pon Pohnpeian
 por por Portuguese
 pra pra Prakrit languages
-pro pro Provençal, Old (to 1500)
+pro pro Proven\u00E7al, Old (to 1500)
 pus pus Pushto
 qaa-qtz qaa-qtz Reserved for local use
 que que Quechua
--- a/jdk/test/javax/imageio/metadata/GetObjectMinValue.java	Tue Jan 14 16:23:49 2014 +0000
+++ b/jdk/test/javax/imageio/metadata/GetObjectMinValue.java	Tue Jan 14 10:08:24 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,12 @@
 /*
  * @test
  * @bug 4429875 7186799
- * @compile -source 1.4 GetObjectMinValue.java
+ * @compile GetObjectMinValue.java
  * @run main GetObjectMinValue
  * @summary Tests the getObject{Min,Max}Value method of
  * IIOMetadataFormatImpl for an inclusive range
  */
 
-// Compiled with -source 1.4 to work around javac bug 5041233
-
 import javax.imageio.metadata.IIOMetadataFormatImpl;
 import javax.imageio.ImageTypeSpecifier;
 
@@ -79,13 +77,13 @@
         }
 
         public void addObjectValue(String elementName,
-                                   Class classType, Object defaultValue,
+                                   Class<?> classType, Integer defaultValue,
                                    Comparable minValue, Comparable maxValue,
                                    boolean minInclusive, boolean maxInclusive) {
-            super.addObjectValue(elementName,
-                                 classType, defaultValue,
-                                 minValue, maxValue,
-                                 minInclusive, maxInclusive);
+            super.<Integer>addObjectValue(elementName,
+                                          (Class<Integer>)classType, defaultValue,
+                                          (Comparable<? super Integer>) minValue, (Comparable<? super Integer>) maxValue,
+                                          minInclusive, maxInclusive);
         }
 
         public boolean canNodeAppear(String elementName,
--- a/jdk/test/javax/sound/midi/MidiDeviceConnectors/TestAllDevices.java	Tue Jan 14 16:23:49 2014 +0000
+++ b/jdk/test/javax/sound/midi/MidiDeviceConnectors/TestAllDevices.java	Tue Jan 14 10:08:24 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
  * @test
  * @bug 4933700
  * @summary Tests that default devices return MidiDeviceTransmitter/Receiver and returned objects return correct MidiDevice
- * @compile -source 1.7 TestAllDevices.java
+ * @compile TestAllDevices.java
  * @run main TestAllDevices
  * @author Alex Menkov
  */
--- a/jdk/test/javax/sound/sampled/AudioFormat/PCM_FLOAT_support.java	Tue Jan 14 16:23:49 2014 +0000
+++ b/jdk/test/javax/sound/sampled/AudioFormat/PCM_FLOAT_support.java	Tue Jan 14 10:08:24 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
  * @test
  * @bug 6944033
  * @summary Tests that PCM_FLOAT encoding is supported
- * @compile -source 1.7 PCM_FLOAT_support.java
+ * @compile PCM_FLOAT_support.java
  * @run main PCM_FLOAT_support
  * @author Alex Menkov
  *
--- a/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java	Tue Jan 14 16:23:49 2014 +0000
+++ b/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java	Tue Jan 14 10:08:24 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
  *
  *  @author Daniel Fuchs
  *
- *  @run compile -XDignore.symbol.file=true -source 1.6 -g LocalRMIServerSocketFactoryTest.java
+ *  @run compile -XDignore.symbol.file=true -g LocalRMIServerSocketFactoryTest.java
  *  @run main LocalRMIServerSocketFactoryTest
  */