From 48ce9464b0fd5bb10bd1068d396eebf4fce23b09 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Tue, 14 Jan 2014 10:08:24 -0800 Subject: [PATCH] 8031651: Remove unneeded -source and -target flags in jdk repo regression tests Reviewed-by: dfuchs, mullan --- .../demo/jvmti/hprof/StackMapTableTest.java | 4 ++-- .../reflect/OldenCompilingWithDefaults.java | 3 +-- .../InvalidParameters.java | 11 +++++++---- .../cert/PKIXParameters/InvalidParameters.java | 10 ++++++---- jdk/test/java/util/Locale/Bug4175998Test.java | 18 ++++++++++-------- .../imageio/metadata/GetObjectMinValue.java | 16 +++++++--------- .../MidiDeviceConnectors/TestAllDevices.java | 4 ++-- .../sampled/AudioFormat/PCM_FLOAT_support.java | 4 ++-- .../LocalRMIServerSocketFactoryTest.java | 4 ++-- 9 files changed, 39 insertions(+), 35 deletions(-) diff --git a/jdk/test/demo/jvmti/hprof/StackMapTableTest.java b/jdk/test/demo/jvmti/hprof/StackMapTableTest.java index eb3fae1300b..758fdaec57e 100644 --- a/jdk/test/demo/jvmti/hprof/StackMapTableTest.java +++ b/jdk/test/demo/jvmti/hprof/StackMapTableTest.java @@ -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 */ diff --git a/jdk/test/java/lang/reflect/OldenCompilingWithDefaults.java b/jdk/test/java/lang/reflect/OldenCompilingWithDefaults.java index c8609b35f9d..0d82520b517 100644 --- a/jdk/test/java/lang/reflect/OldenCompilingWithDefaults.java +++ b/jdk/test/java/lang/reflect/OldenCompilingWithDefaults.java @@ -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 diff --git a/jdk/test/java/security/cert/PKIXBuilderParameters/InvalidParameters.java b/jdk/test/java/security/cert/PKIXBuilderParameters/InvalidParameters.java index d9ef366c481..e1c64a5e045 100644 --- a/jdk/test/java/security/cert/PKIXBuilderParameters/InvalidParameters.java +++ b/jdk/test/java/security/cert/PKIXBuilderParameters/InvalidParameters.java @@ -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 @@ public class InvalidParameters { // make sure Set of invalid objects throws ClassCastException try { + @SuppressWarnings("unchecked") // Knowingly do something bad + Set badSet = (Set) (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) { } } diff --git a/jdk/test/java/security/cert/PKIXParameters/InvalidParameters.java b/jdk/test/java/security/cert/PKIXParameters/InvalidParameters.java index 3e16fa64d1d..ebce8a18347 100644 --- a/jdk/test/java/security/cert/PKIXParameters/InvalidParameters.java +++ b/jdk/test/java/security/cert/PKIXParameters/InvalidParameters.java @@ -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 @@ public class InvalidParameters { } catch (NullPointerException npe) { } // make sure Set of invalid objects throws ClassCastException + @SuppressWarnings("unchecked") // Knowingly do something bad + Set badSet = (Set) (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) { } } diff --git a/jdk/test/java/util/Locale/Bug4175998Test.java b/jdk/test/java/util/Locale/Bug4175998Test.java index 55d92a6ce0d..e890ae9e667 100644 --- a/jdk/test/java/util/Locale/Bug4175998Test.java +++ b/jdk/test/java/util/Locale/Bug4175998Test.java @@ -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 @@ pol pol Polish 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 diff --git a/jdk/test/javax/imageio/metadata/GetObjectMinValue.java b/jdk/test/javax/imageio/metadata/GetObjectMinValue.java index b5d3f6fdfef..04094e3e041 100644 --- a/jdk/test/javax/imageio/metadata/GetObjectMinValue.java +++ b/jdk/test/javax/imageio/metadata/GetObjectMinValue.java @@ -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 class GetObjectMinValue { } 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.addObjectValue(elementName, + (Class)classType, defaultValue, + (Comparable) minValue, (Comparable) maxValue, + minInclusive, maxInclusive); } public boolean canNodeAppear(String elementName, diff --git a/jdk/test/javax/sound/midi/MidiDeviceConnectors/TestAllDevices.java b/jdk/test/javax/sound/midi/MidiDeviceConnectors/TestAllDevices.java index 9155dbb6b32..27290738a0c 100644 --- a/jdk/test/javax/sound/midi/MidiDeviceConnectors/TestAllDevices.java +++ b/jdk/test/javax/sound/midi/MidiDeviceConnectors/TestAllDevices.java @@ -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 */ diff --git a/jdk/test/javax/sound/sampled/AudioFormat/PCM_FLOAT_support.java b/jdk/test/javax/sound/sampled/AudioFormat/PCM_FLOAT_support.java index 43d39fb8ead..7b4f0b1b8e7 100644 --- a/jdk/test/javax/sound/sampled/AudioFormat/PCM_FLOAT_support.java +++ b/jdk/test/javax/sound/sampled/AudioFormat/PCM_FLOAT_support.java @@ -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 * diff --git a/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java b/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java index 620b828caba..e4243391341 100644 --- a/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java +++ b/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java @@ -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 */