diff --git a/.hgtags b/.hgtags index b21995364ae..85568ceac65 100644 --- a/.hgtags +++ b/.hgtags @@ -307,3 +307,4 @@ ac3f5a39d4ff14d70c365e12cf5ec8f2abd52a04 jdk9-b61 e7dbbef69d12b6a74dfad331b7188e7f893e8d29 jdk9-b62 989253a902c34dcb7564695161c9200a5fbb7412 jdk9-b63 8ffdeabc7c2b9a8280bf46cae026ac46b4d31c26 jdk9-b64 +4915246064b2f89d5f00c96e758686b7fdad36a6 jdk9-b65 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index bfa2e564382..69e09487ac2 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -307,3 +307,4 @@ ea38728b4f4bdd8fd0d7a89b18069f521cf05013 jdk9-b61 105d045a69174d870b69bfe471b3f2d05a9f8ecc jdk9-b62 0b32ed628fa60e4ab99fb0b5866d648e16231f17 jdk9-b63 82cf9aab9a83e41c8194ba01af9666afdb856cbe jdk9-b64 +7c31f9d7b932f7924f1258d52885b1c7c3e078c2 jdk9-b65 diff --git a/common/bin/compare_exceptions.sh.incl b/common/bin/compare_exceptions.sh.incl index 90e110c8978..b015b7d0d8b 100644 --- a/common/bin/compare_exceptions.sh.incl +++ b/common/bin/compare_exceptions.sh.incl @@ -83,7 +83,6 @@ ACCEPTED_BIN_DIFF=" ./bin/jcmd ./bin/jconsole ./bin/jdb -./bin/jhat ./bin/jimage ./bin/jinfo ./bin/jjs @@ -163,7 +162,6 @@ ACCEPTED_BIN_DIFF=" ./bin/jcmd ./bin/jconsole ./bin/jdb -./bin/jhat ./bin/jimage ./bin/jinfo ./bin/jjs @@ -284,7 +282,6 @@ ACCEPTED_SMALL_SIZE_DIFF=" ./bin/jcmd ./bin/jconsole ./bin/jdb -./bin/jhat ./bin/jimage ./bin/jinfo ./bin/jjs @@ -420,7 +417,6 @@ ACCEPTED_SMALL_SIZE_DIFF=" ./bin/jcmd ./bin/jconsole ./bin/jdb -./bin/jhat ./bin/jimage ./bin/jinfo ./bin/jjs @@ -499,7 +495,6 @@ ACCEPTED_SMALL_SIZE_DIFF=" ./bin/jcmd.exe ./bin/jconsole.exe ./bin/jdb.exe -./bin/jhat.exe ./bin/jimage.exe ./bin/jinfo.exe ./bin/jjs.exe @@ -579,7 +574,6 @@ ACCEPTED_BIN_DIFF=" ./bin/jcmd ./bin/jconsole ./bin/jdb -./bin/jhat ./bin/jimage ./bin/jinfo ./bin/jjs diff --git a/corba/.hgtags b/corba/.hgtags index 8acbf91c3b9..182e23ba265 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -307,3 +307,4 @@ d690f489ca0bb95a6157d996da2fa72bcbcf02ea jdk9-b61 d27f7e0a7aca129969de23e9934408a31b4abf4c jdk9-b62 0acac6937de7a0868f8c6f88b7d036d780abeee6 jdk9-b63 0a5e5a7c3539e8bde73d9fe55750e49a49cb8dac jdk9-b64 +afc1e295c4bf83f9a5dd539c29914edd4a754a3f jdk9-b65 diff --git a/hotspot/.hgtags b/hotspot/.hgtags index def3dbf7702..36118304912 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -467,3 +467,4 @@ ee878f3d6732856f7725c590312bfbe2ffa52cc7 jdk9-b58 1eab877142cce6ca06e556e2ad0af688f993f00b jdk9-b62 2ac9b6b36689b50d1562627067c92d51781b5684 jdk9-b63 bf92b8db249cdfa5651ef954b6c0743a7e0ea4cd jdk9-b64 +e7ae94c4f35e940ea423fc1dd260435df34a77c0 jdk9-b65 diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 54df16471cc..1682318d964 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -307,3 +307,4 @@ f4a4a54620370f077c2e830a5561c8cfa811712b jdk9-b61 3bcf83c1bbc1b7663e930d72c133a9bd86c7618d jdk9-b62 4a8f895f0317dcc90479cb7cc97014312e69edf7 jdk9-b63 6f91749b5aaef1a171ec2254163233438d1071d1 jdk9-b64 +ae7406e82828fe1c245ac7507a9da5fd5b1c9529 jdk9-b65 diff --git a/jaxp/test/javax/xml/jaxp/functional/test/auctionportal/AuctionController.java b/jaxp/test/javax/xml/jaxp/functional/test/auctionportal/AuctionController.java index 005828687f5..576f44a154f 100644 --- a/jaxp/test/javax/xml/jaxp/functional/test/auctionportal/AuctionController.java +++ b/jaxp/test/javax/xml/jaxp/functional/test/auctionportal/AuctionController.java @@ -22,8 +22,8 @@ */ package test.auctionportal; -import static com.sun.org.apache.xerces.internal.jaxp.JAXPConstants.JAXP_SCHEMA_LANGUAGE; -import static com.sun.org.apache.xerces.internal.jaxp.JAXPConstants.JAXP_SCHEMA_SOURCE; +import static test.auctionportal.HiBidConstants.JAXP_SCHEMA_LANGUAGE; +import static test.auctionportal.HiBidConstants.JAXP_SCHEMA_SOURCE; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; diff --git a/jaxp/test/javax/xml/jaxp/functional/test/auctionportal/AuctionItemRepository.java b/jaxp/test/javax/xml/jaxp/functional/test/auctionportal/AuctionItemRepository.java index 8fe1efa3598..25e78643cb4 100644 --- a/jaxp/test/javax/xml/jaxp/functional/test/auctionportal/AuctionItemRepository.java +++ b/jaxp/test/javax/xml/jaxp/functional/test/auctionportal/AuctionItemRepository.java @@ -22,10 +22,10 @@ */ package test.auctionportal; -import static com.sun.org.apache.xerces.internal.impl.Constants.SP_ENTITY_EXPANSION_LIMIT; -import static com.sun.org.apache.xerces.internal.impl.Constants.SP_MAX_OCCUR_LIMIT; -import static com.sun.org.apache.xerces.internal.jaxp.JAXPConstants.JAXP_SCHEMA_LANGUAGE; -import static com.sun.org.apache.xerces.internal.jaxp.JAXPConstants.JAXP_SCHEMA_SOURCE; +import static test.auctionportal.HiBidConstants.SP_ENTITY_EXPANSION_LIMIT; +import static test.auctionportal.HiBidConstants.SP_MAX_OCCUR_LIMIT; +import static test.auctionportal.HiBidConstants.JAXP_SCHEMA_LANGUAGE; +import static test.auctionportal.HiBidConstants.JAXP_SCHEMA_SOURCE; import static org.testng.Assert.assertTrue; import java.io.File; import java.io.FileInputStream; diff --git a/jaxp/test/javax/xml/jaxp/functional/test/auctionportal/UserController.java b/jaxp/test/javax/xml/jaxp/functional/test/auctionportal/UserController.java index 6236668ce8b..b32cb3d0d51 100644 --- a/jaxp/test/javax/xml/jaxp/functional/test/auctionportal/UserController.java +++ b/jaxp/test/javax/xml/jaxp/functional/test/auctionportal/UserController.java @@ -22,7 +22,7 @@ */ package test.auctionportal; -import static com.sun.org.apache.xerces.internal.jaxp.JAXPConstants.JAXP_SCHEMA_LANGUAGE; +import static test.auctionportal.HiBidConstants.JAXP_SCHEMA_LANGUAGE; import static org.testng.Assert.assertFalse; import java.io.FileOutputStream; import java.nio.file.Files; diff --git a/jaxp/test/javax/xml/jaxp/internaltest/TEST.properties b/jaxp/test/javax/xml/jaxp/internaltest/TEST.properties new file mode 100644 index 00000000000..9c5515637e5 --- /dev/null +++ b/jaxp/test/javax/xml/jaxp/internaltest/TEST.properties @@ -0,0 +1,3 @@ +# jaxp test uses TestNG +TestNG.dirs = javax/xml/common/bug6979306 javax/xml/parsers/bug8003147 javax/xml/transform/bug6551616 javax/xml/transform/cli + diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6979306Test.java b/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/common/bug6979306/Bug6979306Test.java similarity index 84% rename from jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6979306Test.java rename to jaxp/test/javax/xml/jaxp/internaltest/javax/xml/common/bug6979306/Bug6979306Test.java index 4058e3a41bf..e6c58a24d28 100644 --- a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug6979306Test.java +++ b/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/common/bug6979306/Bug6979306Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, 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,19 @@ * questions. */ -package javax.xml.common; +/* + * @test + * @modules java.xml/com.sun.org.apache.xerces.internal.impl + * java.xml/com.sun.org.apache.xalan.internal + * java.xml/com.sun.org.apache.xalan.internal.xslt + * @bug 6979306 + * @summary Test JAXP component version. + */ import org.testng.annotations.Test; import com.sun.org.apache.xalan.internal.xslt.EnvironmentCheck; -/* - * @bug 6979306 - * @summary Test JAXP component version. - */ public class Bug6979306Test { @Test diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug8003147Test.java b/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/parsers/bug8003147/Bug8003147Test.java similarity index 89% rename from jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug8003147Test.java rename to jaxp/test/javax/xml/jaxp/internaltest/javax/xml/parsers/bug8003147/Bug8003147Test.java index d345f1bf2d6..2781c97f853 100644 --- a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/parsers/Bug8003147Test.java +++ b/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/parsers/bug8003147/Bug8003147Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, 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,7 +21,13 @@ * questions. */ -package javax.xml.parsers; +/* + * @test + * @modules java.xml/com.sun.org.apache.bcel.internal.classfile + * java.xml/com.sun.org.apache.bcel.internal.generic + * @bug 8003147 + * @summary Test port fix for BCEL bug 39695. + */ import java.io.FileOutputStream; import java.util.ArrayList; @@ -38,10 +44,6 @@ import com.sun.org.apache.bcel.internal.classfile.Method; import com.sun.org.apache.bcel.internal.generic.ClassGen; import com.sun.org.apache.bcel.internal.generic.MethodGen; -/* - * @bug 8003147 - * @summary Test port fix for BCEL bug 39695. - */ public class Bug8003147Test { @Test @@ -51,7 +53,7 @@ public class Bug8003147Test { // rename class ConstantPool cp = jc.getConstantPool(); int cpIndex = ((ConstantClass) cp.getConstant(jc.getClassNameIndex())).getNameIndex(); - cp.setConstant(cpIndex, new ConstantUtf8("javax/xml/parsers/Bug8003147TestPrime")); + cp.setConstant(cpIndex, new ConstantUtf8("Bug8003147TestPrime")); ClassGen gen = new ClassGen(jc); Method[] methods = jc.getMethods(); int index; @@ -67,7 +69,7 @@ public class Bug8003147Test { gen.getJavaClass().dump(new FileOutputStream(path)); try { - Class.forName("javax.xml.parsers.Bug8003147TestPrime"); + Class.forName("Bug8003147TestPrime"); } catch (ClassFormatError cfe) { cfe.printStackTrace(); Assert.fail("modified version of class does not pass verification"); diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6551616.java b/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/bug6551616/Bug6551616.java similarity index 93% rename from jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6551616.java rename to jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/bug6551616/Bug6551616.java index c6ab3d4625f..6a072573c1f 100644 --- a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/Bug6551616.java +++ b/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/bug6551616/Bug6551616.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, 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,24 +21,23 @@ * questions. */ -package javax.xml.transform; +/* + * @test + * @modules java.xml/com.sun.org.apache.xalan.internal.xsltc.trax + * @bug 6551616 + * @summary Test SAX2StAXEventWriter. + */ -import java.io.File; import java.io.InputStream; import java.io.StringBufferInputStream; -import java.security.Policy; import javax.xml.stream.XMLEventWriter; import javax.xml.stream.XMLOutputFactory; -import com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXEventWriter; - import org.testng.annotations.Test; -/* - * @bug 6551616 - * @summary Test SAX2StAXEventWriter. - */ +import com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXEventWriter; + public class Bug6551616 { String _cache = ""; diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CLITest.java b/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/CLITest.java similarity index 91% rename from jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CLITest.java rename to jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/CLITest.java index de8139a8267..a015b65b03f 100644 --- a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/transform/CLITest.java +++ b/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/CLITest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, 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,14 +21,15 @@ * questions. */ -package javax.xml.transform; +/* + * @test + * @modules java.xml/com.sun.org.apache.xalan.internal.xslt + * @summary Test internal transform CLI. + */ import org.testng.Assert; import org.testng.annotations.Test; -/* - * @summary Test internal transform CLI. - */ public class CLITest { @Test diff --git a/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/tigertest-in.xml b/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/tigertest-in.xml new file mode 100644 index 00000000000..eeb3723c2bc --- /dev/null +++ b/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/tigertest-in.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/tigertest.xsl b/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/tigertest.xsl new file mode 100644 index 00000000000..5b10fc88769 --- /dev/null +++ b/jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/tigertest.xsl @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + diff --git a/jaxp/test/javax/xml/jaxp/libs/test/auctionportal/HiBidConstants.java b/jaxp/test/javax/xml/jaxp/libs/test/auctionportal/HiBidConstants.java index 9ee741b15a1..5c812c52b04 100644 --- a/jaxp/test/javax/xml/jaxp/libs/test/auctionportal/HiBidConstants.java +++ b/jaxp/test/javax/xml/jaxp/libs/test/auctionportal/HiBidConstants.java @@ -42,4 +42,24 @@ public class HiBidConstants { * Name space for account operation. */ public static final String PORTAL_ACCOUNT_NS = "http://www.auctionportal.org/Accounts"; + + /** + * JAXP schema language property name. + */ + public static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; + + /** + * JAXP schema source property name. + */ + public static final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource"; + + /** + * Name of system property JDK entity expansion limit + */ + public static final String SP_ENTITY_EXPANSION_LIMIT = "jdk.xml.entityExpansionLimit"; + + /** + * Name of system property JDK maxOccur limit + */ + public static final String SP_MAX_OCCUR_LIMIT = "jdk.xml.maxOccurLimit"; } diff --git a/jaxp/test/javax/xml/jaxp/TEST.properties b/jaxp/test/javax/xml/jaxp/unittest/TEST.properties similarity index 52% rename from jaxp/test/javax/xml/jaxp/TEST.properties rename to jaxp/test/javax/xml/jaxp/unittest/TEST.properties index 8ba6cb12a72..e8445deaa68 100644 --- a/jaxp/test/javax/xml/jaxp/TEST.properties +++ b/jaxp/test/javax/xml/jaxp/unittest/TEST.properties @@ -1,3 +1,3 @@ # jaxp test uses TestNG -TestNG.dirs = unittest +TestNG.dirs = . diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug7143711Test.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug7143711Test.java index a9f8b84c13c..7b38db0c0c2 100644 --- a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug7143711Test.java +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/common/Bug7143711Test.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, 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 @@ -76,7 +76,7 @@ public class Bug7143711Test { } - @Test + @Test(enabled=false) //skipped due to bug JDK-8080097 public void testTransform_DOM_withSM() { System.out.println("Transform using DOM Source; Security Manager is set:"); @@ -89,7 +89,7 @@ public class Bug7143711Test { TransformerFactory factory = TransformerFactory.newInstance("com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl", TransformerFactory.class.getClassLoader()); factory.setFeature(ORACLE_FEATURE_SERVICE_MECHANISM, true); - if (((com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl) factory).useServicesMechnism()) { + if ((boolean) factory.getFeature(ORACLE_FEATURE_SERVICE_MECHANISM)) { Assert.fail("should not override in secure mode"); } diff --git a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/NamespaceTest.java b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/NamespaceTest.java index 25fd9d0fa0b..7f036defb2f 100644 --- a/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/NamespaceTest.java +++ b/jaxp/test/javax/xml/jaxp/unittest/javax/xml/stream/XMLStreamWriterTest/NamespaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, 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,20 +24,16 @@ package javax.xml.stream.XMLStreamWriterTest; import java.io.ByteArrayOutputStream; -import java.io.IOException; import javax.xml.XMLConstants; import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; -import javax.xml.transform.stream.StreamResult; import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import com.sun.xml.internal.stream.writers.XMLStreamWriterImpl; - /* * @summary Test the writing of Namespaces. */ @@ -80,15 +76,10 @@ public class NamespaceTest { private void resetWriter() { // reset the Writer try { - xmlStreamWriter.flush(); - xmlStreamWriter.close(); - ((XMLStreamWriterImpl) xmlStreamWriter).reset(); byteArrayOutputStream.reset(); - ((XMLStreamWriterImpl) xmlStreamWriter).setOutput(new StreamResult(byteArrayOutputStream), "utf-8"); + xmlStreamWriter = xmlOutputFactory.createXMLStreamWriter(byteArrayOutputStream, "utf-8"); } catch (XMLStreamException xmlStreamException) { Assert.fail(xmlStreamException.toString()); - } catch (IOException ioException) { - Assert.fail(ioException.toString()); } } diff --git a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/LSSerializerTest.java b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/LSSerializerTest.java index d0152fb03bf..56aafde0bb5 100644 --- a/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/LSSerializerTest.java +++ b/jaxp/test/javax/xml/jaxp/unittest/org/w3c/dom/ls/LSSerializerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, 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 @@ -42,12 +42,12 @@ import org.w3c.dom.Document; import org.xml.sax.InputSource; import org.xml.sax.SAXException; -import com.sun.org.apache.xerces.internal.impl.Constants; /* * @summary Test LSSerializer. */ public class LSSerializerTest { + private static final String DOM_FORMAT_PRETTY_PRINT = "format-pretty-print"; class DOMErrorHandlerImpl implements DOMErrorHandler { @@ -192,47 +192,47 @@ public class LSSerializerTest { DOMConfiguration domConfiguration = lsSerializer.getDomConfig(); // query current configuration - Boolean defaultFormatPrettyPrint = (Boolean) domConfiguration.getParameter(Constants.DOM_FORMAT_PRETTY_PRINT); - Boolean canSetFormatPrettyPrintFalse = (Boolean) domConfiguration.canSetParameter(Constants.DOM_FORMAT_PRETTY_PRINT, Boolean.FALSE); - Boolean canSetFormatPrettyPrintTrue = (Boolean) domConfiguration.canSetParameter(Constants.DOM_FORMAT_PRETTY_PRINT, Boolean.TRUE); + Boolean defaultFormatPrettyPrint = (Boolean) domConfiguration.getParameter(DOM_FORMAT_PRETTY_PRINT); + Boolean canSetFormatPrettyPrintFalse = (Boolean) domConfiguration.canSetParameter(DOM_FORMAT_PRETTY_PRINT, Boolean.FALSE); + Boolean canSetFormatPrettyPrintTrue = (Boolean) domConfiguration.canSetParameter(DOM_FORMAT_PRETTY_PRINT, Boolean.TRUE); - System.out.println(Constants.DOM_FORMAT_PRETTY_PRINT + " default/can set false/can set true = " + defaultFormatPrettyPrint + "/" + System.out.println(DOM_FORMAT_PRETTY_PRINT + " default/can set false/can set true = " + defaultFormatPrettyPrint + "/" + canSetFormatPrettyPrintFalse + "/" + canSetFormatPrettyPrintTrue); // test values - Assert.assertEquals(defaultFormatPrettyPrint, Boolean.FALSE, "Default value of " + Constants.DOM_FORMAT_PRETTY_PRINT + " should be " + Boolean.FALSE); + Assert.assertEquals(defaultFormatPrettyPrint, Boolean.FALSE, "Default value of " + DOM_FORMAT_PRETTY_PRINT + " should be " + Boolean.FALSE); - Assert.assertEquals(canSetFormatPrettyPrintFalse, Boolean.TRUE, "Can set " + Constants.DOM_FORMAT_PRETTY_PRINT + " to " + Boolean.FALSE + " should be " + Assert.assertEquals(canSetFormatPrettyPrintFalse, Boolean.TRUE, "Can set " + DOM_FORMAT_PRETTY_PRINT + " to " + Boolean.FALSE + " should be " + Boolean.TRUE); - Assert.assertEquals(canSetFormatPrettyPrintTrue, Boolean.TRUE, "Can set " + Constants.DOM_FORMAT_PRETTY_PRINT + " to " + Boolean.TRUE + " should be " + Assert.assertEquals(canSetFormatPrettyPrintTrue, Boolean.TRUE, "Can set " + DOM_FORMAT_PRETTY_PRINT + " to " + Boolean.TRUE + " should be " + Boolean.TRUE); // get default serialization String prettyPrintDefault = lsSerializer.writeToString(document); - System.out.println("(default) " + Constants.DOM_FORMAT_PRETTY_PRINT + "==" + (Boolean) domConfiguration.getParameter(Constants.DOM_FORMAT_PRETTY_PRINT) + System.out.println("(default) " + DOM_FORMAT_PRETTY_PRINT + "==" + (Boolean) domConfiguration.getParameter(DOM_FORMAT_PRETTY_PRINT) + ": \n\"" + prettyPrintDefault + "\""); - Assert.assertEquals(XML_DOCUMENT_DEFAULT_PRINT, prettyPrintDefault, "Invalid serialization with default value, " + Constants.DOM_FORMAT_PRETTY_PRINT + "==" - + (Boolean) domConfiguration.getParameter(Constants.DOM_FORMAT_PRETTY_PRINT)); + Assert.assertEquals(XML_DOCUMENT_DEFAULT_PRINT, prettyPrintDefault, "Invalid serialization with default value, " + DOM_FORMAT_PRETTY_PRINT + "==" + + (Boolean) domConfiguration.getParameter(DOM_FORMAT_PRETTY_PRINT)); // configure LSSerializer to not format-pretty-print - domConfiguration.setParameter(Constants.DOM_FORMAT_PRETTY_PRINT, Boolean.FALSE); + domConfiguration.setParameter(DOM_FORMAT_PRETTY_PRINT, Boolean.FALSE); String prettyPrintFalse = lsSerializer.writeToString(document); - System.out.println("(FALSE) " + Constants.DOM_FORMAT_PRETTY_PRINT + "==" + (Boolean) domConfiguration.getParameter(Constants.DOM_FORMAT_PRETTY_PRINT) + System.out.println("(FALSE) " + DOM_FORMAT_PRETTY_PRINT + "==" + (Boolean) domConfiguration.getParameter(DOM_FORMAT_PRETTY_PRINT) + ": \n\"" + prettyPrintFalse + "\""); - Assert.assertEquals(XML_DOCUMENT_DEFAULT_PRINT, prettyPrintFalse, "Invalid serialization with FALSE value, " + Constants.DOM_FORMAT_PRETTY_PRINT + "==" - + (Boolean) domConfiguration.getParameter(Constants.DOM_FORMAT_PRETTY_PRINT)); + Assert.assertEquals(XML_DOCUMENT_DEFAULT_PRINT, prettyPrintFalse, "Invalid serialization with FALSE value, " + DOM_FORMAT_PRETTY_PRINT + "==" + + (Boolean) domConfiguration.getParameter(DOM_FORMAT_PRETTY_PRINT)); // configure LSSerializer to format-pretty-print - domConfiguration.setParameter(Constants.DOM_FORMAT_PRETTY_PRINT, Boolean.TRUE); + domConfiguration.setParameter(DOM_FORMAT_PRETTY_PRINT, Boolean.TRUE); String prettyPrintTrue = lsSerializer.writeToString(document); - System.out.println("(TRUE) " + Constants.DOM_FORMAT_PRETTY_PRINT + "==" + (Boolean) domConfiguration.getParameter(Constants.DOM_FORMAT_PRETTY_PRINT) + System.out.println("(TRUE) " + DOM_FORMAT_PRETTY_PRINT + "==" + (Boolean) domConfiguration.getParameter(DOM_FORMAT_PRETTY_PRINT) + ": \n\"" + prettyPrintTrue + "\""); - Assert.assertEquals(XML_DOCUMENT_PRETTY_PRINT, prettyPrintTrue, "Invalid serialization with TRUE value, " + Constants.DOM_FORMAT_PRETTY_PRINT + "==" - + (Boolean) domConfiguration.getParameter(Constants.DOM_FORMAT_PRETTY_PRINT)); + Assert.assertEquals(XML_DOCUMENT_PRETTY_PRINT, prettyPrintTrue, "Invalid serialization with TRUE value, " + DOM_FORMAT_PRETTY_PRINT + "==" + + (Boolean) domConfiguration.getParameter(DOM_FORMAT_PRETTY_PRINT)); } @Test diff --git a/jaxws/.hgtags b/jaxws/.hgtags index ab14d761a9e..248373168ce 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -310,3 +310,4 @@ f31835b59035377a220efc5a248b90f090ee1689 jdk9-b60 cd0cf72b2cbf4adb778a02505fb065bb2292688c jdk9-b62 b5c22d09b1c91dd49b006f38d8ba9c4397517ccc jdk9-b63 df100399ed27d0eaa57c137ca99819a0fee66178 jdk9-b64 +45ef73bb85c12ec1b291835c1d40e342a454e3f0 jdk9-b65 diff --git a/jdk/.hgtags b/jdk/.hgtags index 4b90d3155bb..757819b39ad 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -307,3 +307,4 @@ da84dcac1b0b12c5b836b05ac75ecbfadee0cd32 jdk9-b61 49118e68fbd4cc0044e718c47db681946d5efd69 jdk9-b62 fd3281c400347088b36aeb16273aa679d53a81a4 jdk9-b63 7de8d036ad0980d988d1b9b4b4e6be555d9fbf98 jdk9-b64 +ed94f3e7ba6bbfec0772de6d24e39543e13f6d88 jdk9-b65 diff --git a/jdk/make/CompileDemos.gmk b/jdk/make/CompileDemos.gmk index 5e03eb1aa46..7719a8663f5 100644 --- a/jdk/make/CompileDemos.gmk +++ b/jdk/make/CompileDemos.gmk @@ -30,6 +30,7 @@ include MakeBase.gmk include JavaCompilation.gmk include NativeCompilation.gmk include SetupJavaCompilers.gmk +include TextFileProcessing.gmk # Prepare the find cache. $(eval $(call FillCacheFind, $(JDK_TOPDIR)/src)) @@ -49,6 +50,15 @@ GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/commo ################################################################################################## +# This rule will be depended on due to the MANIFEST line +$(eval $(call SetupTextFileProcessing, BUILD_JAVA_MANIFEST, \ + SOURCE_FILES := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \ + OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf, \ + REPLACEMENTS := \ + @@RELEASE@@ => $(RELEASE) ; \ + @@COMPANY_NAME@@ => $(COMPANY_NAME) , \ +)) + define SetupAppletDemo $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1, \ SETUP := GENERATE_USINGJDKBYTECODE, \ @@ -122,7 +132,7 @@ define SetupDemo COPY := $(PATTERNS_TO_COPY) $(10), \ JAR := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/$$($1_JARFILE), \ JARMAIN := $4, \ - MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \ + MANIFEST := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf, \ EXTRA_MANIFEST_ATTR := $(11), \ SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/src.zip, \ EXCLUDE_FILES := $9, \ @@ -290,7 +300,7 @@ define SetupJVMTIDemo COPY := $(PATTERNS_TO_COPY), \ JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar, \ EXTRA_MANIFEST_ATTR := Main-Class: \n, \ - MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf)) + MANIFEST := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf)) BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar endif @@ -382,7 +392,7 @@ ifeq ($(OPENJDK_TARGET_OS), solaris) BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \ HEADERS := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \ JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar, \ - MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \ + MANIFEST := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf, \ SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/src.zip, \ COPY := README.txt Poller.c, \ JARMAIN := Client)) diff --git a/jdk/make/launcher/Launcher-jdk.dev.gmk b/jdk/make/launcher/Launcher-jdk.dev.gmk index b58545e5418..7d3781707cb 100644 --- a/jdk/make/launcher/Launcher-jdk.dev.gmk +++ b/jdk/make/launcher/Launcher-jdk.dev.gmk @@ -33,9 +33,6 @@ $(eval $(call SetupLauncher,jdeps, \ $(eval $(call SetupLauncher,jimage,\ -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "jdk.tools.jimage.Main"$(COMMA) }')) -$(eval $(call SetupLauncher,jhat, \ - -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.hat.Main"$(COMMA) }')) - $(eval $(call SetupLauncher,native2ascii, \ -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.native2ascii.Main"$(COMMA) }')) diff --git a/jdk/make/lib/Lib-jdk.attach.gmk b/jdk/make/lib/Lib-jdk.attach.gmk index c64867c070d..dbabea5b733 100644 --- a/jdk/make/lib/Lib-jdk.attach.gmk +++ b/jdk/make/lib/Lib-jdk.attach.gmk @@ -27,6 +27,12 @@ include LibCommon.gmk ################################################################################ +ifeq ($(OPENJDK_TARGET_OS), windows) + # In (at least) VS2013 and later, -DPSAPI_VERSION=1 is needed to generate + # a binary that is compatible with windows versions older than 7/2008R2. + # See MSDN documentation for GetProcessMemoryInfo for more information. + LIBATTACH_CFLAGS := -DPSAPI_VERSION=1 +endif $(eval $(call SetupNativeCompilation,BUILD_LIBATTACH, \ LIBRARY := attach, \ @@ -35,7 +41,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBATTACH, \ OPTIMIZATION := LOW, \ CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \ -I$(SUPPORT_OUTPUTDIR)/headers/jdk.attach \ - $(LIBJAVA_HEADER_FLAGS), \ + $(LIBJAVA_HEADER_FLAGS) $(LIBATTACH_CFLAGS), \ CFLAGS_windows := /Gy, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libattach/mapfile-$(OPENJDK_TARGET_OS), \ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ diff --git a/jdk/make/lib/Lib-jdk.management.gmk b/jdk/make/lib/Lib-jdk.management.gmk index bd07d478f5b..84e71f7060c 100644 --- a/jdk/make/lib/Lib-jdk.management.gmk +++ b/jdk/make/lib/Lib-jdk.management.gmk @@ -39,10 +39,12 @@ LIBMANAGEMENT_EXT_CFLAGS := -I$(JDK_TOPDIR)/src/java.management/share/native/inc $(LIBJAVA_HEADER_FLAGS) \ # -# In (at least) VS2013 and later, -DPSAPI_VERSION=1 is needed to generate -# a binary that is compatible with windows versions older than 7/2008R2. -# See MSDN documentation for GetProcessMemoryInfo for more information. -BUILD_LIBMANAGEMENT_EXT_CFLAGS += -DPSAPI_VERSION=1 +ifeq ($(OPENJDK_TARGET_OS), windows) + # In (at least) VS2013 and later, -DPSAPI_VERSION=1 is needed to generate + # a binary that is compatible with windows versions older than 7/2008R2. + # See MSDN documentation for GetProcessMemoryInfo for more information. + LIBMANAGEMENT_EXT_CFLAGS += -DPSAPI_VERSION=1 +endif LIBMANAGEMENT_EXT_OPTIMIZATION := HIGH ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), ) diff --git a/jdk/make/src/classes/build/tools/module/boot.modules b/jdk/make/src/classes/build/tools/module/boot.modules index eb0ac74d739..b77e400e4ed 100644 --- a/jdk/make/src/classes/build/tools/module/boot.modules +++ b/jdk/make/src/classes/build/tools/module/boot.modules @@ -24,6 +24,7 @@ jdk.httpserver jdk.jfr jdk.management jdk.management.cmm +jdk.management.resource jdk.naming.rmi jdk.sctp jdk.security.auth diff --git a/jdk/src/demo/share/applets.html b/jdk/src/demo/share/applets.html index 2d93ce26982..6f861d6082e 100644 --- a/jdk/src/demo/share/applets.html +++ b/jdk/src/demo/share/applets.html @@ -56,8 +56,7 @@ -JAVATM -PLUG-IN   +JAVA™ PLUG-IN  
Demonstration Applets 
diff --git a/jdk/src/demo/share/jvmti/index.html b/jdk/src/demo/share/jvmti/index.html index 4b479c12468..25440a104d9 100644 --- a/jdk/src/demo/share/jvmti/index.html +++ b/jdk/src/demo/share/jvmti/index.html @@ -5,7 +5,7 @@

The -JavaTM Virtual Machine Tools Interface (JVM TI) +Java™ Virtual Machine Tools Interface (JVM TI) is a native tool interface provided in JDK 5.0 and newer. Native libraries that use JVM TI and are loaded into the Java Virtual Machine diff --git a/jdk/src/java.base/share/classes/java/lang/Boolean.java b/jdk/src/java.base/share/classes/java/lang/Boolean.java index 4e9f6e4328c..1e3a9d7cd05 100644 --- a/jdk/src/java.base/share/classes/java/lang/Boolean.java +++ b/jdk/src/java.base/share/classes/java/lang/Boolean.java @@ -230,13 +230,12 @@ public final class Boolean implements java.io.Serializable, } /** - * Returns {@code true} if and only if the system property - * named by the argument exists and is equal to the string - * {@code "true"}. (Beginning with version 1.0.2 of the - * JavaTM platform, the test of - * this string is case insensitive.) A system property is accessible - * through {@code getProperty}, a method defined by the - * {@code System} class. + * Returns {@code true} if and only if the system property named + * by the argument exists and is equal to the string {@code + * "true"}. (Beginning with version 1.0.2 of the Java™ + * platform, the test of this string is case insensitive.) A + * system property is accessible through {@code getProperty}, a + * method defined by the {@code System} class. *

* If there is no property with the specified name, or if the specified * name is empty or null, then {@code false} is returned. diff --git a/jdk/src/java.base/share/classes/java/lang/Character.java b/jdk/src/java.base/share/classes/java/lang/Character.java index f546ab53b0a..e3d6c38a7c6 100644 --- a/jdk/src/java.base/share/classes/java/lang/Character.java +++ b/jdk/src/java.base/share/classes/java/lang/Character.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -645,8 +645,14 @@ class Character implements java.io.Serializable, Comparable { * @since 1.2 */ public static final class UnicodeBlock extends Subset { - - private static Map map = new HashMap<>(256); + /** + * 510 - the expected number of enteties + * 0.75 - the default load factor of HashMap + */ + private static final int INITIAL_CAPACITY = + (int)(510 / 0.75f + 1.0f); + private static Map map = + new HashMap<>(INITIAL_CAPACITY); /** * Creates a UnicodeBlock with the given identifier name. diff --git a/jdk/src/java.base/share/classes/java/lang/Long.java b/jdk/src/java.base/share/classes/java/lang/Long.java index 9382a2df1e9..b1b37032397 100644 --- a/jdk/src/java.base/share/classes/java/lang/Long.java +++ b/jdk/src/java.base/share/classes/java/lang/Long.java @@ -1708,7 +1708,7 @@ public final class Long extends Number implements Comparable { * @since 1.5 */ public static int bitCount(long i) { - // HD, Figure 5-14 + // HD, Figure 5-2 i = i - ((i >>> 1) & 0x5555555555555555L); i = (i & 0x3333333333333333L) + ((i >>> 2) & 0x3333333333333333L); i = (i + (i >>> 4)) & 0x0f0f0f0f0f0f0f0fL; diff --git a/jdk/src/java.base/share/classes/java/lang/String.java b/jdk/src/java.base/share/classes/java/lang/String.java index bd39fa60f94..45ee5411def 100644 --- a/jdk/src/java.base/share/classes/java/lang/String.java +++ b/jdk/src/java.base/share/classes/java/lang/String.java @@ -179,7 +179,7 @@ public final class String * not affect the newly created string. * * @param value - * Array that is the source of characters + * Array that is the source of characters * * @param offset * The initial offset @@ -208,7 +208,7 @@ public final class String if (offset > value.length - count) { throw new StringIndexOutOfBoundsException(offset + count); } - this.value = Arrays.copyOfRange(value, offset, offset+count); + this.value = Arrays.copyOfRange(value, offset, offset + count); } /** @@ -262,11 +262,11 @@ public final class String // Pass 1: Compute precise size of char[] int n = count; for (int i = offset; i < end; i++) { - int c = codePoints[i]; - if (Character.isBmpCodePoint(c)) - continue; - else if (Character.isValidCodePoint(c)) - n++; + int c = codePoints[i]; + if (Character.isBmpCodePoint(c)) + continue; + else if (Character.isValidCodePoint(c)) + n++; else throw new IllegalArgumentException(Integer.toString(c)); } @@ -327,7 +327,7 @@ public final class String @Deprecated public String(byte ascii[], int hibyte, int offset, int count) { checkBounds(ascii, offset, count); - char value[] = new char[count]; + char[] value = new char[count]; if (hibyte == 0) { for (int i = count; i-- > 0;) { @@ -465,7 +465,7 @@ public final class String if (charset == null) throw new NullPointerException("charset"); checkBounds(bytes, offset, length); - this.value = StringCoding.decode(charset, bytes, offset, length); + this.value = StringCoding.decode(charset, bytes, offset, length); } /** @@ -567,7 +567,7 @@ public final class String * * @since 1.1 */ - public String(byte bytes[]) { + public String(byte[] bytes) { this(bytes, 0, bytes.length); } @@ -983,11 +983,10 @@ public final class String return true; } if (anObject instanceof String) { - String anotherString = (String)anObject; - int n = value.length; - if (n == anotherString.value.length) { - char v1[] = value; - char v2[] = anotherString.value; + char[] v1 = value; + char[] v2 = ((String)anObject).value; + int n = v1.length; + if (n == v2.length) { int i = 0; while (n-- != 0) { if (v1[i] != v2[i]) @@ -1020,8 +1019,8 @@ public final class String } private boolean nonSyncContentEquals(AbstractStringBuilder sb) { - char v1[] = value; - char v2[] = sb.getValue(); + char[] v1 = value; + char[] v2 = sb.getValue(); int n = v1.length; if (n != sb.length()) { return false; @@ -1066,7 +1065,7 @@ public final class String return equals(cs); } // Argument is a generic CharSequence - char v1[] = value; + char[] v1 = value; int n = v1.length; if (n != cs.length()) { return false; @@ -1156,20 +1155,18 @@ public final class String * lexicographically greater than the string argument. */ public int compareTo(String anotherString) { - int len1 = value.length; - int len2 = anotherString.value.length; + char[] v1 = value; + char[] v2 = anotherString.value; + int len1 = v1.length; + int len2 = v2.length; int lim = Math.min(len1, len2); - char v1[] = value; - char v2[] = anotherString.value; - int k = 0; - while (k < lim) { + for (int k = 0; k < lim; k++) { char c1 = v1[k]; char c2 = v2[k]; if (c1 != c2) { return c1 - c2; } - k++; } return len1 - len2; } @@ -1278,14 +1275,14 @@ public final class String */ public boolean regionMatches(int toffset, String other, int ooffset, int len) { - char ta[] = value; + char[] ta = value; int to = toffset; - char pa[] = other.value; + char[] pa = other.value; int po = ooffset; // Note: toffset, ooffset, or len might be near -1>>>1. if ((ooffset < 0) || (toffset < 0) - || (toffset > (long)value.length - len) - || (ooffset > (long)other.value.length - len)) { + || (toffset > (long)ta.length - len) + || (ooffset > (long)pa.length - len)) { return false; } while (len-- > 0) { @@ -1348,14 +1345,14 @@ public final class String */ public boolean regionMatches(boolean ignoreCase, int toffset, String other, int ooffset, int len) { - char ta[] = value; + char[] ta = value; int to = toffset; - char pa[] = other.value; + char[] pa = other.value; int po = ooffset; // Note: toffset, ooffset, or len might be near -1>>>1. if ((ooffset < 0) || (toffset < 0) - || (toffset > (long)value.length - len) - || (ooffset > (long)other.value.length - len)) { + || (toffset > (long)ta.length - len) + || (ooffset > (long)pa.length - len)) { return false; } while (len-- > 0) { @@ -1405,13 +1402,13 @@ public final class String * */ public boolean startsWith(String prefix, int toffset) { - char ta[] = value; + char[] ta = value; int to = toffset; - char pa[] = prefix.value; + char[] pa = prefix.value; int po = 0; - int pc = prefix.value.length; + int pc = pa.length; // Note: toffset might be near -1>>>1. - if ((toffset < 0) || (toffset > value.length - pc)) { + if ((toffset < 0) || (toffset > ta.length - pc)) { return false; } while (--pc >= 0) { @@ -1473,7 +1470,9 @@ public final class String for (char v : value) { h = 31 * h + v; } - hash = h; + if (h != 0) { + hash = h; + } } return h; } @@ -1928,14 +1927,17 @@ public final class String * length of this {@code String} object. */ public String substring(int beginIndex) { - if (beginIndex < 0) { - throw new StringIndexOutOfBoundsException(beginIndex); + if (beginIndex <= 0) { + if (beginIndex < 0) { + throw new StringIndexOutOfBoundsException(beginIndex); + } + return this; } int subLen = value.length - beginIndex; if (subLen < 0) { throw new StringIndexOutOfBoundsException(subLen); } - return (beginIndex == 0) ? this : new String(value, beginIndex, subLen); + return new String(value, beginIndex, subLen); } /** @@ -1961,8 +1963,13 @@ public final class String * {@code endIndex}. */ public String substring(int beginIndex, int endIndex) { - if (beginIndex < 0) { - throw new StringIndexOutOfBoundsException(beginIndex); + if (beginIndex <= 0) { + if (beginIndex < 0) { + throw new StringIndexOutOfBoundsException(beginIndex); + } + if (endIndex == value.length) { + return this; + } } if (endIndex > value.length) { throw new StringIndexOutOfBoundsException(endIndex); @@ -1971,8 +1978,7 @@ public final class String if (subLen < 0) { throw new StringIndexOutOfBoundsException(subLen); } - return ((beginIndex == 0) && (endIndex == value.length)) ? this - : new String(value, beginIndex, subLen); + return new String(value, beginIndex, subLen); } /** @@ -2034,7 +2040,7 @@ public final class String return this; } int len = value.length; - char buf[] = Arrays.copyOf(value, len + otherLen); + char[] buf = Arrays.copyOf(value, len + otherLen); str.getChars(buf, len); return new String(buf, true); } @@ -2070,9 +2076,9 @@ public final class String */ public String replace(char oldChar, char newChar) { if (oldChar != newChar) { - int len = value.length; - int i = -1; char[] val = value; /* avoid getfield opcode */ + int len = val.length; + int i = -1; while (++i < len) { if (val[i] == oldChar) { @@ -2080,7 +2086,7 @@ public final class String } } if (i < len) { - char buf[] = new char[len]; + char[] buf = new char[len]; for (int j = 0; j < i; j++) { buf[j] = val[j]; } @@ -2876,17 +2882,17 @@ public final class String * trailing white space. */ public String trim() { - int len = value.length; - int st = 0; char[] val = value; /* avoid getfield opcode */ + int end = val.length; + int beg = 0; - while ((st < len) && (val[st] <= ' ')) { - st++; + while ((beg < end) && (val[beg] <= ' ')) { + beg++; } - while ((st < len) && (val[len - 1] <= ' ')) { - len--; + while ((beg < end) && (val[end - 1] <= ' ')) { + end--; } - return ((st > 0) || (len < value.length)) ? substring(st, len) : this; + return substring(beg, end); } /** @@ -3081,7 +3087,7 @@ public final class String */ public char[] toCharArray() { // Cannot use Arrays.copyOf because of class initialization order issues - char result[] = new char[value.length]; + char[] result = new char[value.length]; System.arraycopy(value, 0, result, 0, value.length); return result; } @@ -3266,8 +3272,7 @@ public final class String * as its single character the argument {@code c}. */ public static String valueOf(char c) { - char data[] = {c}; - return new String(data, true); + return new String(new char[]{c}, true); } /** diff --git a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java index 3dd5933fb06..786d63ce73f 100644 --- a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java +++ b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java @@ -25,23 +25,24 @@ package java.security; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.Map; import java.util.WeakHashMap; +import java.util.concurrent.ConcurrentHashMap; +import sun.misc.JavaSecurityAccess; import sun.misc.JavaSecurityProtectionDomainAccess; import static sun.misc.JavaSecurityProtectionDomainAccess.ProtectionDomainCache; +import sun.misc.SharedSecrets; import sun.security.util.Debug; import sun.security.util.SecurityConstants; -import sun.misc.JavaSecurityAccess; -import sun.misc.SharedSecrets; /** - * - *

- * This ProtectionDomain class encapsulates the characteristics of a domain, + * The ProtectionDomain class encapsulates the characteristics of a domain, * which encloses a set of classes whose instances are granted a set * of permissions when being executed on behalf of a given set of Principals. *

@@ -58,6 +59,7 @@ import sun.misc.SharedSecrets; */ public class ProtectionDomain { + private static class JavaSecurityAccessImpl implements JavaSecurityAccess { private JavaSecurityAccessImpl() { @@ -86,18 +88,33 @@ public class ProtectionDomain { AccessController.getContext(), context); } - private static AccessControlContext getCombinedACC(AccessControlContext context, AccessControlContext stack) { - AccessControlContext acc = new AccessControlContext(context, stack.getCombiner(), true); + private static AccessControlContext getCombinedACC( + AccessControlContext context, AccessControlContext stack) { + AccessControlContext acc = + new AccessControlContext(context, stack.getCombiner(), true); return new AccessControlContext(stack.getContext(), acc).optimize(); } } static { - // Set up JavaSecurityAccess in SharedSecrets + // setup SharedSecrets to allow access to doIntersectionPrivilege + // methods and ProtectionDomain cache SharedSecrets.setJavaSecurityAccess(new JavaSecurityAccessImpl()); + SharedSecrets.setJavaSecurityProtectionDomainAccess( + new JavaSecurityProtectionDomainAccess() { + @Override + public ProtectionDomainCache getProtectionDomainCache() { + return new PDCache(); + } + }); } + /** + * Used for storing ProtectionDomains as keys in a Map. + */ + static final class Key {} + /* CodeSource */ private CodeSource codesource ; @@ -451,40 +468,104 @@ public class ProtectionDomain { } /** - * Used for storing ProtectionDomains as keys in a Map. + * A cache of ProtectionDomains and their Permissions. + * + * This class stores ProtectionDomains as weak keys in a ConcurrentHashMap + * with additional support for checking and removing weak keys that are no + * longer in use. */ - final static class Key {} - - // A cache of ProtectionDomains and their Permissions private static class PDCache implements ProtectionDomainCache { - // We must wrap the PermissionCollection in a WeakReference as there - // are some PermissionCollections which contain strong references - // back to a ProtectionDomain and otherwise would never be removed - // from the WeakHashMap - private final Map> - map = new WeakHashMap<>(); + private final ConcurrentHashMap + pdMap = new ConcurrentHashMap<>(); + private final ReferenceQueue queue = new ReferenceQueue<>(); @Override - public synchronized void put(ProtectionDomain pd, - PermissionCollection pc) { - map.put(pd == null ? null : pd.key, new WeakReference<>(pc)); + public void put(ProtectionDomain pd, PermissionCollection pc) { + processQueue(queue, pdMap); + WeakProtectionDomainKey weakPd = + new WeakProtectionDomainKey(pd, queue); + pdMap.putIfAbsent(weakPd, pc); } @Override - public synchronized PermissionCollection get(ProtectionDomain pd) { - WeakReference ref = - map.get(pd == null ? null : pd.key); - return ref == null ? null : ref.get(); + public PermissionCollection get(ProtectionDomain pd) { + processQueue(queue, pdMap); + WeakProtectionDomainKey weakPd = + new WeakProtectionDomainKey(pd, queue); + return pdMap.get(weakPd); + } + + /** + * Removes weak keys from the map that have been enqueued + * on the reference queue and are no longer in use. + */ + private static void processQueue(ReferenceQueue queue, + ConcurrentHashMap, ?> pdMap) { + Reference ref; + while ((ref = queue.poll()) != null) { + pdMap.remove(ref); + } } } - static { - SharedSecrets.setJavaSecurityProtectionDomainAccess( - new JavaSecurityProtectionDomainAccess() { - @Override - public ProtectionDomainCache getProtectionDomainCache() { - return new PDCache(); - } - }); + /** + * A weak key for a ProtectionDomain. + */ + private static class WeakProtectionDomainKey extends WeakReference { + /** + * Saved value of the referent's identity hash code, to maintain + * a consistent hash code after the referent has been cleared + */ + private final int hash; + + /** + * A key representing a null ProtectionDomain. + */ + private static final Key NULL_KEY = new Key(); + + /** + * Create a new WeakProtectionDomain with the specified domain and + * registered with a queue. + */ + WeakProtectionDomainKey(ProtectionDomain pd, ReferenceQueue rq) { + this((pd == null ? NULL_KEY : pd.key), rq); + } + + private WeakProtectionDomainKey(Key key, ReferenceQueue rq) { + super(key, rq); + hash = key.hashCode(); + } + + /** + * Returns the identity hash code of the original referent. + */ + @Override + public int hashCode() { + return hash; + } + + /** + * Returns true if the given object is an identical + * WeakProtectionDomainKey instance, or, if this object's referent + * has not been cleared and the given object is another + * WeakProtectionDomainKey instance with an identical non-null + * referent as this one. + */ + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + + if (obj instanceof WeakProtectionDomainKey) { + Object referent = get(); + return (referent != null) && + (referent == ((WeakProtectionDomainKey)obj).get()); + } else { + return false; + } + } } } diff --git a/jdk/src/java.base/share/classes/java/text/ChoiceFormat.java b/jdk/src/java.base/share/classes/java/text/ChoiceFormat.java index 601b019e886..8355dee87d4 100644 --- a/jdk/src/java.base/share/classes/java/text/ChoiceFormat.java +++ b/jdk/src/java.base/share/classes/java/text/ChoiceFormat.java @@ -490,7 +490,7 @@ public class ChoiceFormat extends NumberFormat { } /** - * Equality comparision between two + * Equality comparison between two */ public boolean equals(Object obj) { if (obj == null) return false; diff --git a/jdk/src/java.base/share/classes/java/util/ArrayPrefixHelpers.java b/jdk/src/java.base/share/classes/java/util/ArrayPrefixHelpers.java index 089b90039cc..abcdb2b35aa 100644 --- a/jdk/src/java.base/share/classes/java/util/ArrayPrefixHelpers.java +++ b/jdk/src/java.base/share/classes/java/util/ArrayPrefixHelpers.java @@ -85,7 +85,7 @@ class ArrayPrefixHelpers { * * As usual for this sort of utility, there are 4 versions, that * are simple copy/paste/adapt variants of each other. (The - * double and int versions differ from long version soley by + * double and int versions differ from long version solely by * replacing "long" (with case-matching)). */ diff --git a/jdk/src/java.base/share/classes/java/util/Calendar.java b/jdk/src/java.base/share/classes/java/util/Calendar.java index 80849001e74..6d696aaee87 100644 --- a/jdk/src/java.base/share/classes/java/util/Calendar.java +++ b/jdk/src/java.base/share/classes/java/util/Calendar.java @@ -1172,7 +1172,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable - * setFeilds(Calendar.YEAR, 2013, + * setFields(Calendar.YEAR, 2013, * Calendar.MONTH, Calendar.DECEMBER, * Calendar.DAY_OF_MONTH, 23); * is equivalent to the sequence of the following @@ -1298,7 +1298,7 @@ public abstract class Calendar implements Serializable, Cloneable, ComparableTimeZone} will be used in the {@link #build() build} * method. @@ -3316,7 +3316,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparablefield is negative, - * equal to or greater then FIELD_COUNT. + * equal to or greater than {@code FIELD_COUNT}. */ static String getFieldName(int field) { return FIELD_NAME[field]; diff --git a/jdk/src/java.base/share/classes/java/util/Collection.java b/jdk/src/java.base/share/classes/java/util/Collection.java index 4545faa6143..3a01908d73e 100644 --- a/jdk/src/java.base/share/classes/java/util/Collection.java +++ b/jdk/src/java.base/share/classes/java/util/Collection.java @@ -537,7 +537,7 @@ public interface Collection extends Iterable { * @implSpec * The default implementation creates a * late-binding spliterator - * from the collections's {@code Iterator}. The spliterator inherits the + * from the collection's {@code Iterator}. The spliterator inherits the * fail-fast properties of the collection's iterator. *

* The created {@code Spliterator} reports {@link Spliterator#SIZED}. diff --git a/jdk/src/java.base/share/classes/java/util/Locale.java b/jdk/src/java.base/share/classes/java/util/Locale.java index ffea237b34a..e3b12c5769c 100644 --- a/jdk/src/java.base/share/classes/java/util/Locale.java +++ b/jdk/src/java.base/share/classes/java/util/Locale.java @@ -719,7 +719,7 @@ public final class Locale implements Cloneable, Serializable { * created and cached. * * @param language lowercase 2 to 8 language code. - * @param country uppercase two-letter ISO-3166 code and numric-3 UN M.49 area code. + * @param country uppercase two-letter ISO-3166 code and numeric-3 UN M.49 area code. * @param variant vendor and browser specific code. See class description. * @return the Locale instance requested * @exception NullPointerException if any argument is null. @@ -1236,7 +1236,7 @@ public final class Locale implements Cloneable, Serializable { /** * Package private method returning the Locale's LocaleExtensions, * used by ResourceBundle. - * @return locale exnteions of this Locale, + * @return locale extensions of this Locale, * or {@code null} if no extensions are defined */ LocaleExtensions getLocaleExtensions() { @@ -2609,7 +2609,7 @@ public final class Locale implements Cloneable, Serializable { * href="./Locale.html#def_locale_extension">well-formed or an exception * is thrown. * - *

Attribute comparision for removal is case-insensitive. + *

Attribute comparison for removal is case-insensitive. * * @param attribute the attribute * @return This builder. diff --git a/jdk/src/java.base/share/classes/java/util/TimeZone.java b/jdk/src/java.base/share/classes/java/util/TimeZone.java index adc6ad349df..f28919f36db 100644 --- a/jdk/src/java.base/share/classes/java/util/TimeZone.java +++ b/jdk/src/java.base/share/classes/java/util/TimeZone.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2015, 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 @@ -293,6 +293,7 @@ abstract public class TimeZone implements Serializable, Cloneable { throw new NullPointerException(); } this.ID = ID; + this.zoneId = null; // invalidate cache } /** @@ -544,7 +545,23 @@ abstract public class TimeZone implements Serializable, Cloneable { * @since 1.8 */ public ZoneId toZoneId() { + ZoneId zId = zoneId; + if (zId == null) { + zoneId = zId = toZoneId0(); + } + return zId; + } + + private ZoneId toZoneId0() { String id = getID(); + TimeZone defaultZone = defaultTimeZone; + // are we not defaultTimeZone but our id is equal to default's? + if (defaultZone != this && + defaultZone != null && id.equals(defaultZone.getID())) { + // delegate to default TZ which is effectively immutable + return defaultZone.toZoneId(); + } + // derive it ourselves if (ZoneInfoFile.useOldMapping() && id.length() == 3) { if ("EST".equals(id)) return ZoneId.of("America/New_York"); @@ -710,7 +727,12 @@ abstract public class TimeZone implements Serializable, Cloneable { sm.checkPermission(new PropertyPermission ("user.timezone", "write")); } - defaultTimeZone = zone; + // by saving a defensive clone and returning a clone in getDefault() too, + // the defaultTimeZone instance is isolated from user code which makes it + // effectively immutable. This is important to avoid races when the + // following is evaluated in ZoneId.systemDefault(): + // TimeZone.getDefault().toZoneId(). + defaultTimeZone = (zone == null) ? null : (TimeZone) zone.clone(); } /** @@ -735,9 +757,7 @@ abstract public class TimeZone implements Serializable, Cloneable { public Object clone() { try { - TimeZone other = (TimeZone) super.clone(); - other.ID = ID; - return other; + return super.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(e); } @@ -759,6 +779,12 @@ abstract public class TimeZone implements Serializable, Cloneable { * @serial */ private String ID; + + /** + * Cached {@link ZoneId} for this TimeZone + */ + private transient ZoneId zoneId; + private static volatile TimeZone defaultTimeZone; static final String GMT_ID = "GMT"; diff --git a/jdk/src/java.base/share/classes/java/util/TreeMap.java b/jdk/src/java.base/share/classes/java/util/TreeMap.java index c04053656cf..a5ed0f5e91c 100644 --- a/jdk/src/java.base/share/classes/java/util/TreeMap.java +++ b/jdk/src/java.base/share/classes/java/util/TreeMap.java @@ -859,7 +859,7 @@ public class TreeMap * Returns a {@link Set} view of the mappings contained in this map. * *

The set's iterator returns the entries in ascending key order. The - * sets's spliterator is + * set's spliterator is * late-binding, * fail-fast, and additionally reports {@link Spliterator#SORTED} and * {@link Spliterator#ORDERED} with an encounter order that is ascending key @@ -2643,7 +2643,7 @@ public class TreeMap * child, also serving as origin for the split-off spliterator. * Left-hands are symmetric. Descending versions place the origin * at the end and invert ascending split rules. This base class - * is non-commital about directionality, or whether the top-level + * is non-committal about directionality, or whether the top-level * spliterator covers the whole tree. This means that the actual * split mechanics are located in subclasses. Some of the subclass * trySplit methods are identical (except for return types), but diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java b/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java index b50bc5930c3..2ffaef68010 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java @@ -481,7 +481,7 @@ public class ConcurrentHashMap extends AbstractMap * * Maintaining API and serialization compatibility with previous * versions of this class introduces several oddities. Mainly: We - * leave untouched but unused constructor arguments refering to + * leave untouched but unused constructor arguments referring to * concurrencyLevel. We accept a loadFactor constructor argument, * but apply it only to initial table capacity (which is the only * time that we can guarantee to honor it.) We also declare an diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java b/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java index 7c2effb95b7..4daee40a362 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java @@ -2710,7 +2710,7 @@ public class ConcurrentSkipListMap extends AbstractMap } /** - * Returns lowest absolute key (ignoring directonality). + * Returns lowest absolute key (ignoring directionality). */ K lowestKey() { Comparator cmp = m.comparator; @@ -2722,7 +2722,7 @@ public class ConcurrentSkipListMap extends AbstractMap } /** - * Returns highest absolute key (ignoring directonality). + * Returns highest absolute key (ignoring directionality). */ K highestKey() { Comparator cmp = m.comparator; diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java b/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java index 0029322cfc2..58f80866140 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java @@ -1328,13 +1328,16 @@ public class ForkJoinPool extends AbstractExecutorService { /** * Number of times to spin-wait before blocking. The spins (in * awaitRunStateLock and awaitWork) currently use randomized - * spins. If/when MWAIT-like intrinsics becomes available, they - * may allow quieter spinning. The value of SPINS must be a power - * of two, at least 4. The current value causes spinning for a - * small fraction of typical context-switch times, well worthwhile - * given the typical likelihoods that blocking is not necessary. + * spins. Currently set to zero to reduce CPU usage. + * + * If greater than zero the value of SPINS must be a power + * of two, at least 4. A value of 2048 causes spinning for a + * small fraction of typical context-switch times. + * + * If/when MWAIT-like intrinsics becomes available, they + * may allow quieter spinning. */ - private static final int SPINS = 1 << 11; + private static final int SPINS = 0; /** * Increment for seed generators. See class ThreadLocal for diff --git a/jdk/src/java.base/share/classes/javax/crypto/interfaces/package.html b/jdk/src/java.base/share/classes/javax/crypto/interfaces/package.html index 8b18ce2df87..c43000e80a7 100644 --- a/jdk/src/java.base/share/classes/javax/crypto/interfaces/package.html +++ b/jdk/src/java.base/share/classes/javax/crypto/interfaces/package.html @@ -47,8 +47,7 @@ cryptographic provider developer guide:

@@ -66,8 +65,7 @@ For further documentation, please see:
  • - JavaTM - Cryptography Architecture API Specification and Reference + Java™ Cryptography Architecture API Specification and Reference
  • diff --git a/jdk/src/java.base/share/classes/javax/crypto/spec/package.html b/jdk/src/java.base/share/classes/javax/crypto/spec/package.html index b8fd80724de..7f563fbb372 100644 --- a/jdk/src/java.base/share/classes/javax/crypto/spec/package.html +++ b/jdk/src/java.base/share/classes/javax/crypto/spec/package.html @@ -62,14 +62,13 @@ and key specifications, please see:
  • - JavaTM - Cryptography Architecture API Specification and Reference + Java™ Cryptography Architecture API Specification and Reference
  • How to Implement a Provider for the - JavaTM Cryptography Architecture + Java™ Cryptography Architecture
  • diff --git a/jdk/src/java.base/share/classes/javax/net/ssl/package.html b/jdk/src/java.base/share/classes/javax/net/ssl/package.html index 52131379bd2..d75e1d397a0 100644 --- a/jdk/src/java.base/share/classes/javax/net/ssl/package.html +++ b/jdk/src/java.base/share/classes/javax/net/ssl/package.html @@ -38,8 +38,7 @@ and to optionally encrypt the data and/or authenticate the communicating peers. diff --git a/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java b/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java index 6db4d4fdb6d..57115f2139d 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java +++ b/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/Parser.java @@ -145,12 +145,12 @@ public abstract class Parser { /** * ASCII character type array. * - * This array maps an ASCII (7 bit) character to the character type.
    - * Possible character type values are:
    - ' ' for any kind of white - * space character;
    - 'a' for any lower case alphabetical character - * value;
    - 'A' for any upper case alphabetical character value;
    - * - 'd' for any decimal digit character value;
    - 'z' for any - * character less then ' ' except '\t', '\n', '\r';
    An ASCII (7 bit) + * This array maps an ASCII (7 bit) character to the character type.
    + * Possible character type values are:
    - ' ' for any kind of white + * space character;
    - 'a' for any lower case alphabetical character + * value;
    - 'A' for any upper case alphabetical character value;
    + * - 'd' for any decimal digit character value;
    - 'z' for any + * character less than ' ' except '\t', '\n', '\r';
    An ASCII (7 bit) * character which does not fall in any category listed above is mapped to * it self. */ @@ -158,11 +158,11 @@ public abstract class Parser { /** * NMTOKEN character type array. * - * This array maps an ASCII (7 bit) character to the character type.
    - * Possible character type values are:
    - 0 for underscore ('_') or any - * lower and upper case alphabetical character value;
    - 1 for colon - * (':') character;
    - 2 for dash ('-') and dot ('.') or any decimal - * digit character value;
    - 3 for any kind of white space character
    + * Possible character type values are:
    - 0 for underscore ('_') or any + * lower and upper case alphabetical character value;
    - 1 for colon + * (':') character;
    - 2 for dash ('-') and dot ('.') or any decimal + * digit character value;
    - 3 for any kind of white space character
    An ASCII (7 bit) character which does not fall in any category listed * above is mapped to 0xff. */ @@ -1841,10 +1841,12 @@ public abstract class Parser { /** * Reads an attribute value. * - * The grammar which this method can read is:
    - * eqstr := S "=" qstr
    - * qstr := S ("'" string "'") | - * ('"' string '"')
    This method resolves entities + * The grammar this method can read is: + *
    {@code
    +     * eqstr := S "=" qstr
    +     * qstr  := S ("'" string "'") | ('"' string '"')
    +     * }
    + * This method resolves entities * inside a string unless the parser parses DTD. * * @param flag The '=' character forces the method to accept the '=' @@ -2633,7 +2635,7 @@ public abstract class Parser { * Reports characters and empties the parser's buffer. This method is called * only if parser is going to return control to the main loop. This means * that this method may use parser buffer to report white space without - * copeing characters to temporary buffer. + * copying characters to temporary buffer. */ protected abstract void bflash() throws Exception; @@ -2642,7 +2644,7 @@ public abstract class Parser { * Reports white space characters and empties the parser's buffer. This * method is called only if parser is going to return control to the main * loop. This means that this method may use parser buffer to report white - * space without copeing characters to temporary buffer. + * space without copying characters to temporary buffer. */ protected abstract void bflash_ws() throws Exception; @@ -3290,16 +3292,20 @@ public abstract class Parser { } /** - * Maps a character to it's type. + * Maps a character to its type. * - * Possible character type values are:
    - ' ' for any kind of white - * space character;
    - 'a' for any lower case alphabetical character - * value;
    - 'A' for any upper case alphabetical character value;
    - * - 'd' for any decimal digit character value;
    - 'z' for any - * character less then ' ' except '\t', '\n', '\r';
    - 'X' for any not - * ASCII character;
    - 'Z' for EOS character.
    An ASCII (7 bit) - * character which does not fall in any category listed above is mapped to - * it self. + * Possible character type values are: + *
      + *
    • ' ' - for any kind of whitespace character;
    • + *
    • 'a' - for any lower case alphabetical character value;
    • + *
    • 'A' - for any upper case alphabetical character value;
    • + *
    • 'd' - for any decimal digit character value;
    • + *
    • 'z' - for any character less than ' ' except '\t', '\n', '\r';
    • + *
    • 'X' - for any not ASCII character;
    • + *
    • 'Z' - for EOS character.
    • + *
    + * An ASCII (7 bit) character which does not fall in any category + * listed above is mapped to itself. * * @param ch The character to map. * @return The type of character. diff --git a/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/ParserSAX.java b/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/ParserSAX.java index da921dc4936..733f2665972 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/ParserSAX.java +++ b/jdk/src/java.base/share/classes/jdk/internal/util/xml/impl/ParserSAX.java @@ -649,7 +649,7 @@ final class ParserSAX * Reports characters and empties the parser's buffer. This method is called * only if parser is going to return control to the main loop. This means * that this method may use parser buffer to report white space without - * copeing characters to temporary buffer. + * copying characters to temporary buffer. */ protected void bflash() throws SAXException { if (mBuffIdx >= 0) { @@ -663,7 +663,7 @@ final class ParserSAX * Reports white space characters and empties the parser's buffer. This * method is called only if parser is going to return control to the main * loop. This means that this method may use parser buffer to report white - * space without copeing characters to temporary buffer. + * space without copying characters to temporary buffer. */ protected void bflash_ws() throws SAXException { if (mBuffIdx >= 0) { diff --git a/jdk/src/java.base/share/classes/sun/misc/Cache.java b/jdk/src/java.base/share/classes/sun/misc/Cache.java index 467481183a6..fb0a9ea8724 100644 --- a/jdk/src/java.base/share/classes/sun/misc/Cache.java +++ b/jdk/src/java.base/share/classes/sun/misc/Cache.java @@ -196,8 +196,8 @@ public /** * Gets the object associated with the specified key in the Cache. * @param key the key in the hash table - * @returns the element for the key or null if the key - * is not defined in the hash table. + * @return the element for the key or null if the key + * is not defined in the hash table. * @see Cache#put */ public synchronized Object get(Object key) { diff --git a/jdk/src/java.base/share/classes/sun/misc/CharacterDecoder.java b/jdk/src/java.base/share/classes/sun/misc/CharacterDecoder.java index c076f46df28..07cbd413594 100644 --- a/jdk/src/java.base/share/classes/sun/misc/CharacterDecoder.java +++ b/jdk/src/java.base/share/classes/sun/misc/CharacterDecoder.java @@ -120,7 +120,7 @@ public abstract class CharacterDecoder { /** * This method does an actual decode. It takes the decoded bytes and * writes them to the OutputStream. The integer l tells the - * method how many bytes are required. This is always <= bytesPerAtom(). + * method how many bytes are required. This is always {@literal <=} bytesPerAtom(). */ protected void decodeAtom(PushbackInputStream aStream, OutputStream bStream, int l) throws IOException { throw new CEStreamExhausted(); diff --git a/jdk/src/java.base/share/classes/sun/misc/CharacterEncoder.java b/jdk/src/java.base/share/classes/sun/misc/CharacterEncoder.java index d152f954cf9..4042cb2c6e7 100644 --- a/jdk/src/java.base/share/classes/sun/misc/CharacterEncoder.java +++ b/jdk/src/java.base/share/classes/sun/misc/CharacterEncoder.java @@ -68,7 +68,7 @@ import java.nio.ByteBuffer; * referenced in the See Also list below. * * @author Chuck McManis - * @see CharacterDecoder; + * @see CharacterDecoder * @see UCEncoder * @see UUEncoder * @see BASE64Encoder @@ -107,7 +107,7 @@ public abstract class CharacterEncoder { /** * Encode the suffix that ends every output line. By default - * this method just prints a into the output stream. + * this method just prints a newline into the output stream. */ protected void encodeLineSuffix(OutputStream aStream) throws IOException { pStream.println(); diff --git a/jdk/src/java.base/share/classes/sun/misc/ConditionLock.java b/jdk/src/java.base/share/classes/sun/misc/ConditionLock.java index e1af5252117..60a6fa5ee04 100644 --- a/jdk/src/java.base/share/classes/sun/misc/ConditionLock.java +++ b/jdk/src/java.base/share/classes/sun/misc/ConditionLock.java @@ -34,7 +34,7 @@ package sun.misc; * with the lock() and unlock() methods. However if there is a thread * waiting for the state variable to become a particular value and you * simply call Unlock(), that thread will not be able to acquire the - * lock until the state variable equals its desired value.

    + * lock until the state variable equals its desired value. * * @author Peter King */ diff --git a/jdk/src/java.base/share/classes/sun/misc/ExtensionDependency.java b/jdk/src/java.base/share/classes/sun/misc/ExtensionDependency.java index c013169fa2f..97c9480efd8 100644 --- a/jdk/src/java.base/share/classes/sun/misc/ExtensionDependency.java +++ b/jdk/src/java.base/share/classes/sun/misc/ExtensionDependency.java @@ -45,26 +45,26 @@ import java.net.MalformedURLException; import sun.net.www.ParseUtil; /** - *

    * This class checks dependent extensions a particular jar file may have * declared through its manifest attributes. - *

    + *

    * Jar file declared dependent extensions through the extension-list * attribute. The extension-list contains a list of keys used to * fetch the other attributes describing the required extension. * If key is the extension key declared in the extension-list * attribute, the following describing attribute can be found in - * the manifest : - * key-Extension-Name: (Specification package name) - * key-Specification-Version: (Specification-Version) - * key-Implementation-Version: (Implementation-Version) - * key-Implementation-Vendor-Id: (Imlementation-Vendor-Id) - * key-Implementation-Version: (Implementation version) - * key-Implementation-URL: (URL to download the requested extension) + * the manifest: + *

      + *
    • key-Extension-Name: (Specification package name)
    • + *
    • key-Specification-Version: (Specification-Version)
    • + *
    • key-Implementation-Version: (Implementation-Version)
    • + *
    • key-Implementation-Vendor-Id: (Imlementation-Vendor-Id)
    • + *
    • key-Implementation-Version: (Implementation version)
    • + *
    • key-Implementation-URL: (URL to download the requested extension)
    • + *
    *

    * This class also maintain versioning consistency of installed * extensions dependencies declared in jar file manifest. - *

    * * @deprecated this class will be removed in a future release. * @author Jerome Dochez @@ -76,10 +76,9 @@ public class ExtensionDependency { private static Vector providers; /** - *

    * Register an ExtensionInstallationProvider. The provider is responsible * for handling the installation (upgrade) of any missing extensions. - *

    + * * @param eip ExtensionInstallationProvider implementation */ public synchronized static void addExtensionInstallationProvider @@ -92,9 +91,7 @@ public class ExtensionDependency { } /** - *

    * Unregister a previously installed installation provider - *

    */ public synchronized static void removeExtensionInstallationProvider (ExtensionInstallationProvider eip) @@ -103,10 +100,9 @@ public class ExtensionDependency { } /** - *

    * Checks the dependencies of the jar file on installed extension. - *

    - * @param jarFile containing the attriutes declaring the dependencies + * + * @param jar containing the attributes declaring the dependencies */ public static boolean checkExtensionsDependencies(JarFile jar) { @@ -182,9 +178,8 @@ public class ExtensionDependency { /* - *

    * Check that a particular dependency on an extension is satisfied. - *

    + * * @param extensionName is the key used for the attributes in the manifest * @param attr is the attributes of the manifest file * @@ -204,10 +199,9 @@ public class ExtensionDependency { } /* - *

    * Check if a particular extension is part of the currently installed * extensions. - *

    + * * @param extensionName is the key for the attributes in the manifest * @param attr is the attributes of the manifest * @@ -262,11 +256,9 @@ public class ExtensionDependency { } /* - *

    * Check if the requested extension described by the attributes * in the manifest under the key extensionName is compatible with * the jar file. - *

    * * @param extensionName key in the attribute list * @param attr manifest file attributes @@ -337,10 +329,8 @@ public class ExtensionDependency { } /* - *

    * An required extension is missing, if an ExtensionInstallationProvider is * registered, delegate the installation of that particular extension to it. - *

    * * @param reqInfo Missing extension information * @param instInfo Older installed version information @@ -380,11 +370,9 @@ public class ExtensionDependency { } /** - *

    * Checks if the extension, that is specified in the extension-list in * the applet jar manifest, is already installed (i.e. exists in the * extension directory). - *

    * * @param extensionName extension name in the extension-list * @@ -428,9 +416,7 @@ public class ExtensionDependency { } /** - *

    * @return the java.ext.dirs property as a list of directory - *

    */ private static File[] getExtDirs() { String s = java.security.AccessController.doPrivileged( @@ -456,9 +442,8 @@ public class ExtensionDependency { } /* - *

    * Scan the directories and return all files installed in those - *

    + * * @param dirs list of directories to scan * * @return the list of files installed in all the directories @@ -483,9 +468,7 @@ public class ExtensionDependency { } /* - *

    * @return the list of installed extensions jar files - *

    */ private File[] getInstalledExtensions() throws IOException { return AccessController.doPrivileged( @@ -503,9 +486,7 @@ public class ExtensionDependency { } /* - *

    * Add the newly installed jar file to the extension class loader. - *

    * * @param cl the current installed extension class loader * diff --git a/jdk/src/java.base/share/classes/sun/misc/ExtensionInfo.java b/jdk/src/java.base/share/classes/sun/misc/ExtensionInfo.java index e6aad939eb8..c3680cd00ec 100644 --- a/jdk/src/java.base/share/classes/sun/misc/ExtensionInfo.java +++ b/jdk/src/java.base/share/classes/sun/misc/ExtensionInfo.java @@ -45,9 +45,7 @@ import java.lang.Character.*; public class ExtensionInfo { /** - *

    * public static values returned by the isCompatible method - *

    */ public static final int COMPATIBLE = 0; public static final int REQUIRE_SPECIFICATION_UPGRADE = 1; @@ -56,10 +54,8 @@ public class ExtensionInfo { public static final int INCOMPATIBLE = 4; /** - *

    * attributes fully describer an extension. The underlying described * extension may be installed and requested. - *

    */ public String title; public String name; @@ -76,15 +72,12 @@ public class ExtensionInfo { /** - *

    * Create a new uninitialized extension information object - *

    */ public ExtensionInfo() { } /** - *

    * Create and initialize an extension information object. * The initialization uses the attributes passed as being * the content of a manifest file to load the extension @@ -93,7 +86,7 @@ public class ExtensionInfo { * extension they may depend on, the extension key parameter * is prepanded to the attribute name to make the key used * to retrieve the attribute from the manifest file - *

    + * * @param extensionKey unique extension key in the manifest * @param attr Attributes of a manifest file */ @@ -149,13 +142,11 @@ public class ExtensionInfo { } /** - *

    * @return true if the extension described by this extension information * is compatible with the extension described by the extension * information passed as a parameter - *

    * - * @param the requested extension information to compare to + * @param ei the requested extension information to compare to */ public int isCompatibleWith(ExtensionInfo ei) { @@ -204,10 +195,8 @@ public class ExtensionInfo { } /** - *

    * helper method to print sensible information on the undelying described * extension - *

    */ public String toString() { return "Extension : title(" + title + "), name(" + name + "), spec vendor(" + @@ -217,15 +206,15 @@ public class ExtensionInfo { } /* - *

    * helper method to compare two versions. * version are in the x.y.z.t pattern. - *

    + * * @param source version to compare to * @param target version used to compare against - * @return < 0 if source < version - * > 0 if source > version - * = 0 if source = version + * @return
    {@code
    +     *   < 0 if source < version
    +     *   > 0 if source > version
    +     *   = 0 if source = version}
    */ private int compareExtensionVersion(String source, String target) throws NumberFormatException @@ -238,15 +227,15 @@ public class ExtensionInfo { /* - *

    * helper method to compare two versions. * version are in the x.y.z.t pattern. - *

    + * * @param source version to compare to * @param target version used to compare against - * @return < 0 if source < version - * > 0 if source > version - * = 0 if source = version + * @return
    {@code
    +     *   < 0 if source < version
    +     *   > 0 if source > version
    +     *   = 0 if source = version}
    */ private int strictCompareExtensionVersion(String source, String target) throws NumberFormatException diff --git a/jdk/src/java.base/share/classes/sun/misc/FDBigInteger.java b/jdk/src/java.base/share/classes/sun/misc/FDBigInteger.java index 77d6fbc08b6..972ccd1ef5f 100644 --- a/jdk/src/java.base/share/classes/sun/misc/FDBigInteger.java +++ b/jdk/src/java.base/share/classes/sun/misc/FDBigInteger.java @@ -384,8 +384,8 @@ public /*@ spec_bigint_math @*/ class FDBigInteger { * Retrieves the normalization bias of the FDBigIntger. The * normalization bias is a left shift such that after it the highest word * of the value will have the 4 highest bits equal to zero: - * (highestWord & 0xf0000000) == 0, but the next bit should be 1 - * (highestWord & 0x08000000) != 0. + * {@code (highestWord & 0xf0000000) == 0}, but the next bit should be 1 + * {@code (highestWord & 0x08000000) != 0}. * * @return The normalization bias. */ @@ -546,9 +546,9 @@ public /*@ spec_bigint_math @*/ class FDBigInteger { * We assume that S has been normalized, as above, and that * "this" has been left-shifted accordingly. * Also assumed, of course, is that the result, q, can be expressed - * as an integer, 0 <= q < 10. + * as an integer, {@code 0 <= q < 10}. * - * @param The divisor of this FDBigInteger. + * @param S The divisor of this FDBigInteger. * @return q = (int)(this / S). */ /*@ @@ -685,7 +685,7 @@ public /*@ spec_bigint_math @*/ class FDBigInteger { * * @param p5 The exponent of the power-of-five factor. * @param p2 The exponent of the power-of-two factor. - * @return + * @return The multiplication result. */ /*@ @ requires this.value() == 0 || p5 == 0 && p2 == 0; @@ -931,11 +931,11 @@ public /*@ spec_bigint_math @*/ class FDBigInteger { /** * Compares the parameter with this FDBigInteger. Returns an * integer accordingly as: - *
    -     * >0: this > other
    -     *  0: this == other
    -     * <0: this < other
    -     * 
    + *
    {@code
    +     * > 0: this > other
    +     *   0: this == other
    +     * < 0: this < other
    +     * }
    * * @param other The FDBigInteger to compare. * @return A negative value, zero, or a positive value according to the @@ -974,11 +974,11 @@ public /*@ spec_bigint_math @*/ class FDBigInteger { * Compares this FDBigInteger with * 5p5 * 2p2. * Returns an integer accordingly as: - *
    -     * >0: this > other
    -     *  0: this == other
    -     * <0: this < other
    -     * 
    + *
    {@code
    +     * > 0: this > other
    +     *   0: this == other
    +     * < 0: this < other
    +     * }
    * @param p5 The exponent of the power-of-five factor. * @param p2 The exponent of the power-of-two factor. * @return A negative value, zero, or a positive value according to the @@ -1011,11 +1011,11 @@ public /*@ spec_bigint_math @*/ class FDBigInteger { /** * Compares this FDBigInteger with x + y. Returns a * value according to the comparison as: - *
    +     * 
    {@code
          * -1: this <  x + y
          *  0: this == x + y
          *  1: this >  x + y
    -     * 
    + * }
    * @param x The first addend of the sum to compare. * @param y The second addend of the sum to compare. * @return -1, 0, or 1 according to the result of the comparison. diff --git a/jdk/src/java.base/share/classes/sun/misc/FloatingDecimal.java b/jdk/src/java.base/share/classes/sun/misc/FloatingDecimal.java index eef4caf9905..b3a4a2a7575 100644 --- a/jdk/src/java.base/share/classes/sun/misc/FloatingDecimal.java +++ b/jdk/src/java.base/share/classes/sun/misc/FloatingDecimal.java @@ -154,7 +154,7 @@ public class FloatingDecimal{ /** * Indicates the sign of the value. - * @return value < 0.0. + * @return {@code value < 0.0}. */ public boolean isNegative(); diff --git a/jdk/src/java.base/share/classes/sun/misc/IOUtils.java b/jdk/src/java.base/share/classes/sun/misc/IOUtils.java index 57f8918975a..bd4b1430c4e 100644 --- a/jdk/src/java.base/share/classes/sun/misc/IOUtils.java +++ b/jdk/src/java.base/share/classes/sun/misc/IOUtils.java @@ -39,7 +39,7 @@ public class IOUtils { /** * Read up to length of bytes from in * until EOF is detected. - * @param in input stream, must not be null + * @param is input stream, must not be null * @param length number of bytes to read, -1 or Integer.MAX_VALUE means * read as much as possible * @param readAll if true, an EOFException will be thrown if not enough diff --git a/jdk/src/java.base/share/classes/sun/misc/JarFilter.java b/jdk/src/java.base/share/classes/sun/misc/JarFilter.java index b4db96db08f..9036ecaed87 100644 --- a/jdk/src/java.base/share/classes/sun/misc/JarFilter.java +++ b/jdk/src/java.base/share/classes/sun/misc/JarFilter.java @@ -29,10 +29,8 @@ import java.io.File; import java.io.FilenameFilter; /** - *

    * This class checks that only jar and zip files are included in the file list. * This class is used in extension installation support (ExtensionDependency). - *

    * * @deprecated this class will be removed in a future release. * @author Michael Colburn diff --git a/jdk/src/java.base/share/classes/sun/misc/JavaLangAccess.java b/jdk/src/java.base/share/classes/sun/misc/JavaLangAccess.java index a86453df430..db37e18fffe 100644 --- a/jdk/src/java.base/share/classes/sun/misc/JavaLangAccess.java +++ b/jdk/src/java.base/share/classes/sun/misc/JavaLangAccess.java @@ -91,14 +91,14 @@ public interface JavaLangAccess { * may be added to the delete on exit list by the application shutdown * hooks. * - * @params slot the slot in the shutdown hook array, whose element - * will be invoked in order during shutdown - * @params registerShutdownInProgress true to allow the hook - * to be registered even if the shutdown is in progress. - * @params hook the hook to be registered + * @param slot the slot in the shutdown hook array, whose element + * will be invoked in order during shutdown + * @param registerShutdownInProgress true to allow the hook + * to be registered even if the shutdown is in progress. + * @param hook the hook to be registered * - * @throw IllegalStateException if shutdown is in progress and - * the slot is not valid to register. + * @throws IllegalStateException if shutdown is in progress and + * the slot is not valid to register. */ void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook); diff --git a/jdk/src/java.base/share/classes/sun/misc/Perf.java b/jdk/src/java.base/share/classes/sun/misc/Perf.java index bafd39dd90c..311e92c8f64 100644 --- a/jdk/src/java.base/share/classes/sun/misc/Perf.java +++ b/jdk/src/java.base/share/classes/sun/misc/Perf.java @@ -67,13 +67,13 @@ public final class Perf { * AccessController.doPrivileged(PrivilegedAction). *

    Here is a suggested idiom for use of this class: * - *

    +     * 
    {@code
          * class MyTrustedClass {
          *   private static final Perf perf =
          *       AccessController.doPrivileged(new Perf.GetPerfAction());
          *   ...
          * }
    -     * 
    + * }
    *

    * In the presence of a security manager, the MyTrustedClass * class in the above example will need to be granted the @@ -171,8 +171,7 @@ public final class Perf { * The attach mode specifies the access permissions requested for the * instrumentation buffer of the target virtual machine. The permitted * access permissions are: - *

    - * + *

      *
    • "r" - Read only access. This Java virtual machine has only * read access to the instrumentation buffer for the target Java * virtual machine. @@ -180,7 +179,7 @@ public final class Perf { * write access to the instrumentation buffer for the target Java virtual * machine. This mode is currently not supported and is reserved for * future enhancements. - * + *
    * * @param lvmid an integer that uniquely identifies the * target local Java virtual machine. diff --git a/jdk/src/java.base/share/classes/sun/misc/PerfCounter.java b/jdk/src/java.base/share/classes/sun/misc/PerfCounter.java index 6d6969a1f69..21a36a8cf8d 100644 --- a/jdk/src/java.base/share/classes/sun/misc/PerfCounter.java +++ b/jdk/src/java.base/share/classes/sun/misc/PerfCounter.java @@ -37,7 +37,7 @@ import java.security.AccessController; * The perf counters will be created in the jvmstat perf buffer * that the HotSpot VM creates. The default size is 32K and thus * the number of counters is bounded. You can alter the size - * with -XX:PerfDataMemorySize= option. If there is + * with {@code -XX:PerfDataMemorySize=} option. If there is * insufficient memory in the jvmstat perf buffer, the C heap memory * will be used and thus the application will continue to run if * the counters added exceeds the buffer size but the counters diff --git a/jdk/src/java.base/share/classes/sun/misc/PerformanceLogger.java b/jdk/src/java.base/share/classes/sun/misc/PerformanceLogger.java index 9f4a9e490ec..6e8917b4545 100644 --- a/jdk/src/java.base/share/classes/sun/misc/PerformanceLogger.java +++ b/jdk/src/java.base/share/classes/sun/misc/PerformanceLogger.java @@ -51,10 +51,12 @@ import java.io.Writer; *

    * To automatically track startup performance in an app or applet, * use the command-line parameter sun.perflog as follows:
    + *

    {@code
      *     -Dsun.perflog[=file:]
    + * }
    *
    * where simply using the parameter with no value will enable output - * to the console and a value of "file:" will cause + * to the console and a value of "{@code file:}" will cause * that given filename to be created and used for all output. *

    * By default, times are measured using System.currentTimeMillis(). To use diff --git a/jdk/src/java.base/share/classes/sun/misc/Resource.java b/jdk/src/java.base/share/classes/sun/misc/Resource.java index b314872a5eb..4ebf58144e4 100644 --- a/jdk/src/java.base/share/classes/sun/misc/Resource.java +++ b/jdk/src/java.base/share/classes/sun/misc/Resource.java @@ -154,7 +154,8 @@ public abstract class Resource { /** * Returns the Resource data as a ByteBuffer, but only if the input stream - * was implemented on top of a ByteBuffer. Return null otherwise. + * was implemented on top of a ByteBuffer. Return {@code null} otherwise. + * @return Resource data or null. */ public ByteBuffer getByteBuffer() throws IOException { InputStream in = cachedInputStream(); diff --git a/jdk/src/java.base/share/classes/sun/misc/Signal.java b/jdk/src/java.base/share/classes/sun/misc/Signal.java index a00ee9f089d..92438833737 100644 --- a/jdk/src/java.base/share/classes/sun/misc/Signal.java +++ b/jdk/src/java.base/share/classes/sun/misc/Signal.java @@ -50,7 +50,7 @@ import java.util.Hashtable; * Signal objects are created based on their names. For example: *

      * new Signal("INT");
    - * 
    + * * constructs a signal object corresponding to SIGINT, which is * typically produced when the user presses Ctrl-C at the command line. * The Signal constructor throws IllegalArgumentException @@ -64,7 +64,7 @@ import java.util.Hashtable; * } * }; * Signal.handle(new Signal("INT"), handler); - * + * * * @author Sheng Liang * @author Bill Shannon @@ -149,7 +149,7 @@ public final class Signal { * * @param sig a signal * @param handler the handler to be registered with the given signal. - * @result the old handler + * @return the old handler * @exception IllegalArgumentException the signal is in use by the VM * @see sun.misc.Signal#raise(Signal sig) * @see sun.misc.SignalHandler diff --git a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java index 1d3454e281e..6d7078a9751 100644 --- a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java +++ b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java @@ -641,9 +641,9 @@ public final class Unsafe { *
  • String: any object (not just a java.lang.String) *
  • InterfaceMethodRef: (NYI) a method handle to invoke on that call site's arguments * - * @params hostClass context for linkage, access control, protection domain, and class loader - * @params data bytes of a class file - * @params cpPatches where non-null entries exist, they replace corresponding CP entries in data + * @param hostClass context for linkage, access control, protection domain, and class loader + * @param data bytes of a class file + * @param cpPatches where non-null entries exist, they replace corresponding CP entries in data */ public native Class defineAnonymousClass(Class hostClass, byte[] data, Object[] cpPatches); @@ -808,9 +808,9 @@ public final class Unsafe { * The system imposes a maximum of 3 samples, representing * averages over the last 1, 5, and 15 minutes, respectively. * - * @params loadavg an array of double of size nelems - * @params nelems the number of samples to be retrieved and - * must be 1 to 3. + * @param loadavg an array of double of size nelems + * @param nelems the number of samples to be retrieved and + * must be 1 to 3. * * @return the number of samples actually retrieved; or -1 * if the load average is unobtainable. @@ -1108,7 +1108,6 @@ public final class Unsafe { *

    * 8-byte atomicity is only guaranteed on platforms on which * support atomic accesses to longs. - *

    * * @param o Java heap object in which the value resides, if any, else * null diff --git a/jdk/src/java.base/share/classes/sun/misc/VM.java b/jdk/src/java.base/share/classes/sun/misc/VM.java index 36bfb606495..8cb765758b4 100644 --- a/jdk/src/java.base/share/classes/sun/misc/VM.java +++ b/jdk/src/java.base/share/classes/sun/misc/VM.java @@ -315,7 +315,7 @@ public class VM { } /* - * Add n to the objects pending for finalization count. + * Add {@code n} to the objects pending for finalization count. * * @param n an integer value to be added to the objects pending * for finalization count diff --git a/jdk/src/java.base/share/classes/sun/misc/resources/Messages.java b/jdk/src/java.base/share/classes/sun/misc/resources/Messages.java index 56f76bb2876..4cf913210a7 100644 --- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages.java +++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages.java @@ -26,7 +26,7 @@ package sun.misc.resources; /** - *

    This class represents the ResourceBundle + * This class represents the {@code ResourceBundle} * for sun.misc. * * @author Michael Colburn @@ -35,9 +35,9 @@ package sun.misc.resources; public class Messages extends java.util.ListResourceBundle { /** - * Returns the contents of this ResourceBundle. - *

    - * @return the contents of this ResourceBundle. + * Returns the contents of this {@code ResourceBundle}. + * + * @return the contents of this {@code ResourceBundle}. */ public Object[][] getContents() { return contents; diff --git a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_de.java b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_de.java index e2961c52e84..d22b1e592ec 100644 --- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_de.java +++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_de.java @@ -26,7 +26,7 @@ package sun.misc.resources; /** - *

    This class represents the ResourceBundle + * This class represents the {@code ResourceBundle} * for sun.misc. * * @author Michael Colburn @@ -35,9 +35,9 @@ package sun.misc.resources; public class Messages_de extends java.util.ListResourceBundle { /** - * Returns the contents of this ResourceBundle. - *

    - * @return the contents of this ResourceBundle. + * Returns the contents of this {@code ResourceBundle}. + * + * @return the contents of this {@code ResourceBundle}. */ public Object[][] getContents() { return contents; diff --git a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_es.java b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_es.java index 9e762017a45..1d4bc2de250 100644 --- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_es.java +++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_es.java @@ -26,7 +26,7 @@ package sun.misc.resources; /** - *

    This class represents the ResourceBundle + * This class represents the {@code ResourceBundle} * for sun.misc. * * @author Michael Colburn @@ -35,9 +35,9 @@ package sun.misc.resources; public class Messages_es extends java.util.ListResourceBundle { /** - * Returns the contents of this ResourceBundle. - *

    - * @return the contents of this ResourceBundle. + * Returns the contents of this {@code ResourceBundle}. + * + * @return the contents of this {@code ResourceBundle}. */ public Object[][] getContents() { return contents; diff --git a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_fr.java b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_fr.java index b742b26ef06..8f74b9b063e 100644 --- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_fr.java +++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_fr.java @@ -26,7 +26,7 @@ package sun.misc.resources; /** - *

    This class represents the ResourceBundle + * This class represents the {@code ResourceBundle} * for sun.misc. * * @author Michael Colburn @@ -35,9 +35,9 @@ package sun.misc.resources; public class Messages_fr extends java.util.ListResourceBundle { /** - * Returns the contents of this ResourceBundle. - *

    - * @return the contents of this ResourceBundle. + * Returns the contents of this {@code ResourceBundle}. + * + * @return the contents of this {@code ResourceBundle}. */ public Object[][] getContents() { return contents; diff --git a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_it.java b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_it.java index ee7dd0a33c8..2b23c638b31 100644 --- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_it.java +++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_it.java @@ -26,7 +26,7 @@ package sun.misc.resources; /** - *

    This class represents the ResourceBundle + * This class represents the {@code ResourceBundle} * for sun.misc. * * @author Michael Colburn @@ -35,9 +35,9 @@ package sun.misc.resources; public class Messages_it extends java.util.ListResourceBundle { /** - * Returns the contents of this ResourceBundle. - *

    - * @return the contents of this ResourceBundle. + * Returns the contents of this {@code ResourceBundle}. + * + * @return the contents of this {@code ResourceBundle}. */ public Object[][] getContents() { return contents; diff --git a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_ja.java b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_ja.java index 4f1455187b4..c5242bf108c 100644 --- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_ja.java +++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_ja.java @@ -26,7 +26,7 @@ package sun.misc.resources; /** - *

    This class represents the ResourceBundle + * This class represents the {@code ResourceBundle} * for sun.misc. * * @author Michael Colburn @@ -35,9 +35,9 @@ package sun.misc.resources; public class Messages_ja extends java.util.ListResourceBundle { /** - * Returns the contents of this ResourceBundle. - *

    - * @return the contents of this ResourceBundle. + * Returns the contents of this {@code ResourceBundle}. + * + * @return the contents of this {@code ResourceBundle}. */ public Object[][] getContents() { return contents; diff --git a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_ko.java b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_ko.java index 53c32fc3f03..63119101d46 100644 --- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_ko.java +++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_ko.java @@ -26,7 +26,7 @@ package sun.misc.resources; /** - *

    This class represents the ResourceBundle + * This class represents the {@code ResourceBundle} * for sun.misc. * * @author Michael Colburn @@ -35,9 +35,9 @@ package sun.misc.resources; public class Messages_ko extends java.util.ListResourceBundle { /** - * Returns the contents of this ResourceBundle. - *

    - * @return the contents of this ResourceBundle. + * Returns the contents of this {@code ResourceBundle}. + * + * @return the contents of this {@code ResourceBundle}. */ public Object[][] getContents() { return contents; diff --git a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_pt_BR.java b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_pt_BR.java index 4781700e06f..ec756d2c4b0 100644 --- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_pt_BR.java +++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_pt_BR.java @@ -26,7 +26,7 @@ package sun.misc.resources; /** - *

    This class represents the ResourceBundle + * This class represents the {@code ResourceBundle} * for sun.misc. * * @author Michael Colburn @@ -35,9 +35,9 @@ package sun.misc.resources; public class Messages_pt_BR extends java.util.ListResourceBundle { /** - * Returns the contents of this ResourceBundle. - *

    - * @return the contents of this ResourceBundle. + * Returns the contents of this {@code ResourceBundle}. + * + * @return the contents of this {@code ResourceBundle}. */ public Object[][] getContents() { return contents; diff --git a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_sv.java b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_sv.java index a813852caa8..3c7402854ab 100644 --- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_sv.java +++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_sv.java @@ -26,7 +26,7 @@ package sun.misc.resources; /** - *

    This class represents the ResourceBundle + * This class represents the {@code ResourceBundle} * for sun.misc. * * @author Michael Colburn @@ -35,9 +35,9 @@ package sun.misc.resources; public class Messages_sv extends java.util.ListResourceBundle { /** - * Returns the contents of this ResourceBundle. - *

    - * @return the contents of this ResourceBundle. + * Returns the contents of this {@code ResourceBundle}. + * + * @return the contents of this {@code ResourceBundle}. */ public Object[][] getContents() { return contents; diff --git a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_zh_CN.java b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_zh_CN.java index d884f74a114..efd2ff0ba8d 100644 --- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_zh_CN.java +++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_zh_CN.java @@ -26,7 +26,7 @@ package sun.misc.resources; /** - *

    This class represents the ResourceBundle + * This class represents the {@code ResourceBundle} * for sun.misc. * * @author Michael Colburn @@ -35,9 +35,9 @@ package sun.misc.resources; public class Messages_zh_CN extends java.util.ListResourceBundle { /** - * Returns the contents of this ResourceBundle. - *

    - * @return the contents of this ResourceBundle. + * Returns the contents of this {@code ResourceBundle}. + * + * @return the contents of this {@code ResourceBundle}. */ public Object[][] getContents() { return contents; diff --git a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_zh_TW.java b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_zh_TW.java index 530a7cdef52..da6938f84a9 100644 --- a/jdk/src/java.base/share/classes/sun/misc/resources/Messages_zh_TW.java +++ b/jdk/src/java.base/share/classes/sun/misc/resources/Messages_zh_TW.java @@ -26,7 +26,7 @@ package sun.misc.resources; /** - *

    This class represents the ResourceBundle + * This class represents the {@code ResourceBundle} * for sun.misc. * * @author Michael Colburn @@ -35,9 +35,9 @@ package sun.misc.resources; public class Messages_zh_TW extends java.util.ListResourceBundle { /** - * Returns the contents of this ResourceBundle. - *

    - * @return the contents of this ResourceBundle. + * Returns the contents of this {@code ResourceBundle}. + * + * @return the contents of this {@code ResourceBundle}. */ public Object[][] getContents() { return contents; diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java index a012c3b6a1c..b9d594b0316 100644 --- a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java +++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java @@ -983,7 +983,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { SocketPermission p = URLtoSocketPermission(this.url); if (p != null) { try { - AccessController.doPrivileged( + AccessController.doPrivilegedWithCombiner( new PrivilegedExceptionAction<>() { public Void run() throws IOException { plainConnect0(); @@ -1244,7 +1244,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { if (p != null) { try { - return AccessController.doPrivileged( + return AccessController.doPrivilegedWithCombiner( new PrivilegedExceptionAction<>() { public OutputStream run() throws IOException { return getOutputStream0(); @@ -1422,7 +1422,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { if (p != null) { try { - return AccessController.doPrivileged( + return AccessController.doPrivilegedWithCombiner( new PrivilegedExceptionAction<>() { public InputStream run() throws IOException { return getInputStream0(); @@ -2565,7 +2565,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { if (p != null) { try { - return AccessController.doPrivileged( + return AccessController.doPrivilegedWithCombiner( new PrivilegedExceptionAction<>() { public Boolean run() throws IOException { return followRedirect0(loc, stat, locUrl0); diff --git a/jdk/src/java.base/share/classes/sun/nio/cs/HKSCS.java b/jdk/src/java.base/share/classes/sun/nio/cs/HKSCS.java index ba22341ae85..773c7a08a36 100644 --- a/jdk/src/java.base/share/classes/sun/nio/cs/HKSCS.java +++ b/jdk/src/java.base/share/classes/sun/nio/cs/HKSCS.java @@ -378,7 +378,6 @@ public class HKSCS { dst[dp++] = repl[1]; continue; } - sp++; } if (bb > MAX_SINGLEBYTE) { // DoubleByte dst[dp++] = (byte)(bb >> 8); diff --git a/jdk/src/java.base/share/classes/sun/nio/cs/Surrogate.java b/jdk/src/java.base/share/classes/sun/nio/cs/Surrogate.java index 8b2fcf6765f..96e30275866 100644 --- a/jdk/src/java.base/share/classes/sun/nio/cs/Surrogate.java +++ b/jdk/src/java.base/share/classes/sun/nio/cs/Surrogate.java @@ -175,10 +175,10 @@ public class Surrogate { * @param in The source buffer, from which one more character * will be consumed if c is a high surrogate * - * @returns Either a parsed UCS-4 character, in which case the isPair() - * and increment() methods will return meaningful values, or - * -1, in which case error() will return a descriptive result - * object + * @return Either a parsed UCS-4 character, in which case the isPair() + * and increment() methods will return meaningful values, or + * -1, in which case error() will return a descriptive result + * object */ public int parse(char c, CharBuffer in) { if (Character.isHighSurrogate(c)) { @@ -216,10 +216,10 @@ public class Surrogate { * @param ip The input index * @param il The input limit * - * @returns Either a parsed UCS-4 character, in which case the isPair() - * and increment() methods will return meaningful values, or - * -1, in which case error() will return a descriptive result - * object + * @return Either a parsed UCS-4 character, in which case the isPair() + * and increment() methods will return meaningful values, or + * -1, in which case error() will return a descriptive result + * object */ public int parse(char c, char[] ia, int ip, int il) { assert (ia[ip] == c); @@ -280,9 +280,9 @@ public class Surrogate { * @param dst The destination buffer, to which one or two UTF-16 * characters will be written * - * @returns Either a positive count of the number of UTF-16 characters - * written to the destination buffer, or -1, in which case - * error() will return a descriptive result object + * @return Either a positive count of the number of UTF-16 characters + * written to the destination buffer, or -1, in which case + * error() will return a descriptive result object */ public int generate(int uc, int len, CharBuffer dst) { if (Character.isBmpCodePoint(uc)) { @@ -325,9 +325,9 @@ public class Surrogate { * @param dp The destination position * @param dl The destination limit * - * @returns Either a positive count of the number of UTF-16 characters - * written to the destination buffer, or -1, in which case - * error() will return a descriptive result object + * @return Either a positive count of the number of UTF-16 characters + * written to the destination buffer, or -1, in which case + * error() will return a descriptive result object */ public int generate(int uc, int len, char[] da, int dp, int dl) { if (Character.isBmpCodePoint(uc)) { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/AVA.java b/jdk/src/java.base/share/classes/sun/security/x509/AVA.java index d1f94fb23a4..c75030a21a7 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/AVA.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/AVA.java @@ -454,7 +454,7 @@ public class AVA implements DerEncoder { if (embeddedHex.size() > 0) { // add space(s) before embedded hex bytes for (int i = 0; i < spaceCount; i++) { - temp.append(" "); + temp.append(' '); } spaceCount = 0; @@ -472,7 +472,7 @@ public class AVA implements DerEncoder { } else { // add space(s) for (int i = 0; i < spaceCount; i++) { - temp.append(" "); + temp.append(' '); } spaceCount = 0; temp.append((char)c); @@ -853,7 +853,7 @@ public class AVA implements DerEncoder { } sbuffer.append(c); } - typeAndValue.append(sbuffer.toString()); + typeAndValue.append(sbuffer); } return typeAndValue.toString(); } @@ -1039,7 +1039,7 @@ public class AVA implements DerEncoder { StringBuilder retval = new StringBuilder(40); retval.append(keyword); - retval.append("="); + retval.append('='); try { String valStr = value.getAsString(); @@ -1147,9 +1147,11 @@ public class AVA implements DerEncoder { // Emit the string ... quote it if needed // if string is already quoted, don't re-quote if (!alreadyQuoted && quoteNeeded) { - retval.append("\"" + sbuffer.toString() + "\""); + retval.append('\"') + .append(sbuffer) + .append('\"'); } else { - retval.append(sbuffer.toString()); + retval.append(sbuffer); } } } catch (IOException e) { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/AuthorityKeyIdentifierExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/AuthorityKeyIdentifierExtension.java index a8b04dea2b8..14754b2536c 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/AuthorityKeyIdentifierExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/AuthorityKeyIdentifierExtension.java @@ -196,17 +196,20 @@ implements CertAttrSet { * Return the object as a string. */ public String toString() { - String s = super.toString() + "AuthorityKeyIdentifier [\n"; + StringBuilder sb = new StringBuilder(); + sb.append(super.toString()) + .append("AuthorityKeyIdentifier [\n"); if (id != null) { - s += id.toString(); // id already has a newline + sb.append(id); // id already has a newline } if (names != null) { - s += names.toString() + "\n"; + sb.append(names).append('\n'); } if (serialNum != null) { - s += serialNum.toString() + "\n"; + sb.append(serialNum).append('\n'); } - return (s + "]\n"); + sb.append("]\n"); + return sb.toString(); } /** diff --git a/jdk/src/java.base/share/classes/sun/security/x509/BasicConstraintsExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/BasicConstraintsExtension.java index 35c8cfc65b9..65e62ec25c0 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/BasicConstraintsExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/BasicConstraintsExtension.java @@ -171,15 +171,11 @@ implements CertAttrSet { * Return user readable form of extension. */ public String toString() { - String s = super.toString() + "BasicConstraints:[\n"; - - s += ((ca) ? (" CA:true") : (" CA:false")) + "\n"; - if (pathLen >= 0) { - s += " PathLen:" + pathLen + "\n"; - } else { - s += " PathLen: undefined\n"; - } - return (s + "]\n"); + return super.toString() + + "BasicConstraints:[\n CA:" + ca + + "\n PathLen:" + + ((pathLen >= 0) ? String.valueOf(pathLen) : " undefined") + + "\n]\n"; } /** diff --git a/jdk/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java index eb2b0801fb8..d60f7f13079 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/CRLDistributionPointsExtension.java @@ -231,8 +231,8 @@ public class CRLDistributionPointsExtension extends Extension distributionPoints = (List)obj; } else { throw new IOException("Attribute name [" + name + - "] not recognized by " + - "CertAttrSet:" + extensionName + "."); + "] not recognized by " + + "CertAttrSet:" + extensionName + '.'); } encodeThis(); } @@ -245,8 +245,8 @@ public class CRLDistributionPointsExtension extends Extension return distributionPoints; } else { throw new IOException("Attribute name [" + name + - "] not recognized by " + - "CertAttrSet:" + extensionName + "."); + "] not recognized by " + + "CertAttrSet:" + extensionName + '.'); } } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java index 9649df6aa94..7a66f0b935f 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/CRLNumberExtension.java @@ -146,8 +146,8 @@ implements CertAttrSet { } crlNumber = (BigInteger)obj; } else { - throw new IOException("Attribute name not recognized by" - + " CertAttrSet:" + extensionName + "."); + throw new IOException("Attribute name not recognized by" + + " CertAttrSet:" + extensionName + '.'); } encodeThis(); } @@ -172,8 +172,8 @@ implements CertAttrSet { if (name.equalsIgnoreCase(NUMBER)) { crlNumber = null; } else { - throw new IOException("Attribute name not recognized by" - + " CertAttrSet:" + extensionName + "."); + throw new IOException("Attribute name not recognized by" + + " CertAttrSet:" + extensionName + '.'); } encodeThis(); } @@ -182,10 +182,15 @@ implements CertAttrSet { * Returns a printable representation of the CRLNumberExtension. */ public String toString() { - String s = super.toString() + extensionLabel + ": " + - ((crlNumber == null) ? "" : Debug.toHexString(crlNumber)) - + "\n"; - return (s); + StringBuilder sb = new StringBuilder(); + sb.append(super.toString()) + .append(extensionLabel) + .append(": "); + if (crlNumber != null) { + sb.append(Debug.toHexString(crlNumber)); + } + sb.append('\n'); + return sb.toString(); } /** @@ -195,7 +200,7 @@ implements CertAttrSet { * @exception IOException on encoding errors. */ public void encode(OutputStream out) throws IOException { - DerOutputStream tmp = new DerOutputStream(); + DerOutputStream tmp = new DerOutputStream(); encode(out, PKIXExtensions.CRLNumber_Id, true); } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/CertException.java b/jdk/src/java.base/share/classes/sun/security/x509/CertException.java index 585d1f825ea..4c2dcc6cfb9 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/CertException.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/CertException.java @@ -158,7 +158,7 @@ public class CertException extends SecurityException { */ public String toString() { - return "[Certificate Exception: " + getMessage() + "]"; + return "[Certificate Exception: " + getMessage() + ']'; } /** @@ -168,6 +168,6 @@ public class CertException extends SecurityException { { return getVerfDescription() + ( (moreData != null) - ? ( "\n (" + moreData + ")" ) : "" ); + ? ( "\n (" + moreData + ')' ) : "" ); } } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/CertificatePoliciesExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/CertificatePoliciesExtension.java index 4f04bedd37c..925936658f7 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/CertificatePoliciesExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/CertificatePoliciesExtension.java @@ -160,10 +160,12 @@ implements CertAttrSet { if (certPolicies == null) { return ""; } - StringBuilder sb = new StringBuilder(super.toString()); - sb.append("CertificatePolicies [\n"); + + StringBuilder sb = new StringBuilder(); + sb.append(super.toString()) + .append("CertificatePolicies [\n"); for (PolicyInformation info : certPolicies) { - sb.append(info.toString()); + sb.append(info); } sb.append("]\n"); return sb.toString(); diff --git a/jdk/src/java.base/share/classes/sun/security/x509/CertificateValidity.java b/jdk/src/java.base/share/classes/sun/security/x509/CertificateValidity.java index cd9b00fa235..29852d35e28 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/CertificateValidity.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/CertificateValidity.java @@ -134,8 +134,8 @@ public class CertificateValidity implements CertAttrSet { public String toString() { if (notBefore == null || notAfter == null) return ""; - return ("Validity: [From: " + notBefore.toString() + - ",\n To: " + notAfter.toString() + "]"); + return "Validity: [From: " + notBefore + + ",\n To: " + notAfter + ']'; } /** diff --git a/jdk/src/java.base/share/classes/sun/security/x509/DistributionPoint.java b/jdk/src/java.base/share/classes/sun/security/x509/DistributionPoint.java index 29b5f933dd3..e2d4971dd1a 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/DistributionPoint.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/DistributionPoint.java @@ -380,23 +380,29 @@ public class DistributionPoint { */ public String toString() { StringBuilder sb = new StringBuilder(); + sb.append("DistributionPoint:\n "); if (fullName != null) { - sb.append("DistributionPoint:\n " + fullName + "\n"); + sb.append(fullName); } if (relativeName != null) { - sb.append("DistributionPoint:\n " + relativeName + "\n"); + sb.append(relativeName); } + sb.append('\n'); if (reasonFlags != null) { sb.append(" ReasonFlags:\n"); for (int i = 0; i < reasonFlags.length; i++) { if (reasonFlags[i]) { - sb.append(" " + reasonToString(i) + "\n"); + sb.append(" ") + .append(reasonToString(i)) + .append('\n'); } } } if (crlIssuer != null) { - sb.append(" CRLIssuer:" + crlIssuer + "\n"); + sb.append(" CRLIssuer:") + .append(crlIssuer) + .append('\n'); } return sb.toString(); } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/DistributionPointName.java b/jdk/src/java.base/share/classes/sun/security/x509/DistributionPointName.java index 4409dc0c6c2..36fe6170bfd 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/DistributionPointName.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/DistributionPointName.java @@ -230,13 +230,13 @@ public class DistributionPointName { */ public String toString() { StringBuilder sb = new StringBuilder(); + sb.append("DistributionPointName:\n "); if (fullName != null) { - sb.append("DistributionPointName:\n " + fullName + "\n"); - + sb.append(fullName); } else { - sb.append("DistributionPointName:\n " + relativeName + "\n"); + sb.append(relativeName); } - + sb.append('\n'); return sb.toString(); } } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/EDIPartyName.java b/jdk/src/java.base/share/classes/sun/security/x509/EDIPartyName.java index e6a8c3bb076..74c0e4df7d4 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/EDIPartyName.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/EDIPartyName.java @@ -209,10 +209,15 @@ public class EDIPartyName implements GeneralNameInterface { * Return the printable string. */ public String toString() { - return ("EDIPartyName: " + - ((assigner == null) ? "" : - (" nameAssigner = " + assigner + ",")) - + " partyName = " + party); + StringBuilder sb = new StringBuilder("EDIPartyName: "); + if (assigner != null) { + sb.append(" nameAssigner = ") + .append(assigner) + .append(','); + } + sb.append(" partyName = ") + .append(party); + return sb.toString(); } /** diff --git a/jdk/src/java.base/share/classes/sun/security/x509/Extension.java b/jdk/src/java.base/share/classes/sun/security/x509/Extension.java index 04489d70094..d3a711e4b5e 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/Extension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/Extension.java @@ -219,13 +219,8 @@ public class Extension implements java.security.cert.Extension { * Returns the Extension in user readable form. */ public String toString() { - String s = "ObjectId: " + extensionId.toString(); - if (critical) { - s += " Criticality=true\n"; - } else { - s += " Criticality=false\n"; - } - return (s); + return "ObjectId: " + extensionId + + " Criticality=" + critical + '\n'; } // Value to mix up the hash diff --git a/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtree.java b/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtree.java index bbd2b2586bd..5635c2b9281 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtree.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtree.java @@ -127,15 +127,22 @@ public class GeneralSubtree { * Return a printable string of the GeneralSubtree. */ public String toString() { - String s = "\n GeneralSubtree: [\n" + - " GeneralName: " + ((name == null) ? "" : name.toString()) + - "\n Minimum: " + minimum; - if (maximum == -1) { - s += "\t Maximum: undefined"; - } else - s += "\t Maximum: " + maximum; - s += " ]\n"; - return (s); + StringBuilder sb = new StringBuilder(); + sb.append("\n GeneralSubtree: [") + .append("\n GeneralName: "); + if (name != null) { + sb.append(name); + } + sb.append("\n Minimum: ") + .append(minimum) + .append("\n Maximum: "); + if (maximum == -1) { + sb.append("undefined"); + } else { + sb.append(maximum); + } + sb.append(" ]\n"); + return sb.toString(); } /** diff --git a/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java b/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java index 40c4db15986..5a1f8c7de65 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/GeneralSubtrees.java @@ -124,8 +124,7 @@ public class GeneralSubtrees implements Cloneable { * Return a printable string of the GeneralSubtree. */ public String toString() { - String s = " GeneralSubtrees:\n" + trees.toString() + "\n"; - return s; + return " GeneralSubtrees:\n" + trees + '\n'; } /** diff --git a/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java b/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java index d9dd126baaa..6d2e78305d5 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/IPAddressName.java @@ -263,7 +263,7 @@ public class IPAddressName implements GeneralNameInterface { if (address.length == 8) { byte[] mask = new byte[4]; System.arraycopy(address, 4, mask, 0, 4); - name = name + "/" + + name = name + '/' + InetAddress.getByAddress(mask).getHostAddress(); } } else { @@ -285,7 +285,7 @@ public class IPAddressName implements GeneralNameInterface { if (!ba.get(i)) break; } - name = name + "/" + i; + name = name + '/' + i; // Verify remaining bits 0 for (; i < 16*8; i++) { if (ba.get(i)) { diff --git a/jdk/src/java.base/share/classes/sun/security/x509/IssuerAlternativeNameExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/IssuerAlternativeNameExtension.java index ba1f584612a..da7dde9a9b8 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/IssuerAlternativeNameExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/IssuerAlternativeNameExtension.java @@ -140,17 +140,20 @@ extends Extension implements CertAttrSet { * Returns a printable representation of the IssuerAlternativeName. */ public String toString() { - - String result = super.toString() + "IssuerAlternativeName [\n"; - if(names == null) { - result += " null\n"; + StringBuilder sb = new StringBuilder(); + sb.append(super.toString()) + .append("IssuerAlternativeName [\n"); + if (names == null) { + sb.append(" null\n"); } else { - for(GeneralName name: names.names()) { - result += " "+name+"\n"; + for (GeneralName name : names.names()) { + sb.append(" ") + .append(name) + .append('\n'); } } - result += "]\n"; - return result; + sb.append("]\n"); + return sb.toString(); } /** diff --git a/jdk/src/java.base/share/classes/sun/security/x509/IssuingDistributionPointExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/IssuingDistributionPointExtension.java index 4be49475ded..26dd18a352b 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/IssuingDistributionPointExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/IssuingDistributionPointExtension.java @@ -441,9 +441,9 @@ public class IssuingDistributionPointExtension extends Extension * Returns the extension as user readable string. */ public String toString() { - - StringBuilder sb = new StringBuilder(super.toString()); - sb.append("IssuingDistributionPoint [\n "); + StringBuilder sb = new StringBuilder(); + sb.append(super.toString()) + .append("IssuingDistributionPoint [\n "); if (distributionPoint != null) { sb.append(distributionPoint); @@ -453,23 +453,18 @@ public class IssuingDistributionPointExtension extends Extension sb.append(revocationReasons); } - sb.append((hasOnlyUserCerts) - ? (" Only contains user certs: true") - : (" Only contains user certs: false")).append("\n"); - - sb.append((hasOnlyCACerts) - ? (" Only contains CA certs: true") - : (" Only contains CA certs: false")).append("\n"); - - sb.append((hasOnlyAttributeCerts) - ? (" Only contains attribute certs: true") - : (" Only contains attribute certs: false")).append("\n"); - - sb.append((isIndirectCRL) - ? (" Indirect CRL: true") - : (" Indirect CRL: false")).append("\n"); - - sb.append("]\n"); + sb.append(" Only contains user certs: ") + .append(hasOnlyUserCerts) + .append('\n') + .append(" Only contains CA certs: ") + .append(hasOnlyCACerts) + .append('\n') + .append(" Only contains attribute certs: ") + .append(hasOnlyAttributeCerts) + .append('\n') + .append(" Indirect CRL: ") + .append(isIndirectCRL) + .append("\n]\n"); return sb.toString(); } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java index a8d46a8a8d0..4d1e4cdd126 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/NameConstraintsExtension.java @@ -214,12 +214,19 @@ implements CertAttrSet, Cloneable { * Return the printable string. */ public String toString() { - return (super.toString() + "NameConstraints: [" + - ((permitted == null) ? "" : - ("\n Permitted:" + permitted.toString())) + - ((excluded == null) ? "" : - ("\n Excluded:" + excluded.toString())) - + " ]\n"); + StringBuilder sb = new StringBuilder(); + sb.append(super.toString()) + .append("NameConstraints: ["); + if (permitted != null) { + sb.append("\n Permitted:") + .append(permitted); + } + if (excluded != null) { + sb.append("\n Excluded:") + .append(excluded); + } + sb.append(" ]\n"); + return sb.toString(); } /** diff --git a/jdk/src/java.base/share/classes/sun/security/x509/PolicyConstraintsExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/PolicyConstraintsExtension.java index 3b0543b202f..eca45828aa6 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/PolicyConstraintsExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/PolicyConstraintsExtension.java @@ -175,19 +175,24 @@ implements CertAttrSet { * Return the extension as user readable string. */ public String toString() { - String s; - s = super.toString() + "PolicyConstraints: [" + " Require: "; - if (require == -1) - s += "unspecified;"; - else - s += require + ";"; - s += "\tInhibit: "; - if (inhibit == -1) - s += "unspecified"; - else - s += inhibit; - s += " ]\n"; - return s; + StringBuilder sb = new StringBuilder(); + sb.append(super.toString()) + .append("PolicyConstraints: [") + .append(" Require: "); + if (require == -1) { + sb.append("unspecified;"); + } else { + sb.append(require) + .append(';'); + } + sb.append("\tInhibit: "); + if (inhibit == -1) { + sb.append("unspecified"); + } else { + sb.append(inhibit); + } + sb.append(" ]\n"); + return sb.toString(); } /** diff --git a/jdk/src/java.base/share/classes/sun/security/x509/PolicyInformation.java b/jdk/src/java.base/share/classes/sun/security/x509/PolicyInformation.java index 0e98e425cd7..491b2b99c0a 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/PolicyInformation.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/PolicyInformation.java @@ -258,9 +258,7 @@ public class PolicyInformation { * Return a printable representation of the PolicyInformation. */ public String toString() { - StringBuilder s = new StringBuilder(" [" + policyIdentifier.toString()); - s.append(policyQualifiers + " ]\n"); - return s.toString(); + return " [" + policyIdentifier + policyQualifiers + " ]\n"; } /** diff --git a/jdk/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java index c20d8557b03..0cb40155025 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/PrivateKeyUsageExtension.java @@ -175,11 +175,22 @@ implements CertAttrSet { * Return the printable string. */ public String toString() { - return(super.toString() + - "PrivateKeyUsage: [\n" + - ((notBefore == null) ? "" : "From: " + notBefore.toString() + ", ") - + ((notAfter == null) ? "" : "To: " + notAfter.toString()) - + "]\n"); + StringBuilder sb = new StringBuilder(); + sb.append(super.toString()) + .append("PrivateKeyUsage: [\n"); + if (notBefore != null) { + sb.append("From: ") + .append(notBefore); + if (notAfter != null) { + sb.append(", "); + } + } + if (notAfter != null) { + sb.append("To: ") + .append(notAfter); + } + sb.append("]\n"); + return sb.toString(); } /** diff --git a/jdk/src/java.base/share/classes/sun/security/x509/RDN.java b/jdk/src/java.base/share/classes/sun/security/x509/RDN.java index aa492e4e127..6ba421d3b27 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/RDN.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/RDN.java @@ -348,14 +348,11 @@ public class RDN { return assertion[0].toString(); } - StringBuilder sb = new StringBuilder(); + StringJoiner sj = new StringJoiner(" + "); for (int i = 0; i < assertion.length; i++) { - if (i != 0) { - sb.append(" + "); - } - sb.append(assertion[i].toString()); + sj.add(assertion[i].toString()); } - return sb.toString(); + return sj.toString(); } /* @@ -376,14 +373,11 @@ public class RDN { return assertion[0].toRFC1779String(oidMap); } - StringBuilder sb = new StringBuilder(); + StringJoiner sj = new StringJoiner(" + "); for (int i = 0; i < assertion.length; i++) { - if (i != 0) { - sb.append(" + "); - } - sb.append(assertion[i].toRFC1779String(oidMap)); + sj.add(assertion[i].toRFC1779String(oidMap)); } - return sb.toString(); + return sj.toString(); } /* diff --git a/jdk/src/java.base/share/classes/sun/security/x509/SerialNumber.java b/jdk/src/java.base/share/classes/sun/security/x509/SerialNumber.java index c61be63edae..2264edfd4ab 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/SerialNumber.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/SerialNumber.java @@ -101,7 +101,7 @@ public class SerialNumber { * Return the SerialNumber as user readable string. */ public String toString() { - return ("SerialNumber: [" + Debug.toHexString(serialNum) + "]"); + return "SerialNumber: [" + Debug.toHexString(serialNum) + ']'; } /** diff --git a/jdk/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java index 43defaaa176..8daa0b319b4 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/SubjectInfoAccessExtension.java @@ -238,8 +238,8 @@ public class SubjectInfoAccessExtension extends Extension * Return the extension as user readable string. */ public String toString() { - return super.toString() + "SubjectInfoAccess [\n " - + accessDescriptions + "\n]\n"; + return super.toString() + + "SubjectInfoAccess [\n " + accessDescriptions + "\n]\n"; } } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/SubjectKeyIdentifierExtension.java b/jdk/src/java.base/share/classes/sun/security/x509/SubjectKeyIdentifierExtension.java index 79482c9bfe8..b3dd2132407 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/SubjectKeyIdentifierExtension.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/SubjectKeyIdentifierExtension.java @@ -115,8 +115,8 @@ implements CertAttrSet { * Returns a printable representation. */ public String toString() { - return super.toString() + "SubjectKeyIdentifier [\n" - + String.valueOf(id) + "]\n"; + return super.toString() + + "SubjectKeyIdentifier [\n" + id + "]\n"; } /** diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java b/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java index 578f8026666..79d64e84555 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X500Name.java @@ -31,6 +31,7 @@ import java.security.PrivilegedExceptionAction; import java.security.AccessController; import java.security.Principal; import java.util.*; +import java.util.StringJoiner; import sun.security.util.*; import javax.security.auth.x500.X500Principal; @@ -689,14 +690,11 @@ public class X500Name implements GeneralNameInterface, Principal { * The encodings of adjoining RelativeDistinguishedNames are separated * by a comma character (',' ASCII 44). */ - StringBuilder fullname = new StringBuilder(48); + StringJoiner sj = new StringJoiner(","); for (int i = names.length - 1; i >= 0; i--) { - if (i < names.length - 1) { - fullname.append(','); - } - fullname.append(names[i].toRFC2253String(oidMap)); + sj.add(names[i].toRFC2253String(oidMap)); } - return fullname.toString(); + return sj.toString(); } public String getRFC2253CanonicalName() { @@ -722,14 +720,11 @@ public class X500Name implements GeneralNameInterface, Principal { * The encodings of adjoining RelativeDistinguishedNames are separated * by a comma character (',' ASCII 44). */ - StringBuilder fullname = new StringBuilder(48); + StringJoiner sj = new StringJoiner(","); for (int i = names.length - 1; i >= 0; i--) { - if (i < names.length - 1) { - fullname.append(','); - } - fullname.append(names[i].toRFC2253String(true)); + sj.add(names[i].toRFC2253String(true)); } - canonicalDn = fullname.toString(); + canonicalDn = sj.toString(); return canonicalDn; } @@ -1064,16 +1059,16 @@ public class X500Name implements GeneralNameInterface, Principal { return; } - StringBuilder sb = new StringBuilder(48); - if (names != null) { - for (int i = names.length - 1; i >= 0; i--) { - if (i != names.length - 1) { - sb.append(", "); - } - sb.append(names[i].toString()); - } + if (names == null) { + dn = ""; + return; } - dn = sb.toString(); + + StringJoiner sj = new StringJoiner(", "); + for (int i = names.length - 1; i >= 0; i--) { + sj.add(names[i].toString()); + } + dn = sj.toString(); } /* @@ -1090,16 +1085,15 @@ public class X500Name implements GeneralNameInterface, Principal { return names[0].toRFC1779String(oidMap); } - StringBuilder sb = new StringBuilder(48); - if (names != null) { - for (int i = names.length - 1; i >= 0; i--) { - if (i != names.length - 1) { - sb.append(", "); - } - sb.append(names[i].toRFC1779String(oidMap)); - } + if (names == null) { + return ""; } - return sb.toString(); + + StringJoiner sj = new StringJoiner(", "); + for (int i = names.length - 1; i >= 0; i--) { + sj.add(names[i].toRFC1779String(oidMap)); + } + return sj.toString(); } /****************************************************************/ diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java index ccc7b893430..8646b43841a 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLEntryImpl.java @@ -291,40 +291,47 @@ public class X509CRLEntryImpl extends X509CRLEntry public String toString() { StringBuilder sb = new StringBuilder(); - sb.append(serialNumber.toString()); - sb.append(" On: " + revocationDate.toString()); + sb.append(serialNumber) + .append(" On: ") + .append(revocationDate); if (certIssuer != null) { - sb.append("\n Certificate issuer: " + certIssuer); + sb.append("\n Certificate issuer: ") + .append(certIssuer); } if (extensions != null) { Collection allEntryExts = extensions.getAllExtensions(); Extension[] exts = allEntryExts.toArray(new Extension[0]); - sb.append("\n CRL Entry Extensions: " + exts.length); + sb.append("\n CRL Entry Extensions: ") + .append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n [" + (i+1) + "]: "); + sb.append("\n [") + .append(i+1) + .append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { - sb.append(ext.toString()); + sb.append(ext); byte[] extValue = ext.getExtensionValue(); if (extValue != null) { DerOutputStream out = new DerOutputStream(); out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: ") + .append("DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)) + .append('\n'); } - } else - sb.append(ext.toString()); //sub-class exists + } else { + sb.append(ext); //sub-class exists + } } catch (Exception e) { sb.append(", Error parsing this extension"); } } } - sb.append("\n"); + sb.append('\n'); return sb.toString(); } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java index 3797105c770..7a68cebdabb 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CRLImpl.java @@ -537,47 +537,65 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { */ public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("X.509 CRL v" + (version+1) + "\n"); + sb.append("X.509 CRL v") + .append(version+1) + .append('\n'); if (sigAlgId != null) - sb.append("Signature Algorithm: " + sigAlgId.toString() + - ", OID=" + (sigAlgId.getOID()).toString() + "\n"); + sb.append("Signature Algorithm: ") + .append(sigAlgId) + .append(", OID=") + .append(sigAlgId.getOID()) + .append('\n'); if (issuer != null) - sb.append("Issuer: " + issuer.toString() + "\n"); + sb.append("Issuer: ") + .append(issuer) + .append('\n'); if (thisUpdate != null) - sb.append("\nThis Update: " + thisUpdate.toString() + "\n"); + sb.append("\nThis Update: ") + .append(thisUpdate) + .append('\n'); if (nextUpdate != null) - sb.append("Next Update: " + nextUpdate.toString() + "\n"); + sb.append("Next Update: ") + .append(nextUpdate) + .append('\n'); if (revokedList.isEmpty()) sb.append("\nNO certificates have been revoked\n"); else { - sb.append("\nRevoked Certificates: " + revokedList.size()); + sb.append("\nRevoked Certificates: ") + .append(revokedList.size()); int i = 1; for (X509CRLEntry entry: revokedList) { - sb.append("\n[" + i++ + "] " + entry.toString()); + sb.append("\n[") + .append(i++) + .append("] ") + .append(entry); } } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Object[] objs = allExts.toArray(); - sb.append("\nCRL Extensions: " + objs.length); + sb.append("\nCRL Extensions: ") + .append(objs.length); for (int i = 0; i < objs.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i+1).append("]: "); Extension ext = (Extension)objs[i]; try { - if (OIDMap.getClass(ext.getExtensionId()) == null) { - sb.append(ext.toString()); - byte[] extValue = ext.getExtensionValue(); - if (extValue != null) { - DerOutputStream out = new DerOutputStream(); - out.putOctetString(extValue); - extValue = out.toByteArray(); - HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); - } - } else - sb.append(ext.toString()); // sub-class exists + if (OIDMap.getClass(ext.getExtensionId()) == null) { + sb.append(ext); + byte[] extValue = ext.getExtensionValue(); + if (extValue != null) { + DerOutputStream out = new DerOutputStream(); + out.putOctetString(extValue); + extValue = out.toByteArray(); + HexDumpEncoder enc = new HexDumpEncoder(); + sb.append("Extension unknown: ") + .append("DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)) + .append('\n'); + } + } else { + sb.append(ext); // sub-class exists + } } catch (Exception e) { sb.append(", Error parsing this extension"); } @@ -585,10 +603,12 @@ public class X509CRLImpl extends X509CRL implements DerEncoder { } if (signature != null) { HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append("\nSignature:\n" + encoder.encodeBuffer(signature) - + "\n"); - } else + sb.append("\nSignature:\n") + .append(encoder.encodeBuffer(signature)) + .append('\n'); + } else { sb.append("NOT signed yet\n"); + } return sb.toString(); } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java b/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java index d1142a26336..b74de5a5dfe 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CertImpl.java @@ -81,7 +81,7 @@ public class X509CertImpl extends X509Certificate implements DerEncoder { private static final long serialVersionUID = -3457612960190864406L; - private static final String DOT = "."; + private static final char DOT = '.'; /** * Public attribute names. */ @@ -799,17 +799,10 @@ public class X509CertImpl extends X509Certificate implements DerEncoder { if (info == null || algId == null || signature == null) return ""; - StringBuilder sb = new StringBuilder(); - - sb.append("[\n"); - sb.append(info.toString() + "\n"); - sb.append(" Algorithm: [" + algId.toString() + "]\n"); - HexDumpEncoder encoder = new HexDumpEncoder(); - sb.append(" Signature:\n" + encoder.encodeBuffer(signature)); - sb.append("\n]"); - - return sb.toString(); + return "[\n" + info + '\n' + + " Algorithm: [" + algId + "]\n" + + " Signature:\n" + encoder.encodeBuffer(signature) + "\n]"; } // the strongly typed gets, as per java.security.cert.X509Certificate @@ -1941,31 +1934,30 @@ public class X509CertImpl extends X509Certificate implements DerEncoder { * only contains 0-9 and A-F. No small case, no colon. */ private String getCertificateFingerPrint(String mdAlg) { - String fingerPrint = ""; try { byte[] encCertInfo = getEncoded(); MessageDigest md = MessageDigest.getInstance(mdAlg); byte[] digest = md.digest(encCertInfo); - StringBuffer buf = new StringBuffer(); + StringBuilder sb = new StringBuilder(digest.length * 2); for (int i = 0; i < digest.length; i++) { - byte2hex(digest[i], buf); + byte2hex(digest[i], sb); } - fingerPrint = buf.toString(); + return sb.toString(); } catch (NoSuchAlgorithmException | CertificateEncodingException e) { // ignored } - return fingerPrint; + return ""; } /** - * Converts a byte to hex digit and writes to the supplied buffer + * Converts a byte to hex digit and writes to the supplied builder */ - private static void byte2hex(byte b, StringBuffer buf) { + private static void byte2hex(byte b, StringBuilder buf) { char[] hexChars = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; int high = ((b & 0xf0) >> 4); int low = (b & 0x0f); - buf.append(hexChars[high]); - buf.append(hexChars[low]); + buf.append(hexChars[high]) + .append(hexChars[low]); } } diff --git a/jdk/src/java.base/share/classes/sun/security/x509/X509CertInfo.java b/jdk/src/java.base/share/classes/sun/security/x509/X509CertInfo.java index 9411519eec8..cdea7551fa9 100644 --- a/jdk/src/java.base/share/classes/sun/security/x509/X509CertInfo.java +++ b/jdk/src/java.base/share/classes/sun/security/x509/X509CertInfo.java @@ -299,55 +299,60 @@ public class X509CertInfo implements CertAttrSet { } StringBuilder sb = new StringBuilder(); - sb.append("[\n"); - sb.append(" " + version.toString() + "\n"); - sb.append(" Subject: " + subject.toString() + "\n"); - sb.append(" Signature Algorithm: " + algId.toString() + "\n"); - sb.append(" Key: " + pubKey.toString() + "\n"); - sb.append(" " + interval.toString() + "\n"); - sb.append(" Issuer: " + issuer.toString() + "\n"); - sb.append(" " + serialNum.toString() + "\n"); + sb.append("[\n") + .append(" ").append(version).append('\n') + .append(" Subject: ").append(subject).append('\n') + .append(" Signature Algorithm: ").append(algId).append('\n') + .append(" Key: ").append(pubKey).append('\n') + .append(" ").append(interval).append('\n') + .append(" Issuer: ").append(issuer).append('\n') + .append(" ").append(serialNum).append('\n'); // optional v2, v3 extras if (issuerUniqueId != null) { - sb.append(" Issuer Id:\n" + issuerUniqueId.toString() + "\n"); + sb.append(" Issuer Id:\n").append(issuerUniqueId).append('\n'); } if (subjectUniqueId != null) { - sb.append(" Subject Id:\n" + subjectUniqueId.toString() + "\n"); + sb.append(" Subject Id:\n").append(subjectUniqueId).append('\n'); } if (extensions != null) { Collection allExts = extensions.getAllExtensions(); Extension[] exts = allExts.toArray(new Extension[0]); - sb.append("\nCertificate Extensions: " + exts.length); + sb.append("\nCertificate Extensions: ").append(exts.length); for (int i = 0; i < exts.length; i++) { - sb.append("\n[" + (i+1) + "]: "); + sb.append("\n[").append(i+1).append("]: "); Extension ext = exts[i]; try { if (OIDMap.getClass(ext.getExtensionId()) == null) { - sb.append(ext.toString()); + sb.append(ext); byte[] extValue = ext.getExtensionValue(); if (extValue != null) { DerOutputStream out = new DerOutputStream(); out.putOctetString(extValue); extValue = out.toByteArray(); HexDumpEncoder enc = new HexDumpEncoder(); - sb.append("Extension unknown: " - + "DER encoded OCTET string =\n" - + enc.encodeBuffer(extValue) + "\n"); + sb.append("Extension unknown: ") + .append("DER encoded OCTET string =\n") + .append(enc.encodeBuffer(extValue)) + .append('\n'); } - } else - sb.append(ext.toString()); //sub-class exists + } else { + sb.append(ext); //sub-class exists + } } catch (Exception e) { sb.append(", Error parsing this extension"); } } Map invalid = extensions.getUnparseableExtensions(); if (invalid.isEmpty() == false) { - sb.append("\nUnparseable certificate extensions: " + invalid.size()); + sb.append("\nUnparseable certificate extensions: ") + .append(invalid.size()); int i = 1; for (Extension ext : invalid.values()) { - sb.append("\n[" + (i++) + "]: "); - sb.append(ext); + sb.append("\n[") + .append(i++) + .append("]: ") + .append(ext); } } } diff --git a/jdk/src/java.base/share/classes/sun/text/CompactByteArray.java b/jdk/src/java.base/share/classes/sun/text/CompactByteArray.java index 412bc0df36d..d9fa1da513f 100644 --- a/jdk/src/java.base/share/classes/sun/text/CompactByteArray.java +++ b/jdk/src/java.base/share/classes/sun/text/CompactByteArray.java @@ -49,7 +49,7 @@ package sun.text; * Han ideographs have the same value. However, lookup is much faster than a * hash table. * A compact array of any primitive data type serves two purposes: - *

      + *
        *
      • Fast access of the indexed values. *
      • Smaller memory footprint. *
      diff --git a/jdk/src/java.base/share/classes/sun/text/ComposedCharIter.java b/jdk/src/java.base/share/classes/sun/text/ComposedCharIter.java index 12560002455..53e0acb9cb1 100644 --- a/jdk/src/java.base/share/classes/sun/text/ComposedCharIter.java +++ b/jdk/src/java.base/share/classes/sun/text/ComposedCharIter.java @@ -50,7 +50,7 @@ public final class ComposedCharIter { } /** - * Construct a new ComposedCharIter. The iterator will return + * Construct a new {@code ComposedCharIter}. The iterator will return * all Unicode characters with canonical decompositions, excluding Korean * Hangul characters. */ @@ -58,10 +58,10 @@ public final class ComposedCharIter { /** * Returns the next precomposed Unicode character. - * Repeated calls to next return all of the precomposed characters defined + * Repeated calls to {@code next} return all of the precomposed characters defined * by Unicode, in ascending order. After all precomposed characters have - * been returned, {@link #hasNext} will return false and further calls - * to next will return {@link #DONE}. + * been returned, {@link #hasNext} will return {@code false} and further calls + * to {@code next} will return {@link #DONE}. */ public int next() { if (curChar == decompNum - 1) { diff --git a/jdk/src/java.base/share/classes/sun/text/Normalizer.java b/jdk/src/java.base/share/classes/sun/text/Normalizer.java index 3d393920559..82a6ebd9e40 100644 --- a/jdk/src/java.base/share/classes/sun/text/Normalizer.java +++ b/jdk/src/java.base/share/classes/sun/text/Normalizer.java @@ -32,7 +32,7 @@ import sun.text.normalizer.NormalizerImpl; * This Normalizer is for Unicode 3.2 support for IDNA only. * Developers should not use this class. * - * @ since 1.6 + * @since 1.6 */ public final class Normalizer { diff --git a/jdk/src/java.base/share/classes/sun/text/bidi/BidiBase.java b/jdk/src/java.base/share/classes/sun/text/bidi/BidiBase.java index bbf1b4b6a21..4691dbc853b 100644 --- a/jdk/src/java.base/share/classes/sun/text/bidi/BidiBase.java +++ b/jdk/src/java.base/share/classes/sun/text/bidi/BidiBase.java @@ -81,14 +81,13 @@ import sun.text.normalizer.UTF16; * *

      General remarks about the API:

      * - * The "limit" of a sequence of characters is the position just after + * The "limit" of a sequence of characters is the position just after * their last character, i.e., one more than that position. *

      * - * Some of the API methods provide access to "runs". Such a - * "run" is defined as a sequence of characters that are at the same + * Some of the API methods provide access to "runs". Such a + * "run" is defined as a sequence of characters that are at the same * embedding level after performing the Bidi algorithm. - *

      * *

      Basic concept: paragraph

      * A piece of text can be divided into several paragraphs by characters @@ -141,7 +140,8 @@ import sun.text.normalizer.UTF16; * these special values are designed that way. Also, the implementation * assumes that MAX_EXPLICIT_LEVEL is odd. * - *
        See Also: + *

        See Also: + *

          *
        • {@link #LEVEL_DEFAULT_LTR} *
        • {@link #LEVEL_DEFAULT_RTL} *
        • {@link #LEVEL_OVERRIDE} @@ -153,7 +153,8 @@ import sun.text.normalizer.UTF16; * Reordering mode values indicate which variant of the Bidi algorithm to * use. * - *
            See Also: + *

            See Also: + *

              *
            • {@link #setReorderingMode} *
            • {@link #REORDER_DEFAULT} *
            • {@link #REORDER_NUMBERS_SPECIAL} @@ -166,7 +167,8 @@ import sun.text.normalizer.UTF16; * *

              Basic concept: Reordering Options

              * Reordering options can be applied during Bidi text transformations. - *
                See Also: + *

                See Also: + *

                  *
                • {@link #setReorderingOptions} *
                • {@link #OPTION_DEFAULT} *
                • {@link #OPTION_INSERT_MARKS} @@ -202,7 +204,7 @@ import sun.text.normalizer.UTF16; * and therefore its implementation omitted from this sample code.
                • *
                * - *
                + * 
                {@code
                  *
                  *  package com.ibm.icu.dev.test.bidi;
                  *
                @@ -451,7 +453,7 @@ import sun.text.normalizer.UTF16;
                  *      }
                  *  }
                  *
                - * 
                + * }
                */ public class BidiBase { @@ -2419,9 +2421,9 @@ public class BidiBase { * (same index) character if the level has the * LEVEL_OVERRIDE bit set.

                * Except for that bit, it must be - * paraLevel<=embeddingLevels[]<=MAX_EXPLICIT_LEVEL, + * {@code paraLevel<=embeddingLevels[]<=MAX_EXPLICIT_LEVEL}, * with one exception: a level of zero may be specified for a - * paragraph separator even if paraLevel>0 when multiple + * paragraph separator even if {@code paraLevel > 0} when multiple * paragraphs are submitted in the same call to setPara().

                * Caution: A reference to this array, not a copy * of the levels, will be stored in the Bidi object; @@ -2680,7 +2682,7 @@ public class BidiBase { * For example, in pure LTR text with numbers the numbers would get * a resolved level of 2 higher than the surrounding text according to * the algorithm. This implementation may set all resolved levels to - * the same value in such a case.

                + * the same value in such a case. * * @param paragraph a paragraph of text with optional character and * paragraph attribute information @@ -2817,7 +2819,7 @@ public class BidiBase { } /** - * Get the index of a paragraph, given a position within the text.

                + * Get the index of a paragraph, given a position within the text. * * @param charIndex is the index of a character within the text, in the * range [0..getProcessedLength()-1]. diff --git a/jdk/src/java.base/share/classes/sun/text/bidi/BidiRun.java b/jdk/src/java.base/share/classes/sun/text/bidi/BidiRun.java index 07519db3934..c0323834c60 100644 --- a/jdk/src/java.base/share/classes/sun/text/bidi/BidiRun.java +++ b/jdk/src/java.base/share/classes/sun/text/bidi/BidiRun.java @@ -42,7 +42,7 @@ package sun.text.bidi; /** * A BidiRun represents a sequence of characters at the same embedding level. * The Bidi algorithm decomposes a piece of text into sequences of characters - * at the same embedding level, each such sequence is called a run. + * at the same embedding level, each such sequence is called a "run". * *

                A BidiRun represents such a run by storing its essential properties, * but does not duplicate the characters which form the run. diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/ICUBinary.java b/jdk/src/java.base/share/classes/sun/text/normalizer/ICUBinary.java index 20984d3b8fb..3e0c348a163 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/ICUBinary.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/ICUBinary.java @@ -65,7 +65,7 @@ public final class ICUBinary /** *

                ICU data header reader method. * Takes a ICU generated big-endian input stream, parse the ICU standard - * file header and authenticates them.

                + * file header and authenticates them. *

                Header format: *

                  *
                • Header size (char) @@ -84,7 +84,7 @@ public final class ICUBinary * [0] major [1] minor [2] milli [3] micro *
                • Unicode version (4 bytes) this ICU is based on. *
                - *

                + * *

                * Example of use:
                *

                @@ -98,7 +98,7 @@ public final class ICUBinary
                     *    System.out.println("This is not a ICU data file");
                     * }
                     * 
                - *

                + * * @param inputStream input stream that contains the ICU data header * @param dataFormatIDExpected Data format expected. An array of 4 bytes * information about the data format. diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/IntTrie.java b/jdk/src/java.base/share/classes/sun/text/normalizer/IntTrie.java index ddc2cc40e58..4be2d6e5862 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/IntTrie.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/IntTrie.java @@ -58,7 +58,7 @@ public class IntTrie extends Trie * trie.

                * @param inputStream file input stream to a ICU data file, containing * the trie - * @param dataManipulate object which provides methods to parse the char + * @param datamanipulate object which provides methods to parse the char * data * @throws IOException thrown when data reading fails * @draft 2.1 diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/NormalizerBase.java b/jdk/src/java.base/share/classes/sun/text/normalizer/NormalizerBase.java index b49db438449..43c4e10167c 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/NormalizerBase.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/NormalizerBase.java @@ -55,16 +55,16 @@ import java.text.Normalizer; * In Unicode, this can be encoded as a single character (the * "composed" form): * - *

                + *

                  *      00C1    LATIN CAPITAL LETTER A WITH ACUTE
                - * 

                + *
                * * or as two separate characters (the "decomposed" form): * - *

                + *

                  *      0041    LATIN CAPITAL LETTER A
                  *      0301    COMBINING ACUTE ACCENT
                - * 

                + *
                * * To a user of your program, however, both of these sequences should be * treated as the same "user-level" character "A with acute accent". When you @@ -76,17 +76,17 @@ import java.text.Normalizer; * * Similarly, the string "ffi" can be encoded as three separate letters: * - *

                + *

                  *      0066    LATIN SMALL LETTER F
                  *      0066    LATIN SMALL LETTER F
                  *      0069    LATIN SMALL LETTER I
                - * 

                + *
                * * or as the single character * - *

                + *

                  *      FB03    LATIN SMALL LIGATURE FFI
                - * 

                + *
                * * The ffi ligature is not a distinct semantic character, and strictly speaking * it shouldn't be in Unicode at all, but it was included for compatibility @@ -555,12 +555,12 @@ public final class NormalizerBase implements Cloneable { //------------------------------------------------------------------------- /** - * Creates a new Normalizer object for iterating over the + * Creates a new {@code Normalizer} object for iterating over the * normalized form of a given string. *

                - * The options parameter specifies which optional - * Normalizer features are to be enabled for this object. - *

                + * The {@code options} parameter specifies which optional + * {@code Normalizer} features are to be enabled for this object. + * * @param str The string to be normalized. The normalization * will start at the beginning of the string. * @@ -579,9 +579,9 @@ public final class NormalizerBase implements Cloneable { } /** - * Creates a new Normalizer object for iterating over the + * Creates a new {@code Normalizer} object for iterating over the * normalized form of the given text. - *

                + * * @param iter The input text to be normalized. The normalization * will start at the beginning of the string. * @@ -592,9 +592,9 @@ public final class NormalizerBase implements Cloneable { } /** - * Creates a new Normalizer object for iterating over the + * Creates a new {@code Normalizer} object for iterating over the * normalized form of the given text. - *

                + * * @param iter The input text to be normalized. The normalization * will start at the beginning of the string. * @@ -615,13 +615,13 @@ public final class NormalizerBase implements Cloneable { } /** - * Clones this Normalizer object. All properties of this + * Clones this {@code Normalizer} object. All properties of this * object are duplicated in the new object, including the cloning of any * {@link CharacterIterator} that was passed in to the constructor * or to {@link #setText(CharacterIterator) setText}. * However, the text storage underlying - * the CharacterIterator is not duplicated unless the - * iterator's clone method does so. + * the {@code CharacterIterator} is not duplicated unless the + * iterator's {@code clone} method does so. * @stable ICU 2.8 */ public Object clone() { @@ -791,7 +791,7 @@ public final class NormalizerBase implements Cloneable { //------------------------------------------------------------------------- /** - * Return the current character in the normalized text-> + * Return the current character in the normalized text. * @return The codepoint as an int * @stable ICU 2.8 */ @@ -872,10 +872,10 @@ public final class NormalizerBase implements Cloneable { * while {@link #next} and {@link #previous} iterate through characters * in the normalized output. This means that there is not * necessarily a one-to-one correspondence between characters returned - * by next and previous and the indices passed to and - * returned from setIndex and {@link #getIndex}. - *

                - * @param index the desired index in the input text-> + * by {@code next} and {@code previous} and the indices passed to and + * returned from {@code setIndex} and {@link #getIndex}. + * + * @param index the desired index in the input text. * * @return the first normalized character that is the result of iterating * forward starting at the given index. @@ -894,8 +894,8 @@ public final class NormalizerBase implements Cloneable { /** * Retrieve the index of the start of the input text. This is the begin - * index of the CharacterIterator or the start (i.e. 0) of the - * String over which this Normalizer is iterating + * index of the {@code CharacterIterator} or the start (i.e. 0) of the + * {@code String} over which this {@code Normalizer} is iterating * @deprecated ICU 2.2. Use startIndex() instead. * @return The codepoint as an int * @see #startIndex @@ -907,8 +907,8 @@ public final class NormalizerBase implements Cloneable { /** * Retrieve the index of the end of the input text. This is the end index - * of the CharacterIterator or the length of the String - * over which this Normalizer is iterating + * of the {@code CharacterIterator} or the length of the {@code String} + * over which this {@code Normalizer} is iterating * @deprecated ICU 2.2. Use endIndex() instead. * @return The codepoint as an int * @see #endIndex @@ -927,9 +927,9 @@ public final class NormalizerBase implements Cloneable { * Note: This method sets the position in the input, while * {@link #next} and {@link #previous} iterate through characters in the * output. This means that there is not necessarily a one-to-one - * correspondence between characters returned by next and - * previous and the indices passed to and returned from - * setIndex and {@link #getIndex}. + * correspondence between characters returned by {@code next} and + * {@code previous} and the indices passed to and returned from + * {@code setIndex} and {@link #getIndex}. * @return The current iteration position * @stable ICU 2.8 */ @@ -942,9 +942,9 @@ public final class NormalizerBase implements Cloneable { } /** - * Retrieve the index of the end of the input text-> This is the end index - * of the CharacterIterator or the length of the String - * over which this Normalizer is iterating + * Retrieve the index of the end of the input text. This is the end index + * of the {@code CharacterIterator} or the length of the {@code String} + * over which this {@code Normalizer} is iterating * @return The current iteration position * @stable ICU 2.8 */ @@ -963,9 +963,9 @@ public final class NormalizerBase implements Cloneable { * return previously buffers characters in the old normalization mode * until the iteration is able to re-sync at the next base character. * It is safest to call {@link #setText setText()}, {@link #first}, - * {@link #last}, etc. after calling setMode. - *

                - * @param newMode the new mode for this Normalizer. + * {@link #last}, etc. after calling {@code setMode}. + * + * @param newMode the new mode for this {@code Normalizer}. * The supported modes are: *

                  *
                • {@link #COMPOSE} - Unicode canonical decompositiion @@ -985,7 +985,7 @@ public final class NormalizerBase implements Cloneable { mode = newMode; } /** - * Return the basic operation performed by this Normalizer + * Return the basic operation performed by this {@code Normalizer} * * @see #setMode * @stable ICU 2.8 @@ -995,8 +995,8 @@ public final class NormalizerBase implements Cloneable { } /** - * Set the input text over which this Normalizer will iterate. - * The iteration position is set to the beginning of the input text-> + * Set the input text over which this {@code Normalizer} will iterate. + * The iteration position is set to the beginning of the input text. * @param newText The new string to be normalized. * @stable ICU 2.8 */ @@ -1011,8 +1011,8 @@ public final class NormalizerBase implements Cloneable { } /** - * Set the input text over which this Normalizer will iterate. - * The iteration position is set to the beginning of the input text-> + * Set the input text over which this {@code Normalizer} will iterate. + * The iteration position is set to the beginning of the input text. * @param newText The new string to be normalized. * @stable ICU 2.8 */ @@ -1571,7 +1571,7 @@ public final class NormalizerBase implements Cloneable { // /** - * Creates a new Normalizer object for iterating over the + * Creates a new {@code Normalizer} object for iterating over the * normalized form of a given string. * * @param str The string to be normalized. The normalization @@ -1646,7 +1646,6 @@ public final class NormalizerBase implements Cloneable { * perform further tests to arrive at a true/false result. * @param str the input string to be checked to see if it is normalized * @param form the normalization form - * @param options the optional features to be enabled. */ public static boolean isNormalized(String str, Normalizer.Form form) { return isNormalized(str, form, UNICODE_LATEST); diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/RangeValueIterator.java b/jdk/src/java.base/share/classes/sun/text/normalizer/RangeValueIterator.java index 71604fde007..771703859fe 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/RangeValueIterator.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/RangeValueIterator.java @@ -38,12 +38,13 @@ package sun.text.normalizer; /** - *

                  Interface for enabling iteration over sets of , + *

                  Interface for enabling iteration over sets of + * {@code }, * where index is the sorted integer index in ascending order and value, its - * associated integer value.

                  + * associated integer value. *

                  The result for each iteration is the consecutive range of - * with the same value. Result is represented by - * where

                  + * {@code } with the same value. Result is represented by + * {@code } where *
                    *
                  • start is the starting integer of the result range *
                  • limit is 1 after the maximum integer that follows start, such that @@ -56,10 +57,10 @@ package sun.text.normalizer; * Hence value(start) = value(start + 1) = .... = value(start + n) = .... = * value(limit - 1). However value(start -1) != value(start) and * value(limit) != value(start). - *

                    + * *

                    Most implementations will be created by factory methods, such as the * character type iterator in UCharacter.getTypeIterator. See example below. - *

                    + * * Example of use:
                    *
                      * RangeValueIterator iterator = UCharacter.getTypeIterator();
                    diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/Replaceable.java b/jdk/src/java.base/share/classes/sun/text/normalizer/Replaceable.java
                    index 5cf2bba578a..e05593540b8 100644
                    --- a/jdk/src/java.base/share/classes/sun/text/normalizer/Replaceable.java
                    +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/Replaceable.java
                    @@ -71,10 +71,9 @@ package sun.text.normalizer;
                      *   
                  • If there is no previous character (i.e. start == 0), use the * following character
                  • *
                  • If there is no following character (i.e. the replaceable was - * empty), use default metadata
                    + * empty), use default metadata
                  • *
                  • If the code point U+FFFF is seen, it should be interpreted as - * a special marker having no metadata
                  • - *
                  • + * a special marker having no metadata
                  • *
                  * If this is not the behavior, the subclass should document any differences. * @@ -111,10 +110,10 @@ public interface Replaceable { * starting at index dstStart and ending at index * dstStart + (srcLimit-srcStart) - 1. * - * @param srcStart the beginning index to copy, inclusive; 0 - * <= start <= limit. + * @param srcStart the beginning index to copy, inclusive; + * {@code 0 <= start <= limit}. * @param srcLimit the ending index to copy, exclusive; - * start <= limit <= length(). + * {@code start <= limit <= length()}. * @param dst the destination array. * @param dstStart the start offset in the destination array. * @stable ICU 2.0 diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/ReplaceableString.java b/jdk/src/java.base/share/classes/sun/text/normalizer/ReplaceableString.java index 0610d6964e3..eb2c4399cd2 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/ReplaceableString.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/ReplaceableString.java @@ -109,10 +109,10 @@ public class ReplaceableString implements Replaceable { * starting at index dstStart and ending at index * dstStart + (srcLimit-srcStart) - 1. * - * @param srcStart the beginning index to copy, inclusive; 0 - * <= start <= limit. + * @param srcStart the beginning index to copy, inclusive; + * {@code 0 <= start <= limit}. * @param srcLimit the ending index to copy, exclusive; - * start <= limit <= length(). + * {@code start <= limit <= length()}. * @param dst the destination array. * @param dstStart the start offset in the destination array. * @stable ICU 2.0 diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/ReplaceableUCharacterIterator.java b/jdk/src/java.base/share/classes/sun/text/normalizer/ReplaceableUCharacterIterator.java index 9eabcba4697..8227ca78124 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/ReplaceableUCharacterIterator.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/ReplaceableUCharacterIterator.java @@ -150,14 +150,12 @@ public class ReplaceableUCharacterIterator extends UCharacterIterator { } /** - *

                  Sets the currentIndex to the specified currentIndex in the text and returns that + * Sets the currentIndex to the specified currentIndex in the text and returns that * single UTF16 character at currentIndex. - * This assumes the text is stored as 16-bit code units.

                  + * This assumes the text is stored as 16-bit code units. * @param currentIndex the currentIndex within the text. * @exception IllegalArgumentException is thrown if an invalid currentIndex is * supplied. i.e. currentIndex is out of bounds. - * @return the character at the specified currentIndex or DONE if the specified - * currentIndex is equal to the end of the text. */ public void setIndex(int currentIndex) { if (currentIndex < 0 || currentIndex > replaceable.length()) { diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/RuleCharacterIterator.java b/jdk/src/java.base/share/classes/sun/text/normalizer/RuleCharacterIterator.java index 029ceecb5e5..a287400ed4f 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/RuleCharacterIterator.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/RuleCharacterIterator.java @@ -101,22 +101,25 @@ public class RuleCharacterIterator { public static final int DONE = -1; /** - * Bitmask option to enable parsing of variable names. If (options & - * PARSE_VARIABLES) != 0, then an embedded variable will be expanded to + * Bitmask option to enable parsing of variable names. + * If {@code (options & PARSE_VARIABLES) != 0}, + * then an embedded variable will be expanded to * its value. Variables are parsed using the SymbolTable API. */ public static final int PARSE_VARIABLES = 1; /** - * Bitmask option to enable parsing of escape sequences. If (options & - * PARSE_ESCAPES) != 0, then an embedded escape sequence will be expanded + * Bitmask option to enable parsing of escape sequences. + * If {@code (options & PARSE_ESCAPES) != 0}, + * then an embedded escape sequence will be expanded * to its value. Escapes are parsed using Utility.unescapeAt(). */ public static final int PARSE_ESCAPES = 2; /** - * Bitmask option to enable skipping of whitespace. If (options & - * SKIP_WHITESPACE) != 0, then whitespace characters will be silently + * Bitmask option to enable skipping of whitespace. + * If {@code (options & SKIP_WHITESPACE) != 0}, + * then whitespace characters will be silently * skipped, as if they were not present in the input. Whitespace * characters are defined by UCharacterProperty.isRuleWhiteSpace(). */ diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/SymbolTable.java b/jdk/src/java.base/share/classes/sun/text/normalizer/SymbolTable.java index f49110e6fa9..305cec72867 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/SymbolTable.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/SymbolTable.java @@ -78,7 +78,7 @@ public interface SymbolTable { /** * Lookup the characters associated with this string and return it. - * Return null if no such name exists. The resultant + * Return {@code null} if no such name exists. The resultant * array may have length zero. * @param s the symbolic name to lookup * @return a char array containing the name's value, or null if @@ -91,7 +91,7 @@ public interface SymbolTable { /** * Lookup the UnicodeMatcher associated with the given character, and - * return it. Return null if not found. + * return it. Return {@code null} if not found. * @param ch a 32-bit code point from 0 to 0x10FFFF inclusive. * @return the UnicodeMatcher object represented by the given * character, or null if there is no mapping for ch. diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/Trie.java b/jdk/src/java.base/share/classes/sun/text/normalizer/Trie.java index 0430bf5e955..f90b2990bd7 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/Trie.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/Trie.java @@ -160,8 +160,10 @@ public abstract class Trie /** * Lead surrogate code points' index displacement in the index array. + *
                  {@code
                       * 0x10000-0xd800=0x2800
                       * 0x2800 >> INDEX_STAGE_1_SHIFT_
                  +    * }
                  */ protected static final int LEAD_INDEX_OFFSET_ = 0x2800 >> 5; /** @@ -191,7 +193,7 @@ public abstract class Trie /** * Number of index (stage 1) entries per lead surrogate. * Same as number of index entries for 1024 trail surrogates, - * ==0x400>>INDEX_STAGE_1_SHIFT_ + * {@code ==0x400>>INDEX_STAGE_1_SHIFT_} */ protected static final int SURROGATE_BLOCK_COUNT=(1<Class enabling iteration of the values in a Trie.

                  + * Class enabling iteration of the values in a Trie. *

                  Result of each iteration contains the interval of codepoints that have - * the same value type and the value type itself.

                  + * the same value type and the value type itself. *

                  The comparison of each codepoint value is done via extract(), which the - * default implementation is to return the value as it is.

                  + * default implementation is to return the value as it is. *

                  Method extract() can be overwritten to perform manipulations on - * codepoint values in order to perform specialized comparison.

                  + * codepoint values in order to perform specialized comparison. *

                  TrieIterator is designed to be a generic iterator for the CharTrie * and the IntTrie, hence to accommodate both types of data, the return - * result will be in terms of int (32 bit) values.

                  - *

                  See com.ibm.icu.text.UCharacterTypeIterator for examples of use.

                  + * result will be in terms of int (32 bit) values. + *

                  See com.ibm.icu.text.UCharacterTypeIterator for examples of use. *

                  Notes for porting utrie_enum from icu4c to icu4j:
                  * Internally, icu4c's utrie_enum performs all iterations in its body. In Java * sense, the caller will have to pass a object with a callback function @@ -63,18 +63,17 @@ package sun.text.normalizer; * the method extract(int) (equivalent to UTrieEnumValue). Independent of icu4j, * the caller will have to code his own iteration and flesh out the task * (equivalent to UTrieEnumRange) to be performed in the iteration loop. - *

                  - *

                  There are basically 3 usage scenarios for porting:

                  + * + *

                  There are basically 3 usage scenarios for porting: *

                  1) UTrieEnumValue is the only implemented callback then just implement a * subclass of TrieIterator and override the extract(int) method. The * extract(int) method is analogus to UTrieEnumValue callback. - *

                  + * *

                  2) UTrieEnumValue and UTrieEnumRange both are implemented then implement - * a subclass of TrieIterator, override the extract method and iterate, e.g - *

                  - *

                  utrie_enum(&normTrie, _enumPropertyStartsValue, _enumPropertyStartsRange, - * set);
                  - * In Java :
                  + * a subclass of TrieIterator, override the extract method and iterate, e.g.
                  + * {@code utrie_enum(&normTrie, _enumPropertyStartsValue, _enumPropertyStartsRange, + * set);}
                  + * In Java:
                  *

                    * class TrieIteratorImpl extends TrieIterator{
                    *     public TrieIteratorImpl(Trie data){
                  @@ -90,17 +89,17 @@ package sun.text.normalizer;
                    *     // port the implementation of _enumPropertyStartsRange
                    * }
                    * 
                  - *

                  + * *

                  3) UTrieEnumRange is the only implemented callback then just implement * the while loop, when utrie_enum is called - *

                  + * 
                  {@code
                    * // utrie_enum(&fcdTrie, NULL, _enumPropertyStartsRange, set);
                    * TrieIterator fcdIter  = new TrieIterator(fcdTrieImpl.fcdTrie);
                    * while(fcdIter.next(result)){
                    *     set.add(result.start);
                    * }
                  - * 
                  - *

                  + * }
                  + * * @author synwee * @see com.ibm.icu.impl.Trie * @see com.ibm.icu.lang.UCharacterTypeIterator diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/UCharacter.java b/jdk/src/java.base/share/classes/sun/text/normalizer/UCharacter.java index 2992eed9146..5382d16012d 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/UCharacter.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/UCharacter.java @@ -128,7 +128,7 @@ import java.util.MissingResourceException; * Annex C: Compatibility Properties of UTS #18 Unicode Regular Expressions * (http://www.unicode.org/reports/tr18/#Compatibility_Properties). *

                  - *

                  + *

                  {@code
                    * API access for C/POSIX character classes is as follows:
                    * - alpha:     isUAlphabetic(c) or hasBinaryProperty(c, UProperty.ALPHABETIC)
                    * - lower:     isULowercase(c) or hasBinaryProperty(c, UProperty.LOWERCASE)
                  @@ -142,7 +142,7 @@ import java.util.MissingResourceException;
                    * - cntrl:     getType(c)==CONTROL
                    * - graph:     hasBinaryProperty(c, UProperty.POSIX_GRAPH)
                    * - print:     hasBinaryProperty(c, UProperty.POSIX_PRINT)
                  - * 

                  + * }
                  *

                  * The C/POSIX character classes are also available in UnicodeSet patterns, * using patterns like [:graph:] or \p{graph}. diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/UCharacterIterator.java b/jdk/src/java.base/share/classes/sun/text/normalizer/UCharacterIterator.java index e5059d7b8ee..f8c41831aeb 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/UCharacterIterator.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/UCharacterIterator.java @@ -200,8 +200,7 @@ public abstract class UCharacterIterator * iterator obtained by calling getLength(). * Usage: * - * - *

                  +     * 
                  {@code
                        *         UChacterIterator iter = new UCharacterIterator.getInstance(text);
                        *         char[] buf = new char[iter.getLength()];
                        *         iter.getText(buf);
                  @@ -217,15 +216,14 @@ public abstract class UCharacterIterator
                        *                 buf = new char[iter.getLength()];
                        *             }
                        *         }
                  -     * 
                  - *
                  + * }
                  * * @param fillIn an array of chars to fill with the underlying UTF-16 code * units. * @param offset the position within the array to start putting the data. * @return the number of code units added to fillIn, as a convenience * @exception IndexOutOfBounds exception if there is not enough - * room after offset in the array, or if offset < 0. + * room after offset in the array, or if offset {@literal <} 0. * @stable ICU 2.4 */ public abstract int getText(char[] fillIn, int offset); diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/UTF16.java b/jdk/src/java.base/share/classes/sun/text/normalizer/UTF16.java index 0342a55648c..f705364b1c8 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/UTF16.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/UTF16.java @@ -38,26 +38,26 @@ package sun.text.normalizer; /** *

                  Standalone utility class providing UTF16 character conversions and - * indexing conversions.

                  + * indexing conversions. *

                  Code that uses strings alone rarely need modification. * By design, UTF-16 does not allow overlap, so searching for strings is a safe * operation. Similarly, concatenation is always safe. Substringing is safe if * the start and end are both on UTF-32 boundaries. In normal code, the values * for start and end are on those boundaries, since they arose from operations * like searching. If not, the nearest UTF-32 boundaries can be determined - * using bounds().

                  + * using bounds(). * Examples: *

                  The following examples illustrate use of some of these methods. - *

                  + * 
                  {@code
                    * // iteration forwards: Original
                  - * for (int i = 0; i < s.length(); ++i) {
                  + * for (int i = 0; i < s.length(); ++i) {
                    *     char ch = s.charAt(i);
                    *     doSomethingWith(ch);
                    * }
                    *
                    * // iteration forwards: Changes for UTF-32
                    * int ch;
                  - * for (int i = 0; i < s.length(); i+=UTF16.getCharCount(ch)) {
                  + * for (int i = 0; i < s.length(); i+=UTF16.getCharCount(ch)) {
                    *     ch = UTF16.charAt(s,i);
                    *     doSomethingWith(ch);
                    * }
                  @@ -74,7 +74,7 @@ package sun.text.normalizer;
                    *     ch = UTF16.charAt(s,i);
                    *     doSomethingWith(ch);
                    * }
                  - * 
                  + * }
                  * Notes: *
                    *
                  • @@ -515,12 +515,12 @@ public final class UTF16 /** *

                    Converts argument code point and returns a String object representing - * the code point's value in UTF16 format.

                    + * the code point's value in UTF16 format. *

                    This method does not check for the validity of the codepoint, the * results are not guaranteed if a invalid codepoint is passed as - * argument.

                    + * argument. *

                    The result is a string whose length is 1 for non-supplementary code - * points, 2 otherwise.

                    + * points, 2 otherwise. * @param ch code point * @return string representation of the code point */ diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeMatcher.java b/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeMatcher.java index d1815c21ca7..52808c9860f 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeMatcher.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeMatcher.java @@ -45,7 +45,8 @@ package sun.text.normalizer; public interface UnicodeMatcher { /** - * The character at index i, where i < contextStart || i >= contextLimit, + * The character at index {@code i}, where + * {@code i < contextStart || i >= contextLimit}, * is ETHER. This allows explicit matching by rules and UnicodeSets * of text outside the context. In traditional terms, this allows anchoring * at the start and/or end. diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSet.java b/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSet.java index a1784652be8..f3ee71aa969 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSet.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSet.java @@ -107,8 +107,8 @@ import java.util.TreeSet; * * * [a{ab}{ac}] - * The character 'a' and the multicharacter strings "ab" and - * "ac" + * The character 'a' and the multicharacter strings "ab" and + * "ac" * * * [\p{Lu}] @@ -148,10 +148,10 @@ import java.util.TreeSet; * literal. Thus "[a\\-b]", "[-ab]", and "[ab-]" all indicate the same * set of three characters, 'a', 'b', and '-'. * - *

                    Sets may be intersected using the '&' operator or the asymmetric + *

                    Sets may be intersected using the {@literal '&'} operator or the asymmetric * set difference may be taken using the '-' operator, for example, - * "[[:L:]&[\\u0000-\\u0FFF]]" indicates the set of all Unicode letters - * with values less than 4096. Operators ('&' and '|') have equal + * "{@code [[:L:]&[\\u0000-\\u0FFF]]}" indicates the set of all Unicode letters + * with values less than 4096. Operators ({@literal '&'} and '|') have equal * precedence and bind left-to-right. Thus * "[[:L:]-[a-z]-[\\u0100-\\u01FF]]" is equivalent to * "[[[:L:]-[a-z]]-[\\u0100-\\u01FF]]". This only really matters for @@ -166,7 +166,7 @@ import java.util.TreeSet; * that is, U+0000 through 'a'-1 and 'z'+1 through U+10FFFF * [[pat1][pat2]] * The union of sets specified by pat1 and pat2 - * [[pat1]&[pat2]] + * [[pat1]&[pat2]] * The intersection of sets specified by pat1 and pat2 * [[pat1]-[pat2]] * The asymmetric difference of sets specified by pat1 and @@ -227,7 +227,7 @@ import java.util.TreeSet; * * * property :=  - * a Unicode property set pattern + * a Unicode property set pattern * * *
                    @@ -337,8 +337,8 @@ public class UnicodeSet implements UnicodeMatcher { } /** - * Constructs a set containing the given range. If end > - * start then an empty set is created. + * Constructs a set containing the given range. + * If {@code end > start} then an empty set is created. * * @param start first character, inclusive, of range * @param end last character, inclusive, of range @@ -651,7 +651,7 @@ public class UnicodeSet implements UnicodeMatcher { * Adds the specified multicharacter to this set if it is not already * present. If this set already contains the multicharacter, * the call leaves this set unchanged. - * Thus "ch" => {"ch"} + * Thus {@code "ch" => {"ch"}} *
                    Warning: you cannot add an empty string ("") to a UnicodeSet. * @param s the source string * @return this object, for chaining @@ -691,7 +691,7 @@ public class UnicodeSet implements UnicodeMatcher { /** * Complements the specified range in this set. Any character in * the range will be removed if it is in this set, or will be - * added if it is not in this set. If end > start + * added if it is not in this set. If {@code end > start} * then an empty range is complemented, leaving the set unchanged. * * @param start first character, inclusive, of range to be removed @@ -1698,8 +1698,8 @@ public class UnicodeSet implements UnicodeMatcher { * Modifies this set to contain those code points which have the * given value for the given property. Prior contents of this * set are lost. - * @param propertyAlias - * @param valueAlias + * @param propertyAlias the property alias + * @param valueAlias the value alias * @param symbols if not null, then symbols are first called to see if a property * is available. If true, then everything else is skipped. * @return this set diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSetIterator.java b/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSetIterator.java index 770745226c8..98544705349 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSetIterator.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/UnicodeSetIterator.java @@ -73,35 +73,35 @@ import java.util.Iterator; public class UnicodeSetIterator { /** - * Value of codepoint if the iterator points to a string. - * If codepoint == IS_STRING, then examine - * string for the current iteration result. + * Value of {@code codepoint} if the iterator points to a string. + * If {@code codepoint == IS_STRING}, then examine + * {@code string} for the current iteration result. * @stable ICU 2.0 */ public static int IS_STRING = -1; /** - * Current code point, or the special value IS_STRING, if + * Current code point, or the special value {@code IS_STRING}, if * the iterator points to a string. * @stable ICU 2.0 */ public int codepoint; /** - * When iterating over ranges using nextRange(), - * codepointEnd contains the inclusive end of the - * iteration range, if codepoint != IS_STRING. If - * iterating over code points using next(), or if - * codepoint == IS_STRING, then the value of - * codepointEnd is undefined. + * When iterating over ranges using {@code nextRange()}, + * {@code codepointEnd} contains the inclusive end of the + * iteration range, if {@code codepoint != IS_STRING}. If + * iterating over code points using {@code next()}, or if + * {@code codepoint == IS_STRING}, then the value of + * {@code codepointEnd} is undefined. * @stable ICU 2.0 */ public int codepointEnd; /** - * If codepoint == IS_STRING, then string points - * to the current string. If codepoint != IS_STRING, the - * value of string is undefined. + * If {@code codepoint == IS_STRING}, then {@code string} points + * to the current string. If {@code codepoint != IS_STRING}, the + * value of {@code string} is undefined. * @stable ICU 2.0 */ public String string; @@ -118,17 +118,17 @@ public class UnicodeSetIterator { /** * Returns the next element in the set, either a code point range * or a string. If there are no more elements in the set, return - * false. If codepoint == IS_STRING, the value is a - * string in the string field. Otherwise the value is a - * range of one or more code points from codepoint to - * codepointeEnd inclusive. + * false. If {@code codepoint == IS_STRING}, the value is a + * string in the {@code string} field. Otherwise the value is a + * range of one or more code points from {@code codepoint} to + * {@code codepointeEnd} inclusive. * *

                    The order of iteration is all code points ranges in sorted * order, followed by all strings sorted order. Ranges are - * disjoint and non-contiguous. string is undefined - * unless codepoint == IS_STRING. Do not mix calls to - * next() and nextRange() without calling - * reset() between them. The results of doing so are + * disjoint and non-contiguous. {@code string} is undefined + * unless {@code codepoint == IS_STRING}. Do not mix calls to + * {@code next()} and {@code nextRange()} without calling + * {@code reset()} between them. The results of doing so are * undefined. * * @return true if there was another element in the set and this @@ -162,8 +162,8 @@ public class UnicodeSetIterator { /** * Sets this iterator to visit the elements of the given set and * resets it to the start of that set. The iterator is valid only - * so long as set is valid. - * @param set the set to iterate over. + * so long as {@code set} is valid. + * @param uset the set to iterate over. * @stable ICU 2.0 */ public void reset(UnicodeSet uset) { diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/Utility.java b/jdk/src/java.base/share/classes/sun/text/normalizer/Utility.java index 841e2119f93..59fb57189c0 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/Utility.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/Utility.java @@ -227,7 +227,7 @@ public final class Utility { /** * Convert a integer to size width hex uppercase digits. - * E.g., hex('a', 4, str) => "0041". + * E.g., {@code hex('a', 4, str) => "0041"}. * Append the output to the given StringBuffer. * If width is too small to fit, nothing will be appended to output. */ @@ -237,7 +237,7 @@ public final class Utility { /** * Convert a integer to size width (minimum) hex uppercase digits. - * E.g., hex('a', 4, str) => "0041". If the integer requires more + * E.g., {@code hex('a', 4, str) => "0041"}. If the integer requires more * than width digits, more will be used. */ public static String hex(int ch, int width) { @@ -334,8 +334,8 @@ public final class Utility { } /** - * Escape unprintable characters using uxxxx notation - * for U+0000 to U+FFFF and Uxxxxxxxx for U+10000 and + * Escape unprintable characters using {@code uxxxx} notation + * for U+0000 to U+FFFF and {@code Uxxxxxxxx} for U+10000 and * above. If the character is printable ASCII, then do nothing * and return FALSE. Otherwise, append the escaped notation and * return TRUE. diff --git a/jdk/src/java.base/share/classes/sun/text/normalizer/VersionInfo.java b/jdk/src/java.base/share/classes/sun/text/normalizer/VersionInfo.java index 09f13b9ceca..d55fe0b996c 100644 --- a/jdk/src/java.base/share/classes/sun/text/normalizer/VersionInfo.java +++ b/jdk/src/java.base/share/classes/sun/text/normalizer/VersionInfo.java @@ -53,7 +53,7 @@ public final class VersionInfo * @param version version String in the format of "major.minor.milli.micro" * or "major.minor.milli" or "major.minor" or "major", * where major, minor, milli, micro are non-negative numbers - * <= 255. If the trailing version numbers are + * {@literal <=} 255. If the trailing version numbers are * not specified they are taken as 0s. E.g. Version "3.1" is * equivalent to "3.1.0.0". * @return an instance of VersionInfo with the argument version. @@ -98,12 +98,12 @@ public final class VersionInfo /** * Returns an instance of VersionInfo with the argument version. - * @param major major version, non-negative number <= 255. - * @param minor minor version, non-negative number <= 255. - * @param milli milli version, non-negative number <= 255. - * @param micro micro version, non-negative number <= 255. + * @param major major version, non-negative number {@literal <=} 255. + * @param minor minor version, non-negative number {@literal <=} 255. + * @param milli milli version, non-negative number {@literal <=} 255. + * @param micro micro version, non-negative number {@literal <=} 255. * @exception throws an IllegalArgumentException when either arguments are - * negative or > 255 + * negative or {@literal >} 255 * @stable ICU 2.6 */ public static VersionInfo getInstance(int major, int minor, int milli, diff --git a/jdk/src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java b/jdk/src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java index 90a9c787ff0..bc194f960ae 100644 --- a/jdk/src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java +++ b/jdk/src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java @@ -270,22 +270,6 @@ class UnixChannelFactory { throw x; } - // fail if the file is a directory - if (flags.read) { - UnixException exc = null; - try { - if (UnixFileAttributes.get(fd).isDirectory()) { - exc = new UnixException(EISDIR); - } - } catch (UnixException x) { - exc = x; - } - if (exc != null) { - close(fd); - throw exc; - } - } - // unlink file immediately if delete on close. The spec is clear that // an implementation cannot guarantee to unlink the correct file when // replaced by an attacker after it is opened. diff --git a/jdk/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c b/jdk/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c index 403c15cad06..8738d5f9f68 100644 --- a/jdk/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c +++ b/jdk/src/java.base/unix/native/libnio/ch/FileDispatcherImpl.c @@ -148,6 +148,13 @@ Java_sun_nio_ch_FileDispatcherImpl_force0(JNIEnv *env, jobject this, jint fd = fdval(env, fdo); int result = 0; +#ifdef MACOSX + result = fcntl(fd, F_FULLFSYNC); + if (result == -1 && errno == ENOTSUP) { + /* Try fsync() in case F_FULLSYUNC is not implemented on the file system. */ + result = fsync(fd); + } +#else /* end MACOSX, begin not-MACOSX */ if (md == JNI_FALSE) { result = fdatasync(fd); } else { @@ -163,9 +170,10 @@ Java_sun_nio_ch_FileDispatcherImpl_force0(JNIEnv *env, jobject this, if (getfl >= 0 && (getfl & O_ACCMODE) == O_RDONLY) { return 0; } -#endif +#endif /* _AIX */ result = fsync(fd); } +#endif /* not-MACOSX */ return handle(env, result, "Force failed"); } diff --git a/jdk/src/java.base/windows/native/libjli/java_md.c b/jdk/src/java.base/windows/native/libjli/java_md.c index fcf1a4932fc..27b87dfdfb9 100644 --- a/jdk/src/java.base/windows/native/libjli/java_md.c +++ b/jdk/src/java.base/windows/native/libjli/java_md.c @@ -990,6 +990,26 @@ ProcessPlatformOption(const char *arg) return JNI_FALSE; } +int +filterArgs(StdArg *stdargs, const int nargc, StdArg **pargv) { + StdArg* argv = NULL; + int nargs = 0; + int i; + + /* Copy the non-vm args */ + for (i = 0; i < nargc ; i++) { + const char *arg = stdargs[i].arg; + if (arg[0] == '-' && arg[1] == 'J') + continue; + argv = (StdArg*) JLI_MemRealloc(argv, (nargs+1) * sizeof(StdArg)); + argv[nargs].arg = JLI_StringDup(arg); + argv[nargs].has_wildcard = stdargs[i].has_wildcard; + nargs++; + } + *pargv = argv; + return nargs; +} + /* * At this point we have the arguments to the application, and we need to * check with original stdargs in order to compare which of these truly @@ -1005,8 +1025,9 @@ CreateApplicationArgs(JNIEnv *env, char **strv, int argc) char *ostart, *astart, **nargv; jboolean needs_expansion = JNI_FALSE; jmethodID mid; - int stdargc; + int filteredargc, stdargc; StdArg *stdargs; + StdArg *filteredargs; jclass cls = GetLauncherHelperClass(env); NULL_CHECK0(cls); @@ -1017,6 +1038,8 @@ CreateApplicationArgs(JNIEnv *env, char **strv, int argc) stdargs = JLI_GetStdArgs(); stdargc = JLI_GetStdArgc(); + filteredargc = filterArgs(stdargs, stdargc, &filteredargs); + // sanity check, this should never happen if (argc > stdargc) { JLI_TraceLauncher("Warning: app args is larger than the original, %d %d\n", argc, stdargc); @@ -1025,8 +1048,8 @@ CreateApplicationArgs(JNIEnv *env, char **strv, int argc) } // sanity check, match the args we have, to the holy grail - idx = stdargc - argc; - ostart = stdargs[idx].arg; + idx = filteredargc - argc; + ostart = filteredargs[idx].arg; astart = strv[0]; // sanity check, ensure that the first argument of the arrays are the same if (JLI_StrCmp(ostart, astart) != 0) { @@ -1039,8 +1062,8 @@ CreateApplicationArgs(JNIEnv *env, char **strv, int argc) // make a copy of the args which will be expanded in java if required. nargv = (char **)JLI_MemAlloc(argc * sizeof(char*)); for (i = 0, j = idx; i < argc; i++, j++) { - jboolean arg_expand = (JLI_StrCmp(stdargs[j].arg, strv[i]) == 0) - ? stdargs[j].has_wildcard + jboolean arg_expand = (JLI_StrCmp(filteredargs[j].arg, strv[i]) == 0) + ? filteredargs[j].has_wildcard : JNI_FALSE; if (needs_expansion == JNI_FALSE) needs_expansion = arg_expand; @@ -1077,5 +1100,6 @@ CreateApplicationArgs(JNIEnv *env, char **strv, int argc) JLI_MemFree(nargv[i]); } JLI_MemFree(nargv); + JLI_MemFree(filteredargs); return outArray; } diff --git a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java index 972b74a7efb..77c6585ec87 100644 --- a/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java +++ b/jdk/src/java.logging/share/classes/java/util/logging/LogManager.java @@ -33,6 +33,7 @@ import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.locks.ReentrantLock; import sun.misc.JavaAWTAccess; import sun.misc.ManagedLocalsThread; import sun.misc.SharedSecrets; @@ -180,10 +181,16 @@ public class LogManager { // initialization has been done) private volatile boolean readPrimordialConfiguration; // Have we initialized global (root) handlers yet? - // This gets set to false in readConfiguration - private boolean initializedGlobalHandlers = true; - // True if JVM death is imminent and the exit hook has been called. - private boolean deathImminent; + // This gets set to STATE_UNINITIALIZED in readConfiguration + private static final int + STATE_INITIALIZED = 0, // initial state + STATE_INITIALIZING = 1, + STATE_READING_CONFIG = 2, + STATE_UNINITIALIZED = 3, + STATE_SHUTDOWN = 4; // terminal state + private volatile int globalHandlersState; // = STATE_INITIALIZED; + // A concurrency lock for reset(), readConfiguration() and Cleaner. + private final ReentrantLock configurationLock = new ReentrantLock(); // This list contains the loggers for which some handlers have been // explicitly configured in the configuration file. @@ -264,13 +271,12 @@ public class LogManager { // before synchronized block. Otherwise deadlocks are possible. LogManager mgr = manager; - // If the global handlers haven't been initialized yet, we - // don't want to initialize them just so we can close them! - synchronized (LogManager.this) { - // Note that death is imminent. - deathImminent = true; - initializedGlobalHandlers = true; - } + // set globalHandlersState to STATE_SHUTDOWN atomically so that + // no attempts are made to (re)initialize the handlers or (re)read + // the configuration again. This is terminal state. + configurationLock.lock(); + globalHandlersState = STATE_SHUTDOWN; + configurationLock.unlock(); // Do a reset to close all active handlers. reset(); @@ -1314,8 +1320,14 @@ public class LogManager { public void reset() throws SecurityException { checkPermission(); + List persistent; - synchronized (this) { + + // We don't want reset() and readConfiguration() + // to run in parallel + configurationLock.lock(); + try { + // install new empty properties props = new Properties(); // make sure we keep the loggers persistent until reset is done. // Those are the loggers for which we previously created a @@ -1323,26 +1335,41 @@ public class LogManager { // from being gc'ed until those handlers are closed. persistent = new ArrayList<>(closeOnResetLoggers); closeOnResetLoggers.clear(); - // Since we are doing a reset we no longer want to initialize - // the global handlers, if they haven't been initialized yet. - initializedGlobalHandlers = true; - } - for (LoggerContext cx : contexts()) { - Enumeration enum_ = cx.getLoggerNames(); - while (enum_.hasMoreElements()) { - String name = enum_.nextElement(); - Logger logger = cx.findLogger(name); - if (logger != null) { - resetLogger(logger); - } + + // if reset has been called from shutdown-hook (Cleaner), + // or if reset has been called from readConfiguration() which + // already holds the lock and will change the state itself, + // then do not change state here... + if (globalHandlersState != STATE_SHUTDOWN && + globalHandlersState != STATE_READING_CONFIG) { + // ...else user called reset()... + // Since we are doing a reset we no longer want to initialize + // the global handlers, if they haven't been initialized yet. + globalHandlersState = STATE_INITIALIZED; } + + for (LoggerContext cx : contexts()) { + resetLoggerContext(cx); + } + + persistent.clear(); + } finally { + configurationLock.unlock(); } - persistent.clear(); } - // Private method to reset an individual target logger. - private void resetLogger(Logger logger) { - // Close all the Logger's handlers. + private void resetLoggerContext(LoggerContext cx) { + Enumeration enum_ = cx.getLoggerNames(); + while (enum_.hasMoreElements()) { + String name = enum_.nextElement(); + Logger logger = cx.findLogger(name); + if (logger != null) { + resetLogger(logger); + } + } + } + + private void closeHandlers(Logger logger) { Handler[] targets = logger.getHandlers(); for (Handler h : targets) { logger.removeHandler(h); @@ -1352,6 +1379,14 @@ public class LogManager { // Problems closing a handler? Keep going... } } + } + + // Private method to reset an individual target logger. + private void resetLogger(Logger logger) { + // Close all the Logger handlers. + closeHandlers(logger); + + // Reset Logger level String name = logger.getName(); if (name != null && name.equals("")) { // This is the root logger. @@ -1408,48 +1443,74 @@ public class LogManager { */ public void readConfiguration(InputStream ins) throws IOException, SecurityException { checkPermission(); - reset(); - // Load the properties + // We don't want reset() and readConfiguration() to run + // in parallel. + configurationLock.lock(); try { - props.load(ins); - } catch (IllegalArgumentException x) { - // props.load may throw an IllegalArgumentException if the stream - // contains malformed Unicode escape sequences. - // We wrap that in an IOException as readConfiguration is - // specified to throw IOException if there are problems reading - // from the stream. - // Note: new IOException(x.getMessage(), x) allow us to get a more - // concise error message than new IOException(x); - throw new IOException(x.getMessage(), x); - } + if (globalHandlersState == STATE_SHUTDOWN) { + // already in terminal state: don't even bother + // to read the configuration + return; + } - // Instantiate new configuration objects. - String names[] = parseClassNames("config"); - - for (String word : names) { + // change state to STATE_READING_CONFIG to signal reset() to not change it + globalHandlersState = STATE_READING_CONFIG; try { - Class clz = ClassLoader.getSystemClassLoader().loadClass(word); - clz.newInstance(); - } catch (Exception ex) { - System.err.println("Can't load config class \"" + word + "\""); - System.err.println("" + ex); - // ex.printStackTrace(); + // reset configuration which leaves globalHandlersState at STATE_READING_CONFIG + // so that while reading configuration, any ongoing logging requests block and + // wait for the outcome (see the end of this try statement) + reset(); + + try { + // Load the properties + props.load(ins); + } catch (IllegalArgumentException x) { + // props.load may throw an IllegalArgumentException if the stream + // contains malformed Unicode escape sequences. + // We wrap that in an IOException as readConfiguration is + // specified to throw IOException if there are problems reading + // from the stream. + // Note: new IOException(x.getMessage(), x) allow us to get a more + // concise error message than new IOException(x); + throw new IOException(x.getMessage(), x); + } + + // Instantiate new configuration objects. + String names[] = parseClassNames("config"); + + for (String word : names) { + try { + Class clz = ClassLoader.getSystemClassLoader().loadClass(word); + clz.newInstance(); + } catch (Exception ex) { + System.err.println("Can't load config class \"" + word + "\""); + System.err.println("" + ex); + // ex.printStackTrace(); + } + } + + // Set levels on any pre-existing loggers, based on the new properties. + setLevelsOnExistingLoggers(); + + // Note that we need to reinitialize global handles when + // they are first referenced. + globalHandlersState = STATE_UNINITIALIZED; + } catch (Throwable t) { + // If there were any trouble, then set state to STATE_INITIALIZED + // so that no global handlers reinitialization is performed on not fully + // initialized configuration. + globalHandlersState = STATE_INITIALIZED; + // re-throw + throw t; } - } - - // Set levels on any pre-existing loggers, based on the new properties. - setLevelsOnExistingLoggers(); - - try { - invokeConfigurationListeners(); } finally { - // Note that we need to reinitialize global handles when - // they are first referenced. - synchronized (this) { - initializedGlobalHandlers = false; - } + configurationLock.unlock(); } + + // should be called out of lock to avoid dead-lock situations + // when user code is involved + invokeConfigurationListeners(); } /** @@ -1576,20 +1637,41 @@ public class LogManager { // Private method to load the global handlers. // We do the real work lazily, when the global handlers // are first used. - private synchronized void initializeGlobalHandlers() { - if (initializedGlobalHandlers) { + private void initializeGlobalHandlers() { + int state = globalHandlersState; + if (state == STATE_INITIALIZED || + state == STATE_SHUTDOWN) { + // Nothing to do: return. return; } - initializedGlobalHandlers = true; - - if (deathImminent) { - // Aaargh... - // The VM is shutting down and our exit hook has been called. - // Avoid allocating global handlers. - return; + // If we have not initialized global handlers yet (or need to + // reinitialize them), lets do it now (this case is indicated by + // globalHandlersState == STATE_UNINITIALIZED). + // If we are in the process of initializing global handlers we + // also need to lock & wait (this case is indicated by + // globalHandlersState == STATE_INITIALIZING). + // If we are in the process of reading configuration we also need to + // wait to see what the outcome will be (this case + // is indicated by globalHandlersState == STATE_READING_CONFIG) + // So in either case we need to wait for the lock. + configurationLock.lock(); + try { + if (globalHandlersState != STATE_UNINITIALIZED) { + return; // recursive call or nothing to do + } + // set globalHandlersState to STATE_INITIALIZING first to avoid + // getting an infinite recursion when loadLoggerHandlers(...) + // is going to call addHandler(...) + globalHandlersState = STATE_INITIALIZING; + try { + loadLoggerHandlers(rootLogger, null, "handlers"); + } finally { + globalHandlersState = STATE_INITIALIZED; + } + } finally { + configurationLock.unlock(); } - loadLoggerHandlers(rootLogger, null, "handlers"); } static final Permission controlPermission = new LoggingPermission("control", null); @@ -1684,7 +1766,7 @@ public class LogManager { // Private method to be called when the configuration has // changed to apply any level settings to any pre-existing loggers. - synchronized private void setLevelsOnExistingLoggers() { + private void setLevelsOnExistingLoggers() { Enumeration enum_ = props.propertyNames(); while (enum_.hasMoreElements()) { String key = (String)enum_.nextElement(); diff --git a/jdk/src/java.logging/share/classes/java/util/logging/package.html b/jdk/src/java.logging/share/classes/java/util/logging/package.html index 46385de5cdc..761baa7a083 100644 --- a/jdk/src/java.logging/share/classes/java/util/logging/package.html +++ b/jdk/src/java.logging/share/classes/java/util/logging/package.html @@ -30,8 +30,7 @@ questions.

                    Provides the classes and interfaces of -the JavaTM 2 - platform's core logging facilities. +the Java™ 2 platform's core logging facilities. The central goal of the logging APIs is to support maintaining and servicing software at customer sites. diff --git a/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java b/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java index 63ec9cc347d..740732b2f82 100644 --- a/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java +++ b/jdk/src/java.management/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java @@ -79,44 +79,46 @@ import sun.reflect.misc.ReflectUtil; /** *

                    A converter between Java types and the limited set of classes - * defined by Open MBeans.

                    + * defined by Open MBeans. * - *

                    A Java type is an instance of java.lang.reflect.Type. For our + *

                    A Java type is an instance of java.lang.reflect.Type. For our * purposes, it is either a Class, such as String.class or int.class; - * or a ParameterizedType, such as List or Map. On J2SE 1.4 and earlier, it can only be a Class.

                    + * or a ParameterizedType, such as {@code List} or + * {@code Map}. + * On J2SE 1.4 and earlier, it can only be a Class. * - *

                    Each Type is associated with an DefaultMXBeanMappingFactory. The - * DefaultMXBeanMappingFactory defines an OpenType corresponding to the Type, plus a - * Java class corresponding to the OpenType. For example:

                    + *

                    Each Type is associated with an DefaultMXBeanMappingFactory. The + * DefaultMXBeanMappingFactory defines an + * OpenType corresponding to the Type, plus a + * Java class corresponding to the OpenType. For example: * - *

                    + *   
                    {@code
                      *   Type                     Open class     OpenType
                      *   ----                     ----------     --------
                    - *   Integer                Integer        SimpleType.INTEGER
                    - *   int                            int            SimpleType.INTEGER
                    - *   Integer[]              Integer[]      ArrayType(1, SimpleType.INTEGER)
                    - *   int[]                  Integer[]      ArrayType(SimpleType.INTEGER, true)
                    - *   String[][]             String[][]     ArrayType(2, SimpleType.STRING)
                    - *   List                   String[]       ArrayType(1, SimpleType.STRING)
                    + *   Integer                  Integer        SimpleType.INTEGER
                    + *   int                      int            SimpleType.INTEGER
                    + *   Integer[]                Integer[]      ArrayType(1, SimpleType.INTEGER)
                    + *   int[]                    Integer[]      ArrayType(SimpleType.INTEGER, true)
                    + *   String[][]               String[][]     ArrayType(2, SimpleType.STRING)
                    + *   List             String[]       ArrayType(1, SimpleType.STRING)
                      *   ThreadState (an Enum)    String         SimpleType.STRING
                    - *   Map   TabularData          TabularType(
                    + *   Map   TabularData    TabularType(
                      *                                           CompositeType(
                      *                                             {"key", SimpleType.INTEGER},
                      *                                             {"value",
                      *                                               ArrayType(1,
                      *                                                SimpleType.STRING)}),
                      *                                           indexNames={"key"})
                    - *   
                    + * }
                    * *

                    Apart from simple types, arrays, and collections, Java types are * converted through introspection into CompositeType. The Java type * must have at least one getter (method such as "int getSize()" or * "boolean isBig()"), and we must be able to deduce how to * reconstruct an instance of the Java class from the values of the - * getters using one of various heuristics.

                    + * getters using one of various heuristics. * - * @since 1.6 + * @since 1.6 */ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory { static abstract class NonNullMXBeanMapping extends MXBeanMapping { @@ -148,8 +150,8 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory { throws OpenDataException; /** - *

                    True if and only if this MXBeanMapping's toOpenValue and - * fromOpenValue methods are the identity function.

                    + * True if and only if this MXBeanMapping's toOpenValue and + * fromOpenValue methods are the identity function. */ boolean isIdentity() { return false; diff --git a/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerCommunicatorAdmin.java b/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerCommunicatorAdmin.java index f943bf5ce68..6df86f5931b 100644 --- a/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerCommunicatorAdmin.java +++ b/jdk/src/java.management/share/classes/com/sun/jmx/remote/internal/ServerCommunicatorAdmin.java @@ -57,8 +57,8 @@ public abstract class ServerCommunicatorAdmin { * rspOutgoing to inform that a response is sent out * for the received request. * @return the value of the termination flag: - *
                      true if the connection is already being terminated, - *
                      false otherwise.
                    + * true if the connection is already being terminated, + * false otherwise. */ public boolean reqIncoming() { if (logger.traceOn()) { @@ -80,8 +80,8 @@ public abstract class ServerCommunicatorAdmin { /** * Tells that a response is sent out for a received request. * @return the value of the termination flag: - *
                      true if the connection is already being terminated, - *
                      false otherwise.
                    + * true if the connection is already being terminated, + * false otherwise. */ public boolean rspOutgoing() { if (logger.traceOn()) { diff --git a/jdk/src/java.management/share/classes/com/sun/jmx/remote/util/EnvHelp.java b/jdk/src/java.management/share/classes/com/sun/jmx/remote/util/EnvHelp.java index bf951df715f..b92ecc847b2 100644 --- a/jdk/src/java.management/share/classes/com/sun/jmx/remote/util/EnvHelp.java +++ b/jdk/src/java.management/share/classes/com/sun/jmx/remote/util/EnvHelp.java @@ -55,17 +55,17 @@ import javax.management.remote.JMXConnectorServer; public class EnvHelp { /** - *

                    Name of the attribute that specifies a default class loader + * Name of the attribute that specifies a default class loader * object. - * The value associated with this attribute is a ClassLoader object

                    + * The value associated with this attribute is a ClassLoader object. */ private static final String DEFAULT_CLASS_LOADER = JMXConnectorFactory.DEFAULT_CLASS_LOADER; /** - *

                    Name of the attribute that specifies a default class loader - * ObjectName. - * The value associated with this attribute is an ObjectName object

                    + * Name of the attribute that specifies a default class loader + * ObjectName. + * The value associated with this attribute is an ObjectName object. */ private static final String DEFAULT_CLASS_LOADER_NAME = JMXConnectorServerFactory.DEFAULT_CLASS_LOADER_NAME; @@ -74,7 +74,6 @@ public class EnvHelp { * Get the Connector Server default class loader. *

                    * Returns: - *

                    *

                      *
                    • * The ClassLoader object found in env for @@ -114,6 +113,7 @@ public class EnvHelp { * jmx.remote.default.class.loader.name is specified * but mbs is null. *
                    • + *
                    * @exception InstanceNotFoundException if * jmx.remote.default.class.loader.name is specified * and the ClassLoader MBean is not found in mbs. @@ -172,7 +172,6 @@ public class EnvHelp { * Get the Connector Client default class loader. *

                    * Returns: - *

                    *

                      *
                    • * The ClassLoader object found in env for @@ -232,7 +231,7 @@ public class EnvHelp { /** * Returns the cause field of a {@code Throwable} object. * The cause field can be got only if t has an - * {@link Throwable#getCause()} method (JDK Version >= 1.4) + * {@link Throwable#getCause()} method (JDK Version {@literal >=} 1.4) * @param t {@code Throwable} on which the cause must be set. * @return the cause if getCause() succeeded and the got value is not * null, otherwise return the t. @@ -254,7 +253,7 @@ public class EnvHelp { /** - *

                      Name of the attribute that specifies the size of a notification + * Name of the attribute that specifies the size of a notification * buffer for a connector server. The default value is 1000. */ public static final String BUFFER_SIZE_PROPERTY = @@ -316,10 +315,10 @@ public class EnvHelp { } /** - *

                      Name of the attribute that specifies the maximum number of - * notifications that a client will fetch from its server.. The + * Name of the attribute that specifies the maximum number of + * notifications that a client will fetch from its server. The * value associated with this attribute should be an - * Integer object. The default value is 1000.

                      + * {@code Integer} object. The default value is 1000. */ public static final String MAX_FETCH_NOTIFS = "jmx.remote.x.notification.fetch.max"; @@ -334,10 +333,10 @@ public class EnvHelp { } /** - *

                      Name of the attribute that specifies the timeout for a + * Name of the attribute that specifies the timeout for a * client to fetch notifications from its server. The value * associated with this attribute should be a Long - * object. The default value is 60000 milliseconds.

                      + * object. The default value is 60000 milliseconds. */ public static final String FETCH_TIMEOUT = "jmx.remote.x.notification.fetch.timeout"; @@ -351,11 +350,12 @@ public class EnvHelp { } /** - *

                      Name of the attribute that specifies an object that will check + * Name of the attribute that specifies an object that will check * accesses to add/removeNotificationListener and also attempts to * receive notifications. The value associated with this attribute * should be a NotificationAccessController object. - * The default value is null.

                      + * The default value is null. + *

                      * This field is not public because of its com.sun dependency. */ public static final String NOTIF_ACCESS_CONTROLLER = @@ -630,9 +630,9 @@ public class EnvHelp { } /** - *

                      Name of the attribute that specifies the timeout to keep a + * Name of the attribute that specifies the timeout to keep a * server side connection after answering last client request. - * The default value is 120000 milliseconds.

                      + * The default value is 120000 milliseconds. */ public static final String SERVER_CONNECTION_TIMEOUT = "jmx.remote.x.server.connection.timeout"; @@ -646,9 +646,9 @@ public class EnvHelp { } /** - *

                      Name of the attribute that specifies the period in - * millisecond for a client to check its connection. The default - * value is 60000 milliseconds.

                      + * Name of the attribute that specifies the period in + * millisecond for a client to check its connection. The default + * value is 60000 milliseconds. */ public static final String CLIENT_CONNECTION_CHECK_PERIOD = "jmx.remote.x.client.connection.check.period"; @@ -741,13 +741,13 @@ public class EnvHelp { } /** - *

                      Name of the attribute that specifies whether a connector server + * Name of the attribute that specifies whether a connector server * should not prevent the VM from exiting */ public static final String JMX_SERVER_DAEMON = "jmx.remote.x.daemon"; /** - * Returns true if {@value SERVER_DAEMON} is specified in the {@code env} + * Returns true if {@value JMX_SERVER_DAEMON} is specified in the {@code env} * as a key and its value is a String and it is equal to true ignoring case. * * @param env diff --git a/jdk/src/java.management/share/classes/javax/management/package.html b/jdk/src/java.management/share/classes/javax/management/package.html index 71c3c790f2f..c079b338e34 100644 --- a/jdk/src/java.management/share/classes/javax/management/package.html +++ b/jdk/src/java.management/share/classes/javax/management/package.html @@ -30,7 +30,7 @@ questions.

                      Provides the core classes for the Java Management Extensions.

                      The Java Management Extensions - (JMXTM) API is a standard + (JMX™) API is a standard API for management and monitoring. Typical uses include:

                        @@ -87,8 +87,7 @@ questions. notion of Standard MBeans. A Standard MBean is one whose attributes and operations are deduced from a Java interface using certain naming patterns, similar to those used - by JavaBeansTM. For - example, consider an interface like this:

                        + by JavaBeans™. For example, consider an interface like this:

                             public interface ConfigurationMBean {
                        diff --git a/jdk/src/java.management/share/classes/javax/management/remote/package.html b/jdk/src/java.management/share/classes/javax/management/remote/package.html
                        index a545d36fcbf..a38712db15c 100644
                        --- a/jdk/src/java.management/share/classes/javax/management/remote/package.html
                        +++ b/jdk/src/java.management/share/classes/javax/management/remote/package.html
                        @@ -1,6 +1,6 @@
                         
                         
                        -    JMX<sup><font size="-2">TM</font></sup> Remote API.
                        +    JMX™ Remote API.
                          ");
                        -                printThing(t);
                        -                out.println("
                        "); - } - } - - out.println("

                        Other Queries

                        "); - out.println("
                          "); - out.println("
                        • "); - printAnchorStart(); - out.print("\">"); - print("Show All Classes"); - out.println(""); - out.println("
                        "); - - endHtml(); - } -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java deleted file mode 100644 index 824501381f7..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 1997, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -import com.sun.tools.hat.internal.model.*; -import com.sun.tools.hat.internal.util.ArraySorter; -import com.sun.tools.hat.internal.util.Comparer; - -import java.util.Enumeration; - -/** - * - * @author Bill Foote - */ - - -class ClassQuery extends QueryHandler { - - - public ClassQuery() { - } - - public void run() { - startHtml("Class " + query); - JavaClass clazz = snapshot.findClass(query); - if (clazz == null) { - error("class not found: " + query); - } else { - printFullClass(clazz); - } - endHtml(); - } - - protected void printFullClass(JavaClass clazz) { - out.print("

                        "); - print(clazz.toString()); - out.println("

                        "); - - out.println("

                        Superclass:

                        "); - printClass(clazz.getSuperclass()); - - out.println("

                        Loader Details

                        "); - out.println("

                        ClassLoader:

                        "); - printThing(clazz.getLoader()); - - out.println("

                        Signers:

                        "); - printThing(clazz.getSigners()); - - out.println("

                        Protection Domain:

                        "); - printThing(clazz.getProtectionDomain()); - - out.println("

                        Subclasses:

                        "); - JavaClass[] sc = clazz.getSubclasses(); - for (int i = 0; i < sc.length; i++) { - out.print(" "); - printClass(sc[i]); - out.println("
                        "); - } - - out.println("

                        Instance Data Members:

                        "); - JavaField[] ff = clazz.getFields().clone(); - ArraySorter.sort(ff, new Comparer() { - public int compare(Object lhs, Object rhs) { - JavaField left = (JavaField) lhs; - JavaField right = (JavaField) rhs; - return left.getName().compareTo(right.getName()); - } - }); - for (int i = 0; i < ff.length; i++) { - out.print(" "); - printField(ff[i]); - out.println("
                        "); - } - - out.println("

                        Static Data Members:

                        "); - JavaStatic[] ss = clazz.getStatics(); - for (int i = 0; i < ss.length; i++) { - printStatic(ss[i]); - out.println("
                        "); - } - - out.println("

                        Instances

                        "); - - printAnchorStart(); - print("instances/" + encodeForURL(clazz)); - out.print("\">"); - out.println("Exclude subclasses
                        "); - - printAnchorStart(); - print("allInstances/" + encodeForURL(clazz)); - out.print("\">"); - out.println("Include subclasses
                        "); - - - if (snapshot.getHasNewSet()) { - out.println("

                        New Instances

                        "); - - printAnchorStart(); - print("newInstances/" + encodeForURL(clazz)); - out.print("\">"); - out.println("Exclude subclasses
                        "); - - printAnchorStart(); - print("allNewInstances/" + encodeForURL(clazz)); - out.print("\">"); - out.println("Include subclasses
                        "); - } - - out.println("

                        References summary by Type

                        "); - printAnchorStart(); - print("refsByType/" + encodeForURL(clazz)); - out.print("\">"); - out.println("References summary by type"); - - printReferencesTo(clazz); - } - - protected void printReferencesTo(JavaHeapObject obj) { - if (obj.getId() == -1) { - return; - } - out.println("

                        References to this object:

                        "); - out.flush(); - Enumeration referers = obj.getReferers(); - while (referers.hasMoreElements()) { - JavaHeapObject ref = (JavaHeapObject) referers.nextElement(); - printThing(ref); - print (" : " + ref.describeReferenceTo(obj, snapshot)); - // If there are more than one references, this only gets the - // first one. - out.println("
                        "); - } - - out.println("

                        Other Queries

                        "); - out.println("Reference Chains from Rootset"); - long id = obj.getId(); - - out.print("
                        • "); - printAnchorStart(); - out.print("roots/"); - printHex(id); - out.print("\">"); - out.println("Exclude weak refs"); - - out.print("
                        • "); - printAnchorStart(); - out.print("allRoots/"); - printHex(id); - out.print("\">"); - out.println("Include weak refs
                        "); - - printAnchorStart(); - out.print("reachableFrom/"); - printHex(id); - out.print("\">"); - out.println("Objects reachable from here
                        "); - } - - -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java deleted file mode 100644 index a717c7aa38c..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 1997, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -import com.sun.tools.hat.internal.model.*; -import java.util.*; - -public class FinalizerObjectsQuery extends QueryHandler { - public void run() { - Enumeration objs = snapshot.getFinalizerObjects(); - startHtml("Objects pending finalization"); - - out.println("Finalizer summary"); - - out.println("

                        Objects pending finalization

                        "); - - while (objs.hasMoreElements()) { - printThing((JavaHeapObject)objs.nextElement()); - out.println("
                        "); - } - - endHtml(); - } -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java deleted file mode 100644 index c1aa35bce55..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 1997, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -import com.sun.tools.hat.internal.model.*; -import java.util.*; - -public class FinalizerSummaryQuery extends QueryHandler { - public void run() { - Enumeration objs = snapshot.getFinalizerObjects(); - startHtml("Finalizer Summary"); - - out.println("

                        "); - out.println("All Classes (excluding platform)"); - out.println("

                        "); - - printFinalizerSummary(objs); - endHtml(); - } - - private static class HistogramElement { - public HistogramElement(JavaClass clazz) { - this.clazz = clazz; - } - - public void updateCount() { - this.count++; - } - - public int compare(HistogramElement other) { - long diff = other.count - count; - return (diff == 0L)? 0 : ((diff > 0L)? +1 : -1); - } - - public JavaClass getClazz() { - return clazz; - } - - public long getCount() { - return count; - } - - private JavaClass clazz; - private long count; - } - - private void printFinalizerSummary(Enumeration objs) { - int count = 0; - Map map = new HashMap(); - - while (objs.hasMoreElements()) { - JavaHeapObject obj = (JavaHeapObject) objs.nextElement(); - count++; - JavaClass clazz = obj.getClazz(); - if (! map.containsKey(clazz)) { - map.put(clazz, new HistogramElement(clazz)); - } - HistogramElement element = map.get(clazz); - element.updateCount(); - } - - out.println("

                        "); - out.println(""); - out.println("Total "); - if (count != 0) { - out.print("instances"); - } else { - out.print("instances"); - } - out.println(" pending finalization: "); - out.print(count); - out.println("


                        "); - - if (count == 0) { - return; - } - - // calculate and print histogram - HistogramElement[] elements = new HistogramElement[map.size()]; - map.values().toArray(elements); - Arrays.sort(elements, new Comparator() { - public int compare(HistogramElement o1, HistogramElement o2) { - return o1.compare(o2); - } - }); - - out.println(""); - out.println(""); - for (int j = 0; j < elements.length; j++) { - out.println(""); - } - out.println("
                        CountClass
                        "); - out.println(elements[j].getCount()); - out.println(""); - printClass(elements[j].getClazz()); - out.println("
                        "); - } -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/HistogramQuery.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/HistogramQuery.java deleted file mode 100644 index 58431debf9c..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/HistogramQuery.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1997, 2008, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -import com.sun.tools.hat.internal.model.JavaClass; -import java.util.Arrays; -import java.util.Comparator; - -/** - * Prints histogram sortable by class name, count and size. - * - */ -public class HistogramQuery extends QueryHandler { - public void run() { - JavaClass[] classes = snapshot.getClassesArray(); - Comparator comparator; - if (query.equals("count")) { - comparator = new Comparator() { - public int compare(JavaClass first, JavaClass second) { - long diff = (second.getInstancesCount(false) - - first.getInstancesCount(false)); - return (diff == 0)? 0: ((diff < 0)? -1 : + 1); - } - }; - } else if (query.equals("class")) { - comparator = new Comparator() { - public int compare(JavaClass first, JavaClass second) { - return first.getName().compareTo(second.getName()); - } - }; - } else { - // default sort is by total size - comparator = new Comparator() { - public int compare(JavaClass first, JavaClass second) { - long diff = (second.getTotalInstanceSize() - - first.getTotalInstanceSize()); - return (diff == 0)? 0: ((diff < 0)? -1 : + 1); - } - }; - } - Arrays.sort(classes, comparator); - - startHtml("Heap Histogram"); - - out.println("

                        "); - out.println("All Classes (excluding platform)"); - out.println("

                        "); - - out.println(""); - out.println(""); - out.println(""); - out.println(""); - for (int i = 0; i < classes.length; i++) { - JavaClass clazz = classes[i]; - out.println(""); - out.println(""); - out.println(""); - } - out.println("
                        ClassInstance CountTotal Size
                        "); - printClass(clazz); - out.println(""); - out.println(clazz.getInstancesCount(false)); - out.println(""); - out.println(clazz.getTotalInstanceSize()); - out.println("
                        "); - - endHtml(); - } -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/HttpReader.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/HttpReader.java deleted file mode 100644 index ba27ae3c974..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/HttpReader.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (c) 1997, 2013, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -/** - * Reads a single HTTP query from a socket, and starts up a QueryHandler - * to server it. - * - * @author Bill Foote - */ - - -import java.net.Socket; - -import java.io.InputStream; -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.BufferedWriter; -import java.io.PrintWriter; -import java.io.OutputStreamWriter; - -import com.sun.tools.hat.internal.model.Snapshot; -import com.sun.tools.hat.internal.oql.OQLEngine; -import com.sun.tools.hat.internal.util.Misc; - -public class HttpReader implements Runnable { - - - private Socket socket; - private PrintWriter out; - private Snapshot snapshot; - private OQLEngine engine; - - public HttpReader (Socket s, Snapshot snapshot, OQLEngine engine) { - this.socket = s; - this.snapshot = snapshot; - this.engine = engine; - } - - public void run() { - InputStream in = null; - try { - in = new BufferedInputStream(socket.getInputStream()); - out = new PrintWriter(new BufferedWriter( - new OutputStreamWriter( - socket.getOutputStream()))); - out.println("HTTP/1.0 200 OK"); - out.println("Cache-Control: no-cache"); - out.println("Pragma: no-cache"); - out.println(); - if (in.read() != 'G' || in.read() != 'E' - || in.read() != 'T' || in.read() != ' ') { - outputError("Protocol error"); - } - int data; - StringBuilder queryBuf = new StringBuilder(); - while ((data = in.read()) != -1 && data != ' ') { - char ch = (char) data; - queryBuf.append(ch); - } - String query = queryBuf.toString(); - query = java.net.URLDecoder.decode(query, "UTF-8"); - QueryHandler handler = null; - if (snapshot == null) { - outputError("The heap snapshot is still being read."); - return; - } else if (query.equals("/")) { - handler = new AllClassesQuery(true, engine != null); - handler.setUrlStart(""); - handler.setQuery(""); - } else if (query.startsWith("/oql/")) { - if (engine != null) { - handler = new OQLQuery(engine); - handler.setUrlStart(""); - handler.setQuery(query.substring(5)); - } - } else if (query.startsWith("/oqlhelp/")) { - if (engine != null) { - handler = new OQLHelp(); - handler.setUrlStart(""); - handler.setQuery(""); - } - } else if (query.equals("/allClassesWithPlatform/")) { - handler = new AllClassesQuery(false, engine != null); - handler.setUrlStart("../"); - handler.setQuery(""); - } else if (query.equals("/showRoots/")) { - handler = new AllRootsQuery(); - handler.setUrlStart("../"); - handler.setQuery(""); - } else if (query.equals("/showInstanceCounts/includePlatform/")) { - handler = new InstancesCountQuery(false); - handler.setUrlStart("../../"); - handler.setQuery(""); - } else if (query.equals("/showInstanceCounts/")) { - handler = new InstancesCountQuery(true); - handler.setUrlStart("../"); - handler.setQuery(""); - } else if (query.startsWith("/instances/")) { - handler = new InstancesQuery(false); - handler.setUrlStart("../"); - handler.setQuery(query.substring(11)); - } else if (query.startsWith("/newInstances/")) { - handler = new InstancesQuery(false, true); - handler.setUrlStart("../"); - handler.setQuery(query.substring(14)); - } else if (query.startsWith("/allInstances/")) { - handler = new InstancesQuery(true); - handler.setUrlStart("../"); - handler.setQuery(query.substring(14)); - } else if (query.startsWith("/allNewInstances/")) { - handler = new InstancesQuery(true, true); - handler.setUrlStart("../"); - handler.setQuery(query.substring(17)); - } else if (query.startsWith("/object/")) { - handler = new ObjectQuery(); - handler.setUrlStart("../"); - handler.setQuery(query.substring(8)); - } else if (query.startsWith("/class/")) { - handler = new ClassQuery(); - handler.setUrlStart("../"); - handler.setQuery(query.substring(7)); - } else if (query.startsWith("/roots/")) { - handler = new RootsQuery(false); - handler.setUrlStart("../"); - handler.setQuery(query.substring(7)); - } else if (query.startsWith("/allRoots/")) { - handler = new RootsQuery(true); - handler.setUrlStart("../"); - handler.setQuery(query.substring(10)); - } else if (query.startsWith("/reachableFrom/")) { - handler = new ReachableQuery(); - handler.setUrlStart("../"); - handler.setQuery(query.substring(15)); - } else if (query.startsWith("/rootStack/")) { - handler = new RootStackQuery(); - handler.setUrlStart("../"); - handler.setQuery(query.substring(11)); - } else if (query.startsWith("/histo/")) { - handler = new HistogramQuery(); - handler.setUrlStart("../"); - handler.setQuery(query.substring(7)); - } else if (query.startsWith("/refsByType/")) { - handler = new RefsByTypeQuery(); - handler.setUrlStart("../"); - handler.setQuery(query.substring(12)); - } else if (query.startsWith("/finalizerSummary/")) { - handler = new FinalizerSummaryQuery(); - handler.setUrlStart("../"); - handler.setQuery(""); - } else if (query.startsWith("/finalizerObjects/")) { - handler = new FinalizerObjectsQuery(); - handler.setUrlStart("../"); - handler.setQuery(""); - } - - if (handler != null) { - handler.setOutput(out); - handler.setSnapshot(snapshot); - handler.run(); - } else { - outputError("Query '" + query + "' not implemented"); - } - } catch (IOException ex) { - ex.printStackTrace(); - } finally { - if (out != null) { - out.close(); - } - try { - if (in != null) { - in.close(); - } - } catch (IOException ignored) { - } - try { - socket.close(); - } catch (IOException ignored) { - } - } - } - - private void outputError(String msg) { - out.println(); - out.println(""); - out.println(Misc.encodeHtml(msg)); - out.println(""); - } - -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java deleted file mode 100644 index 311df7bbb26..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (c) 1997, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -import com.sun.tools.hat.internal.model.*; -import com.sun.tools.hat.internal.util.ArraySorter; -import com.sun.tools.hat.internal.util.Comparer; -import java.util.Enumeration; - -/** - * - * @author Bill Foote - */ - - -class InstancesCountQuery extends QueryHandler { - - - private boolean excludePlatform; - - public InstancesCountQuery(boolean excludePlatform) { - this.excludePlatform = excludePlatform; - } - - public void run() { - if (excludePlatform) { - startHtml("Instance Counts for All Classes (excluding platform)"); - } else { - startHtml("Instance Counts for All Classes (including platform)"); - } - - JavaClass[] classes = snapshot.getClassesArray(); - if (excludePlatform) { - int num = 0; - for (int i = 0; i < classes.length; i++) { - if (! PlatformClasses.isPlatformClass(classes[i])) { - classes[num++] = classes[i]; - } - } - JavaClass[] tmp = new JavaClass[num]; - System.arraycopy(classes, 0, tmp, 0, tmp.length); - classes = tmp; - } - ArraySorter.sort(classes, new Comparer() { - public int compare(Object lhso, Object rhso) { - JavaClass lhs = (JavaClass) lhso; - JavaClass rhs = (JavaClass) rhso; - int diff = lhs.getInstancesCount(false) - - rhs.getInstancesCount(false); - if (diff != 0) { - return -diff; // Sort from biggest to smallest - } - String left = lhs.getName(); - String right = rhs.getName(); - if (left.startsWith("[") != right.startsWith("[")) { - // Arrays at the end - if (left.startsWith("[")) { - return 1; - } else { - return -1; - } - } - return left.compareTo(right); - } - }); - - String lastPackage = null; - long totalSize = 0; - long instances = 0; - for (int i = 0; i < classes.length; i++) { - JavaClass clazz = classes[i]; - int count = clazz.getInstancesCount(false); - print("" + count); - printAnchorStart(); - print("instances/" + encodeForURL(classes[i])); - out.print("\"> "); - if (count == 1) { - print("instance"); - } else { - print("instances"); - } - out.print(" "); - if (snapshot.getHasNewSet()) { - Enumeration objects = clazz.getInstances(false); - int newInst = 0; - while (objects.hasMoreElements()) { - JavaHeapObject obj = objects.nextElement(); - if (obj.isNew()) { - newInst++; - } - } - print("("); - printAnchorStart(); - print("newInstances/" + encodeForURL(classes[i])); - out.print("\">"); - print("" + newInst + " new"); - out.print(") "); - } - print("of "); - printClass(classes[i]); - out.println("
                        "); - instances += count; - totalSize += classes[i].getTotalInstanceSize(); - } - out.println("

                        Total of " + instances + " instances occupying " + totalSize + " bytes.

                        "); - - out.println("

                        Other Queries

                        "); - out.println("
                          "); - - out.print("
                        • "); - printAnchorStart(); - if (!excludePlatform) { - out.print("showInstanceCounts/\">"); - print("Show instance counts for all classes (excluding platform)"); - } else { - out.print("showInstanceCounts/includePlatform/\">"); - print("Show instance counts for all classes (including platform)"); - } - out.println(""); - - out.print("
                        • "); - printAnchorStart(); - out.print("allClassesWithPlatform/\">"); - print("Show All Classes (including platform)"); - out.println(""); - - out.print("
                        • "); - printAnchorStart(); - out.print("\">"); - print("Show All Classes (excluding platform)"); - out.println(""); - - out.println("
                        "); - - endHtml(); - } - - -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java deleted file mode 100644 index 7532b0b2e62..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 1997, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -import com.sun.tools.hat.internal.model.*; -import java.util.Enumeration; - -/** - * - * @author Bill Foote - */ - - -class InstancesQuery extends QueryHandler { - - private boolean includeSubclasses; - private boolean newObjects; - - public InstancesQuery(boolean includeSubclasses) { - this.includeSubclasses = includeSubclasses; - } - - public InstancesQuery(boolean includeSubclasses, boolean newObjects) { - this.includeSubclasses = includeSubclasses; - this.newObjects = newObjects; - } - - public void run() { - JavaClass clazz = snapshot.findClass(query); - String instancesOf; - if (newObjects) - instancesOf = "New instances of "; - else - instancesOf = "Instances of "; - if (includeSubclasses) { - startHtml(instancesOf + query + " (including subclasses)"); - } else { - startHtml(instancesOf + query); - } - if (clazz == null) { - error("Class not found"); - } else { - out.print(""); - printClass(clazz); - out.print("

                        "); - Enumeration objects = clazz.getInstances(includeSubclasses); - long totalSize = 0; - long instances = 0; - while (objects.hasMoreElements()) { - JavaHeapObject obj = objects.nextElement(); - if (newObjects && !obj.isNew()) - continue; - printThing(obj); - out.println("
                        "); - totalSize += obj.getSize(); - instances++; - } - out.println("

                        Total of " + instances + " instances occupying " + totalSize + " bytes.

                        "); - } - endHtml(); - } -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java deleted file mode 100644 index 9a40d8364df..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 1997, 2013, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -import java.io.*; - -/** - * This handles Object Query Language (OQL) help. - * - * @author A. Sundararajan - */ - -class OQLHelp extends QueryHandler { - - public OQLHelp() { - } - - public void run() { - InputStream is = getClass().getResourceAsStream("/com/sun/tools/hat/resources/oqlhelp.html"); - int ch = -1; - try { - is = new BufferedInputStream(is); - while ( (ch = is.read()) != -1) { - out.print((char)ch); - } - } catch (Exception exp) { - printException(exp); - } - } -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java deleted file mode 100644 index c21493c520f..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 1997, 2013, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -import com.sun.tools.hat.internal.oql.*; - -/** - * This handles Object Query Language (OQL) queries. - * - * @author A. Sundararajan - */ - -class OQLQuery extends QueryHandler { - - public OQLQuery(OQLEngine engine) { - this.engine = engine; - } - - public void run() { - startHtml("Object Query Language (OQL) query"); - String oql = null; - if (query != null && !query.equals("")) { - int index = query.indexOf("?query="); - if (index != -1 && query.length() > 7) { - oql = query.substring(index + 7); - } - } - out.println("

                        "); - out.println(""); - out.println(""); - out.println("
                        "); - out.println("All Classes (excluding platform)"); - out.println("OQL Help

                        "); - out.println("
                        "); - out.println("

                        "); - out.println(""); - out.println("

                        "); - out.println("

                        "); - out.println(""); - out.println("

                        "); - out.println("
                        "); - if (oql != null) { - executeQuery(oql); - } - endHtml(); - } - - private void executeQuery(String q) { - try { - out.println(""); - engine.executeQuery(q, new ObjectVisitor() { - public boolean visit(Object o) { - out.println(""); - return false; - } - }); - out.println("
                        "); - try { - out.println(engine.toHtml(o)); - } catch (Exception e) { - printException(e); - } - out.println("
                        "); - } catch (OQLException exp) { - printException(exp); - } - } - - private OQLEngine engine; -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/ObjectQuery.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/ObjectQuery.java deleted file mode 100644 index 208b250fbf8..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/ObjectQuery.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 1997, 2008, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -import java.util.Enumeration; - -import com.sun.tools.hat.internal.model.*; -import com.sun.tools.hat.internal.util.ArraySorter; -import com.sun.tools.hat.internal.util.Comparer; - -/** - * - * @author Bill Foote - */ - - -class ObjectQuery extends ClassQuery { - // We inherit printFullClass from ClassQuery - - public ObjectQuery() { - } - - public void run() { - startHtml("Object at " + query); - long id = parseHex(query); - JavaHeapObject thing = snapshot.findThing(id); - // - // In the following, I suppose we really should use a visitor - // pattern. I'm not that strongly motivated to do this, however: - // This is the only typecase there is, and the default for an - // unrecognized type is to do something reasonable. - // - if (thing == null) { - error("object not found"); - } else if (thing instanceof JavaClass) { - printFullClass((JavaClass) thing); - } else if (thing instanceof JavaValueArray) { - print(((JavaValueArray) thing).valueString(true)); - printAllocationSite(thing); - printReferencesTo(thing); - } else if (thing instanceof JavaObjectArray) { - printFullObjectArray((JavaObjectArray) thing); - printAllocationSite(thing); - printReferencesTo(thing); - } else if (thing instanceof JavaObject) { - printFullObject((JavaObject) thing); - printAllocationSite(thing); - printReferencesTo(thing); - } else { - // We should never get here - print(thing.toString()); - printReferencesTo(thing); - } - endHtml(); - } - - - private void printFullObject(JavaObject obj) { - out.print("

                        instance of "); - print(obj.toString()); - out.print(" (" + obj.getSize() + " bytes)"); - out.println("

                        \n"); - - out.println("

                        Class:

                        "); - printClass(obj.getClazz()); - - out.println("

                        Instance data members:

                        "); - final JavaThing[] things = obj.getFields(); - final JavaField[] fields = obj.getClazz().getFieldsForInstance(); - Integer[] hack = new Integer[things.length]; - for (int i = 0; i < things.length; i++) { - hack[i] = i; - } - ArraySorter.sort(hack, new Comparer() { - public int compare(Object lhs, Object rhs) { - JavaField left = fields[((Integer) lhs).intValue()]; - JavaField right = fields[((Integer) rhs).intValue()]; - return left.getName().compareTo(right.getName()); - } - }); - for (int i = 0; i < things.length; i++) { - int index = hack[i].intValue(); - printField(fields[index]); - out.print(" : "); - printThing(things[index]); - out.println("
                        "); - } - } - - private void printFullObjectArray(JavaObjectArray arr) { - JavaThing[] elements = arr.getElements(); - out.println("

                        Array of " + elements.length + " objects

                        "); - - out.println("

                        Class:

                        "); - printClass(arr.getClazz()); - - out.println("

                        Values

                        "); - for (int i = 0; i < elements.length; i++) { - out.print("" + i + " : "); - printThing(elements[i]); - out.println("
                        "); - } - } - - // - // Print the StackTrace where this was allocated - // - private void printAllocationSite(JavaHeapObject obj) { - StackTrace trace = obj.getAllocatedFrom(); - if (trace == null || trace.getFrames().length == 0) { - return; - } - out.println("

                        Object allocated from:

                        "); - printStackTrace(trace); - } -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/PlatformClasses.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/PlatformClasses.java deleted file mode 100644 index ef735b0fa04..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/PlatformClasses.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 1997, 2008, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -import com.sun.tools.hat.internal.model.JavaClass; -import com.sun.tools.hat.internal.model.Snapshot; - -import java.util.LinkedList; -import java.io.InputStream; -import java.io.Reader; -import java.io.InputStreamReader; -import java.io.BufferedReader; -import java.io.IOException; - -/** - * This class is a helper that determines if a class is a "platform" - * class or not. It's a platform class if its name starts with one of - * the prefixes to be found in /com/sun/tools/hat/resources/platform_names.txt. - * - * @author Bill Foote - */ - -public class PlatformClasses { - - static String[] names = null; - - - public static synchronized String[] getNames() { - if (names == null) { - LinkedList list = new LinkedList(); - InputStream str - = PlatformClasses.class - .getResourceAsStream("/com/sun/tools/hat/resources/platform_names.txt"); - if (str != null) { - try { - BufferedReader rdr - = new BufferedReader(new InputStreamReader(str)); - for (;;) { - String s = rdr.readLine(); - if (s == null) { - break; - } else if (s.length() > 0) { - list.add(s); - } - } - rdr.close(); - str.close(); - } catch (IOException ex) { - ex.printStackTrace(); - // Shouldn't happen, and if it does, continuing - // is the right thing to do anyway. - } - } - names = list.toArray(new String[list.size()]); - } - return names; - } - - - public static boolean isPlatformClass(JavaClass clazz) { - // all classes loaded by bootstrap loader are considered - // platform classes. In addition, the older name based filtering - // is also done for compatibility. - if (clazz.isBootstrap()) { - return true; - } - - String name = clazz.getName(); - // skip even the array classes of the skipped classes. - if (name.startsWith("[")) { - int index = name.lastIndexOf('['); - if (index != -1) { - if (name.charAt(index + 1) != 'L') { - // some primitive array. - return true; - } - // skip upto 'L' after the last '['. - name = name.substring(index + 2); - } - } - String[] nms = getNames(); - for (int i = 0; i < nms.length; i++) { - if (name.startsWith(nms[i])) { - return true; - } - } - return false; - } -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java deleted file mode 100644 index 3db09be7418..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (c) 1997, 2013, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -import java.io.PrintWriter; - -import com.sun.tools.hat.internal.model.*; -import com.sun.tools.hat.internal.util.Misc; -import java.io.StringWriter; - -import java.net.URLEncoder; -import java.io.UnsupportedEncodingException; - -/** - * - * @author Bill Foote - */ - - -abstract class QueryHandler { - - protected String urlStart; - protected String query; - protected PrintWriter out; - protected Snapshot snapshot; - - abstract void run(); - - - void setUrlStart(String s) { - urlStart = s; - } - - void setQuery(String s) { - query = s; - } - - void setOutput(PrintWriter o) { - this.out = o; - } - - void setSnapshot(Snapshot ss) { - this.snapshot = ss; - } - - protected String encodeForURL(String s) { - try { - s = URLEncoder.encode(s, "UTF-8"); - } catch (UnsupportedEncodingException ex) { - // Should never happen - ex.printStackTrace(); - } - return s; - } - - protected void startHtml(String title) { - out.print(""); - print(title); - out.println(""); - out.println("

                        "); - print(title); - out.println("

                        "); - } - - protected void endHtml() { - out.println(""); - } - - protected void error(String msg) { - println(msg); - } - - protected void printAnchorStart() { - out.print(""); - } - - protected void printObject(JavaObject obj) { - printThing(obj); - } - - protected void printThing(JavaThing thing) { - if (thing == null) { - out.print("null"); - return; - } - if (thing instanceof JavaHeapObject) { - JavaHeapObject ho = (JavaHeapObject) thing; - long id = ho.getId(); - if (id != -1L) { - if (ho.isNew()) - out.println(""); - printThingAnchorTag(id); - } - print(thing.toString()); - if (id != -1) { - if (ho.isNew()) - out.println("[new]"); - out.print(" (" + ho.getSize() + " bytes)"); - out.println(""); - } - } else { - print(thing.toString()); - } - } - - protected void printRoot(Root root) { - StackTrace st = root.getStackTrace(); - boolean traceAvailable = (st != null) && (st.getFrames().length != 0); - if (traceAvailable) { - printAnchorStart(); - out.print("rootStack/"); - printHex(root.getIndex()); - out.print("\">"); - } - print(root.getDescription()); - if (traceAvailable) { - out.print(""); - } - } - - protected void printClass(JavaClass clazz) { - if (clazz == null) { - out.println("null"); - return; - } - printAnchorStart(); - out.print("class/"); - print(encodeForURL(clazz)); - out.print("\">"); - print(clazz.toString()); - out.println(""); - } - - protected String encodeForURL(JavaClass clazz) { - if (clazz.getId() == -1) { - return encodeForURL(clazz.getName()); - } else { - return clazz.getIdString(); - } - } - - protected void printField(JavaField field) { - print(field.getName() + " (" + field.getSignature() + ")"); - } - - protected void printStatic(JavaStatic member) { - JavaField f = member.getField(); - printField(f); - out.print(" : "); - if (f.hasId()) { - JavaThing t = member.getValue(); - printThing(t); - } else { - print(member.getValue().toString()); - } - } - - protected void printStackTrace(StackTrace trace) { - StackFrame[] frames = trace.getFrames(); - for (int i = 0; i < frames.length; i++) { - StackFrame f = frames[i]; - String clazz = f.getClassName(); - out.print(""); - print(clazz); - out.print(""); - print("." + f.getMethodName() + "(" + f.getMethodSignature() + ")"); - out.print(" : "); - print(f.getSourceFileName() + " line " + f.getLineNumber()); - out.println("
                        "); - } - } - - protected void printException(Throwable t) { - println(t.getMessage()); - out.println("
                        ");
                        -        StringWriter sw = new StringWriter();
                        -        t.printStackTrace(new PrintWriter(sw));
                        -        print(sw.toString());
                        -        out.println("
                        "); - } - - protected void printHex(long addr) { - if (snapshot.getIdentifierSize() == 4) { - out.print(Misc.toHex((int)addr)); - } else { - out.print(Misc.toHex(addr)); - } - } - - protected long parseHex(String value) { - return Misc.parseHex(value); - } - - protected void print(String str) { - out.print(Misc.encodeHtml(str)); - } - - protected void println(String str) { - out.println(Misc.encodeHtml(str)); - } -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/QueryListener.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/QueryListener.java deleted file mode 100644 index b0b7c6855a3..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/QueryListener.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 1997, 2008, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -/** - * - * @author Bill Foote - */ - - -import java.net.Socket; -import java.net.ServerSocket; -import java.net.InetAddress; - -import java.io.InputStream; -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.Writer; -import java.io.BufferedWriter; -import java.io.PrintWriter; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.BufferedOutputStream; - -import com.sun.tools.hat.internal.model.Snapshot; -import com.sun.tools.hat.internal.oql.OQLEngine; - -public class QueryListener implements Runnable { - - - private Snapshot snapshot; - private OQLEngine engine; - private int port; - - public QueryListener(int port) { - this.port = port; - this.snapshot = null; // Client will setModel when it's ready - this.engine = null; // created when snapshot is set - } - - public void setModel(Snapshot ss) { - this.snapshot = ss; - if (OQLEngine.isOQLSupported()) { - this.engine = new OQLEngine(ss); - } - } - - public void run() { - try { - waitForRequests(); - } catch (IOException ex) { - ex.printStackTrace(); - System.exit(1); - } - } - - private void waitForRequests() throws IOException { - ServerSocket ss = new ServerSocket(port); - Thread last = null; - for (;;) { - Socket s = ss.accept(); - Thread t = new Thread(new HttpReader(s, snapshot, engine)); - if (snapshot == null) { - t.setPriority(Thread.NORM_PRIORITY+1); - } else { - t.setPriority(Thread.NORM_PRIORITY-1); - if (last != null) { - try { - last.setPriority(Thread.NORM_PRIORITY-2); - } catch (Throwable ignored) { - } - // If the thread is no longer alive, we'll get a - // NullPointerException - } - } - t.start(); - last = t; - } - } - -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/ReachableQuery.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/ReachableQuery.java deleted file mode 100644 index f6e4ab54ba0..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/ReachableQuery.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1997, 2008, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -import com.sun.tools.hat.internal.model.*; - -/** - * - * @author Bill Foote - */ - - -class ReachableQuery extends QueryHandler { - // We inherit printFullClass from ClassQuery - - - public ReachableQuery() { - } - - public void run() { - startHtml("Objects Reachable From " + query); - long id = parseHex(query); - JavaHeapObject root = snapshot.findThing(id); - ReachableObjects ro = new ReachableObjects(root, - snapshot.getReachableExcludes()); - // Now, print out the sorted list, but start with root - long totalSize = ro.getTotalSize(); - JavaThing[] things = ro.getReachables(); - long instances = things.length; - - out.print(""); - printThing(root); - out.println("
                        "); - out.println("
                        "); - for (int i = 0; i < things.length; i++) { - printThing(things[i]); - out.println("
                        "); - } - - printFields(ro.getUsedFields(), "Data Members Followed"); - printFields(ro.getExcludedFields(), "Excluded Data Members"); - out.println("

                        Total of " + instances + " instances occupying " + totalSize + " bytes.

                        "); - - endHtml(); - } - - private void printFields(String[] fields, String title) { - if (fields.length == 0) { - return; - } - out.print("

                        "); - print(title); - out.println("

                        "); - - for (int i = 0; i < fields.length; i++) { - print(fields[i]); - out.println("
                        "); - } - } -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java deleted file mode 100644 index 15f7ae8b492..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 1997, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -import com.sun.tools.hat.internal.model.*; -import java.util.*; - -/** - * References by type summary - * - */ -public class RefsByTypeQuery extends QueryHandler { - public void run() { - JavaClass clazz = snapshot.findClass(query); - if (clazz == null) { - error("class not found: " + query); - } else { - Map referrersStat = new HashMap(); - final Map refereesStat = new HashMap(); - Enumeration instances = clazz.getInstances(false); - while (instances.hasMoreElements()) { - JavaHeapObject instance = instances.nextElement(); - if (instance.getId() == -1) { - continue; - } - Enumeration e = instance.getReferers(); - while (e.hasMoreElements()) { - JavaHeapObject ref = (JavaHeapObject)e.nextElement(); - JavaClass cl = ref.getClazz(); - if (cl == null) { - System.out.println("null class for " + ref); - continue; - } - Long count = referrersStat.get(cl); - if (count == null) { - count = 1L; - } else { - count = count + 1L; - } - referrersStat.put(cl, count); - } - instance.visitReferencedObjects( - new AbstractJavaHeapObjectVisitor() { - public void visit(JavaHeapObject obj) { - JavaClass cl = obj.getClazz(); - Long count = refereesStat.get(cl); - if (count == null) { - count = 1L; - } else { - count = count + 1L; - } - refereesStat.put(cl, count); - } - } - ); - } // for each instance - - startHtml("References by Type"); - out.println("

                        "); - printClass(clazz); - if (clazz.getId() != -1) { - println("[" + clazz.getIdString() + "]"); - } - out.println("

                        "); - - if (referrersStat.size() != 0) { - out.println("

                        Referrers by Type

                        "); - print(referrersStat); - } - - if (refereesStat.size() != 0) { - out.println("

                        Referees by Type

                        "); - print(refereesStat); - } - - endHtml(); - } // clazz != null - } // run - - private void print(final Map map) { - out.println(""); - Set keys = map.keySet(); - JavaClass[] classes = new JavaClass[keys.size()]; - keys.toArray(classes); - Arrays.sort(classes, new Comparator() { - public int compare(JavaClass first, JavaClass second) { - Long count1 = map.get(first); - Long count2 = map.get(second); - return count2.compareTo(count1); - } - }); - - out.println(""); - for (int i = 0; i < classes.length; i++) { - JavaClass clazz = classes[i]; - out.println(""); - } - out.println("
                        ClassCount
                        "); - out.print(""); - print(clazz.getName()); - out.println(""); - out.println(""); - out.println(map.get(clazz)); - out.println("
                        "); - } -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/RootStackQuery.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/RootStackQuery.java deleted file mode 100644 index 30f9e4cdc03..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/RootStackQuery.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 1997, 2008, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - - -import com.sun.tools.hat.internal.model.*; - -/** - * Query to show the StackTrace for a given root - * - * @author Bill Foote - */ - - -class RootStackQuery extends QueryHandler { - - public RootStackQuery() { - } - - public void run() { - int index = (int) parseHex(query); - Root root = snapshot.getRootAt(index); - if (root == null) { - error("Root at " + index + " not found"); - return; - } - StackTrace st = root.getStackTrace(); - if (st == null || st.getFrames().length == 0) { - error("No stack trace for " + root.getDescription()); - return; - } - startHtml("Stack Trace for " + root.getDescription()); - out.println("

                        "); - printStackTrace(st); - out.println("

                        "); - endHtml(); - } - -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/RootsQuery.java b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/RootsQuery.java deleted file mode 100644 index 2ab8d61bbda..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/internal/server/RootsQuery.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 1997, 2008, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -package com.sun.tools.hat.internal.server; - -import java.util.Vector; - -import com.sun.tools.hat.internal.model.*; -import com.sun.tools.hat.internal.util.ArraySorter; -import com.sun.tools.hat.internal.util.Comparer; - -/** - * - * @author Bill Foote - */ - - -class RootsQuery extends QueryHandler { - - private boolean includeWeak; - - public RootsQuery(boolean includeWeak) { - this.includeWeak = includeWeak; - } - - public void run() { - long id = parseHex(query); - JavaHeapObject target = snapshot.findThing(id); - if (target == null) { - startHtml("Object not found for rootset"); - error("object not found"); - endHtml(); - return; - } - if (includeWeak) { - startHtml("Rootset references to " + target - + " (includes weak refs)"); - } else { - startHtml("Rootset references to " + target - + " (excludes weak refs)"); - } - out.flush(); - - ReferenceChain[] refs - = snapshot.rootsetReferencesTo(target, includeWeak); - ArraySorter.sort(refs, new Comparer() { - public int compare(Object lhs, Object rhs) { - ReferenceChain left = (ReferenceChain) lhs; - ReferenceChain right = (ReferenceChain) rhs; - Root leftR = left.getObj().getRoot(); - Root rightR = right.getObj().getRoot(); - int d = leftR.getType() - rightR.getType(); - if (d != 0) { - return -d; // More interesting values are *higher* - } - return left.getDepth() - right.getDepth(); - } - }); - - out.print("

                        References to "); - printThing(target); - out.println("

                        "); - int lastType = Root.INVALID_TYPE; - for (int i= 0; i < refs.length; i++) { - ReferenceChain ref = refs[i]; - Root root = ref.getObj().getRoot(); - if (root.getType() != lastType) { - lastType = root.getType(); - out.print("

                        "); - print(root.getTypeName() + " References"); - out.println("

                        "); - } - out.print("

                        "); - printRoot(root); - if (root.getReferer() != null) { - out.print(" (from "); - printThingAnchorTag(root.getReferer().getId()); - print(root.getReferer().toString()); - out.print(")"); - - } - out.print(" :

                        "); - while (ref != null) { - ReferenceChain next = ref.getNext(); - JavaHeapObject obj = ref.getObj(); - print("--> "); - printThing(obj); - if (next != null) { - print(" (" + - obj.describeReferenceTo(next.getObj(), snapshot) - + ":)"); - } - out.println("
                        "); - ref = next; - } - } - - out.println("

                        Other queries

                        "); - - if (includeWeak) { - printAnchorStart(); - out.print("roots/"); - printHex(id); - out.print("\">"); - out.println("Exclude weak refs
                        "); - endHtml(); - } - - if (!includeWeak) { - printAnchorStart(); - out.print("allRoots/"); - printHex(id); - out.print("\">"); - out.println("Include weak refs
                        "); - } - } - -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/resources/hat.js b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/resources/hat.js deleted file mode 100644 index c8ef946caf0..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/resources/hat.js +++ /dev/null @@ -1,1473 +0,0 @@ -/* - * Copyright (c) 2005, 2013, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * The Original Code is HAT. The Initial Developer of the - * Original Code is Bill Foote, with contributions from others - * at JavaSoft/Sun. - */ - -var hatPkg = Packages.com.sun.tools.hat.internal; - -/** - * This is JavaScript interface for heap analysis using HAT - * (Heap Analysis Tool). HAT classes are referred from - * this file. In particular, refer to classes in hat.model - * package. - * - * HAT model objects are wrapped as convenient script objects so that - * fields may be accessed in natural syntax. For eg. Java fields can be - * accessed with obj.field_name syntax and array elements can be accessed - * with array[index] syntax. - */ - -// returns an enumeration that wraps elements of -// the input enumeration elements. -function wrapperEnumeration(e) { - return new java.util.Enumeration() { - hasMoreElements: function() { - return e.hasMoreElements(); - }, - nextElement: function() { - return wrapJavaValue(e.nextElement()); - } - }; -} - -// returns an enumeration that filters out elements -// of input enumeration using the filter function. -function filterEnumeration(e, func, wrap) { - var next = undefined; - var index = 0; - - function findNext() { - var tmp; - while (e.hasMoreElements()) { - tmp = e.nextElement(); - index++; - if (wrap) { - tmp = wrapJavaValue(tmp); - } - if (func(tmp, index, e)) { - next = tmp; - return; - } - } - } - - return new java.util.Enumeration() { - hasMoreElements: function() { - findNext(); - return next != undefined; - }, - - nextElement: function() { - if (next == undefined) { - // user may not have called hasMoreElements? - findNext(); - } - if (next == undefined) { - throw "NoSuchElementException"; - } - var res = next; - next = undefined; - return res; - } - }; -} - -// enumeration that has no elements .. -var emptyEnumeration = new java.util.Enumeration() { - hasMoreElements: function() { - return false; - }, - nextElement: function() { - throw "NoSuchElementException"; - } - }; - -function wrapRoot(root) { - if (root) { - return { - id: root.idString, - description: root.description, - referrer: wrapJavaValue(root.referer), - type: root.typeName - }; - } else { - return null; - } -} - -function JavaClassProto() { - function jclass(obj) { - return obj['wrapped-object']; - } - - // return whether given class is subclass of this class or not - this.isSubclassOf = function(other) { - var tmp = jclass(this); - var otherid = objectid(other); - while (tmp != null) { - if (otherid.equals(tmp.idString)) { - return true; - } - tmp = tmp.superclass; - } - return false; - } - - // return whether given class is superclass of this class or not - this.isSuperclassOf = function(other) { - return other.isSubclassOf(this); - } - - // includes direct and indirect superclasses - this.superclasses = function() { - var res = new Array(); - var tmp = this.superclass; - while (tmp != null) { - res[res.length] = tmp; - tmp = tmp.superclass; - } - return res; - } - - /** - * Returns an array containing subclasses of this class. - * - * @param indirect should include indirect subclasses or not. - * default is true. - */ - this.subclasses = function(indirect) { - if (indirect == undefined) indirect = true; - var classes = jclass(this).subclasses; - var res = new Array(); - for (var i in classes) { - var subclass = wrapJavaValue(classes[i]); - res[res.length] = subclass; - if (indirect) { - res = res.concat(subclass.subclasses()); - } - } - return res; - } - this.toString = function() { return jclass(this).toString(); } -} - -var theJavaClassProto = new JavaClassProto(); - -// Script wrapper for HAT model objects, values. -// wraps a Java value as appropriate for script object -function wrapJavaValue(thing) { - if (thing == null || thing == undefined || - thing instanceof hatPkg.model.HackJavaValue) { - return null; - } - - if (thing instanceof hatPkg.model.JavaValue) { - // map primitive values to closest JavaScript primitives - if (thing instanceof hatPkg.model.JavaBoolean) { - return thing.toString() == "true"; - } else if (thing instanceof hatPkg.model.JavaChar) { - return thing.toString() + ''; - } else { - return java.lang.Double.parseDouble(thing.toString()); - } - } else { - // wrap Java object as script object - return wrapJavaObject(thing); - } -} - -// wrap Java object with appropriate script object -function wrapJavaObject(thing) { - - // HAT Java model object wrapper. Handles all cases - // (instance, object/primitive array and Class objects) - function javaObject(jobject) { - // FIXME: Do I need this? or can I assume that these would - // have been resolved already? - if (jobject instanceof hatPkg.model.JavaObjectRef) { - jobject = jobject.dereference(); - if (jobject instanceof hatPkg.model.HackJavaValue) { - print(jobject); - return null; - } - } - - if (jobject instanceof hatPkg.model.JavaObject) { - return new JavaObjectWrapper(jobject); - } else if (jobject instanceof hatPkg.model.JavaClass) { - return new JavaClassWrapper(jobject); - } else if (jobject instanceof hatPkg.model.JavaObjectArray) { - return new JavaObjectArrayWrapper(jobject); - } else if (jobject instanceof hatPkg.model.JavaValueArray) { - return new JavaValueArrayWrapper(jobject); - } else { - print("unknown heap object type: " + jobject.getClass()); - return jobject; - } - } - - // returns wrapper for Java instances - function JavaObjectWrapper(instance) { - var things = instance.fields; - var fields = instance.clazz.fieldsForInstance; - - // instance fields can be accessed in natural syntax - return new JSAdapter() { - __getIds__ : function() { - var res = new Array(fields.length); - for (var i in fields) { - res[i] = fields[i].name; - } - return res; - }, - __has__ : function(name) { - for (var i in fields) { - if (name == fields[i].name) return true; - } - return name == 'class' || name == 'toString' || - name == 'wrapped-object'; - }, - __get__ : function(name) { - - for (var i in fields) { - if(fields[i].name == name) { - return wrapJavaValue(things[i]); - } - } - - if (name == 'class') { - return wrapJavaValue(instance.clazz); - } else if (name == 'wrapped-object') { - return instance; - } - - return undefined; - }, - __call__: function(name) { - if (name == 'toString') { - return instance.toString(); - } else { - return undefined; - } - } - } - } - - - // return wrapper for Java Class objects - function JavaClassWrapper(jclass) { - var fields = jclass.statics; - - // to access static fields of given Class cl, use - // cl.statics. syntax - this.statics = new JSAdapter() { - __getIds__ : function() { - var res = new Array(fields.length); - for (var i in fields) { - res[i] = fields[i].field.name; - } - return res; - }, - __has__ : function(name) { - for (var i in fields) { - if (name == fields[i].field.name) { - return true; - } - } - return false; - }, - __get__ : function(name) { - for (var i in fields) { - if (name == fields[i].field.name) { - return wrapJavaValue(fields[i].value); - } - } - return undefined; - } - } - - if (jclass.superclass != null) { - this.superclass = wrapJavaValue(jclass.superclass); - } else { - this.superclass = null; - } - - this.loader = wrapJavaValue(jclass.getLoader()); - this.signers = wrapJavaValue(jclass.getSigners()); - this.protectionDomain = wrapJavaValue(jclass.getProtectionDomain()); - this.instanceSize = jclass.instanceSize; - this.name = jclass.name; - this.fields = jclass.fields; - this['wrapped-object'] = jclass; - } - - for (var i in theJavaClassProto) { - if (typeof theJavaClassProto[i] == 'function') { - JavaClassWrapper.prototype[i] = theJavaClassProto[i]; - } - } - - // returns wrapper for Java object arrays - function JavaObjectArrayWrapper(array) { - var elements = array.elements; - // array elements can be accessed in natural syntax - // also, 'length' property is supported. - return new JSAdapter() { - __getIds__ : function() { - var res = new Array(elements.length); - for (var i = 0; i < elements.length; i++) { - res[i] = String(i); - } - return res; - }, - __has__: function(name) { - return (name >= 0 && name < elements.length) || - name == 'length' || name == 'class' || - name == 'toString' || name == 'wrapped-object'; - }, - __get__ : function(name) { - if (name >= 0 && name < elements.length) { - return wrapJavaValue(elements[name]); - } else if (name == 'length') { - return elements.length; - } else if (name == 'class') { - return wrapJavaValue(array.clazz); - } else if (name == 'wrapped-object') { - return array; - } else { - return undefined; - } - }, - __call__: function(name) { - if (name == 'toString') { - return array.toString(); - } else { - return undefined; - } - } - } - } - - // returns wrapper for Java primitive arrays - function JavaValueArrayWrapper(array) { - var type = String(java.lang.Character.toString(array.elementType)); - var elements = array.elements; - // array elements can be accessed in natural syntax - // also, 'length' property is supported. - return new JSAdapter() { - __getIds__ : function() { - var r = new Array(array.length); - for (var i = 0; i < array.length; i++) { - r[i] = String(i); - } - return r; - }, - __has__: function(name) { - return (name >= 0 && name < array.length) || - name == 'length' || name == 'class' || - name == 'toString' || name == 'wrapped-object'; - }, - __get__: function(name) { - if (name >= 0 && name < array.length) { - return elements[name]; - } - - if (name == 'length') { - return array.length; - } else if (name == 'wrapped-object') { - return array; - } else if (name == 'class') { - return wrapJavaValue(array.clazz); - } else { - return undefined; - } - }, - __call__: function(name) { - if (name == 'toString') { - return array.valueString(true); - } else { - return undefined; - } - } - } - } - return javaObject(thing); -} - -// unwrap a script object to corresponding HAT object -function unwrapJavaObject(jobject) { - if (!(jobject instanceof hatPkg.model.JavaHeapObject)) { - try { - jobject = jobject["wrapped-object"]; - } catch (e) { - print("unwrapJavaObject: " + jobject + ", " + e); - jobject = undefined; - } - } - return jobject; -} - -/** - * readHeapDump parses a heap dump file and returns script wrapper object. - * - * @param file Heap dump file name - * @param stack flag to tell if allocation site traces are available - * @param refs flag to tell if backward references are needed or not - * @param debug debug level for HAT - * @return heap as a JavaScript object - */ -function readHeapDump(file, stack, refs, debug) { - - // default value of debug is 0 - if (!debug) debug = 0; - - // by default, we assume no stack traces - if (!stack) stack = false; - - // by default, backward references are resolved - if (!refs) refs = true; - - // read the heap dump - var heap = hatPkg.parser.HprofReader.readFile(file, stack, debug); - - // resolve it - heap.resolve(refs); - - // wrap Snapshot as convenient script object - return wrapHeapSnapshot(heap); -} - -/** - * The result object supports the following methods: - * - * forEachClass -- calls a callback for each Java Class - * forEachObject -- calls a callback for each Java object - * findClass -- finds Java Class of given name - * findObject -- finds object from given object id - * objects -- returns all objects of given class as an enumeration - * classes -- returns all classes in the heap as an enumeration - * reachables -- returns all objects reachable from a given object - * livepaths -- returns an array of live paths because of which an - * object alive. - * describeRef -- returns description for a reference from a 'from' - * object to a 'to' object. - */ -function wrapHeapSnapshot(heap) { - function getClazz(clazz) { - if (clazz == undefined) clazz = "java.lang.Object"; - var type = typeof(clazz); - if (type == "string") { - clazz = heap.findClass(clazz); - } else if (type == "object") { - clazz = unwrapJavaObject(clazz); - } else { - throw "class expected";; - } - return clazz; - } - - // return heap as a script object with useful methods. - return { - snapshot: heap, - - /** - * Class iteration: Calls callback function for each - * Java Class in the heap. Default callback function - * is 'print'. If callback returns true, the iteration - * is stopped. - * - * @param callback function to be called. - */ - forEachClass: function(callback) { - if (callback == undefined) callback = print; - var classes = this.snapshot.classes; - while (classes.hasMoreElements()) { - if (callback(wrapJavaValue(classes.nextElement()))) - return; - } - }, - - /** - * Returns an Enumeration of all roots. - */ - roots: function() { - var e = this.snapshot.roots; - return new java.util.Enumeration() { - hasMoreElements: function() { - return e.hasMoreElements(); - }, - nextElement: function() { - return wrapRoot(e.nextElement()); - } - }; - }, - - /** - * Returns an Enumeration for all Java classes. - */ - classes: function() { - return wrapIterator(this.snapshot.classes, true); - }, - - /** - * Object iteration: Calls callback function for each - * Java Object in the heap. Default callback function - * is 'print'.If callback returns true, the iteration - * is stopped. - * - * @param callback function to be called. - * @param clazz Class whose objects are retrieved. - * Optional, default is 'java.lang.Object' - * @param includeSubtypes flag to tell if objects of subtypes - * are included or not. optional, default is true. - */ - forEachObject: function(callback, clazz, includeSubtypes) { - if (includeSubtypes == undefined) includeSubtypes = true; - if (callback == undefined) callback = print; - clazz = getClazz(clazz); - - if (clazz) { - var instances = clazz.getInstances(includeSubtypes); - while (instances.hasNextElements()) { - if (callback(wrapJavaValue(instances.nextElement()))) - return; - } - } - }, - - /** - * Returns an enumeration of Java objects in the heap. - * - * @param clazz Class whose objects are retrieved. - * Optional, default is 'java.lang.Object' - * @param includeSubtypes flag to tell if objects of subtypes - * are included or not. optional, default is true. - * @param where (optional) filter expression or function to - * filter the objects. The expression has to return true - * to include object passed to it in the result array. - * Built-in variable 'it' refers to the current object in - * filter expression. - */ - objects: function(clazz, includeSubtypes, where) { - if (includeSubtypes == undefined) includeSubtypes = true; - if (where) { - if (typeof(where) == 'string') { - where = new Function("it", "return " + where); - } - } - clazz = getClazz(clazz); - if (clazz) { - var instances = clazz.getInstances(includeSubtypes); - if (where) { - return filterEnumeration(instances, where, true); - } else { - return wrapperEnumeration(instances); - } - } else { - return emptyEnumeration; - } - }, - - /** - * Find Java Class of given name. - * - * @param name class name - */ - findClass: function(name) { - var clazz = this.snapshot.findClass(name + ''); - return wrapJavaValue(clazz); - }, - - /** - * Find Java Object from given object id - * - * @param id object id as string - */ - findObject: function(id) { - return wrapJavaValue(this.snapshot.findThing(id)); - }, - - /** - * Returns an enumeration of objects in the finalizer - * queue waiting to be finalized. - */ - finalizables: function() { - var tmp = this.snapshot.getFinalizerObjects(); - return wrapperEnumeration(tmp); - }, - - /** - * Returns an array that contains objects referred from the - * given Java object directly or indirectly (i.e., all - * transitively referred objects are returned). - * - * @param jobject Java object whose reachables are returned. - */ - reachables: function (jobject) { - return reachables(jobject, this.snapshot.reachableExcludes); - }, - - /** - * Returns array of paths of references by which the given - * Java object is live. Each path itself is an array of - * objects in the chain of references. Each path supports - * toHtml method that returns html description of the path. - * - * @param jobject Java object whose live paths are returned - * @param weak flag to indicate whether to include paths with - * weak references or not. default is false. - */ - livepaths: function (jobject, weak) { - if (weak == undefined) { - weak = false; - } - - function wrapRefChain(refChain) { - var path = new Array(); - - // compute path array from refChain - var tmp = refChain; - while (tmp != null) { - var obj = tmp.obj; - path[path.length] = wrapJavaValue(obj); - tmp = tmp.next; - } - - function computeDescription(html) { - var root = refChain.obj.root; - var desc = root.description; - if (root.referer) { - var ref = root.referer; - desc += " (from " + - (html? toHtml(ref) : ref.toString()) + ')'; - } - desc += '->'; - var tmp = refChain; - while (tmp != null) { - var next = tmp.next; - var obj = tmp.obj; - desc += html? toHtml(obj) : obj.toString(); - if (next != null) { - desc += " (" + - obj.describeReferenceTo(next.obj, heap) + - ") ->"; - } - tmp = next; - } - return desc; - } - - return new JSAdapter() { - __getIds__ : function() { - var res = new Array(path.length); - for (var i = 0; i < path.length; i++) { - res[i] = String(i); - } - return res; - }, - __has__ : function (name) { - return (name >= 0 && name < path.length) || - name == 'length' || name == 'toHtml' || - name == 'toString'; - }, - __get__ : function(name) { - if (name >= 0 && name < path.length) { - return path[name]; - } else if (name == 'length') { - return path.length; - } else { - return undefined; - } - }, - __call__: function(name) { - if (name == 'toHtml') { - return computeDescription(true); - } else if (name == 'toString') { - return computeDescription(false); - } else { - return undefined; - } - } - }; - } - - jobject = unwrapJavaObject(jobject); - var refChains = this.snapshot.rootsetReferencesTo(jobject, weak); - var paths = new Array(refChains.length); - for (var i in refChains) { - paths[i] = wrapRefChain(refChains[i]); - } - return paths; - }, - - /** - * Return description string for reference from 'from' object - * to 'to' Java object. - * - * @param from source Java object - * @param to destination Java object - */ - describeRef: function (from, to) { - from = unwrapJavaObject(from); - to = unwrapJavaObject(to); - return from.describeReferenceTo(to, this.snapshot); - }, - }; -} - -// per-object functions - -/** - * Returns allocation site trace (if available) of a Java object - * - * @param jobject object whose allocation site trace is returned - */ -function allocTrace(jobject) { - try { - jobject = unwrapJavaObject(jobject); - var trace = jobject.allocatedFrom; - return (trace != null) ? trace.frames : null; - } catch (e) { - print("allocTrace: " + jobject + ", " + e); - return null; - } -} - -/** - * Returns Class object for given Java object - * - * @param jobject object whose Class object is returned - */ -function classof(jobject) { - jobject = unwrapJavaObject(jobject); - return wrapJavaValue(jobject.clazz); -} - -/** - * Find referers (a.k.a in-coming references). Calls callback - * for each referrer of the given Java object. If the callback - * returns true, the iteration is stopped. - * - * @param callback function to call for each referer - * @param jobject object whose referers are retrieved - */ -function forEachReferrer(callback, jobject) { - jobject = unwrapJavaObject(jobject); - var refs = jobject.referers; - while (refs.hasMoreElements()) { - if (callback(wrapJavaValue(refs.nextElement()))) { - return; - } - } -} - -/** - * Compares two Java objects for object identity. - * - * @param o1, o2 objects to compare for identity - */ -function identical(o1, o2) { - return objectid(o1) == objectid(o2); -} - -/** - * Returns Java object id as string - * - * @param jobject object whose id is returned - */ -function objectid(jobject) { - try { - jobject = unwrapJavaObject(jobject); - return String(jobject.idString); - } catch (e) { - print("objectid: " + jobject + ", " + e); - return null; - } -} - -/** - * Prints allocation site trace of given object - * - * @param jobject object whose allocation site trace is returned - */ -function printAllocTrace(jobject) { - var frames = this.allocTrace(jobject); - if (frames == null || frames.length == 0) { - print("allocation site trace unavailable for " + - objectid(jobject)); - return; - } - print(objectid(jobject) + " was allocated at .."); - for (var i in frames) { - var frame = frames[i]; - var src = frame.sourceFileName; - if (src == null) src = ''; - print('\t' + frame.className + "." + - frame.methodName + '(' + frame.methodSignature + ') [' + - src + ':' + frame.lineNumber + ']'); - } -} - -/** - * Returns an enumeration of referrers of the given Java object. - * - * @param jobject Java object whose referrers are returned. - */ -function referrers(jobject) { - try { - jobject = unwrapJavaObject(jobject); - return wrapperEnumeration(jobject.referers); - } catch (e) { - print("referrers: " + jobject + ", " + e); - return emptyEnumeration; - } -} - -/** - * Returns an array that contains objects referred from the - * given Java object. - * - * @param jobject Java object whose referees are returned. - */ -function referees(jobject) { - var res = new Array(); - jobject = unwrapJavaObject(jobject); - if (jobject != undefined) { - try { - jobject.visitReferencedObjects( - new hatPkg.model.JavaHeapObjectVisitor() { - visit: function(other) { - res[res.length] = wrapJavaValue(other); - }, - exclude: function(clazz, field) { - return false; - }, - mightExclude: function() { - return false; - } - }); - } catch (e) { - print("referees: " + jobject + ", " + e); - } - } - return res; -} - -/** - * Returns an array that contains objects referred from the - * given Java object directly or indirectly (i.e., all - * transitively referred objects are returned). - * - * @param jobject Java object whose reachables are returned. - * @param excludes optional comma separated list of fields to be - * removed in reachables computation. Fields are - * written as class_name.field_name form. - */ -function reachables(jobject, excludes) { - if (excludes == undefined) { - excludes = null; - } else if (typeof(excludes) == 'string') { - var st = new java.util.StringTokenizer(excludes, ","); - var excludedFields = new Array(); - while (st.hasMoreTokens()) { - excludedFields[excludedFields.length] = st.nextToken().trim(); - } - if (excludedFields.length > 0) { - excludes = new hatPkg.model.ReachableExcludes() { - isExcluded: function (field) { - for (var index in excludedFields) { - if (field.equals(excludedFields[index])) { - return true; - } - } - return false; - } - }; - } else { - // nothing to filter... - excludes = null; - } - } else if (! (excludes instanceof hatPkg.model.ReachableExcludes)) { - excludes = null; - } - - jobject = unwrapJavaObject(jobject); - var ro = new hatPkg.model.ReachableObjects(jobject, excludes); - var tmp = ro.reachables; - var res = new Array(tmp.length); - for (var i in tmp) { - res[i] = wrapJavaValue(tmp[i]); - } - return res; -} - - -/** - * Returns whether 'from' object refers to 'to' object or not. - * - * @param from Java object that is source of the reference. - * @param to Java object that is destination of the reference. - */ -function refers(from, to) { - try { - var tmp = unwrapJavaObject(from); - if (tmp instanceof hatPkg.model.JavaClass) { - from = from.statics; - } else if (tmp instanceof hatPkg.model.JavaValueArray) { - return false; - } - for (var i in from) { - if (identical(from[i], to)) { - return true; - } - } - } catch (e) { - print("refers: " + from + ", " + e); - } - return false; -} - -/** - * If rootset includes given jobject, return Root - * object explanining the reason why it is a root. - * - * @param jobject object whose Root is returned - */ -function root(jobject) { - try { - jobject = unwrapJavaObject(jobject); - return wrapRoot(jobject.root); - } catch (e) { - return null; - } -} - -/** - * Returns size of the given Java object - * - * @param jobject object whose size is returned - */ -function sizeof(jobject) { - try { - jobject = unwrapJavaObject(jobject); - return jobject.size; - } catch (e) { - print("sizeof: " + jobject + ", " + e); - return null; - } -} - -/** - * Returns String by replacing Unicode chars and - * HTML special chars (such as '<') with entities. - * - * @param str string to be encoded - */ -function encodeHtml(str) { - return hatPkg.util.Misc.encodeHtml(str); -} - -/** - * Returns HTML string for the given object. - * - * @param obj object for which HTML string is returned. - */ -function toHtml(obj) { - if (obj == null) { - return "null"; - } - - if (obj == undefined) { - return "undefined"; - } - - var tmp = unwrapJavaObject(obj); - if (tmp != undefined) { - var id = tmp.idString; - if (tmp instanceof Packages.com.sun.tools.hat.internal.model.JavaClass) { - var name = tmp.name; - return "class " + name + ""; - } else { - var name = tmp.clazz.name; - return "" + - name + "@" + id + ""; - } - } else if (obj instanceof Object) { - if (Array.isArray(obj)) { - // script array - var res = "[ "; - for (var i in obj) { - res += toHtml(obj[i]); - if (i != obj.length - 1) { - res += ", "; - } - } - res += " ]"; - return res; - } else { - // if the object has a toHtml function property - // just use that... - if (typeof(obj.toHtml) == 'function') { - return obj.toHtml(); - } else { - // script object - var res = "{ "; - for (var i in obj) { - res += i + ":" + toHtml(obj[i]) + ", "; - } - res += "}"; - return res; - } - } - } else { - // a Java object - obj = wrapIterator(obj); - // special case for enumeration - if (obj instanceof java.util.Enumeration) { - var res = "[ "; - while (obj.hasMoreElements()) { - res += toHtml(obj.nextElement()) + ", "; - } - res += "]"; - return res; - } else { - return obj; - } - } -} - -/* - * Generic array/iterator/enumeration [or even object!] manipulation - * functions. These functions accept an array/iteration/enumeration - * and expression String or function. These functions iterate each - * element of array and apply the expression/function on each element. - */ - -// private function to wrap an Iterator as an Enumeration -function wrapIterator(itr, wrap) { - if (itr instanceof java.util.Iterator) { - return new java.util.Enumeration() { - hasMoreElements: function() { - return itr.hasNext(); - }, - nextElement: function() { - return wrap? wrapJavaValue(itr.next()) : itr.next(); - } - }; - } else { - return itr; - } -} - -/** - * Converts an enumeration/iterator/object into an array - * - * @param obj enumeration/iterator/object - * @return array that contains values of enumeration/iterator/object - */ -function toArray(obj) { - obj = wrapIterator(obj); - if (obj instanceof java.util.Enumeration) { - var res = new Array(); - while (obj.hasMoreElements()) { - res[res.length] = obj.nextElement(); - } - return res; - } else if (obj instanceof Array) { - return obj; - } else { - var res = new Array(); - for (var index in obj) { - res[res.length] = obj[index]; - } - return res; - } -} - -/** - * Returns whether the given array/iterator/enumeration contains - * an element that satisfies the given boolean expression specified - * in code. - * - * @param array input array/iterator/enumeration that is iterated - * @param code expression string or function - * @return boolean result - * - * The code evaluated can refer to the following built-in variables. - * - * 'it' -> currently visited element - * 'index' -> index of the current element - * 'array' -> array that is being iterated - */ -function contains(array, code) { - array = wrapIterator(array); - var func = code; - if (typeof(func) != 'function') { - func = new Function("it", "index", "array", "return " + code); - } - - if (array instanceof java.util.Enumeration) { - var index = 0; - while (array.hasMoreElements()) { - var it = array.nextElement(); - if (func(it, index, array)) { - return true; - } - index++; - } - } else { - for (var index in array) { - var it = array[index]; - if (func(it, String(index), array)) { - return true; - } - } - } - return false; -} - -/** - * concatenates two arrays/iterators/enumerators. - * - * @param array1 array/iterator/enumeration - * @param array2 array/iterator/enumeration - * - * @return concatenated array or composite enumeration - */ -function concat(array1, array2) { - array1 = wrapIterator(array1); - array2 = wrapIterator(array2); - if (array1 instanceof Array && array2 instanceof Array) { - return array1.concat(array2); - } else if (array1 instanceof java.util.Enumeration && - array2 instanceof java.util.Enumeration) { - return new Packages.com.sun.tools.hat.internal.util.CompositeEnumeration(array1, array2); - } else { - return undefined; - } -} - -/** - * Returns the number of array/iterator/enumeration elements - * that satisfy the given boolean expression specified in code. - * The code evaluated can refer to the following built-in variables. - * - * @param array input array/iterator/enumeration that is iterated - * @param code expression string or function - * @return number of elements - * - * 'it' -> currently visited element - * 'index' -> index of the current element - * 'array' -> array that is being iterated - */ -function count(array, code) { - if (code == undefined) { - return length(array); - } - array = wrapIterator(array); - var func = code; - if (typeof(func) != 'function') { - func = new Function("it", "index", "array", "return " + code); - } - - var result = 0; - if (array instanceof java.util.Enumeration) { - var index = 0; - while (array.hasMoreElements()) { - var it = array.nextElement(); - if (func(it, index, array)) { - result++; - } - index++; - } - } else { - for (var index in array) { - var it = array[index]; - if (func(it, index, array)) { - result++; - } - } - } - return result; -} - -/** - * filter function returns an array/enumeration that contains - * elements of the input array/iterator/enumeration that satisfy - * the given boolean expression. The boolean expression code can - * refer to the following built-in variables. - * - * @param array input array/iterator/enumeration that is iterated - * @param code expression string or function - * @return array/enumeration that contains the filtered elements - * - * 'it' -> currently visited element - * 'index' -> index of the current element - * 'array' -> array that is being iterated - * 'result' -> result array - */ -function filter(array, code) { - array = wrapIterator(array); - var func = code; - if (typeof(code) != 'function') { - func = new Function("it", "index", "array", "result", "return " + code); - } - if (array instanceof java.util.Enumeration) { - return filterEnumeration(array, func, false); - } else { - var result = new Array(); - for (var index in array) { - var it = array[index]; - if (func(it, String(index), array, result)) { - result[result.length] = it; - } - } - return result; - } -} - -/** - * Returns the number of elements of array/iterator/enumeration. - * - * @param array input array/iterator/enumeration that is iterated - */ -function length(array) { - array = wrapIterator(array); - if (array instanceof Array) { - return array.length; - } else if (array instanceof java.util.Enumeration) { - var cnt = 0; - while (array.hasMoreElements()) { - array.nextElement(); - cnt++; - } - return cnt; - } else { - var cnt = 0; - for (var index in array) { - cnt++; - } - return cnt; - } -} - -/** - * Transforms the given object or array by evaluating given code - * on each element of the object or array. The code evaluated - * can refer to the following built-in variables. - * - * @param array input array/iterator/enumeration that is iterated - * @param code expression string or function - * @return array/enumeration that contains mapped values - * - * 'it' -> currently visited element - * 'index' -> index of the current element - * 'array' -> array that is being iterated - * 'result' -> result array - * - * map function returns an array/enumeration of values created - * by repeatedly calling code on each element of the input - * array/iterator/enumeration. - */ -function map(array, code) { - array = wrapIterator(array); - var func = code; - if(typeof(code) != 'function') { - func = new Function("it", "index", "array", "result", "return " + code); - } - - if (array instanceof java.util.Enumeration) { - var index = 0; - var result = new java.util.Enumeration() { - hasMoreElements: function() { - return array.hasMoreElements(); - }, - nextElement: function() { - return func(array.nextElement(), index++, array, result); - } - }; - return result; - } else { - var result = new Array(); - for (var index in array) { - var it = array[index]; - result[result.length] = func(it, String(index), array, result); - } - return result; - } -} - -// private function used by min, max functions -function minmax(array, code) { - if (typeof(code) == 'string') { - code = new Function("lhs", "rhs", "return " + code); - } - array = wrapIterator(array); - if (array instanceof java.util.Enumeration) { - if (! array.hasMoreElements()) { - return undefined; - } - var res = array.nextElement(); - while (array.hasMoreElements()) { - var next = array.nextElement(); - if (code(next, res)) { - res = next; - } - } - return res; - } else { - if (array.length == 0) { - return undefined; - } - var res = array[0]; - for (var index = 1; index < array.length; index++) { - if (code(array[index], res)) { - res = array[index]; - } - } - return res; - } -} - -/** - * Returns the maximum element of the array/iterator/enumeration - * - * @param array input array/iterator/enumeration that is iterated - * @param code (optional) comparision expression or function - * by default numerical maximum is computed. - */ -function max(array, code) { - if (code == undefined) { - code = function (lhs, rhs) { return lhs > rhs; } - } - return minmax(array, code); -} - -/** - * Returns the minimum element of the array/iterator/enumeration - * - * @param array input array/iterator/enumeration that is iterated - * @param code (optional) comparision expression or function - * by default numerical minimum is computed. - */ -function min(array, code) { - if (code == undefined) { - code = function (lhs, rhs) { return lhs < rhs; } - } - return minmax(array, code); -} - -/** - * sort function sorts the input array. optionally accepts - * code to compare the elements. If code is not supplied, - * numerical sort is done. - * - * @param array input array/iterator/enumeration that is sorted - * @param code expression string or function - * @return sorted array - * - * The comparison expression can refer to the following - * built-in variables: - * - * 'lhs' -> 'left side' element - * 'rhs' -> 'right side' element - */ -function sort(array, code) { - // we need an array to sort, so convert non-arrays - array = toArray(array); - - // by default use numerical comparison - var func = code; - if (code == undefined) { - func = function(lhs, rhs) { return lhs - rhs; }; - } else if (typeof(code) == 'string') { - func = new Function("lhs", "rhs", "return " + code); - } - return array.sort(func); -} - -/** - * Returns the sum of the elements of the array - * - * @param array input array that is summed. - * @param code optional expression used to map - * input elements before sum. - */ -function sum(array, code) { - array = wrapIterator(array); - if (code != undefined) { - array = map(array, code); - } - var result = 0; - if (array instanceof java.util.Enumeration) { - while (array.hasMoreElements()) { - result += Number(array.nextElement()); - } - } else { - for (var index in array) { - result += Number(array[index]); - } - } - return result; -} - -/** - * Returns array of unique elements from the given input - * array/iterator/enumeration. - * - * @param array from which unique elements are returned. - * @param code optional expression (or function) giving unique - * attribute/property for each element. - * by default, objectid is used for uniqueness. - */ -function unique(array, code) { - array = wrapIterator(array); - if (code == undefined) { - code = new Function("it", "return objectid(it);"); - } else if (typeof(code) == 'string') { - code = new Function("it", "return " + code); - } - var tmp = new Object(); - if (array instanceof java.util.Enumeration) { - while (array.hasMoreElements()) { - var it = array.nextElement(); - tmp[code(it)] = it; - } - } else { - for (var index in array) { - var it = array[index]; - tmp[code(it)] = it; - } - } - var res = new Array(); - for (var index in tmp) { - res[res.length] = tmp[index]; - } - return res; -} diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/resources/oqlhelp.html b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/resources/oqlhelp.html deleted file mode 100644 index 5d7ec4576e8..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/resources/oqlhelp.html +++ /dev/null @@ -1,808 +0,0 @@ - - - - - - -Object Query Language (OQL) - - - -

                        Object Query Language (OQL)

                        - -

                        -OQL is SQL-like query language to query Java heap. OQL allows to filter/select information -wanted from Java heap. While pre-defined queries such as "show all instances of class X" -are already supported by HAT, OQL adds more flexibility. OQL is based on JavaScript expression -language. -

                        - -

                        -OQL query is of the form - -

                        -
                        -         select <JavaScript expression to select>
                        -         [ from [instanceof] <class name> <identifier>
                        -         [ where <JavaScript boolean expression to filter> ] ]
                        -
                        -
                        -where class name is fully qualified Java class name (example: java.net.URL) or array class name. -[C is char array name, [Ljava.io.File; is name of java.io.File[] and so on. -Note that fully qualified class name does not always uniquely identify a -Java class at runtime. There may be more than one Java class with the same -name but loaded by different loaders. So, class name is permitted to be -id string of the class object. - -If instanceof keyword is used, subtype objects are selected. If this -keyword is not specified, only the instances of exact class specified are selected. Both -from and where clauses are optional. -

                        - - -

                        -In select and (optional) where clauses, the expression -used in JavaScript expression. Java heap objects are wrapped as convenient script objects so that -fields may be accessed in natural syntax. For example, Java fields can be accessed with obj.field_name -syntax and array elements can be accessed with array[index] syntax. Each Java object selected is -bound to a JavaScript variable of the identifier name specified in from clause. -

                        - -

                        OQL Examples

                        - -
                          -
                        • select all Strings of length 100 or more -
                          -
                          -    select s from java.lang.String s where s.value.length >= 100
                          -
                          -
                          -
                        • select all int arrays of length 256 or more -
                          -
                          -    select a from [I a where a.length >= 256
                          -
                          -
                          -
                        • show content of Strings that match a regular expression -
                          -
                          -    select s.value.toString() from java.lang.String s 
                          -    where /java/.test(s.value.toString())
                          -
                          -
                          -
                        • show path value of all File objects -
                          -
                          -    select file.path.value.toString() from java.io.File file
                          -
                          -
                          -
                        • show names of all ClassLoader classes -
                          -
                          -    select classof(cl).name 
                          -    from instanceof java.lang.ClassLoader cl
                          -
                          -
                          -
                        • show instances of the Class identified by given id string -
                          -
                          -    select o from instanceof 0xd404b198 o
                          -
                          -
                          -Note that 0xd404b198 is id of a Class (in a session). This is found by -looking at the id shown in that class's page. -
                        - -

                        OQL built-in objects, functions

                        - -

                        heap object

                        - -The heap built-in object supports the following methods: - -
                          -
                        • heap.forEachClass -- calls a callback function for each Java Class -
                          -
                          -    heap.forEachClass(callback);
                          -
                          -
                          -
                        • heap.forEachObject -- calls a callback function for each Java object -
                          -
                          -    heap.forEachObject(callback, clazz, includeSubtypes);
                          -
                          -
                          -clazz is the class whose instances are selected. If not specified, defaults to java.lang.Object. includeSubtypes is a boolean flag -that specifies whether to include subtype instances or not. Default value of -this flag is true. - -
                        • heap.findClass -- finds Java Class of given name -
                          -
                          -    heap.findClass(className);
                          -
                          -
                          -where className is name of the class to find. The resulting Class -object has following properties: -
                            -
                          • name - name of the class. -
                          • superclass - Class object for super class (or null if java.lang.Object). -
                          • statics - name, value pairs for static fields of the Class. -
                          • fields - array of field objects. field object has name, signature -properties. -
                          • loader - ClassLoader object that loaded this class. -
                          • signers - signers that signed this class. -
                          • protectionDomain - protection domain to which this class belongs. -
                          -Class objects have the following methods: -
                            -
                          • isSubclassOf - tests whether given class is direct or indirect -subclass of this class or not. -
                          • isSuperclassOf - tests whether given Class is direct or indirect -superclass of this class or not. -
                          • subclasses - returns array of direct and indirect subclasses. -
                          • superclasses - returns array of direct and indirect superclasses. -
                          - -
                        • heap.findObject -- finds object from given object id -
                          -
                          -    heap.findObject(stringIdOfObject);
                          -
                          -
                          - -
                        • heap.classes -- returns an enumeration of all Java classes - -
                        • heap.objects -- returns an enumeration of Java objects -
                          -
                          -    heap.objects(clazz, [includeSubtypes], [filter])
                          -
                          -
                          -clazz is the class whose instances are selected. If not specified, defaults to java.lang.Object. includeSubtypes is a boolean flag -that specifies whether to include subtype instances or not. Default value of -this flag is true. This method accepts an optional filter expression to filter -the result set of objects. - -
                        • heap.finalizables -- returns an enumeration of Java objects that are -pending to be finalized. -
                        • heap.livepaths -- return an array of paths by which a given object -is alive. This method accepts optional second parameter that is a boolean -flag. This flag tells whether to include paths with weak reference(s) or not. -By default, paths with weak reference(s) are not included. -
                          -
                          -    select heap.livepaths(s) from java.lang.String s
                          -
                          -
                          -Each element of this array itself is another array. The later array is -contains an objects that are in the 'reference chain' of the path. -
                        • heap.roots -- returns an Enumeration of Roots of the heap. - -Each Root object has the following properties: -
                            -
                          • id - String id of the object that is referred by this root -
                          • type - descriptive type of Root (JNI Global, JNI Local, Java Static etc) -
                          • description - String description of the Root -
                          • referrer - Thread Object or Class object that is responsible for this root or null -
                          -
                        - -Examples: -
                          -
                        • access static field 'props' of class java.lang.System -
                          -
                          -    select heap.findClass("java.lang.System").statics.props
                          -
                          -
                          -
                        • get number of fields of java.lang.String class -
                          -
                          -    select heap.findClass("java.lang.String").fields.length
                          -
                          -
                          -
                        • find the object whose object id is given -
                          -
                          -    select heap.findObject("0xf3800b58")
                          -
                          -
                          -
                        • select all classes that have name pattern java.net.* -
                          -
                          -    select filter(heap.classes(), "/java.net./.test(it.name)")
                          -
                          -
                          -
                        - -

                        functions on individual objects

                        - - - - -

                        allocTrace function

                        - -This returns allocation site trace of a given Java object if available. -allocTrace returns array of frame objects. Each frame object has the following -properties: -
                          -
                        • className - name of the Java class whose method is running in the frame. -
                        • methodName - name of the Java method running in the frame. -
                        • methodSignature - signature of the Java method running in the frame. -
                        • sourceFileName - name of source file of the Java class running in the frame. -
                        • lineNumber - source line number within the method. -
                        - - -

                        classof function

                        - -Returns Class object of a given Java Object. The result object supports the -following properties: -
                          -
                        • name - name of the class. -
                        • superclass - Class object for super class (or null if java.lang.Object). -
                        • statics - name, value pairs for static fields of the Class. -
                        • fields - array of field objects. Field objects have name, signature -properties. -
                        • loader - ClassLoader object that loaded this class. -
                        • signers - signers that signed this class. -
                        • protectionDomain - protection domain to which this class belongs. -
                        -Class objects have the following methods: -
                          -
                        • isSubclassOf - tests whether given class is direct or indirect -subclass of this class or not. -
                        • isSuperclassOf - tests whether given Class is direct or indirect -superclass of this class or not. -
                        • subclasses - returns array of direct and indirect subclasses. -
                        • superclasses - returns array of direct and indirect superclasses. -
                        - -Examples: -
                          -
                        • show class name of each Reference type object -
                          -
                          -    select classof(o).name from instanceof java.lang.ref.Reference o
                          -
                          -
                        • show all subclasses of java.io.InputStream -
                          -
                          -    select heap.findClass("java.io.InputStream").subclasses()
                          -
                          -
                        • show all superclasses of java.io.BufferedInputStream -
                          -
                          -    select heap.findClass("java.io.BufferedInputStream").superclasses()
                          -
                          -
                          -
                        - - -

                        forEachReferrer function

                        - -calls a callback function for each referrer of a given Java object. - - -

                        identical function

                        -

                        -Returns whether two given Java objects are identical or not. -

                        -Example: -
                        -
                        -    select identical(heap.findClass("Foo").statics.bar, heap.findClass("AnotherClass").statics.bar)
                        -
                        -
                        - - -

                        objectid function

                        - -

                        -Returns String id of a given Java object. This id can be passed to -heap.findObject and may also be used to compare -objects for identity. -

                        -Example: -
                        -
                        -    select objectid(o) from java.lang.Object o
                        -
                        -
                        - - -

                        reachables function

                        -

                        -Returns an array of Java objects that are transitively referred from the -given Java object. Optionally accepts a second parameter that is comma -separated field names to be excluded from reachability computation. -Fields are written in class_name.field_name pattern. -

                        -Examples: -
                          -
                        • print all reachable objects from each Properties instance. -
                          -
                          -    select reachables(p) from java.util.Properties p
                          -
                          -
                          -
                        • print all reachables from each java.net.URL but omit the objects reachable -via the fields specified. -
                          -
                          -    select reachables(u, 'java.net.URL.handler') from java.net.URL u
                          -
                          -
                          -
                        - - -

                        referrers function

                        -

                        -Returns an enumeration of Java objects that hold reference to a given Java -object. -

                        -Examples: -
                          -
                        • print number of referrers for each java.lang.Object instance -
                          -
                          -    select count(referrers(o)) from java.lang.Object o
                          -
                          -
                          -
                        • print referrers for each java.io.File object -
                          -
                          -    select referrers(f) from java.io.File f
                          -
                          -
                          -
                        • print URL objects only if referred by 2 or more -
                          -
                          -    select u from java.net.URL u where count(referrers(u)) > 2
                          -
                          -
                          -
                        - - -

                        referees function

                        -

                        -Returns an array of Java objects to which the given Java -object directly refers to. -

                        -Example: to print all static reference fields of java.io.File class -
                        -
                        -    select referees(heap.findClass("java.io.File"))
                        -
                        -
                        - - -

                        refers function

                        -

                        -Returns whether first Java object refers to second Java object or not. -

                        - - -

                        root function

                        -

                        -If given object is a member of root set of objects, this function returns -a descriptive Root object describing why it is so. -If given object is not a root, then this function returns null. -

                        - - -

                        sizeof function

                        - -Returns size of the given Java object in bytes -Example: -
                        -
                        -    select sizeof(o) from [I o
                        -
                        -
                        - - -

                        toHtml function

                        - -Returns HTML string for the given Java object. Note that this is called -automatically for objects selected by select expression. But, it may be useful -to print more complex output. - -Example: print hyperlink in bold font weight -
                        -
                        -    select "<b>" + toHtml(o) + "</b>" from java.lang.Object o
                        -
                        -
                        - -

                        Selecting multiple values

                        -

                        -Multiple values can be selected using JavaScript object literals or arrays. -

                        - -Example: show name and thread for each thread object -
                        -
                        -    select { name: t.name? t.name.toString() : "null", thread: t } 
                        -    from instanceof java.lang.Thread t
                        -
                        -
                        - -

                        array/iterator/enumeration manipulation functions

                        - -

                        -These functions accept an array/iterator/enumeration and an -expression string [or a callback function] as input. These functions iterate -the array/iterator/enumeration and apply the expression (or function) on -each element. Note that JavaScript objects are associative arrays. So, -these functions may also be used with arbitrary JavaScript objects. -

                        - - - - -

                        concat function

                        -

                        -Concatenates two arrays or enumerations (i.e., returns composite -enumeration). -

                        - - -

                        contains function

                        -

                        -Returns whether the given array/enumeration contains an element -the given boolean expression specified in code. The code evaluated -can refer to the following built-in variables. -

                        -
                          -
                        • it -> currently visited element -
                        • index -> index of the current element -
                        • array -> array/enumeration that is being iterated -
                        -Example: select all Properties objects that are referred by -some static field some class. -
                        -
                        -    select p from java.util.Properties p
                        -    where contains(referrers(p), "classof(it).name == 'java.lang.Class'")
                        -
                        -
                        - - -

                        count function

                        -

                        -count function returns the count of elements of the input array/enumeration -that satisfy the given boolean expression. The boolean expression code can -refer to the following built-in variables. -

                        -
                          -
                        • it -> currently visited element -
                        • index -> index of the current element -
                        • array -> array/enumeration that is being iterated -
                        -Example: print number of classes that have specific name pattern -
                        -
                        -    select count(heap.classes(), "/java.io./.test(it.name)")
                        -
                        -
                        - - -

                        filter function

                        -

                        -filter function returns an array/enumeration that contains elements -of the input array/enumeration that satisfy the given boolean -expression. The boolean expression code can refer to the following built-in -variables. -

                        -
                          -
                        • it -> currently visited element -
                        • index -> index of the current element -
                        • array -> array/enumeration that is being iterated -
                        • result -> result array/enumeration -
                        -Examples: -
                          -
                        • show all classes that have java.io.* name pattern -
                          -
                          -    select filter(heap.classes(), "/java.io./.test(it.name)")
                          -
                          -
                          -
                        • show all referrers of URL object where the referrer is not from -java.net package -
                          -
                          -    select filter(referrers(u), "! /java.net./.test(classof(it).name)")
                          -    from java.net.URL u
                          -
                          -
                          -
                        - - -

                        length function

                        -

                        -length function returns number of elements of an array/enumeration. -

                        - - -

                        map function

                        -

                        -Transforms the given array/enumeration by evaluating given code -on each element. The code evaluated can refer to the following built-in -variables. -

                        -
                          -
                        • it -> currently visited element -
                        • index -> index of the current element -
                        • array -> array/enumeration that is being iterated -
                        • result -> result array/enumeration -
                        -

                        -map function returns an array/enumeration of values created by repeatedly -calling code on each element of input array/enumeration. -

                        -Example: show all static fields of java.io.File with name and value -
                        -
                        -    select map(heap.findClass("java.io.File").statics, "index + '=' + toHtml(it)")
                        -
                        -
                        - - -

                        max function

                        -

                        -returns the maximum element of the given array/enumeration. -Optionally accepts code expression to compare elements of the array. -By default numerical comparison is used. The comparison expression can -use the following built-in variables: -

                        -
                          -
                        • lhs -> left side element for comparison -
                        • rhs -> right side element for comparison -
                        -Examples: -
                          -
                        • find the maximum length of any String instance -
                          -
                          -    select max(map(heap.objects('java.lang.String', false), 'it.value.length'))
                          -
                          -
                          -
                        • find string instance that has the maximum length -
                          -
                          -    select max(heap.objects('java.lang.String'), 'lhs.value.length > rhs.value.length')
                          -
                          -
                          -
                        - - -

                        min function

                        -

                        -returns the minimum element of the given array/enumeration. Optionally -accepts code expression to compare elements of the array. By default numerical -comparison is used. The comparison expression can use the following built-in -variables: -

                        -
                          -
                        • lhs -> left side element for comparison -
                        • rhs -> right side element for comparison -
                        -Examples: -
                          -
                        • find the minimum size of any Vector instance -
                          -
                          -    select min(map(heap.objects('java.util.Vector', false), 'it.elementData.length'))
                          -
                          -
                          -
                        • find Vector instance that has the maximum length -
                          -
                          -    select min(heap.objects('java.util.Vector'), 'lhs.elementData.length < rhs.elementData.length')
                          -
                          -
                        - - -

                        sort function

                        -

                        -sorts given array/enumeration. Optionally accepts code expression to -compare elements of the array. By default numerical comparison is used. -The comparison expression can use the following built-in variables: -

                        -
                          -
                        • lhs -> left side element for comparison -
                        • rhs -> right side element for comparison -
                        -Examples: -
                          -
                        • print all char[] objects in the order of size. -
                          -
                          -    select sort(heap.objects('[C'), 'sizeof(lhs) - sizeof(rhs)')
                          -
                          -
                          -
                        • print all char[] objects in the order of size but print -size as well. -
                          -
                          -    select map(sort(heap.objects('[C'), 'sizeof(lhs) - sizeof(rhs)'), '{ size: sizeof(it), obj: it }')
                          -
                          -
                          -
                        - - -

                        sum function

                        -

                        -This function returns the sum of all the elements of the given input array or -enumeration. Optionally, accepts an expression as second param. This is used -to map the input elements before summing those. -

                        -Example: return sum of sizes of the reachable objects from each Properties object -
                        -
                        -    select sum(map(reachables(p), 'sizeof(it)')) 
                        -    from java.util.Properties p
                        -
                        -    // or omit the map as in ...
                        -    select sum(reachables(p), 'sizeof(it)') 
                        -    from java.util.Properties p
                        -
                        -
                        -
                        - - -

                        toArray function

                        -

                        -This function returns an array that contains elements of the input -array/enumeration. -

                        - - -

                        unique function

                        -

                        -This function returns an array/enumeration containing unique elements of the -given input array/enumeration -

                        -Example: select unique char[] instances referenced from Strings. Note that -more than one String instance can share the same char[] for the content. -
                        -
                        -   // number of unique char[] instances referenced from any String
                        -   select count(unique(map(heap.objects('java.lang.String'), 'it.value')))
                        -
                        -   // total number of Strings
                        -   select count(heap.objects('java.lang.String'))
                        -
                        -
                        - -

                        More complex examples

                        - -

                        Print histogram of each class loader and number of classes loaded by it

                        - -
                        -
                        -   select map(sort(map(heap.objects('java.lang.ClassLoader'), 
                        -   '{ loader: it, count: it.classes.elementCount }'), 'lhs.count < rhs.count'),
                        -   'toHtml(it) + "<br>"')
                        -
                        -
                        -

                        -The above query uses the fact that, java.lang.ClassLoader has a private -field called classes of type java.util.Vector and Vector has a -private field named elementCount that is number of elements in the -vector. We select multiple values (loader, count) using JavaScript object -literal and map function. We sort the result by count (i.e., number of classes -loaded) using sort function with comparison expression. -

                        - -

                        Show parent-child chain for each class loader instance

                        - -
                        -
                        -   select map(heap.objects('java.lang.ClassLoader'),
                        -      function (it) {
                        -         var res = '';
                        -         while (it != null) {
                        -            res += toHtml(it) + "->";
                        -            it = it.parent;
                        -         }
                        -         res += "null";
                        -         return res + "<br>";
                        -      })
                        -
                        -
                        -

                        -Note that we use parent field of java.lang.ClassLoader class -and walk until parent is null using the callback function to map call. -

                        - -

                        Printing value of all System properties

                        - -
                        -
                        -   select map(filter(heap.findClass('java.lang.System').statics.props.table, 'it != null'), 
                        -            function (it) {
                        -                var res = "";
                        -                while (it != null) {
                        -                    res += it.key.value.toString() + '=' +
                        -                           it.value.value.toString() + '<br>';
                        -                    it = it.next;
                        -                }
                        -                return res;
                        -            });
                        -
                        -
                        -

                        -The above query uses the following facts: -

                          -
                        • java.lang.System has static field by name 'props' of type java.util.Properties. -
                        • java.util.Properties has field by 'table' of type java.util.Hashtable$Entry -(this field is inherited from java.util.Hashtable). This is the hashtable -buckets array. -
                        • java.util.Hashtable$Entry has 'key', 'value' and 'next' fields. Each -entry points the next entry (or null) in the same hashtable bucket. -
                        • java.lang.String class has 'value' field of type char[]. -
                        -

                        -Note that this query (and many other queries) may not be stable - because -private fields of Java platform classes may be modified/removed without any -notification! (implementation detail). But, using such queries on user -classes may be safe - given that user has the control over the classes. -

                        - - - diff --git a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/resources/platform_names.txt b/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/resources/platform_names.txt deleted file mode 100644 index 9ce6f9fc5ed..00000000000 --- a/jdk/src/jdk.dev/share/classes/com/sun/tools/hat/resources/platform_names.txt +++ /dev/null @@ -1,29 +0,0 @@ -boolean[ -char[ -float[ -double[ -byte[ -short[ -int[ -long[ -sun. -java. -javax.accessibility -javax.crypto. -javax.imageio. -javax.naming. -javax.net. -javax.print. -javax.rmi. -javax.security. -javax.sound. -javax.sql. -javax.swing. -javax.transaction. -javax.xml.parsers. -javax.xml.transform. -org.ietf.jgss. -org.omg. -org.w3c.dom. -org.xml.sax. - diff --git a/jdk/src/jdk.hprof.agent/unix/native/libhprof/hprof_md.c b/jdk/src/jdk.hprof.agent/unix/native/libhprof/hprof_md.c index 78a4f606735..9b3063562d5 100644 --- a/jdk/src/jdk.hprof.agent/unix/native/libhprof/hprof_md.c +++ b/jdk/src/jdk.hprof.agent/unix/native/libhprof/hprof_md.c @@ -290,19 +290,7 @@ md_get_prelude_path(char *path, int path_len, char *filename) Dl_info dlinfo; libdir[0] = 0; -#if defined(LINUX) || defined(_ALLBSD_SOURCE) || defined(AIX) - addr = (void*)&Agent_OnLoad; -#else - /* Just using &Agent_OnLoad will get the first external symbol with - * this name in the first .so, which may not be libhprof.so. - * On Solaris we can actually ask for the address of our Agent_OnLoad. - */ - addr = dlsym(RTLD_SELF, "Agent_OnLoad"); - /* Just in case the above didn't work (missing linker patch?). */ - if ( addr == NULL ) { - addr = (void*)&Agent_OnLoad; - } -#endif + addr = (void*)&md_get_prelude_path; /* Use dladdr() to get the full path to libhprof.so, which we use to find * the prelude file. diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Accessible.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Accessible.java index a1886b797af..ba2463ad205 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Accessible.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Accessible.java @@ -40,8 +40,8 @@ package com.sun.jdi; public interface Accessible { /** - * Returns the JavaTM - * programming language modifiers, encoded in an integer. + * Returns the Java™ programming language modifiers, encoded + * in an integer. *

                        * The modifier encodings are defined in * The Java™ Virtual Machine Specification diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassNotLoadedException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassNotLoadedException.java index 3493185c610..ab516e06e50 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassNotLoadedException.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassNotLoadedException.java @@ -45,7 +45,7 @@ package com.sun.jdi; *

                      • There can be no guarantee that running the appropriate class * loader won't cause a deadlock in loading the * class. Class loaders can consist of arbitrary - * JavaTM programming language code and the + * Java™ programming language code and the * class loading methods are usually synchronized. Most of the work * done by a debugger happens when threads are suspended. If another * application thread is suspended within the same class loader, diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Locatable.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Locatable.java index 4dae01401f5..a0089436a78 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Locatable.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Locatable.java @@ -36,10 +36,10 @@ package com.sun.jdi; @jdk.Exported public interface Locatable { /** - * Returns the {@link Location} of this mirror, if there - * is executable code associated with it. Note that both - * JavaTM programming - * language methods and native methods have executable code. + * Returns the {@link Location} of this mirror, if there is + * executable code associated with it. Note that both Java™ + * programming language methods and native methods have executable + * code. * Returns null for abstract methods, since abstract methods * have no executable code. * diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java index 03d64f9424e..9b6e71b8680 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java @@ -31,8 +31,7 @@ import com.sun.jdi.*; * Request for notification when the contents of a field are accessed * in the target VM. * This event will be triggered when the specified field is accessed - * by JavaTM programming - * language code or by a + * by Java™ programming language code or by a * Java Native Interface (JNI) get function (Get<Type>Field, * GetStatic<Type>Field). * Access by JDI does not trigger this event. diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java index d28ae734659..994658485d6 100644 --- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java +++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java @@ -30,7 +30,7 @@ import com.sun.jdi.*; /** * Request for notification when a field is set. * This event will be triggered when a value is assigned to the specified - * field with a JavaTM programming + * field with a Java™ programming * language statement (assignment, increment, etc) or by a * Java Native Interface (JNI) set function (Set<Type>Field, * SetStatic<Type>Field). diff --git a/jdk/src/jdk.jdi/share/classes/jdi-overview.html b/jdk/src/jdk.jdi/share/classes/jdi-overview.html index 0a407f33868..83833741d82 100644 --- a/jdk/src/jdk.jdi/share/classes/jdi-overview.html +++ b/jdk/src/jdk.jdi/share/classes/jdi-overview.html @@ -1,11 +1,10 @@ - Java(tm) Debug Interface + Java™ Debug Interface - The JavaTM - Debug Interface (JDI) is a high level Java + The Java™ Debug Interface (JDI) is a high level Java API providing information useful for debuggers and similar systems needing access to the running state of a (usually remote) virtual machine. diff --git a/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/RMIGenerator.java b/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/RMIGenerator.java index 4dc745ff8ab..9725872a373 100644 --- a/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/RMIGenerator.java +++ b/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/RMIGenerator.java @@ -79,7 +79,7 @@ public class RMIGenerator implements RMIConstants, Generator { * Examine and consume command line arguments. * @param argv The command line arguments. Ignore null * and unknown arguments. Set each consumed argument to null. - * @param error Report any errors using the main.error() methods. + * @param main Report any errors using the main.error() methods. * @return true if no errors, false otherwise. */ public boolean parseArgs(String argv[], Main main) { diff --git a/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/RemoteClass.java b/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/RemoteClass.java index e9ec3fa67ea..6187d5ca866 100644 --- a/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/RemoteClass.java +++ b/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/RemoteClass.java @@ -111,7 +111,7 @@ public class RemoteClass implements sun.rmi.rmic.RMIConstants { * the remote methods implemented by this class, i.e. all of the * methods in the class's remote interfaces. * - * The methods in the array are ordered according to the comparision + * The methods in the array are ordered according to the comparison * of the strings consisting of their method name followed by their * type signature, so each method's index in the array corresponds * to its "operation number" in the JDK 1.1 version of the diff --git a/jdk/src/sample/share/jmx/jmx-scandir/index.html b/jdk/src/sample/share/jmx/jmx-scandir/index.html index 835e7a1cff6..c235e20ad9d 100644 --- a/jdk/src/sample/share/jmx/jmx-scandir/index.html +++ b/jdk/src/sample/share/jmx/jmx-scandir/index.html @@ -33,11 +33,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> - JMX(TM) "scandir" Example + JMX™ "scandir" Example -

                        JavaTM Management Extensions (JMXTM) scandir Example

                        +

                        Java™ Management Extensions (JMX™) scandir Example

                        Introduction

                          @@ -1197,7 +1197,7 @@ href="http://www.netbeans.org"

                          Another common best practice when you want to improve interoperability is to use directly the Notification base classes provided in the - JMXTM API. Do not create your own + JMX™ API. Do not create your own subclasses of these standard classes.

                          Indeed, if you code your own subclass, a generic @@ -1974,7 +1974,7 @@ java More information on SSL authentication can be obtained from the JavaTM Secure Socket Extension (JSSE) Reference Guide. + >Java™ Secure Socket Extension (JSSE) Reference Guide.

                          To start jconsole with our provided keystore and truststore, go to the scandir example root directory and @@ -2202,13 +2202,13 @@ href="http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.htm

                        • JavaTM Secure Socket Extension (JSSE) Reference Guide: - comprehensive documentation about the JavaTM Secure Socket + >Java™ Secure Socket Extension (JSSE) Reference Guide: + comprehensive documentation about the Java™ Secure Socket Extension (JSSE)
                        • Java SE 6 Documentation Index: This document covers the - JavaTM Platform, Standard Edition 6 JDK.
                        • + Java™ Platform, Standard Edition 6 JDK.


                          diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 7232e6b2f3b..cf33484f7ef 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -379,4 +379,10 @@ sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.java generic-all # 8064572 8060736 8062938 sun/jvmstat/monitor/MonitoredVm/CR6672135.java generic-all +# 8079273 +demo/jvmti/hprof/CpuOldTest.java generic-all +demo/jvmti/hprof/CpuTimesTest.java generic-all +demo/jvmti/hprof/OptionsTest.java generic-all +demo/jvmti/hprof/StackMapTableTest.java generic-all + ############################################################################ diff --git a/jdk/test/TEST.groups b/jdk/test/TEST.groups index 73ac408f90e..d6af5fa5799 100644 --- a/jdk/test/TEST.groups +++ b/jdk/test/TEST.groups @@ -534,7 +534,6 @@ needs_charsets = \ sun/nio/cs/OLD/TestIBMDB.java \ sun/nio/cs/SJISCanEncode.java \ sun/nio/cs/Test6254467.java \ - sun/nio/cs/TestCompoundTest.java \ sun/nio/cs/TestCp834_SBCS.java \ sun/nio/cs/TestEUC_TW.java \ sun/nio/cs/TestISO2022CNDecoder.java \ diff --git a/jdk/test/com/sun/crypto/provider/Cipher/KeyWrap/TestCipherKeyWrapperTest.java b/jdk/test/com/sun/crypto/provider/Cipher/KeyWrap/TestCipherKeyWrapperTest.java new file mode 100644 index 00000000000..363d21d0c27 --- /dev/null +++ b/jdk/test/com/sun/crypto/provider/Cipher/KeyWrap/TestCipherKeyWrapperTest.java @@ -0,0 +1,316 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import static java.lang.System.out; + +import java.lang.Integer; +import java.lang.String; +import java.lang.System; +import java.security.AlgorithmParameters; +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.Key; +import java.security.KeyPair; +import java.security.NoSuchAlgorithmException; +import java.security.KeyPairGenerator; +import java.security.Provider; +import java.security.Security; +import java.security.spec.AlgorithmParameterSpec; +import java.security.spec.InvalidKeySpecException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Random; + +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.SecretKey; +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.SecretKeyFactory; +import javax.crypto.spec.PBEKeySpec; +import javax.crypto.spec.PBEParameterSpec; + +/* + * @test + * @bug 8048599 + * @summary Tests for key wrap and unwrap operations + */ + +public class TestCipherKeyWrapperTest { + private static final String SUN_JCE = "SunJCE"; + // Blowfish Variable key length: 32 bits to 448 bits + private static final int BLOWFISH_MIN_KEYSIZE = 32; + private static final int BLOWFISH_MAX_KEYSIZE = 448; + private static final int LINIMITED_KEYSIZE = 128; + private static final String NOPADDING = "NoPaDDing"; + private static final String[] PBE_ALGORITHM_AR = { "pbeWithMD5ANDdes", + "PBEWithMD5AndDES/CBC/PKCS5Padding", "PBEWithMD5AndTripleDES", + "PBEWithMD5AndTripleDES/CBC/PKCS5Padding", "PBEwithSHA1AndDESede", + "PBEwithSHA1AndDESede/CBC/PKCS5Padding", "PBEwithSHA1AndRC2_40", + "PBEwithSHA1Andrc2_40/CBC/PKCS5Padding", "PBEWithSHA1AndRC2_128", + "PBEWithSHA1andRC2_128/CBC/PKCS5Padding", "PBEWithSHA1AndRC4_40", + "PBEWithsha1AndRC4_40/ECB/NoPadding", "PBEWithSHA1AndRC4_128", + "pbeWithSHA1AndRC4_128/ECB/NoPadding", "PBEWithHmacSHA1AndAES_128", + "PBEWithHmacSHA224AndAES_128", "PBEWithHmacSHA256AndAES_128", + "PBEWithHmacSHA384AndAES_128", "PBEWithHmacSHA512AndAES_128", + "PBEWithHmacSHA1AndAES_256", "PBEWithHmacSHA224AndAES_256", + "PBEWithHmacSHA256AndAES_256", "PBEWithHmacSHA384AndAES_256", + "PBEWithHmacSHA512AndAES_256" }; + private static final String[] MODEL_AR = { "ECb", "pCbC", "cbC", "cFB", + "cFB24", "cFB40", "OfB48", "OFB64" }; + private static final String[] PADDING_AR = { NOPADDING, "PKCS5Padding" }; + + private enum AlgorithmWrapper { + AESWrap("AES", "AESWrap", -1), + AESWrap_128("AES", "AESWrap_128", 128), + AESWrap_192("AES", "AESWrap_192", 192), + AESWrap_256("AES", "AESWrap_256", 256), + DESedeWrap("desede", "DESedeWrap", -1), + NegtiveWrap("AES", "DESedeWrap", -1); + + private final String algorithm; + private final String wrapper; + private final int keySize; + + private AlgorithmWrapper(String algorithm, String wrapper, int kSize) { + this.algorithm = algorithm; + this.wrapper = wrapper; + this.keySize = kSize; + } + + public String getAlgorithm() { + return algorithm; + } + + public String getWrapper() { + return wrapper; + } + + public int getKeySize() { + return keySize; + } + + }; + + public static void main(String[] args) throws Exception { + + TestCipherKeyWrapperTest test = new TestCipherKeyWrapperTest(); + // AESWrap and DESedeWrap test + for (AlgorithmWrapper algoWrapper : AlgorithmWrapper.values()) { + String algo = algoWrapper.getAlgorithm(); + String wrapper = algoWrapper.getWrapper(); + try { + int keySize = algoWrapper.getKeySize(); + // only run the tests on longer key lengths if unlimited + // version of JCE jurisdiction policy files are installed + if (!(Cipher.getMaxAllowedKeyLength(algo) == Integer.MAX_VALUE) + && keySize > LINIMITED_KEYSIZE) { + out.println(algo + " will not run if unlimited version of" + + " JCE jurisdiction policy files are installed"); + continue; + } + test.wrapperAesDESedeKeyTest(algo, wrapper, keySize); + if (algoWrapper == AlgorithmWrapper.NegtiveWrap) { + throw new RuntimeException("Expected not throw when algo" + + " and wrapAlgo are not match:" + algo); + } + } catch (InvalidKeyException e) { + if (algoWrapper == AlgorithmWrapper.NegtiveWrap) { + out.println("Expepted exception when algo" + + " and wrapAlgo are not match:" + algo); + } else { + throw e; + } + } + } + test.wrapperBlowfishKeyTest(); + // PBE and public wrapper test. + String[] publicPrivateAlgos = new String[] { "DiffieHellman", "DSA", + "RSA" }; + Provider provider = Security.getProvider(SUN_JCE); + if (provider == null) { + throw new RuntimeException("SUN_JCE provider not exist"); + } + + test.wrapperPBEKeyTest(provider); + // Public and private key wrap test + test.wrapperPublicPriviteKeyTest(provider, publicPrivateAlgos); + } + + private void wrapperAesDESedeKeyTest(String algo, String wrapAlgo, + int keySize) throws InvalidKeyException, NoSuchAlgorithmException, + NoSuchPaddingException, IllegalBlockSizeException, + InvalidAlgorithmParameterException { + // Initialization + KeyGenerator kg = KeyGenerator.getInstance(algo); + if (keySize != -1) { + kg.init(keySize); + } + SecretKey key = kg.generateKey(); + wrapTest(algo, wrapAlgo, key, key, Cipher.SECRET_KEY, false); + } + + private void wrapperBlowfishKeyTest() throws InvalidKeyException, + NoSuchAlgorithmException, NoSuchPaddingException, + IllegalBlockSizeException, InvalidAlgorithmParameterException { + // how many kinds of padding mode + int padKinds; + // Keysize should be multiple of 8 bytes. + int KeyCutter = 8; + int kSize = BLOWFISH_MIN_KEYSIZE; + String algorithm = "Blowfish"; + int maxAllowKeyLength = Cipher.getMaxAllowedKeyLength(algorithm); + boolean unLimitPolicy = maxAllowKeyLength == Integer.MAX_VALUE; + SecretKey key = null; + while (kSize <= BLOWFISH_MAX_KEYSIZE) { + for (String mode : MODEL_AR) { + // PKCS5padding is meaningful only for ECB, CBC, PCBC + if (mode.equalsIgnoreCase(MODEL_AR[0]) + || mode.equalsIgnoreCase(MODEL_AR[1]) + || mode.equalsIgnoreCase(MODEL_AR[2])) { + padKinds = PADDING_AR.length; + } else { + padKinds = 1; + } + // Initialization + KeyGenerator kg = KeyGenerator.getInstance(algorithm); + for (int k = 0; k < padKinds; k++) { + String transformation = algorithm + "/" + mode + "/" + + PADDING_AR[k]; + if (NOPADDING.equals(PADDING_AR[k]) && kSize % 64 != 0) { + out.println(transformation + + " will not run if input length not multiple" + + " of 8 bytes when padding is " + NOPADDING); + continue; + } + kg.init(kSize); + key = kg.generateKey(); + // only run the tests on longer key lengths if unlimited + // version of JCE jurisdiction policy files are installed + if (!unLimitPolicy && kSize > LINIMITED_KEYSIZE) { + out.println("keyStrength > 128 within " + algorithm + + " will not run under global policy"); + } else { + wrapTest(transformation, transformation, key, key, + Cipher.SECRET_KEY, false); + } + } + } + if (kSize <= LINIMITED_KEYSIZE) { + KeyCutter = 8; + } else { + KeyCutter = 48; + } + kSize += KeyCutter; + } + } + + private void wrapperPBEKeyTest(Provider p) throws InvalidKeySpecException, + InvalidKeyException, NoSuchPaddingException, + IllegalBlockSizeException, InvalidAlgorithmParameterException, + NoSuchAlgorithmException { + for (String alg : PBE_ALGORITHM_AR) { + String baseAlgo = alg.split("/")[0].toUpperCase(); + // only run the tests on longer key lengths if unlimited version + // of JCE jurisdiction policy files are installed + + if (Cipher.getMaxAllowedKeyLength(alg) < Integer.MAX_VALUE + && (baseAlgo.endsWith("TRIPLEDES") || alg + .endsWith("AES_256"))) { + out.println("keyStrength > 128 within " + alg + + " will not run under global policy"); + continue; + } + SecretKeyFactory skf = SecretKeyFactory.getInstance(baseAlgo, p); + SecretKey key = skf.generateSecret(new PBEKeySpec("Secret Lover" + .toCharArray())); + wrapTest(alg, alg, key, key, Cipher.SECRET_KEY, true); + } + } + + private void wrapperPublicPriviteKeyTest(Provider p, String[] algorithms) + throws NoSuchAlgorithmException, InvalidKeyException, + NoSuchPaddingException, IllegalBlockSizeException, + InvalidAlgorithmParameterException { + for (String algo : algorithms) { + // Key pair generated + System.out.println("Generate key pair (algorithm: " + algo + + ", provider: " + p.getName() + ")"); + KeyPairGenerator kpg = KeyPairGenerator.getInstance(algo); + kpg.initialize(512); + KeyPair kp = kpg.genKeyPair(); + // key generated + String algoWrap = "DES"; + KeyGenerator kg = KeyGenerator.getInstance(algoWrap, p); + Key key = kg.generateKey(); + wrapTest(algo, algoWrap, key, kp.getPrivate(), Cipher.PRIVATE_KEY, + false); + wrapTest(algo, algoWrap, key, kp.getPublic(), Cipher.PUBLIC_KEY, + false); + } + } + + private void wrapTest(String transformation, String wrapAlgo, Key initKey, + Key wrapKey, int keyType, boolean isPBE) + throws NoSuchAlgorithmException, NoSuchPaddingException, + InvalidKeyException, IllegalBlockSizeException, + InvalidAlgorithmParameterException { + String algo = transformation.split("/")[0]; + boolean isAESBlowfish = algo.indexOf("AES") != -1 + || algo.indexOf("Blowfish") != -1; + AlgorithmParameters aps = null; + AlgorithmParameterSpec pbeParams = null; + if (isPBE) { + byte[] salt = new byte[8]; + int iterCnt = 1000; + new Random().nextBytes(salt); + pbeParams = new PBEParameterSpec(salt, iterCnt); + } + // Wrap & UnWrap operation + Cipher wrapCI = Cipher.getInstance(wrapAlgo); + if (isPBE && !isAESBlowfish) { + wrapCI.init(Cipher.WRAP_MODE, initKey, pbeParams); + } else if (isAESBlowfish) { + wrapCI.init(Cipher.WRAP_MODE, initKey); + aps = wrapCI.getParameters(); + } else { + wrapCI.init(Cipher.WRAP_MODE, initKey); + } + out.println("keysize : " + wrapKey.getEncoded().length); + byte[] keyWrapper = wrapCI.wrap(wrapKey); + if (isPBE && !isAESBlowfish) { + wrapCI.init(Cipher.UNWRAP_MODE, initKey, pbeParams); + } else if (isAESBlowfish) { + wrapCI.init(Cipher.UNWRAP_MODE, initKey, aps); + } else { + wrapCI.init(Cipher.UNWRAP_MODE, initKey); + } + Key unwrappedKey = wrapCI.unwrap(keyWrapper, algo, keyType); + // Comparison + if (!Arrays.equals(wrapKey.getEncoded(), unwrappedKey.getEncoded())) { + throw new RuntimeException("Comparation failed testing " + + transformation + ":" + wrapAlgo + ":" + keyType); + } + } +} diff --git a/jdk/test/com/sun/jdi/BadHandshakeTest.java b/jdk/test/com/sun/jdi/BadHandshakeTest.java index 20f0ba559ed..89e05e08c94 100644 --- a/jdk/test/com/sun/jdi/BadHandshakeTest.java +++ b/jdk/test/com/sun/jdi/BadHandshakeTest.java @@ -84,14 +84,19 @@ public class BadHandshakeTest { class_name, pb, (line) -> { - // The first thing that will get read is - // Listening for transport dt_socket at address: xxxxx - // which shows the debuggee is ready to accept connections. - success.set(line.contains("Listening for transport dt_socket at address:")); - // If the first line contains 'Address already in use' - // that means the debuggee has failed to start due to busy port - bindFailed.set(line.contains("Address already in use")); - return true; + // 'Listening for transport dt_socket at address: xxxxx' + // indicates the debuggee is ready to accept connections + if (line.contains("Listening for transport dt_socket at address:")) { + success.set(true); + return true; + } + // 'Address already in use' indicates + // the debuggee has failed to start due to busy port. + if (line.contains("Address already in use")) { + bindFailed.set(true); + return true; + } + return false; }, Integer.MAX_VALUE, TimeUnit.MILLISECONDS diff --git a/jdk/test/com/sun/jdi/NoLaunchOptionTest.java b/jdk/test/com/sun/jdi/NoLaunchOptionTest.java index f141466f348..fdaa4adc374 100644 --- a/jdk/test/com/sun/jdi/NoLaunchOptionTest.java +++ b/jdk/test/com/sun/jdi/NoLaunchOptionTest.java @@ -21,134 +21,35 @@ * questions. */ +import static jdk.testlibrary.Asserts.assertFalse; +import jdk.testlibrary.OutputAnalyzer; +import jdk.testlibrary.ProcessTools; + /* - * @test NoLaunchOptionTest.java - * @bug 4554734 4724714 - * @summary Test for -Xrunjdwp:[onthrow,onuncaught] suboptions require launch suboption - * @author Tim Bell - * - * @modules jdk.jdi - * @run compile -g NoLaunchOptionTest.java - * @build VMConnection - * @run driver NoLaunchOptionTest + * @test NoLaunchOptionTest.java + * @bug 4554734 4724714 + * @summary Test for -Xrunjdwp:[onthrow,onuncaught] suboptions require launch suboption + * @author Tim Bell + * @library /lib/testlibrary + * @modules jdk.jdi + * @run compile -g NoLaunchOptionTest.java + * @build jdk.testlibrary.* VMConnection + * @run driver NoLaunchOptionTest */ - -import java.net.ServerSocket; - public class NoLaunchOptionTest extends Object { - private Process subprocess; - private int subprocessStatus; - private static final String CR = System.getProperty("line.separator"); - private static final int BUFFERSIZE = 4096; - public static final int RETSTAT = 0; - public static final int STDOUT = 1; - public static final int STDERR = 2; - - /** - * Run an arbitrary command and return the results to caller. - * - * @param an array of String containing the command - * to run and any flags or parameters to the command. - * - * @return completion status, stderr and stdout as array of String - * Look for: - * return status in result[NoLaunchOptionTest.RETSTAT] - * standard out in result[NoLaunchOptionTest.STDOUT] - * standard err in result[NoLaunchOptionTest.STDERR] - * - */ - public String[] run (String[] cmdStrings) { - StringBuffer stdoutBuffer = new StringBuffer(); - StringBuffer stderrBuffer = new StringBuffer(); - - System.out.print(CR + "runCommand method about to execute: "); - for (int iNdx = 0; iNdx < cmdStrings.length; iNdx++) { - System.out.print(" "); - System.out.print(cmdStrings[iNdx]); - } - System.out.println(CR); - try { - Process process = Runtime.getRuntime().exec(cmdStrings); - /* - * Gather up the output of the subprocess using non-blocking - * reads so we can get both the subprocess stdout and the - * subprocess stderr without overfilling any buffers. - */ - java.io.BufferedInputStream is = - new java.io.BufferedInputStream(process.getInputStream()); - int isLen = 0; - byte[] isBuf = new byte[BUFFERSIZE]; - - java.io.BufferedInputStream es = - new java.io.BufferedInputStream(process.getErrorStream()); - int esLen = 0; - byte[] esBuf = new byte[BUFFERSIZE]; - - do { - isLen = is.read(isBuf); - if (isLen > 0) { - stdoutBuffer.append( - new String(isBuf, 0, isLen)); - } - esLen = es.read(esBuf); - if (esLen > 0) { - stderrBuffer.append( - new String(esBuf, 0, esLen)); - } - } while ((isLen > -1) || (esLen > -1)); - try { - process.waitFor(); - subprocessStatus = process.exitValue(); - process = null; - } catch(java.lang.InterruptedException e) { - System.err.println("InterruptedException: " + e); - } - - } catch(java.io.IOException ex) { - System.err.println("IO error: " + ex); - } - String[] result = - new String[] { - Integer.toString(subprocessStatus), - stdoutBuffer.toString(), - stderrBuffer.toString() - }; - - System.out.println(CR + "--- Return code was: " + - CR + result[RETSTAT]); - System.out.println(CR + "--- Return stdout was: " + - CR + result[STDOUT]); - System.out.println(CR + "--- Return stderr was: " + - CR + result[STDERR]); - - return result; - } public static void main(String[] args) throws Exception { - // find a free port - ServerSocket ss = new ServerSocket(0); - int port = ss.getLocalPort(); - ss.close(); - String address = String.valueOf(port); + String[] cmd = VMConnection.insertDebuggeeVMOptions(new String[] { + "-agentlib:jdwp=transport=dt_socket,address=5555," + + "onthrow=java.lang.ClassNotFoundException,suspend=n", + "NotAClass" }); - String javaExe = System.getProperty("java.home") + - java.io.File.separator + "bin" + - java.io.File.separator + "java"; - String targetClass = "NotAClass"; - String cmds [] = {javaExe, - "-agentlib:jdwp=transport=dt_socket,address=" + - address + "," + - "onthrow=java.lang.ClassNotFoundException,suspend=n", - targetClass}; - NoLaunchOptionTest myTest = new NoLaunchOptionTest(); - String results [] = myTest.run(VMConnection.insertDebuggeeVMOptions(cmds)); - if ((results[RETSTAT].equals("1")) && - (results[STDERR].contains("ERROR:"))) { - System.out.println("Test passed: status = 1 with warning messages " + - "is expected and normal for this test"); - } else { - throw new Exception("Test failed: unspecified test failure"); - } + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmd); + OutputAnalyzer output = ProcessTools.executeProcess(pb); + System.out.println(output.getOutput()); + + assertFalse(output.getExitValue() == 0, "Exit code should not be 0"); + output.shouldContain("ERROR: JDWP Specify launch= when using onthrow or onuncaught suboption"); } } diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.java index d98b5b70ba3..77b6eec14e8 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2015, 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,22 +21,55 @@ * questions. */ -/* - * - * @bug 6455258 - * @summary Sanity test for com.sun.management.HotSpotDiagnosticMXBean.dumpHeap - * method - */ +import static jdk.testlibrary.Asserts.assertTrue; +import static jdk.testlibrary.Asserts.fail; +import java.io.File; import java.lang.management.*; import java.util.List; -import javax.management.MBeanServer; + +import jdk.test.lib.hprof.HprofParser; +import jdk.testlibrary.ProcessTools; + import com.sun.management.HotSpotDiagnosticMXBean; +/* + * @test + * @bug 6455258 + * @summary Sanity test for com.sun.management.HotSpotDiagnosticMXBean.dumpHeap method + * @library /lib/testlibrary + * @library /../../test/lib/share/classes + * @build jdk.testlibrary.* + * @build jdk.test.lib.hprof.* + * @build jdk.test.lib.hprof.module.* + * @build jdk.test.lib.hprof.parser.* + * @build jdk.test.lib.hprof.utils.* + * @run main DumpHeap + */ public class DumpHeap { - public static void main(String[] argv) throws Exception { - List list = ManagementFactory.getPlatformMXBeans(HotSpotDiagnosticMXBean.class); - System.out.println("Dumping to file: " + argv[0] + " ...."); - list.get(0).dumpHeap(argv[0], true); + + public static void main(String[] args) throws Exception { + List list = ManagementFactory.getPlatformMXBeans(HotSpotDiagnosticMXBean.class); + File dump = new File(ProcessTools.getProcessId() + ".hprof"); + if (dump.exists()) { + dump.delete(); + } + System.out.println("Dumping to file: " + dump.getAbsolutePath()); + list.get(0).dumpHeap(dump.getAbsolutePath(), true); + + verifyDumpFile(dump); + + dump.delete(); } + + private static void verifyDumpFile(File dump) { + assertTrue(dump.exists() && dump.isFile(), "Could not create dump file"); + try { + HprofParser.parse(dump); + } catch (Exception e) { + e.printStackTrace(); + fail("Could not parse dump file"); + } + } + } diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh deleted file mode 100644 index 55aef40d183..00000000000 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2006, 2015, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - - -# @test -# @bug 6455258 -# @summary Sanity test for com.sun.management.HotSpotDiagnosticMXBean.dumpHeap -# method -# -# @modules jdk.management -# @build DumpHeap -# @run shell DumpHeap.sh - -if [ "${TESTJAVA}" = "" ] ; then - echo "--Error: TESTJAVA must be defined as the pathname of a jdk to test." - exit 1 -fi - -if [ "${COMPILEJAVA}" = "" ] ; then - COMPILEJAVA="${TESTJAVA}" -fi - -failed=0 - -# we use the pid of this shell process to name the heap dump output file. -DUMPFILE="java_pid$$.hprof" - -${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES \ - DumpHeap ${DUMPFILE} || exit 2 - -# check that heap dump is parsable -${COMPILEJAVA}/bin/jhat ${TESTTOOLVMOPTS} -parseonly true ${DUMPFILE} -if [ $? != 0 ]; then failed=1; fi - -# dump file is large so remove it -rm ${DUMPFILE} - -exit $failed diff --git a/jdk/test/java/lang/Character/UnicodeBlock/NonOptimalMapSize.java b/jdk/test/java/lang/Character/UnicodeBlock/NonOptimalMapSize.java new file mode 100644 index 00000000000..73688021596 --- /dev/null +++ b/jdk/test/java/lang/Character/UnicodeBlock/NonOptimalMapSize.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/** + * @test + * @bug 8080535 + * @summary Expected size of Character.UnicodeBlock.map is not optimal + */ + +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Map; + +public class NonOptimalMapSize { + public static void main(String[] args) throws Throwable { + Class ubCls = Character.UnicodeBlock.class; + Field mapField = ubCls.getDeclaredField("map"); + mapField.setAccessible(true); + Map map = (Map)mapField.get(null); + if (!map.getClass().equals(HashMap.class)) { + throw new RuntimeException( + "Character.UnicodeBlock.map is expected to be HashMap"); + } + int mapSize = map.size(); + + Field sizeField = ubCls.getDeclaredField("INITIAL_CAPACITY"); + sizeField.setAccessible(true); + int INITIAL_CAPACITY = sizeField.getInt(null); + + // Construct a HashMap with specified initial capacity + HashMap map1 = new HashMap<>(INITIAL_CAPACITY); + Class hmCls = HashMap.class; + Field tableField = hmCls.getDeclaredField("table"); + tableField.setAccessible(true); + // ... and fill it up + map1.put(new Object(), new Object()); + final Object initialTable = tableField.get(map1); + while (map1.size() < map.size() && + initialTable == tableField.get(map1)) { + map1.put(new Object(), new Object()); + } + + // Now check that internal storage didn't change + if (initialTable != tableField.get(map1)) { + throw new RuntimeException( + "Initial capacity " + INITIAL_CAPACITY + + " was only enough to hold " + (map1.size()-1) + + " entries, but needed " + map.size()); + } + } +} diff --git a/jdk/test/java/lang/Runtime/exec/LotsOfOutput.java b/jdk/test/java/lang/Runtime/exec/LotsOfOutput.java index b75f8e89eb1..8d0c9514486 100644 --- a/jdk/test/java/lang/Runtime/exec/LotsOfOutput.java +++ b/jdk/test/java/lang/Runtime/exec/LotsOfOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -23,12 +23,22 @@ /** * @test - * @bug 4369826 + * @bug 4369826 8078582 * @summary Process with lots of output should not crash VM + * @key intermittent * @author kladko */ public class LotsOfOutput { + static final Runtime runtime = Runtime.getRuntime(); + + // Allow memory to grow by up to 1Mb total + static final int THRESHOLD = 1048576; + + // Compute used memory + static long usedMemory() { + return runtime.totalMemory() - runtime.freeMemory(); + } public static void main(String[] args) throws Exception { if (! UnixCommands.isUnix) { @@ -37,18 +47,21 @@ public class LotsOfOutput { } UnixCommands.ensureCommandsAvailable("cat"); - Process p = Runtime.getRuntime().exec(UnixCommands.cat() + " /dev/zero"); - long initMemory = Runtime.getRuntime().totalMemory(); - for (int i=1; i< 10; i++) { + Process p = runtime.exec(UnixCommands.cat() + " /dev/zero"); + long initMemory = usedMemory(); + boolean growing = false; + for (int i = 1; i < 10; i++) { Thread.sleep(100); - long totalMemory = Runtime.getRuntime().totalMemory(); - if (totalMemory != initMemory) { - System.out.printf("consuming memory: i: %d, initial: %d, total: %d, delta: %d%n", - i, initMemory, totalMemory, totalMemory - initMemory); + long used = usedMemory(); + if (used != initMemory) { + System.out.printf("consuming memory: i: %d, initial: %d, used: %d, delta: %d%n", + i, initMemory, used, used - initMemory); } - if (totalMemory > initMemory + 1000000) - throw new Exception("Process consumes memory."); + if (used > initMemory + THRESHOLD) + growing = true; } + if (growing) + throw new Exception("Process consumes memory."); } } diff --git a/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java b/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java index 1d3cbeb64d1..45284277fcb 100644 --- a/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java +++ b/jdk/test/java/lang/invoke/MethodHandles/CatchExceptionTest.java @@ -72,12 +72,6 @@ public class CatchExceptionTest { final int catchDrops) { this.testCase = testCase; this.dropped = catchDrops; - if (Helper.IS_VERBOSE) { - System.out.printf("CatchException::CatchException(%s, isVararg=%b " + - "argsCount=%d catchDrops=%d)%n", - testCase, isVararg, argsCount, catchDrops - ); - } MethodHandle thrower = testCase.thrower; int throwerLen = thrower.type().parameterCount(); List> classes; @@ -97,9 +91,11 @@ public class CatchExceptionTest { } public static void main(String[] args) throws Throwable { + System.out.println("classes = " + ARGS_CLASSES); + TestFactory factory = new TestFactory(); long timeout = Helper.IS_THOROUGH ? 0L : Utils.adjustTimeout(Utils.DEFAULT_TEST_TIMEOUT); - // substract vm init time and reserve time for vm exit + // subtract vm init time and reserve time for vm exit timeout *= 0.9; TimeLimitedRunner runner = new TimeLimitedRunner(timeout, 2.0d, () -> { @@ -131,6 +127,12 @@ public class CatchExceptionTest { } private void runTest() { + if (Helper.IS_VERBOSE) { + System.out.printf("CatchException(%s, isVararg=%b argsCount=%d " + + "dropped=%d)%n", + testCase, thrower.isVarargsCollector(), argsCount, dropped); + } + Helper.clear(); Object[] args = Helper.randomArgs( @@ -212,10 +214,7 @@ class TestFactory { args = 1; } - if (Helper.IS_VERBOSE) { - System.out.printf("maxArgs = %d%nmaxDrops = %d%n", - maxArgs, maxDrops); - } + System.out.printf("maxArgs = %d%nmaxDrops = %d%n", maxArgs, maxDrops); constructorSize = TestCase.CONSTRUCTORS.size(); } @@ -243,7 +242,7 @@ class TestFactory { /** * @return next test from test matrix: - * {varArgs, noVarArgs} x TestCase.rtypes x TestCase.THROWABLES x {1, .., maxArgs } x {1, .., maxDrops} + * {varArgs, noVarArgs} x TestCase.rtypes x TestCase.THROWABLES x {1, .., maxArgs } x {0, .., maxDrops} */ public CatchExceptionTest nextTest() { if (constructor < constructorSize) { @@ -256,7 +255,7 @@ class TestFactory { return null; } if (dropArgs <= currentMaxDrops) { - if (dropArgs == 1) { + if (dropArgs == 0) { if (Helper.IS_THOROUGH || Helper.RNG.nextBoolean()) { ++dropArgs; return createTest(); @@ -271,8 +270,8 @@ class TestFactory { } } - if (args <= maxArgs) { - dropArgs = 1; + if (args < maxArgs) { + dropArgs = 0; currentMaxDrops = Math.min(args, maxDrops); ++args; return createTest(); diff --git a/jdk/test/java/nio/file/Files/SBC.java b/jdk/test/java/nio/file/Files/SBC.java index 64672d27947..d26428d5f60 100644 --- a/jdk/test/java/nio/file/Files/SBC.java +++ b/jdk/test/java/nio/file/Files/SBC.java @@ -22,7 +22,7 @@ */ /* @test - * @bug 4313887 8066915 + * @bug 4313887 * @summary Unit test for java.nio.file.Files.newByteChannel * @library .. */ @@ -59,7 +59,6 @@ public class SBC { dosSharingOptionTests(dir); // misc. tests - directoryOpenTests(dir); badCombinations(dir); unsupportedOptions(dir); nullTests(dir); @@ -279,21 +278,6 @@ public class SBC { } } - // test opening a directory for read or write - static void directoryOpenTests(Path dir) throws Exception { - try (SeekableByteChannel sbc = Files.newByteChannel(dir, READ)) { - throw new RuntimeException("Opened directory for read"); - } catch (IOException expected) { } - - try (SeekableByteChannel sbc = Files.newByteChannel(dir, WRITE)) { - throw new RuntimeException("Opened directory for write"); - } catch (IOException expected) { } - - try (SeekableByteChannel sbc = Files.newByteChannel(dir, APPEND)) { - throw new RuntimeException("Opened directory for append "); - } catch (IOException expected) { } - } - // Windows specific options for the use by applications that really want // to use legacy DOS sharing options static void dosSharingOptionTests(Path dir) throws Exception { diff --git a/jdk/test/java/security/KeyStore/ProbeKeystores.java b/jdk/test/java/security/KeyStore/ProbeKeystores.java index 10a005316fe..f97c416cfe4 100644 --- a/jdk/test/java/security/KeyStore/ProbeKeystores.java +++ b/jdk/test/java/security/KeyStore/ProbeKeystores.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, 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 @@ -41,15 +41,6 @@ public class ProbeKeystores { private static final String CERT_FILE = "trusted.pem"; public static final void main(String[] args) throws Exception { - try { - test(); - } finally { - cleanup(); - } - } - - private static final void test() throws Exception { - cleanup(); // Testing empty keystores @@ -129,22 +120,11 @@ public class ProbeKeystores { System.out.println("OK."); } - private static void cleanup() { - new File("empty.jks").delete(); - new File("empty.jceks").delete(); - new File("empty.p12").delete(); - new File("onecert.jks").delete(); - new File("onecert.jceks").delete(); - new File("onecert.p12").delete(); - new File("onekey.jceks").delete(); - new File("onekey.p12").delete(); - } - // Instantiate an empty keystore using the supplied keystore type private static void init(String file, String type) throws Exception { KeyStore ks = KeyStore.getInstance(type); ks.load(null, null); - try (OutputStream stream = new FileOutputStream(DIR + "/" + file)) { + try (OutputStream stream = new FileOutputStream(file)) { ks.store(stream, PASSWORD); } System.out.println("Created a " + type + " keystore named '" + file + "'"); @@ -156,7 +136,7 @@ public class ProbeKeystores { KeyStore ks = KeyStore.getInstance(type); ks.load(null, null); ks.setEntry("mycert", new KeyStore.TrustedCertificateEntry(cert), null); - try (OutputStream stream = new FileOutputStream(DIR + "/" + file)) { + try (OutputStream stream = new FileOutputStream(file)) { ks.store(stream, PASSWORD); } System.out.println("Created a " + type + " keystore named '" + file + "'"); @@ -169,7 +149,7 @@ public class ProbeKeystores { ks.load(null, null); ks.setEntry("mykey", new KeyStore.SecretKeyEntry(key), new PasswordProtection(PASSWORD)); - try (OutputStream stream = new FileOutputStream(DIR + "/" + file)) { + try (OutputStream stream = new FileOutputStream(file)) { ks.store(stream, PASSWORD); } System.out.println("Created a " + type + " keystore named '" + file + "'"); @@ -178,7 +158,7 @@ public class ProbeKeystores { // Instantiate a keystore by probing the supplied file for the keystore type private static void probe(String file, String type) throws Exception { // First try with the correct password - KeyStore ks = KeyStore.getInstance(new File(DIR, file), PASSWORD); + KeyStore ks = KeyStore.getInstance(new File(file), PASSWORD); if (!type.equalsIgnoreCase(ks.getType())) { throw new Exception("ERROR: expected a " + type + " keystore, " + "got a " + ks.getType() + " keystore instead"); @@ -188,7 +168,7 @@ public class ProbeKeystores { // Next try with an incorrect password try { - ks = KeyStore.getInstance(new File(DIR, file), BAD_PASSWORD); + ks = KeyStore.getInstance(new File(file), BAD_PASSWORD); throw new Exception("ERROR: expected an exception but got success"); } catch (IOException e) { System.out.println("Failed to load a " + type + " keystore named '" + file + "' (as expected)"); @@ -201,10 +181,10 @@ public class ProbeKeystores { Builder builder; if (usePassword) { - builder = Builder.newInstance(new File(DIR, file), + builder = Builder.newInstance(new File(file), new PasswordProtection(PASSWORD)); } else { - builder = Builder.newInstance(new File(DIR, file), + builder = Builder.newInstance(new File(file), new CallbackHandlerProtection(new DummyHandler())); } KeyStore ks = builder.getKeyStore(); @@ -219,7 +199,7 @@ public class ProbeKeystores { // Load the keystore entries private static void load(String file, String type) throws Exception { KeyStore ks = KeyStore.getInstance(type); - try (InputStream stream = new FileInputStream(DIR + "/" + file)) { + try (InputStream stream = new FileInputStream(file)) { ks.load(stream, PASSWORD); } if (!type.equalsIgnoreCase(ks.getType())) { diff --git a/jdk/test/java/util/logging/LogManager/Configuration/TestConfigurationLock.java b/jdk/test/java/util/logging/LogManager/Configuration/TestConfigurationLock.java new file mode 100644 index 00000000000..47e812cc012 --- /dev/null +++ b/jdk/test/java/util/logging/LogManager/Configuration/TestConfigurationLock.java @@ -0,0 +1,457 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.io.File; +import java.io.IOException; +import java.lang.management.LockInfo; +import java.lang.management.ManagementFactory; +import java.lang.management.MonitorInfo; +import java.lang.management.ThreadInfo; +import java.security.Permission; +import java.security.Policy; +import java.security.ProtectionDomain; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicLong; +import java.util.logging.Level; +import java.util.logging.LogManager; +import java.util.logging.Logger; + + +/** + * @test + * @bug 8077846 + * @key randomness + * @summary Test that using a reentrant configuration lock does not introduce + * new synchronization issues in Logger and LogManager. This test + * focuses more particularly on potential deadlock in + * drainLoggerRefQueueBounded / readConfiguration / reset + * todo: add at randomness + * @run main/othervm TestConfigurationLock + * @author danielfuchs + */ +// This test is a best effort to try & detect issues. The test itself will run +// for 8secs. This might be unsufficient to detect issues. +// To get a greater confidence it is recommended to run this test in a loop: +// e.g. use something like: +// $ while jtreg -jdk:$JDK -verbose:all \ +// test/java/util/logging/TestConfigurationLock.java ; \ +// do echo Running test again ; done +// and let it run for a few hours... +// +public class TestConfigurationLock { + + static volatile Exception thrown = null; + static volatile boolean goOn = true; + static volatile boolean deadlock = false; + + static final double CONFSYNCTHRESHOLD = 0.3; + static final double LOGSYNCTHRESHOLD = 0.3; + static final int RESETERS = 0; + static final int READERS = 3; + static final int LOGGERS = 4; + static final long TIME = 8 * 1000; // 8 sec. + static final long STEP = 1 * 1000; // message every 1 sec. + static final int LCOUNT = 50; // 50 loggers created in a row... + static final AtomicLong nextLogger = new AtomicLong(0); + static final AtomicLong resetCount = new AtomicLong(0); + static final AtomicLong readCount = new AtomicLong(0); + static final AtomicLong checkCount = new AtomicLong(0); + + static final String BLAH = "blah"; + + static Object fakeConfExternalLock() { + return LogManager.getLogManager(); + } + + static Object fakeLogExternalLock() { + return LogManager.getLogManager(); + } + + + /** + * This test will run both with and without a security manager. + * + * The test starts a number of threads that will call + * LogManager.reset() concurrently (ResetConf), and a number of threads + * that will call readConfiguration() (ReadConf), and then starts a + * number of threads that will create new loggers concurrently + * (AddLogger), and finally two additional threads: + * - one (Stopper) that will stop the test after 4secs (TIME ms), + * - and one DeadlockDetector that will attempt to detect deadlocks. + * If after 4secs no deadlock was detected and no exception was thrown + * then the test is considered a success and passes. + * + * This procedure is done twice: once without a security manager and once + * again with a security manager - which means the test takes ~8secs to + * run. + * + * Note that 8sec may not be enough to detect issues if there are some. + * This is a best effort test. + * + * @param args the command line arguments + * @throws java.lang.Exception if the test fails + */ + public static void main(String[] args) throws Exception { + + File conf = new File(System.getProperty("test.src", "./src"), + TestConfigurationLock.class.getSimpleName() + ".properties"); + if (!conf.canRead()) { + throw new IOException("Can't read config file: " + conf.getAbsolutePath()); + } + System.setProperty("java.util.logging.config.file", conf.getAbsolutePath()); + // test without security + System.out.println("No security"); + test(); + + // test with security + System.out.println("\nWith security"); + Policy.setPolicy(new Policy() { + @Override + public boolean implies(ProtectionDomain domain, Permission permission) { + if (super.implies(domain, permission)) return true; + // System.out.println("Granting " + permission); + return true; // all permissions + } + }); + System.setSecurityManager(new SecurityManager()); + test(); + } + + + /** + * Starts all threads, wait 4secs, then stops all threads. + * @throws Exception if a deadlock was detected or an error occurred. + */ + public static void test() throws Exception { + goOn = true; + thrown = null; + long sNextLogger = nextLogger.get(); + long sUpdateCount = resetCount.get(); + long sReadCount = readCount.get(); + long sCheckCount = checkCount.get(); + List threads = new ArrayList<>(); + for (int i = 0; i CONFSYNCTHRESHOLD) { + // calling reset while holding a lock can increase + // deadlock probability... + synchronized(fakeConfExternalLock()) { + LogManager.getLogManager().reset(); + } + } else { + LogManager.getLogManager().reset(); + } + Logger blah = Logger.getLogger(BLAH); + blah.setLevel(Level.FINEST); + blah.fine(BLAH); + resetCount.incrementAndGet(); + pause(1); + } catch (Exception x) { + fail(x); + } + } + } + } + + final static class ReadConf extends Thread { + + public ReadConf() { + setDaemon(true); + } + + @Override + public void run() { + while (goOn) { + try { + if (Math.random() > CONFSYNCTHRESHOLD) { + // calling readConfiguration while holding a lock can + // increase deadlock probability... + synchronized(fakeConfExternalLock()) { + LogManager.getLogManager().readConfiguration(); + } + } else { + LogManager.getLogManager().readConfiguration(); + } + Logger blah = Logger.getLogger(BLAH); + blah.setLevel(Level.FINEST); + blah.fine(BLAH); + readCount.incrementAndGet(); + pause(1); + } catch (Exception x) { + fail(x); + } + } + } + } + + final static class AddLogger extends Thread { + + public AddLogger() { + setDaemon(true); + } + + @Override + public void run() { + try { + while (goOn) { + Logger l; + Logger foo = Logger.getLogger("foo"); + Logger bar = Logger.getLogger("foo.bar"); + for (int i=0; i < LCOUNT ; i++) { + LogManager manager = LogManager.getLogManager(); + if (Math.random() > LOGSYNCTHRESHOLD) { + synchronized(fakeLogExternalLock()) { + l = Logger.getLogger("foo.bar.l"+nextLogger.incrementAndGet()); + } + } else { + l = Logger.getLogger("foo.bar.l"+nextLogger.incrementAndGet()); + } + l.setLevel(Level.FINEST); + l.fine("I'm fine"); + if (!goOn) break; + pause(1); + } + } + } catch (InterruptedException | RuntimeException x ) { + fail(x); + } + } + } + + final static class DeadlockDetector extends Thread { + + @Override + public void run() { + boolean deadlock = false; + while(goOn) { + try { + long[] ids = ManagementFactory.getThreadMXBean().findDeadlockedThreads(); + checkCount.incrementAndGet(); + ids = ids == null ? new long[0] : ids; + if (ids.length == 1) { + throw new RuntimeException("Found 1 deadlocked thread: "+ids[0]); + } else if (ids.length > 0) { + deadlock = true; + ThreadInfo[] infos = ManagementFactory.getThreadMXBean() + .getThreadInfo(ids, true, true); + System.err.println("Found "+ids.length+" deadlocked threads: "); + for (ThreadInfo inf : infos) { + System.err.println(asString(inf)); + } + throw new RuntimeException("Found "+ids.length+" deadlocked threads"); + } + pause(100); + } catch(InterruptedException | RuntimeException x) { + if (deadlock) deadlock(x); + else fail(x); + } + } + } + + } + + static final class Stopper extends Thread { + long start; + long time; + + Stopper(long time) { + start = System.currentTimeMillis(); + this.time = time; + setDaemon(true); + } + + @Override + public void run() { + try { + long rest, previous; + int msgCount = 0; + previous = time; + Logger logger = Logger.getLogger("remaining"); + while (goOn && (rest = start - System.currentTimeMillis() + time) > 0) { + if (previous == time || previous - rest >= STEP) { + logger.log(Level.INFO, "{0}ms remaining...", String.valueOf(rest)); + msgCount++; + previous = rest == time ? rest -1 : rest; + System.gc(); + } + if (goOn == false) break; + pause(Math.min(rest, 100)); + } + System.err.println(this + ": " + msgCount + " messages."); + System.err.flush(); + System.out.println(System.currentTimeMillis() - start + + " ms elapsed ("+time+ " requested)"); + goOn = false; + } catch(InterruptedException | RuntimeException x) { + fail(x); + } + } + + } + + // ThreadInfo.toString() only prints 8 frames... + static String asString(ThreadInfo inf) { + StringBuilder sb = new StringBuilder(); + sb.append("\"").append(inf.getThreadName()).append("\"") + .append(inf.isDaemon() ? " daemon" : "") + .append(" prio=").append(inf.getPriority()) + .append(" Id=").append(inf.getThreadId()) + .append(" ").append(inf.getThreadState()); + if (inf.getLockName() != null) { + sb.append(" on ").append(inf.getLockName()); + } + if (inf.getLockOwnerName() != null) { + sb.append(" owned by \"").append(inf.getLockOwnerName()) + .append("\" Id=").append(inf.getLockOwnerId()); + } + if (inf.isSuspended()) { + sb.append(" (suspended)"); + } + if (inf.isInNative()) { + sb.append(" (in native)"); + } + sb.append('\n'); + int i = 0; + StackTraceElement[] stackTrace = inf.getStackTrace(); + for (; i < stackTrace.length; i++) { + StackTraceElement ste = stackTrace[i]; + sb.append("\tat ").append(ste.toString()); + sb.append('\n'); + if (i == 0 && inf.getLockInfo() != null) { + Thread.State ts = inf.getThreadState(); + switch (ts) { + case BLOCKED: + sb.append("\t- blocked on ").append(inf.getLockInfo()); + sb.append('\n'); + break; + case WAITING: + sb.append("\t- waiting on ").append(inf.getLockInfo()); + sb.append('\n'); + break; + case TIMED_WAITING: + sb.append("\t- waiting on ").append(inf.getLockInfo()); + sb.append('\n'); + break; + default: + } + } + + for (MonitorInfo mi : inf.getLockedMonitors()) { + if (mi.getLockedStackDepth() == i) { + sb.append("\t- locked ").append(mi); + sb.append('\n'); + } + } + } + if (i < stackTrace.length) { + sb.append("\t..."); + sb.append('\n'); + } + + LockInfo[] locks = inf.getLockedSynchronizers(); + if (locks.length > 0) { + sb.append("\n\tNumber of locked synchronizers = ").append(locks.length); + sb.append('\n'); + for (LockInfo li : locks) { + sb.append("\t- ").append(li); + sb.append('\n'); + } + } + sb.append('\n'); + return sb.toString(); + } + + static void pause(long millis) throws InterruptedException { + Thread.sleep(millis); + } + + static void fail(Exception x) { + x.printStackTrace(System.err); + if (thrown == null) { + thrown = x; + } + goOn = false; + } + + static void deadlock(Exception x) { + deadlock = true; + System.out.flush(); + fail(x); + System.err.flush(); + } +} diff --git a/jdk/test/java/util/logging/LogManager/Configuration/TestConfigurationLock.properties b/jdk/test/java/util/logging/LogManager/Configuration/TestConfigurationLock.properties new file mode 100644 index 00000000000..c512b0ea067 --- /dev/null +++ b/jdk/test/java/util/logging/LogManager/Configuration/TestConfigurationLock.properties @@ -0,0 +1,22 @@ +######################################################################## +# Logging configuration property file for TestConfigurationLock.java # +######################################################################## + +handlers= java.util.logging.ConsoleHandler + +.level= INFO + +java.util.logging.FileHandler.pattern = %h/java%u.log +java.util.logging.FileHandler.limit = 50000 +java.util.logging.FileHandler.count = 1 +java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter + +java.util.logging.ConsoleHandler.level = INFO +java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter + +blah.level = FINE +foo.bar.l10.level = INFO +foo.bar.l100.level = INFO +foo.bar.l1000.level = INFO + + diff --git a/jdk/test/javax/crypto/SecretKeyFactory/PBKDF2TranslateTest.java b/jdk/test/javax/crypto/SecretKeyFactory/PBKDF2TranslateTest.java new file mode 100644 index 00000000000..acd2081b0f6 --- /dev/null +++ b/jdk/test/javax/crypto/SecretKeyFactory/PBKDF2TranslateTest.java @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2003, 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.spec.InvalidKeySpecException; +import java.util.Arrays; +import java.util.Random; +import javax.crypto.SecretKey; +import javax.crypto.SecretKeyFactory; +import javax.crypto.interfaces.PBEKey; +import javax.crypto.spec.PBEKeySpec; +import javax.security.auth.DestroyFailedException; + +import static java.lang.System.out; + +/* + * @test + * @bug 8048820 + * @summary The test verifies if the SecretKeyFactory.translateKey() method + * works as expected for the PBKDF2 algorithms. + */ + +public class PBKDF2TranslateTest { + + private static final String PASS_PHRASE = "some hidden string"; + private static final int ITERATION_COUNT = 1000; + private static final int KEY_SIZE = 128; + private static final String[] TEST_ALGOS = { "PBKDF2WithHmacSHA1", + "PBKDF2WithHmacSHA224", "PBKDF2WithHmacSHA256", + "PBKDF2WithHmacSHA384", "PBKDF2WithHmacSHA512" }; + private final String algoForTest; + + public static void main(String[] args) throws Exception { + for (String algo : TEST_ALGOS) { + PBKDF2TranslateTest theTest = new PBKDF2TranslateTest(algo); + byte[] salt = new byte[8]; + new Random().nextBytes(salt); + theTest.testMyOwnSecretKey(salt); + theTest.generateAndTranslateKey(salt); + theTest.translateSpoiledKey(salt); + } + } + + public PBKDF2TranslateTest(String algo) { + algoForTest = algo; + } + + /** + * The test case scenario implemented in the method: - derive PBKDF2 key + * using the given algorithm; - translate the key - check if the translated + * and original keys have the same key value. + * + */ + public void generateAndTranslateKey(byte[] salt) + throws NoSuchAlgorithmException, InvalidKeySpecException, + InvalidKeyException { + // derive PBKDF2 key + SecretKey key1 = getSecretKeyForPBKDF2(algoForTest, salt); + + // translate key + SecretKeyFactory skf = SecretKeyFactory.getInstance(algoForTest); + SecretKey key2 = skf.translateKey(key1); + + // Check if it still the same after translation + if (!Arrays.equals(key1.getEncoded(), key2.getEncoded())) { + System.out.println("Key1=" + new String(key1.getEncoded()) + + " key2=" + new String(key2.getEncoded()) + " salt=" + + new String(salt)); + throw new RuntimeException( + "generateAndTranslateKey test case failed: the key1 and" + + " key2 values in its primary encoding format are" + + " not the same for " + algoForTest + + " algorithm."); + } + } + + /** + * The test case scenario implemented in the method: - derive Key1 for the + * given PBKDF2 algorithm - create my own secret Key2 as an instance of a + * class implements PBEKey - translate Key2 - check if the key value of the + * translated key and Key1 are the same. + */ + private void testMyOwnSecretKey(byte[] salt) + throws NoSuchAlgorithmException, InvalidKeySpecException, + InvalidKeyException { + SecretKey key1 = getSecretKeyForPBKDF2(algoForTest, salt); + SecretKey key2 = getMyOwnSecretKey(salt); + + // Is it actually the same? + if (!Arrays.equals(key1.getEncoded(), key2.getEncoded())) { + throw new RuntimeException( + "We shouldn't be here. The key1 and key2 values in its" + + " primary encoding format have to be the same!"); + } + + // translate key + SecretKeyFactory skf = SecretKeyFactory.getInstance(algoForTest); + SecretKey key3 = skf.translateKey(key2); + + // Check if it still the same after translation + if (!Arrays.equals(key1.getEncoded(), key3.getEncoded())) { + System.out.println("Key1=" + new String(key1.getEncoded()) + + " key3=" + new String(key3.getEncoded()) + " salt=" + + new String(salt)); + throw new RuntimeException( + "testMyOwnSecretKey test case failed: the key1 and key3" + + " values in its primary encoding format are not" + + " the same for " + algoForTest + " algorithm."); + } + + } + + /** + * The test case scenario implemented in the method: - create my own secret + * Key2 as an instance of a class implements PBEKey - spoil the key (set + * iteration count to 0, for example) - try to translate key - + * InvalidKeyException is expected. + */ + public void translateSpoiledKey(byte[] salt) + throws NoSuchAlgorithmException, InvalidKeySpecException { + // derive the key + SecretKey key1 = getMyOwnSecretKey(salt); + + // spoil the key + ((MyPBKDF2SecretKey) key1).spoil(); + + // translate key + SecretKeyFactory skf = SecretKeyFactory.getInstance(algoForTest); + try { + skf.translateKey(key1); + throw new RuntimeException( + "translateSpoiledKey test case failed, should throw" + + " InvalidKeyException when spoil the key"); + } catch (InvalidKeyException ike) { + out.println("Expected exception when spoil the key"); + } + + } + + /** + * Generate a PBKDF2 secret key using given algorithm. + */ + private SecretKey getSecretKeyForPBKDF2(String algoDeriveKey, byte[] salt) + throws NoSuchAlgorithmException, InvalidKeySpecException { + + SecretKeyFactory skf = SecretKeyFactory.getInstance(algoDeriveKey); + PBEKeySpec spec = new PBEKeySpec(PASS_PHRASE.toCharArray(), salt, + ITERATION_COUNT, KEY_SIZE); + + return skf.generateSecret(spec); + } + + /** + * Generate a secrete key as an instance of a class implements PBEKey. + */ + private SecretKey getMyOwnSecretKey(byte[] salt) + throws InvalidKeySpecException, NoSuchAlgorithmException { + return new MyPBKDF2SecretKey(PASS_PHRASE, algoForTest, salt, + ITERATION_COUNT, KEY_SIZE); + } + + /** + * An utility class to check the SecretKeyFactory.translateKey() method. + */ + class MyPBKDF2SecretKey implements PBEKey { + private final byte[] key; + private final byte[] salt; + private final String algorithm; + private final int keyLength; + private final String pass; + private int itereationCount; + + /** + * The key is generating by SecretKeyFactory and its value just copying + * in the key field of MySecretKey class. So, this is real key derived + * using the given algo. + */ + public MyPBKDF2SecretKey(String passPhrase, String algo, byte[] salt1, + int iterationCount, int keySize) + throws InvalidKeySpecException, NoSuchAlgorithmException { + algorithm = algo; + salt = salt1; + itereationCount = iterationCount; + pass = passPhrase; + + PBEKeySpec spec = new PBEKeySpec(passPhrase.toCharArray(), salt, + iterationCount, keySize); + + SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(algo); + + SecretKey realKey = keyFactory.generateSecret(spec); + + keyLength = realKey.getEncoded().length; + + key = new byte[keyLength]; + System.arraycopy(realKey.getEncoded(), 0, key, 0, keyLength); + } + + @Override + public String getAlgorithm() { + return algorithm; + } + + @Override + public String getFormat() { + return "RAW"; + } + + @Override + public byte[] getEncoded() { + byte[] copy = new byte[keyLength]; + System.arraycopy(key, 0, copy, 0, keyLength); + return copy; + } + + @Override + public int getIterationCount() { + return itereationCount; + } + + @Override + public byte[] getSalt() { + return salt; + } + + @Override + public char[] getPassword() { + return pass.toCharArray(); + } + + /** + * Spoil the generated key (before translation) to cause an + * InvalidKeyException + */ + public void spoil() { + itereationCount = -1; + } + + @Override + public void destroy() throws DestroyFailedException { + } + + @Override + public boolean isDestroyed() { + return false; + } + + } +} \ No newline at end of file diff --git a/jdk/test/javax/crypto/SecretKeyFactory/SecKFTranslateTest.java b/jdk/test/javax/crypto/SecretKeyFactory/SecKFTranslateTest.java new file mode 100644 index 00000000000..f1b5c825798 --- /dev/null +++ b/jdk/test/javax/crypto/SecretKeyFactory/SecKFTranslateTest.java @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2003, 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; +import java.security.SecureRandom; +import java.security.spec.AlgorithmParameterSpec; +import java.security.spec.InvalidKeySpecException; +import java.util.Arrays; +import java.util.Random; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.SecretKey; +import javax.crypto.SecretKeyFactory; +import javax.crypto.ShortBufferException; +import javax.crypto.spec.PBEKeySpec; +import javax.crypto.spec.PBEParameterSpec; +import javax.security.auth.DestroyFailedException; + +/* + * @test + * @bug 8048820 + * @summary The test verifies SecretKey values should remain the same after + * translation with SecretKeyFactory.translateKey(). + */ + +public class SecKFTranslateTest { + private static final String SUN_JCE = "SunJCE"; + + public static void main(String[] args) throws Exception { + + SecKFTranslateTest test = new SecKFTranslateTest(); + test.run(); + } + + private void run() throws Exception { + + for (Algorithm algorithm : Algorithm.values()) { + runTest(algorithm); + } + } + + private void runTest(Algorithm algo) throws NoSuchAlgorithmException, + NoSuchProviderException, InvalidKeyException, + InvalidKeySpecException, NoSuchPaddingException, + InvalidAlgorithmParameterException, ShortBufferException, + IllegalBlockSizeException, BadPaddingException { + AlgorithmParameterSpec[] aps = new AlgorithmParameterSpec[1]; + byte[] plainText = new byte[800]; + + SecretKey key1 = algo.intSecurityKey(aps); + Random random = new Random(); + // Initialization + SecretKeyFactory skf = SecretKeyFactory.getInstance(algo.toString(), + SUN_JCE); + + random.nextBytes(plainText); + Cipher ci = Cipher.getInstance(algo.toString(), SUN_JCE); + // Encryption + ci.init(Cipher.ENCRYPT_MODE, key1, aps[0]); + byte[] cipherText = new byte[ci.getOutputSize(plainText.length)]; + int offset = ci.update(plainText, 0, plainText.length, cipherText, 0); + ci.doFinal(cipherText, offset); + // translate key + SecretKey key2 = skf.translateKey(key1); + + // Decryption + ci.init(Cipher.DECRYPT_MODE, key2, aps[0]); + byte[] recoveredText = new byte[ci.getOutputSize(plainText.length)]; + ci.doFinal(cipherText, 0, cipherText.length, recoveredText); + + // Comparison + if (!Arrays.equals(plainText, recoveredText)) { + System.out.println("Key1:" + new String(key1.getEncoded()) + + " Key2:" + new String(key2.getEncoded())); + throw new RuntimeException("Testing translate key failed with " + + algo); + } + + } +} + +class MyOwnSecKey implements SecretKey { + + private static final String DEFAULT_ALGO = "PBEWithMD5AndDES"; + private final byte[] key; + private final String algorithm; + private final int keySize; + + public MyOwnSecKey(byte[] key1, int offset, String algo) + throws InvalidKeyException { + algorithm = algo; + if (algo.equalsIgnoreCase("DES")) { + keySize = 8; + } else if (algo.equalsIgnoreCase("DESede")) { + keySize = 24; + } else { + throw new InvalidKeyException( + "Inappropriate key format and algorithm"); + } + + if (key1 == null || key1.length - offset < keySize) { + throw new InvalidKeyException("Wrong key size"); + } + key = new byte[keySize]; + System.arraycopy(key, offset, key, 0, keySize); + } + + public MyOwnSecKey(PBEKeySpec ks) throws InvalidKeySpecException { + algorithm = DEFAULT_ALGO; + key = new String(ks.getPassword()).getBytes(); + keySize = key.length; + } + + @Override + public String getAlgorithm() { + return algorithm; + } + + @Override + public String getFormat() { + return "RAW"; + } + + @Override + public byte[] getEncoded() { + byte[] copy = new byte[keySize]; + System.arraycopy(key, 0, copy, 0, keySize); + return copy; + } + + @Override + public void destroy() throws DestroyFailedException { + } + + @Override + public boolean isDestroyed() { + return false; + } +} + +enum Algorithm { + DES { + @Override + SecretKey intSecurityKey(AlgorithmParameterSpec[] spec) + throws InvalidKeyException { + int keyLength = 8; + byte[] keyVal = new byte[keyLength]; + new SecureRandom().nextBytes(keyVal); + SecretKey key1 = new MyOwnSecKey(keyVal, 0, this.toString()); + return key1; + } + }, + DESEDE { + @Override + SecretKey intSecurityKey(AlgorithmParameterSpec[] spec) + throws InvalidKeyException { + int keyLength = 24; + byte[] keyVal = new byte[keyLength]; + new SecureRandom().nextBytes(keyVal); + SecretKey key1 = new MyOwnSecKey(keyVal, 0, this.toString()); + return key1; + } + }, + PBEWithMD5ANDdes { + @Override + SecretKey intSecurityKey(AlgorithmParameterSpec[] spec) + throws InvalidKeySpecException { + byte[] salt = new byte[8]; + int iterCnt = 6; + new Random().nextBytes(salt); + spec[0] = new PBEParameterSpec(salt, iterCnt); + PBEKeySpec pbeKS = new PBEKeySpec( + new String("So far so good").toCharArray()); + SecretKey key1 = new MyOwnSecKey(pbeKS); + return key1; + } + }; + abstract SecretKey intSecurityKey(AlgorithmParameterSpec[] spec) + throws InvalidKeyException, InvalidKeySpecException; +} diff --git a/jdk/test/javax/script/SimpleScriptContextNameChecksTest.java b/jdk/test/javax/script/SimpleScriptContextNameChecksTest.java new file mode 100644 index 00000000000..02b33553a26 --- /dev/null +++ b/jdk/test/javax/script/SimpleScriptContextNameChecksTest.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8072853 + * @summary SimpleScriptContext used by NashornScriptEngine doesn't completely complies to the spec regarding exception throwing + * @run testng SimpleScriptContextNameChecksTest + */ + +import java.util.List; +import java.util.function.Consumer; +import javax.script.*; +import org.testng.annotations.Test; + +public class SimpleScriptContextNameChecksTest { + private List getFactories() { + return new ScriptEngineManager().getEngineFactories(); + } + + private void testAndExpect(Consumer c, Class clazz) { + for (ScriptEngineFactory fac : getFactories()) { + ScriptContext sc = fac.getScriptEngine().getContext(); + String name = fac.getEngineName(); + try { + c.accept(sc); + throw new RuntimeException("no exception for " + name); + } catch (NullPointerException | IllegalArgumentException e) { + if (e.getClass() == clazz) { + System.out.println("got " + e + " as expected for " + name); + } else { + throw e; + } + } + } + } + + private void testAndExpectIAE(Consumer c) { + testAndExpect(c, IllegalArgumentException.class); + } + + private void testAndExpectNPE(Consumer c) { + testAndExpect(c, NullPointerException.class); + } + + @Test + public void getAttributeEmptyName() { + testAndExpectIAE(sc -> sc.getAttribute("", ScriptContext.GLOBAL_SCOPE)); + } + + @Test + public void getAttributeNullName() { + testAndExpectNPE(sc -> sc.getAttribute(null, ScriptContext.GLOBAL_SCOPE)); + } + + @Test + public void removeAttributeEmptyName() { + testAndExpectIAE(sc -> sc.removeAttribute("", ScriptContext.GLOBAL_SCOPE)); + } + + @Test + public void removeAttributeNullName() { + testAndExpectNPE(sc -> sc.removeAttribute(null, ScriptContext.GLOBAL_SCOPE)); + } + + @Test + public void setAttributeEmptyName() { + testAndExpectIAE(sc -> sc.setAttribute("", "value", ScriptContext.GLOBAL_SCOPE)); + } + + @Test + public void setAttributeNullName() { + testAndExpectNPE(sc -> sc.setAttribute(null, "value", ScriptContext.GLOBAL_SCOPE)); + } + + @Test + public void getAttributesScopeEmptyName() { + testAndExpectIAE(sc -> sc.getAttributesScope("")); + } + + @Test + public void getAttributesScopeNullName() { + testAndExpectNPE(sc -> sc.getAttributesScope(null)); + } +} diff --git a/jdk/test/javax/xml/crypto/dsig/ErrorHandlerPermissions.java b/jdk/test/javax/xml/crypto/dsig/ErrorHandlerPermissions.java new file mode 100644 index 00000000000..1231d3cfe33 --- /dev/null +++ b/jdk/test/javax/xml/crypto/dsig/ErrorHandlerPermissions.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.security.KeyFactory; +import java.security.PublicKey; +import java.security.spec.X509EncodedKeySpec; +import java.util.Base64; +import javax.xml.XMLConstants; +import javax.xml.crypto.Data; +import javax.xml.crypto.KeySelector; +import javax.xml.crypto.OctetStreamData; +import javax.xml.crypto.URIDereferencer; +import javax.xml.crypto.URIReference; +import javax.xml.crypto.URIReferenceException; +import javax.xml.crypto.XMLCryptoContext; +import javax.xml.crypto.dsig.XMLSignature; +import javax.xml.crypto.dsig.XMLSignatureFactory; +import javax.xml.crypto.dsig.dom.DOMValidateContext; +import javax.xml.parsers.DocumentBuilderFactory; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +/** + * @test + * @bug 8079140 + * @summary Check if IgnoreAllErrorHandler doesn't require additional permission + * @run main/othervm/java.security.policy=ErrorHandlerPermissions.policy + * ErrorHandlerPermissions + */ +public class ErrorHandlerPermissions { + + private final static String FS = System.getProperty("file.separator"); + private final static String DIR = System.getProperty("test.src", "."); + private final static String DATA_DIR = DIR + FS + "data"; + private final static String SIGNATURE = DATA_DIR + FS + + "signature-external-rsa.xml"; + + private static final String validationKey = + "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnx4TdvPSA5vcsPi0OJZi9Ox0Z" + + "2FRz2oeUCtuWoyEg0kUCeFd+jJZMstDJUiZNSOeuCO3FWSpdJgAwI4zlveHvuU/o" + + "qHSa1eYTObOCvxfVYGGflWsSvGXyiANtRWVUrYODBeyL+2pWxDYh+Fi5EKizPfTG" + + "wRjBVRSkRZKTnSjnQwIDAQAB"; + + private static final URIDereferencer dereferencer = + new DummyURIDereferencer(); + + public static void main(String[] args) throws Exception { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setNamespaceAware(true); + dbf.setValidating(false); + dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); + Document doc = dbf.newDocumentBuilder().parse(new File(SIGNATURE)); + NodeList nl = doc.getElementsByTagNameNS(XMLSignature.XMLNS, + "Signature"); + if (nl.getLength() == 0) { + throw new RuntimeException("Couldn't find 'Signature' element"); + } + Element element = (Element) nl.item(0); + + byte[] keyBytes = Base64.getDecoder().decode(validationKey); + X509EncodedKeySpec spec = new X509EncodedKeySpec(keyBytes); + KeyFactory kf = KeyFactory.getInstance("RSA"); + PublicKey key = kf.generatePublic(spec); + KeySelector ks = KeySelector.singletonKeySelector(key); + + DOMValidateContext vc = new DOMValidateContext(ks, element); + + // disable secure validation mode + vc.setProperty("org.jcp.xml.dsig.secureValidation", Boolean.FALSE); + + // set a dummy dereferencer to be able to get content by references + vc.setURIDereferencer(dereferencer); + + XMLSignatureFactory factory = XMLSignatureFactory.getInstance(); + XMLSignature signature = factory.unmarshalXMLSignature(vc); + + // run validation + signature.validate(vc); + } + + /** + * This URIDereferencer returns a static XML document. + */ + private static class DummyURIDereferencer implements URIDereferencer { + + @Override + public Data dereference(final URIReference ref, XMLCryptoContext ctx) + throws URIReferenceException { + // return static content + return new OctetStreamData(new ByteArrayInputStream( + "test".getBytes()), ref.getURI(), + ref.getType()); + } + } + +} diff --git a/jdk/test/javax/xml/crypto/dsig/ErrorHandlerPermissions.policy b/jdk/test/javax/xml/crypto/dsig/ErrorHandlerPermissions.policy new file mode 100644 index 00000000000..8db9c01c3c8 --- /dev/null +++ b/jdk/test/javax/xml/crypto/dsig/ErrorHandlerPermissions.policy @@ -0,0 +1,5 @@ +grant { + permission java.util.PropertyPermission "test.src", "read"; + permission java.util.PropertyPermission "file.separator", "read"; + permission java.io.FilePermission "${test.src}/-", "read"; +}; diff --git a/jdk/test/javax/xml/crypto/dsig/GenerationTests.java b/jdk/test/javax/xml/crypto/dsig/GenerationTests.java index 068cd2a86a2..945b1cdb802 100644 --- a/jdk/test/javax/xml/crypto/dsig/GenerationTests.java +++ b/jdk/test/javax/xml/crypto/dsig/GenerationTests.java @@ -24,7 +24,7 @@ /** * @test * @bug 4635230 6283345 6303830 6824440 6867348 7094155 8038184 8038349 8046949 - * 8046724 + * 8046724 8079693 * @summary Basic unit tests for generating XML Signatures with JSR 105 * @compile -XDignore.symbol.file KeySelectors.java SignatureValidator.java * X509KeySelector.java GenerationTests.java @@ -92,7 +92,8 @@ public class GenerationTests { rsaSha256, rsaSha384, rsaSha512, ecdsaSha1; private static DigestMethod sha1, sha256, sha384, sha512; - private static KeyInfo dsa1024, dsa2048, rsa, rsa1024, p256ki; + private static KeyInfo dsa1024, dsa2048, rsa, rsa1024, + p256ki, p384ki, p521ki; private static KeySelector kvks = new KeySelectors.KeyValueKeySelector(); private static KeySelector sks; private static Key signingKey; @@ -131,6 +132,8 @@ public class GenerationTests { test_create_signature_enveloping_hmac_sha512(); test_create_signature_enveloping_rsa(); test_create_signature_enveloping_p256_sha1(); + test_create_signature_enveloping_p384_sha1(); + test_create_signature_enveloping_p521_sha1(); test_create_signature_external_b64_dsa(); test_create_signature_external_dsa(); test_create_signature_keyname(); @@ -186,7 +189,11 @@ public class GenerationTests { rsa1024 = kifac.newKeyInfo(Collections.singletonList (kifac.newKeyValue(getPublicKey("RSA", 1024)))); p256ki = kifac.newKeyInfo(Collections.singletonList - (kifac.newKeyValue(getECPublicKey()))); + (kifac.newKeyValue(getECPublicKey("P256")))); + p384ki = kifac.newKeyInfo(Collections.singletonList + (kifac.newKeyValue(getECPublicKey("P384")))); + p521ki = kifac.newKeyInfo(Collections.singletonList + (kifac.newKeyValue(getECPublicKey("P521")))); rsaSha1 = fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null); rsaSha256 = fac.newSignatureMethod ("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", null); @@ -359,7 +366,21 @@ public class GenerationTests { static void test_create_signature_enveloping_p256_sha1() throws Exception { System.out.println("* Generating signature-enveloping-p256-sha1.xml"); test_create_signature_enveloping(sha1, ecdsaSha1, p256ki, - getECPrivateKey(), kvks, false); + getECPrivateKey("P256"), kvks, false); + System.out.println(); + } + + static void test_create_signature_enveloping_p384_sha1() throws Exception { + System.out.println("* Generating signature-enveloping-p384-sha1.xml"); + test_create_signature_enveloping(sha1, ecdsaSha1, p384ki, + getECPrivateKey("P384"), kvks, false); + System.out.println(); + } + + static void test_create_signature_enveloping_p521_sha1() throws Exception { + System.out.println("* Generating signature-enveloping-p521-sha1.xml"); + test_create_signature_enveloping(sha1, ecdsaSha1, p521ki, + getECPrivateKey("P521"), kvks, false); System.out.println(); } @@ -1189,37 +1210,63 @@ public class GenerationTests { "237008997971129772408397621801631622129297063463868593083106979716" + "204903524890556839550490384015324575598723478554854070823335021842" + "210112348400928769"; - private static final String EC_X = + private static final String EC_P256_X = "335863644451761614592446380116804721648611739647823420286081723541" + "6166183710"; - private static final String EC_Y = + private static final String EC_P256_Y = "951559601159729477487064127150143688502130342917782252098602422796" + "95457910701"; - private static final String EC_S = + private static final String EC_P256_S = "425976209773168452211813225517384419928639977904006759709292218082" + "7440083936"; - private static final ECParameterSpec EC_PARAMS; + private static final ECParameterSpec EC_P256_PARAMS = initECParams( + "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF", + "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC", + "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B", + "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296", + "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5", + "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551", + 1 + ); + private static final String EC_P384_X = + "12144058647679082341340699736608428955270957565259459672517275506071643671835484144490620216582303669654008841724053"; + private static final String EC_P384_Y = + "18287745972107701566600963632634101287058332546756092926848497481238534346489545826483592906634896557151987868614320"; + private static final String EC_P384_S = + "10307785759830534742680442271492590599236624208247590184679565032330507874096079979152605984203102224450595283943382"; + private static final ECParameterSpec EC_P384_PARAMS = initECParams( + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF", + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC", + "B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF", + "AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7", + "3617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F", + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973", + 1 + ); + private static final String EC_P521_X = + "4157918188927862838251799402582135611021257663417126086145819679867926857146776190737187582274664373117054717389603317411991660346043842712448912355335343997"; + private static final String EC_P521_Y = + "4102838062751704796157456866854813794620023146924181568434486703918224542844053923233919899911519054998554969832861957437850996213216829205401947264294066288"; + private static final String EC_P521_S = + "4857798533181496041050215963883119936300918353498701880968530610687256097257307590162398707429640390843595868713096292822034014722985178583665959048714417342"; + private static final ECParameterSpec EC_P521_PARAMS = initECParams( + "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", + "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC", + "0051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00", + "00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66", + "011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650", + "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409", + 1 + ); - static { - final String ec_sfield, ec_a, ec_b, ec_gx, ec_gy, ec_n; - ec_sfield = - "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"; - ec_a = - "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"; - ec_b = - "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"; - ec_gx = - "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296"; - ec_gy = - "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"; - ec_n = - "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"; - final int ec_h = 1; - final ECField ec_field = new ECFieldFp(bigInt(ec_sfield)); - final EllipticCurve ec_curve = new EllipticCurve(ec_field, - bigInt(ec_a), bigInt(ec_b)); - final ECPoint ec_g = new ECPoint(bigInt(ec_gx), bigInt(ec_gy)); - EC_PARAMS = new ECParameterSpec(ec_curve, ec_g, bigInt(ec_n), ec_h); + private static ECParameterSpec initECParams( + String sfield, String a, String b, String gx, String gy, + String n, int h) { + ECField field = new ECFieldFp(bigInt(sfield)); + EllipticCurve curve = new EllipticCurve(field, + bigInt(a), bigInt(b)); + ECPoint g = new ECPoint(bigInt(gx), bigInt(gy)); + return new ECParameterSpec(curve, g, bigInt(n), h); } private static BigInteger bigInt(String s) { @@ -1253,11 +1300,32 @@ public class GenerationTests { return kf.generatePublic(kspec); } - private static PublicKey getECPublicKey() throws Exception { + private static PublicKey getECPublicKey(String curve) throws Exception { KeyFactory kf = KeyFactory.getInstance("EC"); - KeySpec kspec = new ECPublicKeySpec(new ECPoint(new BigInteger(EC_X), - new BigInteger(EC_Y)), - EC_PARAMS); + String x, y; + ECParameterSpec params; + switch (curve) { + case "P256": + x = EC_P256_X; + y = EC_P256_Y; + params = EC_P256_PARAMS; + break; + case "P384": + x = EC_P384_X; + y = EC_P384_Y; + params = EC_P384_PARAMS; + break; + case "P521": + x = EC_P521_X; + y = EC_P521_Y; + params = EC_P521_PARAMS; + break; + default: + throw new Exception("Unsupported curve: " + curve); + } + KeySpec kspec = new ECPublicKeySpec(new ECPoint(new BigInteger(x), + new BigInteger(y)), + params); return kf.generatePublic(kspec); } @@ -1287,9 +1355,27 @@ public class GenerationTests { return kf.generatePrivate(kspec); } - private static PrivateKey getECPrivateKey() throws Exception { + private static PrivateKey getECPrivateKey(String curve) throws Exception { + String s; + ECParameterSpec params; + switch (curve) { + case "P256": + s = EC_P256_S; + params = EC_P256_PARAMS; + break; + case "P384": + s = EC_P384_S; + params = EC_P384_PARAMS; + break; + case "P521": + s = EC_P521_S; + params = EC_P521_PARAMS; + break; + default: + throw new Exception("Unsupported curve: " + curve); + } KeyFactory kf = KeyFactory.getInstance("EC"); - KeySpec kspec = new ECPrivateKeySpec(new BigInteger(EC_S), EC_PARAMS); + KeySpec kspec = new ECPrivateKeySpec(new BigInteger(s), params); return kf.generatePrivate(kspec); } diff --git a/jdk/test/javax/xml/crypto/dsig/ValidationTests.java b/jdk/test/javax/xml/crypto/dsig/ValidationTests.java index 3480f23b2be..5413d28d215 100644 --- a/jdk/test/javax/xml/crypto/dsig/ValidationTests.java +++ b/jdk/test/javax/xml/crypto/dsig/ValidationTests.java @@ -23,7 +23,7 @@ /** * @test - * @bug 4635230 6365103 6366054 6824440 7131084 8046724 + * @bug 4635230 6365103 6366054 6824440 7131084 8046724 8079693 * @summary Basic unit tests for validating XML Signatures with JSR 105 * @compile -XDignore.symbol.file KeySelectors.java SignatureValidator.java * X509KeySelector.java ValidationTests.java @@ -35,6 +35,7 @@ import java.io.FileInputStream; import java.security.*; import javax.xml.crypto.Data; import javax.xml.crypto.KeySelector; +import javax.xml.crypto.MarshalException; import javax.xml.crypto.OctetStreamData; import javax.xml.crypto.URIDereferencer; import javax.xml.crypto.URIReference; @@ -60,9 +61,17 @@ public class ValidationTests { static class Test { String file; KeySelector ks; - Test(String file, KeySelector ks) { + Class exception; + + Test(String file, KeySelector ks, Class exception) { this.file = file; this.ks = ks; + this.exception = exception; + } + + // XMLSignatureException is expected by default + Test(String file, KeySelector ks) { + this(file, ks, XMLSignatureException.class); } } @@ -91,6 +100,8 @@ public class ValidationTests { new Test("signature-enveloping-dsa.xml", KVKS), new Test("signature-enveloping-rsa.xml", KVKS), new Test("signature-enveloping-p256-sha1.xml", KVKS), + new Test("signature-enveloping-p384-sha1.xml", KVKS), + new Test("signature-enveloping-p521-sha1.xml", KVKS), new Test("signature-enveloping-hmac-sha1.xml", SKKS), new Test("signature-external-dsa.xml", KVKS), new Test("signature-external-b64-dsa.xml", KVKS), @@ -110,7 +121,17 @@ public class ValidationTests { private final static Test[] INVALID_TESTS = { new Test("signature-enveloping-hmac-sha1-40.xml", SKKS), new Test("signature-enveloping-hmac-sha1-trunclen-0-attack.xml", SKKS), - new Test("signature-enveloping-hmac-sha1-trunclen-8-attack.xml", SKKS) + new Test("signature-enveloping-hmac-sha1-trunclen-8-attack.xml", SKKS), + new Test("signature-extra-text-in-signed-info.xml", SKKS, + MarshalException.class), + new Test("signature-wrong-canonicalization-method-algorithm.xml", SKKS, + MarshalException.class), + new Test("signature-wrong-transform-algorithm.xml", SKKS, + MarshalException.class), + new Test("signature-no-reference-uri.xml", SKKS), + new Test("signature-wrong-signature-method-algorithm.xml", SKKS, + MarshalException.class), + new Test("signature-wrong-tag-names.xml", SKKS, MarshalException.class) }; public static void main(String args[]) throws Exception { @@ -143,9 +164,14 @@ public class ValidationTests { test_signature(test); System.out.println("FAILED"); atLeastOneFailed = true; - } catch (XMLSignatureException xse) { - System.out.println(xse.getMessage()); - System.out.println("PASSED"); + } catch (Exception e) { + System.out.println("Exception: " + e); + if (e.getClass() != test.exception) { + System.out.println("FAILED: unexpected exception"); + atLeastOneFailed = true; + } else { + System.out.println("PASSED"); + } } } diff --git a/jdk/test/javax/xml/crypto/dsig/data/signature-enveloping-p384-sha1.xml b/jdk/test/javax/xml/crypto/dsig/data/signature-enveloping-p384-sha1.xml new file mode 100644 index 00000000000..115a5ae5c0a --- /dev/null +++ b/jdk/test/javax/xml/crypto/dsig/data/signature-enveloping-p384-sha1.xml @@ -0,0 +1,3 @@ +7/XTsHaBSOnJ/jXD5v0zL6VKYsk=s15F4ng4a+TfNHlK+y18igexSe3wRspeyQi8hwhyMUh6I6kyzxO1wcqRulFyBNwh/Dplht+WS9dO +GwL4xfDfozKss36ZsHACI3EYe0QI6pN7hcKp511muPI+cmoZzIN/BE7my2bSrGpZ3jNFQ1I6baGP9CE4AIMIyN/ugWhbsCQz8ntwXf15NStBt9MBXolglXbRYMqV8vYB +f7UJ1ixum8hzcEvgShn0L9l1VkWaU4bYr/Ss9ApimDvbF2g6Mw++sA==some text \ No newline at end of file diff --git a/jdk/test/javax/xml/crypto/dsig/data/signature-enveloping-p521-sha1.xml b/jdk/test/javax/xml/crypto/dsig/data/signature-enveloping-p521-sha1.xml new file mode 100644 index 00000000000..a4b60282cba --- /dev/null +++ b/jdk/test/javax/xml/crypto/dsig/data/signature-enveloping-p521-sha1.xml @@ -0,0 +1,5 @@ +7/XTsHaBSOnJ/jXD5v0zL6VKYsk=AaVkRumHXD0vVtkn2ogcAoByVge1KWGVWE6vph+xr/hcZTqNNaiIyXb7Itu0FBHD9M47T/CuM7y4 +m60zEssaaHl0AUNm7xGpZy7Heqaoibb/gMU1ErrfSNs7yuPG/TCqs8YAd3RGnc6ZbloitWpycGCU +LS4xxKms0KeRnbVpjk5OeVfKBAE2HJjBQRbl0sdGa1+1cJwxtPJXcnrRdmRXs6TEQmU97US+CK0vsoDQtlnXxDx37mawN7Sh4Atp +CUeYBbzvBmwPfQEyAO600W9xn4s5wSQvXod8v8brh5ISXhxYPFy3SCcGUxbQYqrVUnBrIXH8WEQX +K0/T+FdF4CzlQswJY0UZGeQYcA==some text \ No newline at end of file diff --git a/jdk/test/javax/xml/crypto/dsig/data/signature-external-rsa.xml b/jdk/test/javax/xml/crypto/dsig/data/signature-external-rsa.xml new file mode 100644 index 00000000000..fb3a0f4f986 --- /dev/null +++ b/jdk/test/javax/xml/crypto/dsig/data/signature-external-rsa.xml @@ -0,0 +1,3 @@ +test1Bq8FsjajUBYPD7stQeJSc66GlM=f6trDCcPsLLkIV/V4DGFbRf8b9Jwal8xGBDshNzEXwPmym2ChN85rbKIg/cbunf04F89/SXLo2v9 +AYjLcUr3G/Vz5YUmqNhnBvJukXgsIG0ddWl3mFi9Tk+CLINlbgfsaFqU9pQwFjmDyAqIrvZYqW7p +rTHLetv218mbUVBBAkc= \ No newline at end of file diff --git a/jdk/test/javax/xml/crypto/dsig/data/signature-extra-text-in-signed-info.xml b/jdk/test/javax/xml/crypto/dsig/data/signature-extra-text-in-signed-info.xml new file mode 100644 index 00000000000..578e7bb16e9 --- /dev/null +++ b/jdk/test/javax/xml/crypto/dsig/data/signature-extra-text-in-signed-info.xml @@ -0,0 +1,3 @@ +test1Bq8FsjajUBYPD7stQeJSc66GlM=extra textiTrgJERmYeD5hFwY8/MwJpkF+nd++AAOgf/Kxt9SwdE6BIYq2Vyxq4CQPhD+t2971BGTgvF6ejZd ++/Ko4Zs5Dqf4Lt65Vck0q43rM0PdP1e8gJov0IPYnZ1zeqFpah+N/OjmqTbshaZWRIjf3eqS6en5 +ZKjn+TkCQ1kOX/YUNDc= \ No newline at end of file diff --git a/jdk/test/javax/xml/crypto/dsig/data/signature-no-reference-uri.xml b/jdk/test/javax/xml/crypto/dsig/data/signature-no-reference-uri.xml new file mode 100644 index 00000000000..eb199f79df2 --- /dev/null +++ b/jdk/test/javax/xml/crypto/dsig/data/signature-no-reference-uri.xml @@ -0,0 +1,3 @@ +test1Bq8FsjajUBYPD7stQeJSc66GlM=BNPSYlNcyXcO/Tc1tr9mQ/KAZ40eFybLTDyB/HH1EHHMpc972A+nOX2EWBaLsVgG8apl0Isp1ZqV +gmoDHNF6xrcJJQVydVJzU08GVV4GiXHMqRYQbted7STQLhlhssvNNdMEoVApsX5ByL66wxKZQXrT +z1kZtOHAi88DOrmIJu0= \ No newline at end of file diff --git a/jdk/test/javax/xml/crypto/dsig/data/signature-wrong-canonicalization-method-algorithm.xml b/jdk/test/javax/xml/crypto/dsig/data/signature-wrong-canonicalization-method-algorithm.xml new file mode 100644 index 00000000000..2ce430e1de9 --- /dev/null +++ b/jdk/test/javax/xml/crypto/dsig/data/signature-wrong-canonicalization-method-algorithm.xml @@ -0,0 +1,3 @@ +test1Bq8FsjajUBYPD7stQeJSc66GlM=EBbyEV7e+1CTUsyCTyxiN8p+U3/za1oTjK7q+kF8Q87r8e/7C1z4ndGWbk6zyI3w6leT+I2suW9U +KkdvkrDXX2OyLw0GfgJfLkNn+1pGK6kyWpL95NoWJZhHkUAKKBZ0ikfZ4j33gYxrYK+IYCLeZYzr +hlZjdXXXCiSH0Sq+weQ= \ No newline at end of file diff --git a/jdk/test/javax/xml/crypto/dsig/data/signature-wrong-signature-method-algorithm.xml b/jdk/test/javax/xml/crypto/dsig/data/signature-wrong-signature-method-algorithm.xml new file mode 100644 index 00000000000..a2709caec76 --- /dev/null +++ b/jdk/test/javax/xml/crypto/dsig/data/signature-wrong-signature-method-algorithm.xml @@ -0,0 +1,3 @@ +test1Bq8FsjajUBYPD7stQeJSc66GlM=RjL9nfQg9u6+KEFfAlBBH7E7ilFgB7YEQ5MxOIJN/fOdQmc5iDD+YuhiHzNGXGi/UOyo6t8LxTxl +X4oFE1RNlPVkSAZK4LcTWhVa757WwgW1/EZo8PQYWp5NScLq6PumYaujoovSYBKW2N6+jQpnD/L6 +4cuEVNnwEFqvOLrjogY= \ No newline at end of file diff --git a/jdk/test/javax/xml/crypto/dsig/data/signature-wrong-tag-names.xml b/jdk/test/javax/xml/crypto/dsig/data/signature-wrong-tag-names.xml new file mode 100644 index 00000000000..152eb791985 --- /dev/null +++ b/jdk/test/javax/xml/crypto/dsig/data/signature-wrong-tag-names.xml @@ -0,0 +1,3 @@ +test1Bq8FsjajUBYPD7stQeJSc66GlM=cbNpPGavhM0BGUtrvLxvy2SCIt+I27BPpVEt0Q9mXrdPYurMqWF/67AdY9m5RqS7+ZZlwUtem083 +MczRYbKoOIq7sMbCqKKdzbSE/U6rfmky/ACQ5wgemZl8jtipwu5LhAUzjhzT8hhTjVqOYpHdkVJz +l9dnd9eWbLmEr3BI0VA= \ No newline at end of file diff --git a/jdk/test/javax/xml/crypto/dsig/data/signature-wrong-transform-algorithm.xml b/jdk/test/javax/xml/crypto/dsig/data/signature-wrong-transform-algorithm.xml new file mode 100644 index 00000000000..a64abc75c46 --- /dev/null +++ b/jdk/test/javax/xml/crypto/dsig/data/signature-wrong-transform-algorithm.xml @@ -0,0 +1,4 @@ + +test1Bq8FsjajUBYPD7stQeJSc66GlM=Wzyx3jgEKGwY+pBXBmqWLWhASHQYCCGZVii5sKKKeZUBKxNBthjiSVfzKANuLgX6zAt16XRycrSL +zFKTPuvGeWVPDvd+KTNKCJxN9ccrG7v23EM7RY2eMJGu2r5DLfKwV7H6YuJPsOuWifVkKAhvq7gd +6akJshxyAj9Ud+mjo48= \ No newline at end of file diff --git a/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java b/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java index 33c3e55a447..8542c98515f 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java +++ b/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java @@ -111,6 +111,8 @@ public class CustomLauncherTest { try { String[] launcher = getLauncher(); + if (launcher == null) return; // launcher not available for the tested platform; skip + System.out.println("Starting custom launcher:"); System.out.println("========================="); System.out.println(" launcher : " + launcher[0]); diff --git a/jdk/test/sun/nio/cs/FindDecoderBugs.java b/jdk/test/sun/nio/cs/FindDecoderBugs.java index df8afd18960..f4add2a4ca0 100644 --- a/jdk/test/sun/nio/cs/FindDecoderBugs.java +++ b/jdk/test/sun/nio/cs/FindDecoderBugs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2015, 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,16 +24,19 @@ /* * @test * @bug 6380723 - * @summary Decode many byte sequences in many ways + * @summary Decode many byte sequences in many ways (use -Dseed=X to set PRNG seed) + * @library /lib/testlibrary + * @build jdk.testlibrary.* * @run main/timeout=1800 FindDecoderBugs * @author Martin Buchholz - * @key randomness + * @key intermittent randomness */ import java.util.*; import java.util.regex.*; import java.nio.*; import java.nio.charset.*; +import jdk.testlibrary.RandomFactory; public class FindDecoderBugs { @@ -322,7 +325,7 @@ public class FindDecoderBugs { } } - private final static Random rnd = new Random(); + private final static Random rnd = RandomFactory.getRandom(); private static byte randomByte() { return (byte) rnd.nextInt(0x100); } diff --git a/jdk/test/sun/nio/cs/FindEncoderBugs.java b/jdk/test/sun/nio/cs/FindEncoderBugs.java index bfef4037ec4..19c1621856f 100644 --- a/jdk/test/sun/nio/cs/FindEncoderBugs.java +++ b/jdk/test/sun/nio/cs/FindEncoderBugs.java @@ -25,15 +25,18 @@ * @test * @bug 6233345 6381699 6381702 6381705 6381706 * @summary Encode many char sequences in many ways + * @library /lib/testlibrary/ + * @build jdk.testlibrary.* * @run main/timeout=1200 FindEncoderBugs * @author Martin Buchholz - * @key randomness + * @key randomness intermittent */ import java.util.*; import java.util.regex.*; import java.nio.*; import java.nio.charset.*; +import jdk.testlibrary.RandomFactory; public class FindEncoderBugs { @@ -456,7 +459,7 @@ public class FindEncoderBugs { } } - private final static Random rnd = new Random(); + private final static Random rnd = RandomFactory.getRandom(); private static char randomChar() { return (char) rnd.nextInt(Character.MAX_VALUE); } diff --git a/jdk/test/sun/nio/cs/TestStringCoding.java b/jdk/test/sun/nio/cs/TestStringCoding.java index 7c18a3596c6..95d273dd5cb 100644 --- a/jdk/test/sun/nio/cs/TestStringCoding.java +++ b/jdk/test/sun/nio/cs/TestStringCoding.java @@ -22,7 +22,7 @@ */ /* @test - @bug 6636323 6636319 7040220 7096080 7183053 + @bug 6636323 6636319 7040220 7096080 7183053 8080248 @summary Test if StringCoding and NIO result have the same de/encoding result * @run main/othervm/timeout=2000 TestStringCoding * @key randomness @@ -200,6 +200,17 @@ public class TestStringCoding { */ } + //encode mappable surrogates for hkscs + if (cs.name().equals("Big5-HKSCS") || cs.name().equals("x-MS950-HKSCS")) { + String str = "ab\uD840\uDD0Ccd"; + byte[] expected = new byte[] {(byte)'a', (byte)'b', + (byte)0x88, (byte)0x45, (byte)'c', (byte)'d' }; + if (!Arrays.equals(str.getBytes(cs.name()), expected) || + !Arrays.equals(str.getBytes(cs), expected)) { + throw new RuntimeException("encode(surrogates) failed -> " + + cs.name()); + } + } } static class PermissiveSecurityManger extends SecurityManager { diff --git a/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java b/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java index fea76c829f9..9d3b44e0057 100644 --- a/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java +++ b/jdk/test/sun/security/krb5/auto/HttpNegotiateServer.java @@ -40,21 +40,34 @@ import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.InetSocketAddress; import java.net.PasswordAuthentication; import java.net.Proxy; import java.net.URL; -import java.security.PrivilegedExceptionAction; +import java.net.URLConnection; +import java.security.*; import java.util.HashMap; import java.util.Map; import javax.security.auth.Subject; +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.CallbackHandler; +import javax.security.auth.callback.NameCallback; +import javax.security.auth.callback.PasswordCallback; +import javax.security.auth.callback.UnsupportedCallbackException; +import javax.security.auth.login.AppConfigurationEntry; +import javax.security.auth.login.Configuration; +import javax.security.auth.login.LoginContext; +import javax.security.auth.login.LoginException; +import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag; import org.ietf.jgss.GSSContext; import org.ietf.jgss.GSSCredential; import org.ietf.jgss.GSSManager; import sun.security.jgss.GSSUtil; import sun.security.krb5.Config; +import java.util.Base64; import sun.util.logging.PlatformLogger; import java.util.Base64; @@ -197,7 +210,7 @@ public class HttpNegotiateServer { proxyUrl = new URL("http://nosuchplace/a/b/c"); try { - Exception e1 = null, e2 = null; + Exception e1 = null, e2 = null, e3 = null; try { test6578647(); } catch (Exception e) { @@ -210,7 +223,14 @@ public class HttpNegotiateServer { e2 = e; e.printStackTrace(); } - if (e1 != null || e2 != null) { + try { + test8077155(); + } catch (Exception e) { + e3 = e; + e.printStackTrace(); + } + + if (e1 != null || e2 != null || e3 != null) { throw new RuntimeException("Test error"); } } finally { @@ -254,6 +274,121 @@ public class HttpNegotiateServer { } } + static void testConnect() { + InputStream inputStream = null; + try { + URL url = webUrl; + + URLConnection conn = url.openConnection(); + conn.connect(); + inputStream = conn.getInputStream(); + byte[] b = new byte[inputStream.available()]; + for (int j = 0; j < b.length; j++) { + b[j] = (byte) inputStream.read(); + } + String s = new String(b); + System.out.println("Length: " + s.length()); + System.out.println(s); + } catch (Exception ex) { + throw new RuntimeException(ex); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + static void test8077155() throws Exception { + final String username = WEB_USER; + final char[] password = WEB_PASS; + + SecurityManager security = new SecurityManager(); + Policy.setPolicy(new SecurityPolicy()); + System.setSecurityManager(security); + + CallbackHandler callback = new CallbackHandler() { + @Override + public void handle(Callback[] pCallbacks) throws IOException, UnsupportedCallbackException { + for (Callback cb : pCallbacks) { + if (cb instanceof NameCallback) { + NameCallback ncb = (NameCallback)cb; + ncb.setName(username); + + } else if (cb instanceof PasswordCallback) { + PasswordCallback pwdcb = (PasswordCallback) cb; + pwdcb.setPassword(password); + } + } + } + + }; + + final String jaasConfigName = "oracle.test.kerberos.login"; + final String krb5LoginModule = "com.sun.security.auth.module.Krb5LoginModule"; + + Configuration loginConfig = new Configuration() { + @Override + public AppConfigurationEntry[] getAppConfigurationEntry(String name) { + if (! jaasConfigName.equals(name)) { + return new AppConfigurationEntry[0]; + } + + Map options = new HashMap(); + options.put("useTicketCache", Boolean.FALSE.toString()); + options.put("useKeyTab", Boolean.FALSE.toString()); + + return new AppConfigurationEntry[] { + new AppConfigurationEntry(krb5LoginModule, + LoginModuleControlFlag.REQUIRED, + options) + }; + } + }; + + // oracle context/subject/login + LoginContext context = null; + try { + context = new LoginContext("oracle.test.kerberos.login", null, callback, loginConfig); + context.login(); + + } catch (LoginException ex) { + ex.printStackTrace(); + throw new RuntimeException(ex); + } + + + Subject subject = context.getSubject(); + + final PrivilegedExceptionAction test_action = new PrivilegedExceptionAction() { + public Object run() throws Exception { + testConnect(); + return null; + } + }; + + System.err.println("\n\nExpecting to succeed when executing with the the logged in subject."); + + try { + Subject.doAs(subject, test_action); + System.err.println("\n\nConnection succeed when executing with the the logged in subject."); + } catch (PrivilegedActionException e) { + System.err.println("\n\nFailure unexpected when executing with the the logged in subject."); + e.printStackTrace(); + throw new RuntimeException("Failed to login as subject"); + } + + try { + System.err.println("\n\nExpecting to fail when running with the current user's login."); + testConnect(); + } catch (Exception ex) { + System.err.println("\nConnect failed when running with the current user's login:\n" + ex.getMessage()); + } + } + /** * Creates and starts an HTTP or proxy server that requires * Negotiate authentication. @@ -366,3 +501,22 @@ public class HttpNegotiateServer { } } } + +class SecurityPolicy extends Policy { + + private static Permissions perms; + + public SecurityPolicy() { + super(); + if (perms == null) { + perms = new Permissions(); + perms.add(new AllPermission()); + } + } + + @Override + public PermissionCollection getPermissions(CodeSource codesource) { + return perms; + } + +} diff --git a/jdk/test/sun/security/krb5/config/ConfPlusProp.java b/jdk/test/sun/security/krb5/config/ConfPlusProp.java index 0a944989cd7..2376d02d46a 100644 --- a/jdk/test/sun/security/krb5/config/ConfPlusProp.java +++ b/jdk/test/sun/security/krb5/config/ConfPlusProp.java @@ -35,6 +35,12 @@ import sun.security.krb5.Config; public class ConfPlusProp { Config config; public static void main(String[] args) throws Exception { + if (System.getenv("USERDNSDOMAIN") != null || + System.getenv("LOGONSERVER") != null) { + System.out.println( + "Looks like a Windows machine in a domain. Skip test."); + return; + } new ConfPlusProp().run(); } @@ -90,23 +96,8 @@ public class ConfPlusProp { check("R2", "old"); check("R3", null); - int version = System.getProperty("java.version").charAt(2) - '0'; - System.out.println("JDK version is " + version); - - // Zero-config is supported since 1.7 - if (version >= 7) { - // Point to a non-existing file - System.setProperty("java.security.krb5.conf", "i-am-not-a file"); - refresh(); - - // Default realm might come from DNS - //checkDefaultRealm(null); - check("R1", null); - check("R2", null); - check("R3", null); - if (config.get("libdefaults", "forwardable") != null) { - throw new Exception("Extra config error"); - } + if (config.get("libdefaults", "forwardable") != null) { + throw new Exception("Extra config error"); } // Add prop @@ -136,14 +127,6 @@ public class ConfPlusProp { check("R2", "k2"); check("R3", "k2"); - // Point to a non-existing file - System.setProperty("java.security.krb5.conf", "i-am-not-a file"); - refresh(); - - checkDefaultRealm("R2"); - check("R1", "k2"); - check("R2", "k2"); - check("R3", "k2"); if (config.get("libdefaults", "forwardable") != null) { throw new Exception("Extra config error"); } diff --git a/jdk/test/sun/security/krb5/config/DNS.java b/jdk/test/sun/security/krb5/config/DNS.java index 8c574be92d5..7171441dcb4 100644 --- a/jdk/test/sun/security/krb5/config/DNS.java +++ b/jdk/test/sun/security/krb5/config/DNS.java @@ -23,12 +23,22 @@ // See dns.sh. import sun.security.krb5.Config; +import sun.security.krb5.KrbException; public class DNS { public static void main(String[] args) throws Exception { System.setProperty("java.security.krb5.conf", - System.getProperty("test.src", ".") +"/nothing.conf"); + System.getProperty("test.src", ".") +"/no-such-file.conf"); Config config = Config.getInstance(); + try { + String r = config.getDefaultRealm(); + throw new Exception("What? There is a default realm " + r + "?"); + } catch (KrbException ke) { + ke.printStackTrace(); + if (ke.getCause() != null) { + throw new Exception("There should be no cause. Won't try DNS"); + } + } String kdcs = config.getKDCList("X"); if (!kdcs.equals("a.com.:88 b.com.:99") && !kdcs.equals("a.com. b.com.:99")) { diff --git a/jdk/test/sun/security/krb5/config/DnsFallback.java b/jdk/test/sun/security/krb5/config/DnsFallback.java index b1e64197794..cf5e6bac942 100644 --- a/jdk/test/sun/security/krb5/config/DnsFallback.java +++ b/jdk/test/sun/security/krb5/config/DnsFallback.java @@ -22,8 +22,7 @@ */ /* * @test - * @bug 6673164 - * @bug 6552334 + * @bug 6673164 6552334 8077102 * @run main/othervm DnsFallback * @summary fix dns_fallback parse error, and use dns by default */ @@ -35,47 +34,66 @@ import sun.security.krb5.Config; public class DnsFallback { static Method useDNS_Realm; + static Method useDNS_KDC; public static void main(String[] args) throws Exception { useDNS_Realm = Config.class.getDeclaredMethod("useDNS_Realm"); useDNS_Realm.setAccessible(true); + useDNS_KDC = Config.class.getDeclaredMethod("useDNS_KDC"); + useDNS_KDC.setAccessible(true); // for 6673164 - check("true", "true", true); - check("false", "true", false); - check("true", "false", true); - check("false", "false", false); - check("true", null, true); - check("false", null, false); - check(null, "true", true); - check(null, "false", false); + check("true", "true", true, true); + check("false", "true", false, false); + check("true", "false", true, true); + check("false", "false", false, false); + check("true", null, true, true); + check("false", null, false, false); + check(null, "true", true, true); + check(null, "false", false, false); - // for 6552334 - check(null, null, true); + // for 6552334, no longer true + //check(null, null, true, true); + + // 8077102 + check(null, null, false, true); } - static void check(String realm, String fallback, boolean output) + /** + * Sets and checks. + * + * @param u dns_lookup_XXX value set, none if null + * @param f dns_fallback value set, none if null + * @param r expected useDNS_Realm + * @param k expected useDNS_KDC + */ + static void check(String u, String f, boolean r, boolean k) throws Exception { try (PrintStream ps = new PrintStream(new FileOutputStream("dnsfallback.conf"))) { ps.println("[libdefaults]\n"); - if (realm != null) { - ps.println("dns_lookup_realm=" + realm); + if (u != null) { + ps.println("dns_lookup_realm=" + u); + ps.println("dns_lookup_kdc=" + u); } - if (fallback != null) { - ps.println("dns_fallback=" + fallback); + if (f != null) { + ps.println("dns_fallback=" + f); } } System.setProperty("java.security.krb5.conf", "dnsfallback.conf"); Config.refresh(); - System.out.println("Testing " + realm + ", " + fallback + ", " + output); + System.out.println("Testing " + u + ", " + f + ", " + r + ", " + k); - if (!useDNS_Realm.invoke(Config.getInstance()).equals(output)) { - throw new Exception("Fail"); + if (!useDNS_Realm.invoke(Config.getInstance()).equals(r)) { + throw new Exception("useDNS_Realm Fail"); + } + + if (!useDNS_KDC.invoke(Config.getInstance()).equals(k)) { + throw new Exception("useDNS_KDC Fail"); } } } diff --git a/jdk/test/sun/security/krb5/config/confplusprop.conf b/jdk/test/sun/security/krb5/config/confplusprop.conf index 5e499483348..39f747293ba 100644 --- a/jdk/test/sun/security/krb5/config/confplusprop.conf +++ b/jdk/test/sun/security/krb5/config/confplusprop.conf @@ -1,7 +1,7 @@ [libdefaults] default_realm = R1 forwardable = well -dns_lookup_realm = false +dns_lookup_kdc = false [realms] R1 = { diff --git a/jdk/test/sun/security/krb5/config/confplusprop2.conf b/jdk/test/sun/security/krb5/config/confplusprop2.conf index c55464bd846..b308e7e41cb 100644 --- a/jdk/test/sun/security/krb5/config/confplusprop2.conf +++ b/jdk/test/sun/security/krb5/config/confplusprop2.conf @@ -1,5 +1,5 @@ [libdefaults] -dns_lookup_realm = false +dns_lookup_kdc = false [realms] R1 = { diff --git a/jdk/test/sun/tools/common/ApplicationSetup.sh b/jdk/test/sun/tools/common/ApplicationSetup.sh deleted file mode 100644 index 64da8b969be..00000000000 --- a/jdk/test/sun/tools/common/ApplicationSetup.sh +++ /dev/null @@ -1,210 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2005, 2012, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - - -# Support functions to start, stop, wait for or kill a given SimpleApplication - -# Starts a given app as background process, usage: -# startApplication port-file [args...] -# -# The following variables are set: -# -# appJavaPid - application's Java pid -# appOtherPid - pid associated with the app other than appJavaPid -# appPidList - all pids associated with the app -# appOutput - file containing stdout and stderr from the app -# -# Waits for at least one line of output from the app to indicate -# that it is up and running. -# -startApplication() -{ - appOutput="${TESTCLASSES}/Application.out" - - ${JAVA} -XX:+UsePerfData -classpath "${TESTCLASSPATH:-${TESTCLASSES}}" "$@" > "$appOutput" 2>&1 & - appJavaPid="$!" - appOtherPid= - appPidList="$appJavaPid" - - echo "INFO: waiting for $1 to initialize..." - _cnt=0 - while true; do - # if the app doesn't start then the JavaTest/JTREG timeout will - # kick in so this isn't really a endless loop - sleep 1 - out=`tail -1 "$appOutput"` - if [ -n "$out" ]; then - # we got some output from the app so it's running - break - fi - _cnt=`expr $_cnt + 1` - echo "INFO: waited $_cnt second(s) ..." - done - unset _cnt - - if $isWindows; then - # Windows requires special handling - appOtherPid="$appJavaPid" - - if $isCygwin; then - appJavaPid=`ps -p "$appOtherPid" \ - | sed -n ' - # See if $appOtherPid is in PID column; there are sometimes - # non-blanks in column 1 (I and S observed so far) - /^.'"${PATTERN_WS}${PATTERN_WS}*${appOtherPid}${PATTERN_WS}"'/{ - # strip PID column - s/^.'"${PATTERN_WS}${PATTERN_WS}*${appOtherPid}${PATTERN_WS}${PATTERN_WS}"'*// - # strip PPID column - s/^[1-9][0-9]*'"${PATTERN_WS}${PATTERN_WS}"'*// - # strip PGID column - s/^[1-9][0-9]*'"${PATTERN_WS}${PATTERN_WS}"'*// - # strip everything after WINPID column - s/'"${PATTERN_WS}"'.*// - p - q - } - '` - echo "INFO: Cygwin pid=$appOtherPid maps to Windows pid=$appJavaPid" - else - # show PID, PPID and COMM columns only - appJavaPid=`ps -o pid,ppid,comm \ - | sed -n ' - # see if appOtherPid is in either PID or PPID columns - /'"${PATTERN_WS}${appOtherPid}${PATTERN_WS}"'/{ - # see if this is a java command - /java'"${PATTERN_EOL}"'/{ - # strip leading white space - s/^'"${PATTERN_WS}${PATTERN_WS}"'*// - # strip everything after the first word - s/'"${PATTERN_WS}"'.*// - # print the pid and we are done - p - q - } - } - '` - echo "INFO: MKS shell pid=$appOtherPid; Java pid=$appJavaPid" - fi - - if [ -z "$appJavaPid" ]; then - echo "ERROR: could not find app's Java pid." >&2 - killApplication - exit 2 - fi - appPidList="$appOtherPid $appJavaPid" - fi - - echo "INFO: $1 is process $appJavaPid" - echo "INFO: $1 output is in $appOutput" -} - - -# Stops a simple application by invoking ShutdownSimpleApplication -# class with a specific port-file, usage: -# stopApplication port-file -# -# Note: When this function returns, the SimpleApplication (or a subclass) -# may still be running because the application has not yet reached the -# shutdown check. -# -stopApplication() -{ - $JAVA -XX:+UsePerfData -classpath "${TESTCLASSPATH:-${TESTCLASSES}}" ShutdownSimpleApplication $1 -} - - -# Wait for a simple application to stop running. -# -waitForApplication() { - if [ $isWindows = false ]; then - # non-Windows is easy; just one process - echo "INFO: waiting for $appJavaPid" - set +e - wait "$appJavaPid" - set -e - - elif $isCygwin; then - # Cygwin pid and not the Windows pid - echo "INFO: waiting for $appOtherPid" - set +e - wait "$appOtherPid" - set -e - - else # implied isMKS - # MKS has intermediate shell and Java process - echo "INFO: waiting for $appJavaPid" - - # appJavaPid can be empty if pid search in startApplication() failed - if [ -n "$appJavaPid" ]; then - # only need to wait for the Java process - set +e - wait "$appJavaPid" - set -e - fi - fi -} - - -# Kills a simple application by sending a SIGTERM to the appropriate -# process(es); on Windows SIGQUIT (-9) is used. -# -killApplication() -{ - if [ $isWindows = false ]; then - # non-Windows is easy; just one process - echo "INFO: killing $appJavaPid" - set +e - kill -TERM "$appJavaPid" # try a polite SIGTERM first - sleep 2 - # send SIGQUIT (-9) just in case SIGTERM didn't do it - # but don't show any complaints - kill -QUIT "$appJavaPid" > /dev/null 2>&1 - wait "$appJavaPid" - set -e - - elif $isCygwin; then - # Cygwin pid and not the Windows pid - echo "INFO: killing $appOtherPid" - set +e - kill -9 "$appOtherPid" - wait "$appOtherPid" - set -e - - else # implied isMKS - # MKS has intermediate shell and Java process - echo "INFO: killing $appPidList" - set +e - kill -9 $appPidList - set -e - - # appJavaPid can be empty if pid search in startApplication() failed - if [ -n "$appJavaPid" ]; then - # only need to wait for the Java process - set +e - wait "$appJavaPid" - set -e - fi - fi -} diff --git a/jdk/test/sun/tools/common/CommonSetup.sh b/jdk/test/sun/tools/common/CommonSetup.sh deleted file mode 100644 index f4401a7f6f2..00000000000 --- a/jdk/test/sun/tools/common/CommonSetup.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2005, 2012, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - - -# Common setup for tool tests and other tests that use jtools. -# Checks that TESTJAVA, TESTSRC, and TESTCLASSES environment variables are set. -# -# Creates the following constants for use by the caller: -# JAVA - java launcher -# JHAT - jhat utility -# JINFO - jinfo utility -# JMAP - jmap utility -# JPS - jps utility -# JSTACK - jstack utility -# JCMD - jcmd utility -# OS - operating system name -# PATTERN_EOL - grep or sed end-of-line pattern -# PATTERN_WS - grep or sed whitespace pattern -# PS - path separator (";" or ":") -# -# Sets the following variables: -# -# isCygwin - true if environment is Cygwin -# isMKS - true if environment is MKS -# isLinux - true if OS is Linux -# isSolaris - true if OS is Solaris -# isWindows - true if OS is Windows -# isMacos - true if OS is Macos X -# isAIX - true if OS is AIX - - -if [ -z "${TESTJAVA}" ]; then - echo "ERROR: TESTJAVA not set. Test cannot execute. Failed." - exit 1 -fi - -if [ -z "${TESTSRC}" ]; then - echo "ERROR: TESTSRC not set. Test cannot execute. Failed." - exit 1 -fi - -if [ -z "${TESTCLASSES}" ]; then - echo "ERROR: TESTCLASSES not set. Test cannot execute. Failed." - exit 1 -fi - -# only enable these after checking the expected incoming env variables -set -eu - -JAVA="${TESTJAVA}/bin/java" -JHAT="${TESTJAVA}/bin/jhat" -JINFO="${TESTJAVA}/bin/jinfo" -JMAP="${TESTJAVA}/bin/jmap" -JPS="${TESTJAVA}/bin/jps" -JSTACK="${TESTJAVA}/bin/jstack" -JCMD="${TESTJAVA}/bin/jcmd" - -isCygwin=false -isMKS=false -isLinux=false -isSolaris=false -isUnknownOS=false -isWindows=false -isMacos=false -isAIX=false - -OS=`uname -s` - -# start with some UNIX like defaults -PATTERN_EOL='$' -# blank and tab -PATTERN_WS='[ ]' -PS=":" - -case "$OS" in - CYGWIN* ) - OS="Windows" - PATTERN_EOL='[ ]*$' - # blank and tab - PATTERN_WS='[ \t]' - isCygwin=true - isWindows=true - ;; - Linux ) - OS="Linux" - isLinux=true - ;; - Darwin ) - OS="Mac OS X" - isMacos=true - ;; - SunOS ) - OS="Solaris" - isSolaris=true - ;; - AIX ) - OS="AIX" - isAIX=true - ;; - Windows* ) - OS="Windows" - PATTERN_EOL='[ ]*$' - PS=";" - isWindows=true - ;; - * ) - isUnknownOS=true - ;; -esac diff --git a/jdk/test/sun/tools/common/ShutdownSimpleApplication.java b/jdk/test/sun/tools/common/ShutdownSimpleApplication.java deleted file mode 100644 index 314bb579bad..00000000000 --- a/jdk/test/sun/tools/common/ShutdownSimpleApplication.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2005, 2010, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Used to shutdown SimpleApplication (or a subclass). The argument to - * this class is the name of a file that contains the TCP port number - * on which SimpleApplication (or a subclass) is listening. - * - * Note: When this program returns, the SimpleApplication (or a subclass) - * may still be running because the application has not yet reached the - * shutdown check. - */ -import java.net.Socket; -import java.net.InetSocketAddress; -import java.io.File; -import java.io.FileInputStream; - -public class ShutdownSimpleApplication { - public static void main(String args[]) throws Exception { - - if (args.length != 1) { - throw new RuntimeException("Usage: ShutdownSimpleApplication" + - " port-file"); - } - - // read the (TCP) port number from the given file - - File f = new File(args[0]); - FileInputStream fis = new FileInputStream(f); - byte b[] = new byte[8]; - int n = fis.read(b); - if (n < 1) { - throw new RuntimeException("Empty port-file"); - } - fis.close(); - - String str = new String(b, 0, n, "UTF-8"); - System.out.println("INFO: Port number of SimpleApplication: " + str); - int port = Integer.parseInt(str); - - // Now connect to the port (which will shutdown application) - - System.out.println("INFO: Connecting to port " + port + - " to shutdown SimpleApplication ..."); - System.out.flush(); - - Socket s = new Socket(); - s.connect( new InetSocketAddress(port) ); - s.close(); - - System.out.println("INFO: done connecting to SimpleApplication."); - System.out.flush(); - - System.exit(0); - } -} diff --git a/jdk/test/sun/tools/common/SimpleApplication.java b/jdk/test/sun/tools/common/SimpleApplication.java deleted file mode 100644 index c7e6b0bdac4..00000000000 --- a/jdk/test/sun/tools/common/SimpleApplication.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2005, 2010, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * A simple application used by unit tests. The first argument to this - * class is the name of a file to which a TCP port number can be written. - * - * By default, this class does nothing other than bind to a TCP port, - * write the TCP port number to a file, and wait for an incoming connection - * in order to complete the application shutdown protocol. - */ -import java.net.Socket; -import java.net.ServerSocket; -import java.io.File; -import java.io.FileOutputStream; - -public class SimpleApplication { - private static SimpleApplication myApp; // simple app or a subclass - private static String myAppName; // simple app name - private static int myPort; // coordination port # - private static ServerSocket mySS; // coordination socket - - // protected so a subclass can extend it; not public so creation is - // limited. - protected SimpleApplication() { - // save simple app (or subclass) name for messages - myAppName = getClass().getName(); - } - - // return the simple application (or a subclass) - final public static SimpleApplication getMyApp() { - return myApp; - } - - // set the simple application (for use by a subclass) - final public static void setMyApp(SimpleApplication _myApp) { - myApp = _myApp; - } - - // execute the application finish protocol - final public void doMyAppFinish(String[] args) throws Exception { - System.out.println("INFO: " + myAppName + " is waiting on port: " + - myPort); - System.out.flush(); - - // wait for test harness to connect - Socket s = mySS.accept(); - s.close(); - mySS.close(); - - System.out.println("INFO: " + myAppName + " is shutting down."); - System.out.flush(); - } - - // execute the application start protocol - final public void doMyAppStart(String[] args) throws Exception { - if (args.length < 1) { - throw new RuntimeException("Usage: " + myAppName + - " port-file [arg(s)]"); - } - - // bind to a random port - mySS = new ServerSocket(0); - myPort = mySS.getLocalPort(); - - // Write the port number to the given file - File f = new File(args[0]); - FileOutputStream fos = new FileOutputStream(f); - fos.write( Integer.toString(myPort).getBytes("UTF-8") ); - fos.close(); - - System.out.println("INFO: " + myAppName + " created socket on port: " + - myPort); - System.out.flush(); - } - - // execute the app work (subclass can override this) - public void doMyAppWork(String[] args) throws Exception { - } - - public static void main(String[] args) throws Exception { - if (myApp == null) { - // create myApp since a subclass hasn't done so - myApp = new SimpleApplication(); - } - - myApp.doMyAppStart(args); // do the app start protocol - - System.out.println("INFO: " + myAppName + " is calling doMyAppWork()"); - System.out.flush(); - myApp.doMyAppWork(args); // do the app work - System.out.println("INFO: " + myAppName + " returned from" + - " doMyAppWork()"); - System.out.flush(); - - myApp.doMyAppFinish(args); // do the app finish protocol - - System.exit(0); - } -} diff --git a/jdk/test/sun/tools/common/SleeperApplication.java b/jdk/test/sun/tools/common/SleeperApplication.java deleted file mode 100644 index b96d9b07ac3..00000000000 --- a/jdk/test/sun/tools/common/SleeperApplication.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2010, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * An example subclass of SimpleApplication that illustrates how to - * override the doMyAppWork() method. - */ - -public class SleeperApplication extends SimpleApplication { - public static int DEFAULT_SLEEP_TIME = 60; // time is in seconds - - // execute the sleeper app work - public void doMyAppWork(String[] args) throws Exception { - int sleep_time = DEFAULT_SLEEP_TIME; - - // args[0] is the port-file - if (args.length < 2) { - System.out.println("INFO: using default sleep time of " - + sleep_time + " seconds."); - } else { - try { - sleep_time = Integer.parseInt(args[1]); - } catch (NumberFormatException nfe) { - throw new RuntimeException("Error: '" + args[1] + - "': is not a valid seconds value."); - } - } - - Thread.sleep(sleep_time * 1000); // our "work" is to sleep - } - - public static void main(String[] args) throws Exception { - SleeperApplication myApp = new SleeperApplication(); - - SimpleApplication.setMyApp(myApp); - - SimpleApplication.main(args); - } -} diff --git a/jdk/test/sun/tools/jhat/HatHeapDump1Test.java b/jdk/test/sun/tools/jhat/HatHeapDump1Test.java deleted file mode 100644 index 4e40fdc1aa3..00000000000 --- a/jdk/test/sun/tools/jhat/HatHeapDump1Test.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2005, 2015, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.File; -import java.util.Arrays; - -import jdk.testlibrary.Asserts; -import jdk.testlibrary.JDKToolLauncher; -import jdk.testlibrary.OutputAnalyzer; -import jdk.testlibrary.ProcessTools; - -/* @test - * @bug 5102009 - * @summary Sanity test of jhat functionality - * @library /lib/testlibrary - * @modules java.management - * @build jdk.testlibarary.* - * @compile -g HelloWorld.java - * @run main HatHeapDump1Test - */ -public class HatHeapDump1Test { - - private static final String TEST_CLASSES = System.getProperty("test.classes", "."); - - public static void main(String args[]) throws Exception { - String className = "HelloWorld"; - File dumpFile = new File(className + ".hdump"); - - // Generate a heap dump - ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder("-cp", - TEST_CLASSES, - "-Xcheck:jni", - "-Xverify:all", - "-agentlib:hprof=heap=dump,format=b,file=" + dumpFile.getAbsolutePath(), - className); - OutputAnalyzer output = ProcessTools.executeProcess(processBuilder); - System.out.println(output.getOutput()); - output.shouldHaveExitValue(0); - output.shouldContain("Dumping Java heap ... done"); - Asserts.assertTrue(dumpFile.exists() && dumpFile.isFile(), "Invalid dump file " + dumpFile.getAbsolutePath()); - - // Run jhat to analyze the heap dump - output = jhat("-debug", "2", dumpFile.getAbsolutePath()); - output.shouldHaveExitValue(0); - output.shouldContain("Snapshot resolved"); - output.shouldContain("-debug 2 was used"); - output.shouldNotContain("ERROR"); - - dumpFile.delete(); - } - - private static OutputAnalyzer jhat(String... toolArgs) throws Exception { - JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jhat"); - if (toolArgs != null) { - for (String toolArg : toolArgs) { - launcher.addToolArg(toolArg); - } - } - - ProcessBuilder processBuilder = new ProcessBuilder(); - processBuilder.command(launcher.getCommand()); - System.out.println(Arrays.toString(processBuilder.command().toArray()).replace(",", "")); - OutputAnalyzer output = ProcessTools.executeProcess(processBuilder); - System.out.println(output.getOutput()); - - return output; - } - -} diff --git a/jdk/test/sun/tools/jhat/HelloWorld.java b/jdk/test/sun/tools/jhat/HelloWorld.java deleted file mode 100644 index f4d30157b8c..00000000000 --- a/jdk/test/sun/tools/jhat/HelloWorld.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2005, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * - * Sample target application. - * - */ - -public class HelloWorld { - public static void main(String args[]) { - - /* Use a generic type */ - java.util.List l = new java.util.ArrayList(); - String.format("%s", ""); - - /* Just some code with branches */ - try { - if ( args.length == 0 ) { - System.out.println("No arguments passed in"); - } else { - System.out.println("Some arguments passed in"); - } - } catch ( Throwable e ) { - System.out.println("ERROR: System.out.println() did a throw"); - } finally { - System.out.println("Hello, world!"); - } - } -} diff --git a/jdk/test/sun/tools/jhat/ParseTest.sh b/jdk/test/sun/tools/jhat/ParseTest.sh deleted file mode 100644 index 9bc9294eb71..00000000000 --- a/jdk/test/sun/tools/jhat/ParseTest.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2006, 2010, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - - -# @test -# @summary Testing jhat parsing against pre-created dump files. -# see also: README.TXT - -# @library ../common -# @run shell ParseTest.sh - -. ${TESTSRC}/../common/CommonSetup.sh - -# all return statuses are checked in this test -set +e - -failed=0 - -DUMPFILE="minimal.bin" - -${JHAT} -parseonly true ${TESTSRC}/${DUMPFILE} -if [ $? != 0 ]; then failed=1; fi - -DUMPFILE="jmap.bin" - -${JHAT} -parseonly true ${TESTSRC}/${DUMPFILE} -if [ $? != 0 ]; then failed=1; fi - -DUMPFILE="hprof.bin" - -${JHAT} -parseonly true ${TESTSRC}/${DUMPFILE} -if [ $? != 0 ]; then failed=1; fi - -# try something that is not heapdump and expect to fail! -DUMPFILE="ParseTest.sh" - -${JHAT} -parseonly true ${TESTSRC}/${DUMPFILE} -if [ $? = 0 ]; then failed=1; fi - -# try something that does not exist and expect to fail! -DUMPFILE="FileThatDoesNotExist" - -${JHAT} -parseonly true ${TESTSRC}/${DUMPFILE} -if [ $? = 0 ]; then failed=1; fi - -exit $failed - diff --git a/jdk/test/sun/tools/jhat/README.TXT b/jdk/test/sun/tools/jhat/README.TXT deleted file mode 100644 index ea852e32a80..00000000000 --- a/jdk/test/sun/tools/jhat/README.TXT +++ /dev/null @@ -1,16 +0,0 @@ -# - -jhat heap dump parsing tests: - -There are three hprof binary format dump files in this directory. -These dumps were created by jmap and hprof profiler against a -simple infinite looping Java program. - -1. minimal.bin - minimal dump that has nothing! - not even java.lang.Class! - - This was created by java -Xrunhprof:format=b,heap=sites MainClass. - -2. jmap.bin - created by jmap -dump option - -3. hprof.bin - created by java -Xrunhprof:heap=all,format=b MainClass - -We can run jhat -parseonly true against these dumps. diff --git a/jdk/test/sun/tools/jmap/BasicJMapTest.java b/jdk/test/sun/tools/jmap/BasicJMapTest.java index ecfcf071e38..4ed8ce2179a 100644 --- a/jdk/test/sun/tools/jmap/BasicJMapTest.java +++ b/jdk/test/sun/tools/jmap/BasicJMapTest.java @@ -21,10 +21,13 @@ * questions. */ +import static jdk.testlibrary.Asserts.assertTrue; +import static jdk.testlibrary.Asserts.fail; + import java.io.File; import java.util.Arrays; -import static jdk.testlibrary.Asserts.*; +import jdk.test.lib.hprof.HprofParser; import jdk.testlibrary.JDKToolLauncher; import jdk.testlibrary.OutputAnalyzer; import jdk.testlibrary.ProcessTools; @@ -34,8 +37,13 @@ import jdk.testlibrary.ProcessTools; * @bug 6321286 * @summary Unit test for jmap utility * @library /lib/testlibrary + * @library /../../test/lib/share/classes * @modules java.management * @build jdk.testlibrary.* + * @build jdk.test.lib.hprof.* + * @build jdk.test.lib.hprof.module.* + * @build jdk.test.lib.hprof.parser.* + * @build jdk.test.lib.hprof.utils.* * @run main BasicJMapTest */ public class BasicJMapTest { @@ -60,24 +68,38 @@ public class BasicJMapTest { } private static void testDump() throws Exception { - File dump = new File("java_pid$" + ProcessTools.getProcessId() + ".hprof"); - OutputAnalyzer output = jmap("-dump:format=b,file=" + dump.getName()); - output.shouldHaveExitValue(0); - output.shouldContain("Heap dump file created"); - verifyDumpFile(dump); + dump(false); } private static void testDumpLive() throws Exception { - File dump = new File("java_pid$" + ProcessTools.getProcessId() + ".hprof"); - OutputAnalyzer output = jmap("-dump:live,format=b,file=" + dump.getName()); + dump(true); + } + + private static void dump(boolean live) throws Exception { + File dump = new File("jmap.dump." + System.currentTimeMillis() + ".hprof"); + if (dump.exists()) { + dump.delete(); + } + OutputAnalyzer output; + if (live) { + output = jmap("-dump:live,format=b,file=" + dump.getName()); + } else { + output = jmap("-dump:format=b,file=" + dump.getName()); + } output.shouldHaveExitValue(0); output.shouldContain("Heap dump file created"); verifyDumpFile(dump); + dump.delete(); } private static void verifyDumpFile(File dump) { - assertTrue(dump.exists() && dump.isFile(), "Could not create dump file"); - dump.delete(); + assertTrue(dump.exists() && dump.isFile(), "Could not create dump file " + dump.getAbsolutePath()); + try { + HprofParser.parse(dump); + } catch (Exception e) { + e.printStackTrace(); + fail("Could not parse dump file " + dump.getAbsolutePath()); + } } private static OutputAnalyzer jmap(String... toolArgs) throws Exception { diff --git a/jdk/test/tools/launcher/Arrrghs.java b/jdk/test/tools/launcher/Arrrghs.java index c7f53d3251d..cb36d2dfe8a 100644 --- a/jdk/test/tools/launcher/Arrrghs.java +++ b/jdk/test/tools/launcher/Arrrghs.java @@ -24,7 +24,7 @@ /** * @test * @bug 5030233 6214916 6356475 6571029 6684582 6742159 4459600 6758881 6753938 - * 6894719 6968053 7151434 7146424 8007333 + * 6894719 6968053 7151434 7146424 8007333 8077822 * @summary Argument parsing validation. * @compile -XDignore.symbol.file Arrrghs.java * @run main/othervm Arrrghs @@ -304,6 +304,16 @@ public class Arrrghs extends TestHelper { throw new RuntimeException("Error: compiling java wildcards"); } + // test if javac (the command) can compile *.java with a vmoption + tr = doExec(javacCmd, "-cp", ".", + "-J-showversion", "-J-Dsomeproperty=foo", + libDir.getName() + File.separator + "*.java"); + if (!tr.isOK()) { + System.out.println(tr); + throw new RuntimeException("Error: compiling java wildcards with vmoptions"); + } + + // use the jar cmd to create jars using the ? wildcard File jarFoo = new File(libDir, "Foo.jar"); tr = doExec(jarCmd, "cvf", jarFoo.getAbsolutePath(), "lib" + File.separator + "F?o.class"); diff --git a/langtools/.hgtags b/langtools/.hgtags index e1c571e2875..aa64da9aa08 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -307,3 +307,4 @@ a598534d277e170a0bbf177bd54d9d179245532b jdk9-b59 40058141a4ec04a3d4cacdb693ad188a5ddf48ed jdk9-b62 a28b7f42dae9bd59513beaa5a2d6eb563dc09e08 jdk9-b63 809d66512998789b620d08c335d7c31211a0cf29 jdk9-b64 +4fcf722b811406a7db8f206d88446c82cda1b5f4 jdk9-b65 diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java index 385cc9828d8..181a2afb8ee 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java @@ -1317,6 +1317,9 @@ public class DeferredAttr extends JCTree.Visitor { return isSimpleReceiver(((JCAnnotatedType)rec).underlyingType); case APPLY: return true; + case NEWCLASS: + JCNewClass nc = (JCNewClass) rec; + return nc.encl == null && nc.def == null && !TreeInfo.isDiamond(nc); default: return false; } @@ -1371,17 +1374,24 @@ public class DeferredAttr extends JCTree.Visitor { Type site; if (rec != null) { - if (rec.hasTag(APPLY)) { - Symbol recSym = quicklyResolveMethod(env, (JCMethodInvocation) rec); - if (recSym == null) - return null; - Symbol resolvedReturnType = - analyzeCandidateMethods(recSym, syms.errSymbol, returnSymbolAnalyzer); - if (resolvedReturnType == null) - return null; - site = resolvedReturnType.type; - } else { - site = attribSpeculative(rec, env, attr.unknownTypeExprInfo).type; + switch (rec.getTag()) { + case APPLY: + Symbol recSym = quicklyResolveMethod(env, (JCMethodInvocation) rec); + if (recSym == null) + return null; + Symbol resolvedReturnType = + analyzeCandidateMethods(recSym, syms.errSymbol, returnSymbolAnalyzer); + if (resolvedReturnType == null) + return null; + site = resolvedReturnType.type; + break; + case NEWCLASS: + JCNewClass nc = (JCNewClass) rec; + site = attribSpeculative(nc.clazz, env, attr.unknownTypeExprInfo).type; + break; + default: + site = attribSpeculative(rec, env, attr.unknownTypeExprInfo).type; + break; } } else { site = env.enclClass.sym.type; diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/ZipArchive.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/ZipArchive.java index 3d3e9d1d203..05c291eb421 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/ZipArchive.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/ZipArchive.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, 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 @@ -278,12 +278,12 @@ public class ZipArchive implements Archive { ZipFileObject o = (ZipFileObject) other; return zarch.getAbsoluteFile().equals(o.zarch.getAbsoluteFile()) - && name.equals(o.name); + && entry.getName().equals(o.entry.getName()); } @Override public int hashCode() { - return zarch.getAbsoluteFile().hashCode() + name.hashCode(); + return zarch.getAbsoluteFile().hashCode() + entry.getName().hashCode(); } } diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java index e097bf0f6c1..39764d4224b 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, 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 @@ -228,12 +228,12 @@ public class ZipFileIndexArchive implements Archive { ZipFileIndexFileObject o = (ZipFileIndexFileObject) other; return zfIndex.getAbsoluteFile().equals(o.zfIndex.getAbsoluteFile()) - && name.equals(o.name); + && entry.equals(o.entry); } @Override public int hashCode() { - return zfIndex.getAbsoluteFile().hashCode() + name.hashCode(); + return zfIndex.getAbsoluteFile().hashCode() + entry.hashCode(); } private String getPrefixedEntryName() { diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Dependencies.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Dependencies.java index 947586e10e6..773f294c48a 100644 --- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Dependencies.java +++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Dependencies.java @@ -145,8 +145,8 @@ public abstract class Dependencies { /** * This class creates a graph of all dependencies as symbols are completed; - * when compilation finishes, the resulting dependecy graph is then dumped - * onto a dot file. Several options are provided to customise the output of the graph. + * when compilation finishes, the resulting dependency graph is then dumped + * onto a dot file. Several options are provided to customize the output of the graph. */ public static class GraphDependencies extends Dependencies implements Closeable, Completer { @@ -233,13 +233,13 @@ public abstract class Dependencies { * (either from source or classfile); (ii) attribution nodes, corresponding to * attribution actions triggered during (source) completion. */ - static abstract class Node extends GraphUtils.AbstractNode + public static abstract class Node extends GraphUtils.AbstractNode implements GraphUtils.DottableNode { /** * Model the dependencies between nodes. */ - enum DependencyKind implements GraphUtils.DependencyKind { + public enum DependencyKind implements GraphUtils.DependencyKind { /** * standard dependency - i.e. completion of the source node depends * on completion of the sink node. @@ -326,7 +326,7 @@ public abstract class Dependencies { * This is a dependency node used to model symbol completion requests. * Completion requests can come from either source or class. */ - static class CompletionNode extends Node { + public static class CompletionNode extends Node { /** * Completion kind (source vs. classfile) @@ -349,9 +349,11 @@ public abstract class Dependencies { } final Kind ck; + final ClassSymbol sym; CompletionNode(ClassSymbol sym) { super(sym.getQualifiedName().toString()); + this.sym = sym; //infer completion kind by looking at the symbol fields boolean fromClass = (sym.classfile == null && sym.sourcefile == null) || (sym.classfile != null && sym.classfile.getKind() == JavaFileObject.Kind.CLASS); @@ -367,6 +369,10 @@ public abstract class Dependencies { p.put("shape", "ellipse"); return p; } + + public ClassSymbol getClassSymbol() { + return sym; + } } /** @@ -437,23 +443,23 @@ public abstract class Dependencies { @Override public void close() throws IOException { + if (!dependenciesModes.contains(DependenciesMode.REDUNDANT)) { + //prune spurious edges + new PruneVisitor().visit(dependencyNodeMap.values(), null); + } + if (!dependenciesModes.contains(DependenciesMode.CLASS)) { + //filter class completions + new FilterVisitor(CompletionNode.Kind.SOURCE).visit(dependencyNodeMap.values(), null); + } + if (!dependenciesModes.contains(DependenciesMode.SOURCE)) { + //filter source completions + new FilterVisitor(CompletionNode.Kind.CLASS).visit(dependencyNodeMap.values(), null); + } + if (dependenciesModes.contains(DependenciesMode.SIDE_EFFECTS)) { + //add side-effects edges + new SideEffectVisitor().visit(dependencyNodeMap.values(), null); + } if (dependenciesFile != null) { - if (!dependenciesModes.contains(DependenciesMode.REDUNDANT)) { - //prune spurious edges - new PruneVisitor().visit(dependencyNodeMap.values(), null); - } - if (!dependenciesModes.contains(DependenciesMode.CLASS)) { - //filter class completions - new FilterVisitor(CompletionNode.Kind.SOURCE).visit(dependencyNodeMap.values(), null); - } - if (!dependenciesModes.contains(DependenciesMode.SOURCE)) { - //filter source completions - new FilterVisitor(CompletionNode.Kind.CLASS).visit(dependencyNodeMap.values(), null); - } - if (dependenciesModes.contains(DependenciesMode.SIDE_EFFECTS)) { - //add side-effects edges - new SideEffectVisitor().visit(dependencyNodeMap.values(), null); - } //write to file try (FileWriter fw = new FileWriter(dependenciesFile)) { fw.append(GraphUtils.toDot(dependencyNodeMap.values(), "CompletionDeps", "")); @@ -473,6 +479,10 @@ public abstract class Dependencies { return true; } + public Collection getNodes() { + return dependencyNodeMap.values(); + } + /** * This visitor is used to generate the special side-effect dependencies * given a graph containing only standard dependencies. diff --git a/langtools/test/com/sun/javadoc/5093723/T5093723.java b/langtools/test/com/sun/javadoc/5093723/T5093723.java index 6ffa7d16945..1dba9fd617c 100644 --- a/langtools/test/com/sun/javadoc/5093723/T5093723.java +++ b/langtools/test/com/sun/javadoc/5093723/T5093723.java @@ -26,6 +26,7 @@ * @bug 5093723 * @summary REGRESSION: ClassCastException in SingleIndexWriter * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main T5093723 */ diff --git a/langtools/test/com/sun/javadoc/AccessAsciiArt/AccessAsciiArt.java b/langtools/test/com/sun/javadoc/AccessAsciiArt/AccessAsciiArt.java index 359ea876531..7e944520745 100644 --- a/langtools/test/com/sun/javadoc/AccessAsciiArt/AccessAsciiArt.java +++ b/langtools/test/com/sun/javadoc/AccessAsciiArt/AccessAsciiArt.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary Add text equivalent of class tree ASCII art for accessibility * @author dkramer * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main AccessAsciiArt */ diff --git a/langtools/test/com/sun/javadoc/AccessFrameTitle/AccessFrameTitle.java b/langtools/test/com/sun/javadoc/AccessFrameTitle/AccessFrameTitle.java index 9505e97c5fa..cc262bd6af8 100644 --- a/langtools/test/com/sun/javadoc/AccessFrameTitle/AccessFrameTitle.java +++ b/langtools/test/com/sun/javadoc/AccessFrameTitle/AccessFrameTitle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary Add title attribute to tags for accessibility * @author dkramer * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main AccessFrameTitle */ diff --git a/langtools/test/com/sun/javadoc/AccessH1/AccessH1.java b/langtools/test/com/sun/javadoc/AccessH1/AccessH1.java index 323ba26f0c9..78a3ac5d665 100644 --- a/langtools/test/com/sun/javadoc/AccessH1/AccessH1.java +++ b/langtools/test/com/sun/javadoc/AccessH1/AccessH1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary Use , and

                          in proper sequence for accessibility * @author dkramer * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main AccessH1 */ diff --git a/langtools/test/com/sun/javadoc/AccessSkipNav/AccessSkipNav.java b/langtools/test/com/sun/javadoc/AccessSkipNav/AccessSkipNav.java index 3e947029905..146de8b3d30 100644 --- a/langtools/test/com/sun/javadoc/AccessSkipNav/AccessSkipNav.java +++ b/langtools/test/com/sun/javadoc/AccessSkipNav/AccessSkipNav.java @@ -27,6 +27,7 @@ * @summary Add ability to skip over nav bar for accessibility * @author dkramer * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main AccessSkipNav */ diff --git a/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java b/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java index 7bdd0a7eefd..9eb88476966 100644 --- a/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java +++ b/langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary Test the tables for summary attribute * @author dkramer * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main AccessSummary */ diff --git a/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java b/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java index 69e82f96ced..b57604baa9e 100644 --- a/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java +++ b/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary Javadoc wrongly inserts tags when using multiple @author tags * @author dkramer * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main AuthorDD */ diff --git a/langtools/test/com/sun/javadoc/DocRootSlash/DocRootSlash.java b/langtools/test/com/sun/javadoc/DocRootSlash/DocRootSlash.java index 314a8d21dbf..b228790dc02 100644 --- a/langtools/test/com/sun/javadoc/DocRootSlash/DocRootSlash.java +++ b/langtools/test/com/sun/javadoc/DocRootSlash/DocRootSlash.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary stddoclet: {@docRoot} inserts an extra trailing "/" * @author dkramer * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main DocRootSlash */ diff --git a/langtools/test/com/sun/javadoc/InheritDocForUserTags/DocTest.java b/langtools/test/com/sun/javadoc/InheritDocForUserTags/DocTest.java index 65632e5cbd2..c37ed93b740 100644 --- a/langtools/test/com/sun/javadoc/InheritDocForUserTags/DocTest.java +++ b/langtools/test/com/sun/javadoc/InheritDocForUserTags/DocTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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,6 +27,7 @@ * @summary Using {@inheritDoc} in simple tag defined via -tag fails * @author Mike Duigou * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main DocTest */ diff --git a/langtools/test/com/sun/javadoc/JavascriptWinTitle/JavascriptWinTitle.java b/langtools/test/com/sun/javadoc/JavascriptWinTitle/JavascriptWinTitle.java index 854663d1d7f..956e38806b3 100644 --- a/langtools/test/com/sun/javadoc/JavascriptWinTitle/JavascriptWinTitle.java +++ b/langtools/test/com/sun/javadoc/JavascriptWinTitle/JavascriptWinTitle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * Window title shouldn't change when loading left frames (javascript) * @author dkramer * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main JavascriptWinTitle */ diff --git a/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java b/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java index 2a14fbd0315..3cd3a53c141 100644 --- a/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java +++ b/langtools/test/com/sun/javadoc/MetaTag/MetaTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * class and member names to improve API search * @author dkramer * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main MetaTag */ diff --git a/langtools/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java b/langtools/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java index ff2a98e9151..a69a5431f4e 100644 --- a/langtools/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java +++ b/langtools/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -29,6 +29,7 @@ * (2) -packagesheader, and (3) -header -packagesheader * @author dkramer * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main PackagesHeader */ diff --git a/langtools/test/com/sun/javadoc/T6735320/T6735320.java b/langtools/test/com/sun/javadoc/T6735320/T6735320.java index 2f913274893..c71a3166b0a 100644 --- a/langtools/test/com/sun/javadoc/T6735320/T6735320.java +++ b/langtools/test/com/sun/javadoc/T6735320/T6735320.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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 @@ -26,6 +26,7 @@ * @bug 6735320 * @summary javadoc throws exception if serialField value is missing * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main T6735320 */ diff --git a/langtools/test/com/sun/javadoc/ValidHtml/ValidHtml.java b/langtools/test/com/sun/javadoc/ValidHtml/ValidHtml.java index aac1d0c39ce..fb0b0453e92 100644 --- a/langtools/test/com/sun/javadoc/ValidHtml/ValidHtml.java +++ b/langtools/test/com/sun/javadoc/ValidHtml/ValidHtml.java @@ -30,6 +30,7 @@ * HTML table tags inserted in wrong place in pakcage use page * @author dkramer * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main ValidHtml */ diff --git a/langtools/test/com/sun/javadoc/VersionNumber/VersionNumber.java b/langtools/test/com/sun/javadoc/VersionNumber/VersionNumber.java index 7089e50517d..f2d4dc4985e 100644 --- a/langtools/test/com/sun/javadoc/VersionNumber/VersionNumber.java +++ b/langtools/test/com/sun/javadoc/VersionNumber/VersionNumber.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary com.sun.tools.doclets.standard.Standard contains hard-coded version number * @author dkramer * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main VersionNumber */ diff --git a/langtools/test/com/sun/javadoc/WindowTitles/WindowTitles.java b/langtools/test/com/sun/javadoc/WindowTitles/WindowTitles.java index f09271f66df..cd11450050d 100644 --- a/langtools/test/com/sun/javadoc/WindowTitles/WindowTitles.java +++ b/langtools/test/com/sun/javadoc/WindowTitles/WindowTitles.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary stddoclet: With frames off, window titles have "()" appended * @author dkramer * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main WindowTitles */ diff --git a/langtools/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java b/langtools/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java index 045b0faa25b..36269fe1db7 100644 --- a/langtools/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java +++ b/langtools/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary Test the generation of constant-values.html. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestConstantValuesDriver */ diff --git a/langtools/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java b/langtools/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java index 91ce3772125..30e50dcad55 100644 --- a/langtools/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java +++ b/langtools/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary Determine if duplicate throws tags can be used. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestDupThrowsTags */ diff --git a/langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java b/langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java index 2d154fbad7b..9988daef26f 100644 --- a/langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java +++ b/langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary This test verifys that the -link option handles absolute paths. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestAbsLinkPath */ diff --git a/langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java b/langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java index 524d25225ef..991ad9df808 100644 --- a/langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java +++ b/langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, 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,6 +28,7 @@ * if the abstract modifier is present explicitly or implicitly. * @author bpatel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestAbstractMethod */ diff --git a/langtools/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java b/langtools/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java index fcd5196e998..ad2e3c7fd2a 100644 --- a/langtools/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java +++ b/langtools/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java @@ -27,6 +27,7 @@ * @summary Test for valid name attribute in HTML anchors. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestAnchorNames */ diff --git a/langtools/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java b/langtools/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java index 6b723d0d9a4..7cee70e780f 100644 --- a/langtools/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java +++ b/langtools/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java @@ -28,6 +28,7 @@ * element headers * @author Mahmood Ali * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestAnnotationOptional */ diff --git a/langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java b/langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java index 8c3d3036fc6..657919c16e1 100644 --- a/langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java +++ b/langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, 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,6 +28,7 @@ * extra HR tags. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestAnnotationTypes */ diff --git a/langtools/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java b/langtools/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java index 3236ce4be79..22669111603 100644 --- a/langtools/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java +++ b/langtools/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * has a forward slash. It would be wrong to use a back slash. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestBackSlashInLink */ diff --git a/langtools/test/com/sun/javadoc/testBadPackageFileInJar/TestBadPackageFileInJar.java b/langtools/test/com/sun/javadoc/testBadPackageFileInJar/TestBadPackageFileInJar.java index f3a51e1072c..a7a53c95fe9 100644 --- a/langtools/test/com/sun/javadoc/testBadPackageFileInJar/TestBadPackageFileInJar.java +++ b/langtools/test/com/sun/javadoc/testBadPackageFileInJar/TestBadPackageFileInJar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * when a bad package.html file is in the JAR. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestBadPackageFileInJar */ diff --git a/langtools/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java b/langtools/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java index 6ee63656c4c..1eac87d244c 100644 --- a/langtools/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java +++ b/langtools/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +28,7 @@ * file in the same directory as the file being documented. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestBadSourceFile */ diff --git a/langtools/test/com/sun/javadoc/testBaseClass/TestBaseClass.java b/langtools/test/com/sun/javadoc/testBaseClass/TestBaseClass.java index b6a71de3a1b..15da3d7d858 100644 --- a/langtools/test/com/sun/javadoc/testBaseClass/TestBaseClass.java +++ b/langtools/test/com/sun/javadoc/testBaseClass/TestBaseClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary Javadoc does not process base class. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build BaseClass * @build JavadocTester * @run main TestBaseClass diff --git a/langtools/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java b/langtools/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java index 161ac5d0dc6..638947bd8dd 100644 --- a/langtools/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java +++ b/langtools/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -30,6 +30,7 @@ * Wrong Answer: "The class is empty (i.e." * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestBreakIterator */ diff --git a/langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java b/langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java index 5c712a41023..514bff820eb 100644 --- a/langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java +++ b/langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, 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,6 +27,7 @@ * @summary Make sure tool parses CR line separators properly. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestCRLineSeparator */ diff --git a/langtools/test/com/sun/javadoc/testCharset/TestCharset.java b/langtools/test/com/sun/javadoc/testCharset/TestCharset.java index b08c128f3ac..a273340c72c 100644 --- a/langtools/test/com/sun/javadoc/testCharset/TestCharset.java +++ b/langtools/test/com/sun/javadoc/testCharset/TestCharset.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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,6 +28,7 @@ * part of the meta tag. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestCharset */ diff --git a/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java b/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java index 9f1d54d4527..28120d4ae5c 100644 --- a/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java +++ b/langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary This test verifies that class cross references work properly. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @build TestClassCrossReferences * @run main TestClassCrossReferences diff --git a/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java b/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java index 90d6b405aea..4603593404b 100644 --- a/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java +++ b/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java @@ -30,6 +30,7 @@ * types. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestClassTree */ diff --git a/langtools/test/com/sun/javadoc/testCmndLineClass/TestCmndLineClass.java b/langtools/test/com/sun/javadoc/testCmndLineClass/TestCmndLineClass.java index e21ca6b5653..e03b498e82d 100644 --- a/langtools/test/com/sun/javadoc/testCmndLineClass/TestCmndLineClass.java +++ b/langtools/test/com/sun/javadoc/testCmndLineClass/TestCmndLineClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -29,6 +29,7 @@ * classes. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestCmndLineClass */ diff --git a/langtools/test/com/sun/javadoc/testCompletionFailure/TestCompletionFailure.java b/langtools/test/com/sun/javadoc/testCompletionFailure/TestCompletionFailure.java index 21419dafb51..2968d6adb4d 100644 --- a/langtools/test/com/sun/javadoc/testCompletionFailure/TestCompletionFailure.java +++ b/langtools/test/com/sun/javadoc/testCompletionFailure/TestCompletionFailure.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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,6 +27,7 @@ * @summary Test to verify javadoc executes without CompletionFailure exception. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestCompletionFailure */ diff --git a/langtools/test/com/sun/javadoc/testConstantValuesPage/TestConstantValuesPage.java b/langtools/test/com/sun/javadoc/testConstantValuesPage/TestConstantValuesPage.java index b0e9bd1643b..76c89c0633f 100644 --- a/langtools/test/com/sun/javadoc/testConstantValuesPage/TestConstantValuesPage.java +++ b/langtools/test/com/sun/javadoc/testConstantValuesPage/TestConstantValuesPage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * generated when doclet has nothing to document. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestConstantValuesPage */ diff --git a/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java b/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java index 50efb7d8513..d4e5784c775 100644 --- a/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java +++ b/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +28,7 @@ *
                          . Check for this in the output. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestConstructorIndent */ diff --git a/langtools/test/com/sun/javadoc/testConstructors/TestConstructors.java b/langtools/test/com/sun/javadoc/testConstructors/TestConstructors.java index 9fef963ee7f..c6e2ebdd425 100644 --- a/langtools/test/com/sun/javadoc/testConstructors/TestConstructors.java +++ b/langtools/test/com/sun/javadoc/testConstructors/TestConstructors.java @@ -27,6 +27,7 @@ * @summary Test for constructor name which should be a non-qualified name. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestConstructors */ diff --git a/langtools/test/com/sun/javadoc/testCustomTag/TestCustomTag.java b/langtools/test/com/sun/javadoc/testCustomTag/TestCustomTag.java index 0e69c20259b..d417701008e 100644 --- a/langtools/test/com/sun/javadoc/testCustomTag/TestCustomTag.java +++ b/langtools/test/com/sun/javadoc/testCustomTag/TestCustomTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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,6 +27,9 @@ * @summary Test custom tag. Verify that an unknown tag generates appropriate warnings. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc/com.sun.tools.doclets.internal.toolkit + * jdk.javadoc/com.sun.tools.doclets.internal.toolkit.taglets + * jdk.javadoc/com.sun.tools.doclets.internal.toolkit.util * @build JavadocTester taglets.CustomTag * @run main TestCustomTag */ diff --git a/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java b/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java index fb1a1ab49f1..0da414fe5db 100644 --- a/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java +++ b/langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +27,7 @@ * @summary * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestDeprecatedDocs */ diff --git a/langtools/test/com/sun/javadoc/testDocEncoding/TestDocEncoding.java b/langtools/test/com/sun/javadoc/testDocEncoding/TestDocEncoding.java index 2a9eea8b8dc..1f6c585e8e4 100644 --- a/langtools/test/com/sun/javadoc/testDocEncoding/TestDocEncoding.java +++ b/langtools/test/com/sun/javadoc/testDocEncoding/TestDocEncoding.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -32,6 +32,7 @@ used for stylesheet as well. * @author jayashree viswanathan * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestDocEncoding */ diff --git a/langtools/test/com/sun/javadoc/testDocErrorReporter/TestDocErrorReporter.java b/langtools/test/com/sun/javadoc/testDocErrorReporter/TestDocErrorReporter.java index 6347ad2c619..74100d21106 100644 --- a/langtools/test/com/sun/javadoc/testDocErrorReporter/TestDocErrorReporter.java +++ b/langtools/test/com/sun/javadoc/testDocErrorReporter/TestDocErrorReporter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +28,7 @@ * DocErrorReporter. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestDocErrorReporter */ diff --git a/langtools/test/com/sun/javadoc/testDocFileDir/TestDocFileDir.java b/langtools/test/com/sun/javadoc/testDocFileDir/TestDocFileDir.java index cdf81c7b149..6bcdbcc3462 100644 --- a/langtools/test/com/sun/javadoc/testDocFileDir/TestDocFileDir.java +++ b/langtools/test/com/sun/javadoc/testDocFileDir/TestDocFileDir.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -30,6 +30,7 @@ * Also test that -docfilessubdirs and -excludedocfilessubdir both work. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestDocFileDir */ diff --git a/langtools/test/com/sun/javadoc/testDocFiles/TestDocFiles.java b/langtools/test/com/sun/javadoc/testDocFiles/TestDocFiles.java index 5d09ef9804e..8bf77ba4506 100644 --- a/langtools/test/com/sun/javadoc/testDocFiles/TestDocFiles.java +++ b/langtools/test/com/sun/javadoc/testDocFiles/TestDocFiles.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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 @@ -26,6 +26,7 @@ * @bug 8008949 * @summary verify that doc-files get copied * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestDocFiles */ diff --git a/langtools/test/com/sun/javadoc/testDocRootInlineTag/TestDocRootInlineTag.java b/langtools/test/com/sun/javadoc/testDocRootInlineTag/TestDocRootInlineTag.java index 2adbe83343b..841b110d76d 100644 --- a/langtools/test/com/sun/javadoc/testDocRootInlineTag/TestDocRootInlineTag.java +++ b/langtools/test/com/sun/javadoc/testDocRootInlineTag/TestDocRootInlineTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -29,6 +29,7 @@ * Make sure that the docRoot tag works with the -bottom option. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestDocRootInlineTag */ diff --git a/langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java b/langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java index 377cdce7dbf..2011ac32d7c 100644 --- a/langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java +++ b/langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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,6 +27,7 @@ * @summary This test verifies the -Xdocrootparent option. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestDocRootLink */ diff --git a/langtools/test/com/sun/javadoc/testDupParamWarn/TestDupParamWarn.java b/langtools/test/com/sun/javadoc/testDupParamWarn/TestDupParamWarn.java index 2d7e355e7bf..e50cc181176 100644 --- a/langtools/test/com/sun/javadoc/testDupParamWarn/TestDupParamWarn.java +++ b/langtools/test/com/sun/javadoc/testDupParamWarn/TestDupParamWarn.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * warning messages about duplicate param tags. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestDupParamWarn */ diff --git a/langtools/test/com/sun/javadoc/testEmptyClass/TestEmptyClass.java b/langtools/test/com/sun/javadoc/testEmptyClass/TestEmptyClass.java index 48593211815..aacbb78e733 100644 --- a/langtools/test/com/sun/javadoc/testEmptyClass/TestEmptyClass.java +++ b/langtools/test/com/sun/javadoc/testEmptyClass/TestEmptyClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, 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,6 +28,7 @@ * run on a completely empty class (no comments or members). * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestEmptyClass */ diff --git a/langtools/test/com/sun/javadoc/testEnclosingClass/TestEnclosingClass.java b/langtools/test/com/sun/javadoc/testEnclosingClass/TestEnclosingClass.java index 9e7d9681796..e3b0a4e7a85 100644 --- a/langtools/test/com/sun/javadoc/testEnclosingClass/TestEnclosingClass.java +++ b/langtools/test/com/sun/javadoc/testEnclosingClass/TestEnclosingClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, 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,6 +27,7 @@ * @summary Check the outer class when documenting enclosing class/interface. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestEnclosingClass */ diff --git a/langtools/test/com/sun/javadoc/testEncoding/TestEncoding.java b/langtools/test/com/sun/javadoc/testEncoding/TestEncoding.java index 83ab93b0e08..a972225c98b 100644 --- a/langtools/test/com/sun/javadoc/testEncoding/TestEncoding.java +++ b/langtools/test/com/sun/javadoc/testEncoding/TestEncoding.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * properly passed from Javadoc to the source file parser. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestEncoding */ diff --git a/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java b/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java index 0f2864891ad..74e06d72d88 100644 --- a/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java +++ b/langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -29,6 +29,7 @@ * "overrides" documentation even though the method is external. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester TestExternalOverridenMethod * @run main TestExternalOverridenMethod */ diff --git a/langtools/test/com/sun/javadoc/testGeneratedBy/TestGeneratedBy.java b/langtools/test/com/sun/javadoc/testGeneratedBy/TestGeneratedBy.java index bde5bbe4ba6..e0f3736a656 100644 --- a/langtools/test/com/sun/javadoc/testGeneratedBy/TestGeneratedBy.java +++ b/langtools/test/com/sun/javadoc/testGeneratedBy/TestGeneratedBy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, 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 @@ -26,6 +26,7 @@ * @bug 8000418 8024288 * @summary Verify that files use a common Generated By string * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestGeneratedBy */ diff --git a/langtools/test/com/sun/javadoc/testGroupOption/TestGroupOption.java b/langtools/test/com/sun/javadoc/testGroupOption/TestGroupOption.java index 6e2234ad984..d3a588cd01c 100644 --- a/langtools/test/com/sun/javadoc/testGroupOption/TestGroupOption.java +++ b/langtools/test/com/sun/javadoc/testGroupOption/TestGroupOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +28,7 @@ * to be printed. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestGroupOption */ diff --git a/langtools/test/com/sun/javadoc/testHeadings/TestHeadings.java b/langtools/test/com/sun/javadoc/testHeadings/TestHeadings.java index a98f151edb3..1d0d82bda59 100644 --- a/langtools/test/com/sun/javadoc/testHeadings/TestHeadings.java +++ b/langtools/test/com/sun/javadoc/testHeadings/TestHeadings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +27,7 @@ * @summary Make sure that headings use the TH tag instead of the TD tag. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @build TestHeadings * @run main TestHeadings diff --git a/langtools/test/com/sun/javadoc/testHelpFile/TestHelpFile.java b/langtools/test/com/sun/javadoc/testHelpFile/TestHelpFile.java index eaf14913b77..7a75e430ce7 100644 --- a/langtools/test/com/sun/javadoc/testHelpFile/TestHelpFile.java +++ b/langtools/test/com/sun/javadoc/testHelpFile/TestHelpFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, 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,6 +27,7 @@ * @summary Make sure that the help file is generated correctly. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestHelpFile */ diff --git a/langtools/test/com/sun/javadoc/testHelpOption/TestHelpOption.java b/langtools/test/com/sun/javadoc/testHelpOption/TestHelpOption.java index 9c571d63a8e..09fff50c505 100644 --- a/langtools/test/com/sun/javadoc/testHelpOption/TestHelpOption.java +++ b/langtools/test/com/sun/javadoc/testHelpOption/TestHelpOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +28,7 @@ * the help link appears in the documentation. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester TestHelpOption * @run main TestHelpOption */ diff --git a/langtools/test/com/sun/javadoc/testHiddenMembers/TestHiddenMembers.java b/langtools/test/com/sun/javadoc/testHiddenMembers/TestHiddenMembers.java index 6cbe9c846b1..84a7ec703d3 100644 --- a/langtools/test/com/sun/javadoc/testHiddenMembers/TestHiddenMembers.java +++ b/langtools/test/com/sun/javadoc/testHiddenMembers/TestHiddenMembers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * documented as inherited. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestHiddenMembers */ diff --git a/langtools/test/com/sun/javadoc/testHref/TestHref.java b/langtools/test/com/sun/javadoc/testHref/TestHref.java index 0bd8cac4feb..47779dc0001 100644 --- a/langtools/test/com/sun/javadoc/testHref/TestHref.java +++ b/langtools/test/com/sun/javadoc/testHref/TestHref.java @@ -27,6 +27,7 @@ * @summary Verify that spaces do not appear in hrefs and anchors. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestHref */ diff --git a/langtools/test/com/sun/javadoc/testHrefInDocComment/TestHrefInDocComment.java b/langtools/test/com/sun/javadoc/testHrefInDocComment/TestHrefInDocComment.java index 427e471b933..5242faa7c71 100644 --- a/langtools/test/com/sun/javadoc/testHrefInDocComment/TestHrefInDocComment.java +++ b/langtools/test/com/sun/javadoc/testHrefInDocComment/TestHrefInDocComment.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * appear in doc comments. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestHrefInDocComment */ diff --git a/langtools/test/com/sun/javadoc/testHtmlComments/TestHtmlComments.java b/langtools/test/com/sun/javadoc/testHtmlComments/TestHtmlComments.java index 3b8379a89fe..4a2d3025982 100644 --- a/langtools/test/com/sun/javadoc/testHtmlComments/TestHtmlComments.java +++ b/langtools/test/com/sun/javadoc/testHtmlComments/TestHtmlComments.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +28,7 @@ * are no fields to document. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestHtmlComments */ diff --git a/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java index 2a2e6de8ed4..27be6a74df8 100644 --- a/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java +++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2015, 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 @@ -29,6 +29,7 @@ * @summary This test verifies the nesting of definition list tags. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestHtmlDefinitionListTag */ diff --git a/langtools/test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java b/langtools/test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java index fa1cc7a7221..890877012d6 100644 --- a/langtools/test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java +++ b/langtools/test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java @@ -28,6 +28,8 @@ * @bug 6851834 * @summary This test verifies the HTML document generation for javadoc output. * @library ../lib + * @modules jdk.javadoc/com.sun.tools.doclets.formats.html.markup + * jdk.javadoc/com.sun.tools.doclets.internal.toolkit * @build JavadocTester * @author Bhavesh Patel * @run main TestHtmlDocument diff --git a/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java b/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java index cba3d5961bc..b31ce25f28e 100644 --- a/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java +++ b/langtools/test/com/sun/javadoc/testHtmlStrongTag/TestHtmlStrongTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, 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 @@ -29,6 +29,7 @@ * @summary This test verifies the use of HTML tag instead of by Javadoc std doclet. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestHtmlStrongTag */ diff --git a/langtools/test/com/sun/javadoc/testHtmlTableStyles/TestHtmlTableStyles.java b/langtools/test/com/sun/javadoc/testHtmlTableStyles/TestHtmlTableStyles.java index 79d1e1cfb73..543ad19279d 100644 --- a/langtools/test/com/sun/javadoc/testHtmlTableStyles/TestHtmlTableStyles.java +++ b/langtools/test/com/sun/javadoc/testHtmlTableStyles/TestHtmlTableStyles.java @@ -27,6 +27,7 @@ * @summary Test styles on HTML tables generated by javadoc. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestHtmlTableStyles */ diff --git a/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java b/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java index bd0ad241056..b3766d2b335 100644 --- a/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java +++ b/langtools/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java @@ -27,6 +27,7 @@ * @summary HTML tables should have table summary, caption and table headers. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestHtmlTableTags */ diff --git a/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java b/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java index 155bbd53293..feae5961147 100644 --- a/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java +++ b/langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2015, 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 @@ -29,6 +29,7 @@ * @summary This test verifies the use of lang attribute by . * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestHtmlTag */ diff --git a/langtools/test/com/sun/javadoc/testHtmlVersion/TestHtmlVersion.java b/langtools/test/com/sun/javadoc/testHtmlVersion/TestHtmlVersion.java index 970ac00bd31..0cf4d9be40b 100644 --- a/langtools/test/com/sun/javadoc/testHtmlVersion/TestHtmlVersion.java +++ b/langtools/test/com/sun/javadoc/testHtmlVersion/TestHtmlVersion.java @@ -27,6 +27,7 @@ * @summary Test the version of HTML generated by the javadoc tool. * @author bpatel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestHtmlVersion */ diff --git a/langtools/test/com/sun/javadoc/testIndentation/TestIndentation.java b/langtools/test/com/sun/javadoc/testIndentation/TestIndentation.java index 52c512865c4..6050197ab18 100644 --- a/langtools/test/com/sun/javadoc/testIndentation/TestIndentation.java +++ b/langtools/test/com/sun/javadoc/testIndentation/TestIndentation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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 @@ -26,6 +26,7 @@ * @bug 8011288 * @summary Erratic/inconsistent indentation of signatures * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestIndentation */ diff --git a/langtools/test/com/sun/javadoc/testIndex/TestIndex.java b/langtools/test/com/sun/javadoc/testIndex/TestIndex.java index bbb57ff0a0a..1ad48381305 100644 --- a/langtools/test/com/sun/javadoc/testIndex/TestIndex.java +++ b/langtools/test/com/sun/javadoc/testIndex/TestIndex.java @@ -29,6 +29,7 @@ * Test for unnamed package in index. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestIndex */ diff --git a/langtools/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java b/langtools/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java index 6ce373f8ac1..396bf4137b0 100644 --- a/langtools/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java +++ b/langtools/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary Test to make sure label is used for inline links. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestInlineLinkLabel */ diff --git a/langtools/test/com/sun/javadoc/testInterface/TestInterface.java b/langtools/test/com/sun/javadoc/testInterface/TestInterface.java index be11baac55f..bfded2cf7fe 100644 --- a/langtools/test/com/sun/javadoc/testInterface/TestInterface.java +++ b/langtools/test/com/sun/javadoc/testInterface/TestInterface.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -30,6 +30,7 @@ * implementing classes in the documentation for I. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestInterface */ diff --git a/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java b/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java index 70f88d5c7fa..4ea77916055 100644 --- a/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java +++ b/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java @@ -27,6 +27,7 @@ * @summary Test of the JavaFX doclet features. * @author jvalenta * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestJavaFX */ diff --git a/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java b/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java index 4736d25870f..866e238fbef 100644 --- a/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java +++ b/langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java @@ -27,6 +27,7 @@ * @summary Verify that the output has the right javascript. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestJavascript */ diff --git a/langtools/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java b/langtools/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java index 84a4eeaa44e..a0848d03990 100644 --- a/langtools/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java +++ b/langtools/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, 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,6 +28,7 @@ * javadoc. * @author bpatel * @library ../lib/ + * @modules jdk.javadoc * @build JavadocTester TestLambdaFeature * @run main TestLambdaFeature */ diff --git a/langtools/test/com/sun/javadoc/testLeadingSpaces/LeadingSpaces.java b/langtools/test/com/sun/javadoc/testLeadingSpaces/LeadingSpaces.java index 6985f1b644c..7752f91674e 100644 --- a/langtools/test/com/sun/javadoc/testLeadingSpaces/LeadingSpaces.java +++ b/langtools/test/com/sun/javadoc/testLeadingSpaces/LeadingSpaces.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, 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 @@ -30,6 +30,7 @@ * spaces stripped * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main LeadingSpaces */ diff --git a/langtools/test/com/sun/javadoc/testLegacyTaglet/TestLegacyTaglet.java b/langtools/test/com/sun/javadoc/testLegacyTaglet/TestLegacyTaglet.java index da4c72aa194..0ed0f129c5b 100644 --- a/langtools/test/com/sun/javadoc/testLegacyTaglet/TestLegacyTaglet.java +++ b/langtools/test/com/sun/javadoc/testLegacyTaglet/TestLegacyTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +28,7 @@ * doclet still works with Taglets that implement the 1.4.0 interface. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester ToDoTaglet UnderlineTaglet Check * @run main TestLegacyTaglet */ diff --git a/langtools/test/com/sun/javadoc/testLinkOption/TestBadLinkOption.java b/langtools/test/com/sun/javadoc/testLinkOption/TestBadLinkOption.java index c1a89319d44..af3522557a5 100644 --- a/langtools/test/com/sun/javadoc/testLinkOption/TestBadLinkOption.java +++ b/langtools/test/com/sun/javadoc/testLinkOption/TestBadLinkOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +27,7 @@ * @summary Make sure that bad -link arguments trigger warnings. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestBadLinkOption */ diff --git a/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java b/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java index 9e250c53edf..43fda5e641d 100644 --- a/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java +++ b/langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * right files, and URLs with and without trailing slash are accepted. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestLinkOption */ diff --git a/langtools/test/com/sun/javadoc/testLinkOption/TestNewLineInLink.java b/langtools/test/com/sun/javadoc/testLinkOption/TestNewLineInLink.java index 54f95acd46b..20154e33820 100644 --- a/langtools/test/com/sun/javadoc/testLinkOption/TestNewLineInLink.java +++ b/langtools/test/com/sun/javadoc/testLinkOption/TestNewLineInLink.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * link and label. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestNewLineInLink */ diff --git a/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java b/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java index 242d0385bb6..d3a1305d7c1 100644 --- a/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java +++ b/langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, 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,6 +28,7 @@ * non-qualified name, furthermore, ensure the right one is linked. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestLinkTaglet */ diff --git a/langtools/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java b/langtools/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java index af2b9e1f304..34dfcc00a5e 100644 --- a/langtools/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java +++ b/langtools/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java @@ -28,6 +28,7 @@ * from a serializable class to serialized-form.html. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestLinkToSerialForm */ diff --git a/langtools/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java b/langtools/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java index 000c6594a4a..b2e2ecdd923 100644 --- a/langtools/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java +++ b/langtools/test/com/sun/javadoc/testLiteralCodeInPre/TestLiteralCodeInPre.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -26,6 +26,7 @@ * @bug 8002387 8014636 * @summary Improve rendered HTML formatting for {@code} * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestLiteralCodeInPre */ diff --git a/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java b/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java index c174d4aa9de..029a4650b81 100644 --- a/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java +++ b/langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * Verify that inheritence labels are correct. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestMemberInheritence */ diff --git a/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java b/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java index f79874d5e15..04e5141ff6a 100644 --- a/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java +++ b/langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java @@ -29,6 +29,7 @@ * documentation is inherited but the return type isn't. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestMemberSummary */ diff --git a/langtools/test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java b/langtools/test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java index 293a37b93ed..f429730b23a 100644 --- a/langtools/test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java +++ b/langtools/test/com/sun/javadoc/testMethodTypes/TestMethodTypes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, 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,6 +27,7 @@ * @summary Test for various method types in the method summary table * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestMethodTypes */ diff --git a/langtools/test/com/sun/javadoc/testModifier/TestModifier.java b/langtools/test/com/sun/javadoc/testModifier/TestModifier.java index 0454fc205f2..d7e7971a530 100644 --- a/langtools/test/com/sun/javadoc/testModifier/TestModifier.java +++ b/langtools/test/com/sun/javadoc/testModifier/TestModifier.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary Javadoc declares interfaces to be "abstract". * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build ModifierAbstract * @build JavadocTester * @run main TestModifier diff --git a/langtools/test/com/sun/javadoc/testNavigation/TestNavigation.java b/langtools/test/com/sun/javadoc/testNavigation/TestNavigation.java index 0dd9e09dae1..7c26feab58d 100644 --- a/langtools/test/com/sun/javadoc/testNavigation/TestNavigation.java +++ b/langtools/test/com/sun/javadoc/testNavigation/TestNavigation.java @@ -28,6 +28,7 @@ * Make sure the navagation is 2 columns, not 3. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestNavigation */ diff --git a/langtools/test/com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java b/langtools/test/com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java index 57bd6410c89..fd6388d875b 100644 --- a/langtools/test/com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java +++ b/langtools/test/com/sun/javadoc/testNestedGenerics/TestNestedGenerics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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,6 +27,7 @@ * @summary Test HTML output for nested generic types. * @author bpatel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestNestedGenerics */ diff --git a/langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java b/langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java index f41ff173bd3..49c0967af0f 100644 --- a/langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java +++ b/langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, 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 @@ -26,6 +26,9 @@ * @summary Test for nested inline tags. * * @author jamieh * @library ../lib + * @modules jdk.javadoc/com.sun.tools.doclets.internal.toolkit + * jdk.javadoc/com.sun.tools.doclets.internal.toolkit.taglets + * jdk.javadoc/com.sun.tools.doclets.internal.toolkit.util * @build JavadocTester * @build testtaglets.UnderlineTaglet * @build testtaglets.BoldTaglet diff --git a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java index 44e50e702e1..5865ed7e0ef 100644 --- a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java +++ b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -29,6 +29,7 @@ * language features are properly documented. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestNewLanguageFeatures */ diff --git a/langtools/test/com/sun/javadoc/testNoPackagesFile/TestNoPackagesFile.java b/langtools/test/com/sun/javadoc/testNoPackagesFile/TestNoPackagesFile.java index 5e0ff72730e..5306ae06c1f 100644 --- a/langtools/test/com/sun/javadoc/testNoPackagesFile/TestNoPackagesFile.java +++ b/langtools/test/com/sun/javadoc/testNoPackagesFile/TestNoPackagesFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +28,7 @@ * longer used. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestNoPackagesFile */ diff --git a/langtools/test/com/sun/javadoc/testNotifications/TestNotifications.java b/langtools/test/com/sun/javadoc/testNotifications/TestNotifications.java index 7f895d12624..ad983a37423 100644 --- a/langtools/test/com/sun/javadoc/testNotifications/TestNotifications.java +++ b/langtools/test/com/sun/javadoc/testNotifications/TestNotifications.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -29,6 +29,7 @@ * Make sure classname is not include in javadoc usage message. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestNotifications */ diff --git a/langtools/test/com/sun/javadoc/testOptions/TestOptions.java b/langtools/test/com/sun/javadoc/testOptions/TestOptions.java index 80c83efbdb0..3aaf576b8a3 100644 --- a/langtools/test/com/sun/javadoc/testOptions/TestOptions.java +++ b/langtools/test/com/sun/javadoc/testOptions/TestOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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,6 +27,7 @@ * @summary Test the output for -header and -footer options. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestOptions */ diff --git a/langtools/test/com/sun/javadoc/testOrdering/TestOrdering.java b/langtools/test/com/sun/javadoc/testOrdering/TestOrdering.java index dbabb93b44c..f9d9ad8634d 100644 --- a/langtools/test/com/sun/javadoc/testOrdering/TestOrdering.java +++ b/langtools/test/com/sun/javadoc/testOrdering/TestOrdering.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, 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,6 +27,7 @@ * @summary test to determine if members are ordered correctly * @author ksrini * @library ../lib/ + * @modules jdk.javadoc * @build JavadocTester * @run main TestOrdering */ diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java index 3bd70294602..51ad72dec92 100644 --- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java +++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +28,7 @@ * interfaces are documented * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestMultiInheritence */ diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java index 4a582a5bb79..7d6f5d4f41d 100644 --- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java +++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +28,7 @@ * class * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestOverridenMethodDocCopy */ diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java index cc76c074c4a..d595705ea93 100644 --- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java +++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * -protected (default) visibility flag is used. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestOverridenPrivateMethods */ diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java index f517919b93b..ecb9bc5c590 100644 --- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java +++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * -protected (default) visibility flag is used. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestOverridenPrivateMethodsWithPackageFlag */ diff --git a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java index 9fb8423e0b2..c2f9481513e 100644 --- a/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java +++ b/langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * -protected (default) visibility flag is used. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestOverridenPrivateMethodsWithPrivateFlag */ diff --git a/langtools/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java b/langtools/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java index 2746814cac8..647f105ff13 100644 --- a/langtools/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java +++ b/langtools/test/com/sun/javadoc/testPackageDeprecation/TestPackageDeprecation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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,6 +27,7 @@ * @summary Test package deprecation. * @author bpatel * @library ../lib/ + * @modules jdk.javadoc * @build JavadocTester TestPackageDeprecation * @run main TestPackageDeprecation */ diff --git a/langtools/test/com/sun/javadoc/testPackagePage/TestPackagePage.java b/langtools/test/com/sun/javadoc/testPackagePage/TestPackagePage.java index 7941694631d..05c343eee3f 100644 --- a/langtools/test/com/sun/javadoc/testPackagePage/TestPackagePage.java +++ b/langtools/test/com/sun/javadoc/testPackagePage/TestPackagePage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -29,6 +29,7 @@ * when single or multiple packages are documented. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestPackagePage */ diff --git a/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java b/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java index 252d3ddbcda..b535b1ab7b2 100644 --- a/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java +++ b/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -29,6 +29,7 @@ * Make sure inheritDoc cannot be used in an invalid param tag. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestParamTaglet */ diff --git a/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java b/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java index 82c285db303..9d6b097bf63 100644 --- a/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java +++ b/langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -38,6 +38,7 @@ * signature is displayed correctly without extra space at the beginning. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestPrivateClasses */ diff --git a/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java b/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java index e5240c2e226..f8ad07dc666 100644 --- a/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java +++ b/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java @@ -27,6 +27,7 @@ * @summary Test javadoc support for profiles. * @author Bhavesh Patel, Evgeniya Stepanova * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestProfiles */ diff --git a/langtools/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java b/langtools/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java index d4c2fd80b41..38020f0d335 100644 --- a/langtools/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java +++ b/langtools/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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,6 +27,7 @@ * @summary Test javadoc options support for profiles. * @author Evgeniya Stepanova * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestProfilesConfiguration */ diff --git a/langtools/test/com/sun/javadoc/testRecurseSubPackages/TestRecurseSubPackages.java b/langtools/test/com/sun/javadoc/testRecurseSubPackages/TestRecurseSubPackages.java index 615c64bba6e..38983a98d2a 100644 --- a/langtools/test/com/sun/javadoc/testRecurseSubPackages/TestRecurseSubPackages.java +++ b/langtools/test/com/sun/javadoc/testRecurseSubPackages/TestRecurseSubPackages.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary Make Javadoc capable of traversing/recursing all of given subpackages. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestRecurseSubPackages */ diff --git a/langtools/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java b/langtools/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java index 34bd4f5fa4f..52bf6e2f99a 100644 --- a/langtools/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java +++ b/langtools/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +28,7 @@ * output so that they are not broken. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestRelativeLinks */ diff --git a/langtools/test/com/sun/javadoc/testRepeatedAnnotations/TestRepeatedAnnotations.java b/langtools/test/com/sun/javadoc/testRepeatedAnnotations/TestRepeatedAnnotations.java index 22370f6e14b..fa0ff4aa02a 100644 --- a/langtools/test/com/sun/javadoc/testRepeatedAnnotations/TestRepeatedAnnotations.java +++ b/langtools/test/com/sun/javadoc/testRepeatedAnnotations/TestRepeatedAnnotations.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, 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,6 +27,7 @@ * @summary Test repeated annotations output. * @author bpatel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestRepeatedAnnotations */ diff --git a/langtools/test/com/sun/javadoc/testReturnTag/TestReturnTag.java b/langtools/test/com/sun/javadoc/testReturnTag/TestReturnTag.java index 35278f60e69..a422aecc866 100644 --- a/langtools/test/com/sun/javadoc/testReturnTag/TestReturnTag.java +++ b/langtools/test/com/sun/javadoc/testReturnTag/TestReturnTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +27,7 @@ * @summary Warn when a return tag is used on a method without a return type. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestReturnTag */ diff --git a/langtools/test/com/sun/javadoc/testSeeTag/TestSeeTag.java b/langtools/test/com/sun/javadoc/testSeeTag/TestSeeTag.java index 8ce6945de84..a57bfb88f73 100644 --- a/langtools/test/com/sun/javadoc/testSeeTag/TestSeeTag.java +++ b/langtools/test/com/sun/javadoc/testSeeTag/TestSeeTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary Javadoc is confused by at-link to imported classes outside of the set of generated packages * @author jjg * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestSeeTag */ diff --git a/langtools/test/com/sun/javadoc/testSerialVersionUID/TestSerialVersionUID.java b/langtools/test/com/sun/javadoc/testSerialVersionUID/TestSerialVersionUID.java index 23bbdf6c1e7..fe8d6e5d6fb 100644 --- a/langtools/test/com/sun/javadoc/testSerialVersionUID/TestSerialVersionUID.java +++ b/langtools/test/com/sun/javadoc/testSerialVersionUID/TestSerialVersionUID.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * documented in the serialized form. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestSerialVersionUID */ diff --git a/langtools/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java b/langtools/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java index 209f7d73a4c..ed844798819 100644 --- a/langtools/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java +++ b/langtools/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, 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 @@ -33,6 +33,7 @@ * Make sure see tags work in serialized form. * @author jamieh * @library ../lib/ + * @modules jdk.javadoc * @build JavadocTester * @build TestSerializedForm * @run main TestSerializedForm diff --git a/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java b/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java index 99e7cdb3d40..36d2d357cfd 100644 --- a/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java +++ b/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2015, 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 @@ -29,6 +29,7 @@ * @summary This test verifies deprecation info in serialized-form.html. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestSerializedFormDeprecationInfo */ diff --git a/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java b/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java index f9169cef77b..890f50f4828 100644 --- a/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java +++ b/langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -30,6 +30,7 @@ * considered a separator when parsing the simple tag argument. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestSimpleTag */ diff --git a/langtools/test/com/sun/javadoc/testSimpleTagExclude/TestSimpleTagExclude.java b/langtools/test/com/sun/javadoc/testSimpleTagExclude/TestSimpleTagExclude.java index 9064ec09151..032348f3e70 100644 --- a/langtools/test/com/sun/javadoc/testSimpleTagExclude/TestSimpleTagExclude.java +++ b/langtools/test/com/sun/javadoc/testSimpleTagExclude/TestSimpleTagExclude.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * exclude a simple tag by using -tag tagname:X * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestSimpleTagExclude */ diff --git a/langtools/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java b/langtools/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java index 011533fa379..2071c10a270 100644 --- a/langtools/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java +++ b/langtools/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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 @@ -26,6 +26,7 @@ * @bug 8008768 8026567 * @summary Using {@inheritDoc} in simple tag defined via -tag fails * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestSimpleTagInherit */ diff --git a/langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java b/langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java index 49c54abcde3..d71299ef09c 100644 --- a/langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java +++ b/langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, 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,6 +27,7 @@ * @summary Test to make sure that the since tag works correctly * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestSinceTag */ diff --git a/langtools/test/com/sun/javadoc/testSingleQuotedLink/TestSingleQuotedLink.java b/langtools/test/com/sun/javadoc/testSingleQuotedLink/TestSingleQuotedLink.java index bdeaec8defc..78e8d26fdce 100644 --- a/langtools/test/com/sun/javadoc/testSingleQuotedLink/TestSingleQuotedLink.java +++ b/langtools/test/com/sun/javadoc/testSingleQuotedLink/TestSingleQuotedLink.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, 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,6 +27,7 @@ * @summary Verify that a link in single quotes copied to the class-use page as is. * @author Yuri Nesterenko * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestSingleQuotedLink */ diff --git a/langtools/test/com/sun/javadoc/testSourceTab/TestSourceTab.java b/langtools/test/com/sun/javadoc/testSourceTab/TestSourceTab.java index 1364ece4ae8..43753f03cc5 100644 --- a/langtools/test/com/sun/javadoc/testSourceTab/TestSourceTab.java +++ b/langtools/test/com/sun/javadoc/testSourceTab/TestSourceTab.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * when -linksourcetab is used. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestSourceTab */ diff --git a/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java b/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java index d96d58cfbe2..23340e5af3f 100644 --- a/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java +++ b/langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java @@ -27,6 +27,7 @@ * @summary Run tests on doclet stylesheet. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestStylesheet */ diff --git a/langtools/test/com/sun/javadoc/testSubTitle/TestSubTitle.java b/langtools/test/com/sun/javadoc/testSubTitle/TestSubTitle.java index d2342bd0a0f..374e48fee90 100644 --- a/langtools/test/com/sun/javadoc/testSubTitle/TestSubTitle.java +++ b/langtools/test/com/sun/javadoc/testSubTitle/TestSubTitle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, 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,6 +27,7 @@ * @summary Test for correct sub title generation. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestSubTitle */ diff --git a/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java b/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java index 1ffeb024e0e..124c1e1d31a 100644 --- a/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java +++ b/langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -29,6 +29,7 @@ * inherits methods. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestSummaryHeading */ diff --git a/langtools/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java b/langtools/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java index 1ff2c9ad2ce..6ae60fd5348 100644 --- a/langtools/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java +++ b/langtools/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * each class in serialized form page. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestSuperClassInSerialForm */ diff --git a/langtools/test/com/sun/javadoc/testSupplementary/TestSupplementary.java b/langtools/test/com/sun/javadoc/testSupplementary/TestSupplementary.java index 7c4355857b8..2d327690181 100644 --- a/langtools/test/com/sun/javadoc/testSupplementary/TestSupplementary.java +++ b/langtools/test/com/sun/javadoc/testSupplementary/TestSupplementary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +28,7 @@ * characters correctly. This test case needs to be run in en_US locale. * @author Naoto Sato * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestSupplementary */ diff --git a/langtools/test/com/sun/javadoc/testTagHolderMethod/TestTagHolderMethod.java b/langtools/test/com/sun/javadoc/testTagHolderMethod/TestTagHolderMethod.java index 4a590de8d52..94281f455d6 100644 --- a/langtools/test/com/sun/javadoc/testTagHolderMethod/TestTagHolderMethod.java +++ b/langtools/test/com/sun/javadoc/testTagHolderMethod/TestTagHolderMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary Determine if the new Tag.holder() method works properly. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @build TestTagHolderMethod * @run main TestTagHolderMethod diff --git a/langtools/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java b/langtools/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java index e3ddc6a636f..3a1ec3d3fd1 100644 --- a/langtools/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java +++ b/langtools/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestTagInheritence */ diff --git a/langtools/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java b/langtools/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java index e133189214d..09138a509e7 100644 --- a/langtools/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java +++ b/langtools/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, 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 @@ -26,6 +26,7 @@ * @summary Determine if proper warning messages are printed when know. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @build TestTagMisuse * @run main TestTagMisuse diff --git a/langtools/test/com/sun/javadoc/testTagOutput/TestTagOutput.java b/langtools/test/com/sun/javadoc/testTagOutput/TestTagOutput.java index bb99e3fdc03..02812009e63 100644 --- a/langtools/test/com/sun/javadoc/testTagOutput/TestTagOutput.java +++ b/langtools/test/com/sun/javadoc/testTagOutput/TestTagOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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 @@ -29,6 +29,7 @@ * @summary This test checks the generated tag output. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestTagOutput */ diff --git a/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java b/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java index 9ab76f6b4f4..790b2525b0a 100644 --- a/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java +++ b/langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -30,6 +30,9 @@ * sure that only the first sentence shows up in the summary table. * @author jamieh * @library ../lib + * @modules jdk.javadoc/com.sun.tools.doclets.internal.toolkit + * jdk.javadoc/com.sun.tools.doclets.internal.toolkit.taglets + * jdk.javadoc/com.sun.tools.doclets.internal.toolkit.util * @build JavadocTester taglets.Foo * @run main TestTaglets */ diff --git a/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java b/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java index fcec5953a0a..950ae0568f0 100644 --- a/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java +++ b/langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -29,6 +29,7 @@ * throws section. Make sure that the link is below a Throws heading. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestThrowsHead */ diff --git a/langtools/test/com/sun/javadoc/testThrowsInheritence/TestThrowsTagInheritence.java b/langtools/test/com/sun/javadoc/testThrowsInheritence/TestThrowsTagInheritence.java index 99fc0a8eadd..38340c69dc3 100644 --- a/langtools/test/com/sun/javadoc/testThrowsInheritence/TestThrowsTagInheritence.java +++ b/langtools/test/com/sun/javadoc/testThrowsInheritence/TestThrowsTagInheritence.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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 @@ -29,6 +29,7 @@ * the case where the name of one exception is not fully qualified. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestThrowsTagInheritence */ diff --git a/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java b/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java index 3b5b7bca314..c33fb926836 100644 --- a/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java +++ b/langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, 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,6 +28,7 @@ * correct order. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestThrowsTag */ diff --git a/langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java b/langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java index d5e977250b4..169a2f3e1e2 100644 --- a/langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java +++ b/langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +27,7 @@ * @summary Test to make sure that the title attribute shows up in links. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestTitleInHref */ diff --git a/langtools/test/com/sun/javadoc/testTopOption/TestTopOption.java b/langtools/test/com/sun/javadoc/testTopOption/TestTopOption.java index 35bf0337a4d..df9f69a0434 100644 --- a/langtools/test/com/sun/javadoc/testTopOption/TestTopOption.java +++ b/langtools/test/com/sun/javadoc/testTopOption/TestTopOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2015, 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,6 +27,7 @@ * @summary Test the new -top option. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestTopOption */ diff --git a/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java b/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java index 33708c493bd..7d28c10a2f8 100644 --- a/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java +++ b/langtools/test/com/sun/javadoc/testTypeAnnotations/TestTypeAnnotations.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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,6 +27,7 @@ * @summary Make sure that type annotations are displayed correctly * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @ignore 8006735 output type annotations in javadoc * @build JavadocTester * @run main TestTypeAnnotations diff --git a/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java b/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java index a4acd27a9bd..0a3b4482ba3 100644 --- a/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java +++ b/langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java @@ -31,6 +31,7 @@ * parameter links in the class/annotation signature section when -linksource is set. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestTypeParameters */ diff --git a/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java b/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java index 13e976452ee..23e413e5cd8 100644 --- a/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java +++ b/langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +28,7 @@ * Generate a package summary for the unnamed package. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestUnnamedPackage */ diff --git a/langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java b/langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java index 86b9e602959..33220bcd345 100644 --- a/langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java +++ b/langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java @@ -27,6 +27,7 @@ * @summary A simple test to ensure class-use files are correct. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestUseOption */ diff --git a/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java b/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java index 9dfe0921493..57c5852c3d8 100644 --- a/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java +++ b/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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,6 +28,7 @@ * use cases. The explainations for each test case are written below. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestValueTag */ diff --git a/langtools/test/com/sun/javadoc/testWarnBadParamNames/TestWarnBadParamNames.java b/langtools/test/com/sun/javadoc/testWarnBadParamNames/TestWarnBadParamNames.java index 8d090f9bf5a..31686f3f247 100644 --- a/langtools/test/com/sun/javadoc/testWarnBadParamNames/TestWarnBadParamNames.java +++ b/langtools/test/com/sun/javadoc/testWarnBadParamNames/TestWarnBadParamNames.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, 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,6 +28,7 @@ * name is used with param. * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestWarnBadParamNames */ diff --git a/langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java b/langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java index 8554624ac48..9f5c46d6ebe 100644 --- a/langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java +++ b/langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2015, 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 @@ -31,6 +31,7 @@ * Make sure error message starts with "error -". * @author jamieh * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestWarnings */ diff --git a/langtools/test/com/sun/javadoc/testWindowTitle/TestWindowTitle.java b/langtools/test/com/sun/javadoc/testWindowTitle/TestWindowTitle.java index 060fbcee19c..2894a02f5a4 100644 --- a/langtools/test/com/sun/javadoc/testWindowTitle/TestWindowTitle.java +++ b/langtools/test/com/sun/javadoc/testWindowTitle/TestWindowTitle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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,6 +27,7 @@ * @summary Test for window title. * @author Bhavesh Patel * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestWindowTitle */ diff --git a/langtools/test/com/sun/javadoc/testXOption/TestXOption.java b/langtools/test/com/sun/javadoc/testXOption/TestXOption.java index 4227d6a40bc..1b7b323fb24 100644 --- a/langtools/test/com/sun/javadoc/testXOption/TestXOption.java +++ b/langtools/test/com/sun/javadoc/testXOption/TestXOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, 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 @@ -26,6 +26,7 @@ * @bug 8007687 * @summary Make sure that the -X option works properly. * @library ../lib + * @modules jdk.javadoc * @build JavadocTester * @run main TestXOption */ diff --git a/langtools/test/com/sun/javadoc/typeAnnotations/smoke/TestSmoke.java b/langtools/test/com/sun/javadoc/typeAnnotations/smoke/TestSmoke.java index 00df273bad8..9902ce6e02e 100644 --- a/langtools/test/com/sun/javadoc/typeAnnotations/smoke/TestSmoke.java +++ b/langtools/test/com/sun/javadoc/typeAnnotations/smoke/TestSmoke.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2015, 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,6 +28,7 @@ * * @author Mahmood Ali * @library ../../lib + * @modules jdk.javadoc * @ignore * @build JavadocTester * @run main TestSmoke diff --git a/langtools/test/tools/all/RunCodingRules.java b/langtools/test/tools/all/RunCodingRules.java index a963f6b497e..b1d59c558d4 100644 --- a/langtools/test/tools/all/RunCodingRules.java +++ b/langtools/test/tools/all/RunCodingRules.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, 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,6 +25,10 @@ * @test * @bug 8043643 * @summary Run the langtools coding rules over the langtools source code. + * @modules java.base/sun.reflect.annotation + * java.logging + * java.xml + * jdk.compiler/com.sun.tools.javac.resources */ diff --git a/langtools/test/tools/doclint/AccessTest.java b/langtools/test/tools/doclint/AccessTest.java index 4723e156577..1ba8c18bce5 100644 --- a/langtools/test/tools/doclint/AccessTest.java +++ b/langtools/test/tools/doclint/AccessTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8004832 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -ref AccessTest.protected.out AccessTest.java * @run main DocLintTester -Xmsgs -ref AccessTest.private.out AccessTest.java diff --git a/langtools/test/tools/doclint/AccessTest.package.out b/langtools/test/tools/doclint/AccessTest.package.out index 7bd5eafd6ad..a60dec722ee 100644 --- a/langtools/test/tools/doclint/AccessTest.package.out +++ b/langtools/test/tools/doclint/AccessTest.package.out @@ -1,19 +1,19 @@ -AccessTest.java:23: error: malformed HTML +AccessTest.java:24: error: malformed HTML * public a < b ^ -AccessTest.java:28: error: malformed HTML +AccessTest.java:29: error: malformed HTML * protected a < b ^ -AccessTest.java:33: error: malformed HTML +AccessTest.java:34: error: malformed HTML * package-private a < b ^ -AccessTest.java:46: error: malformed HTML +AccessTest.java:47: error: malformed HTML * public a < b ^ -AccessTest.java:51: error: malformed HTML +AccessTest.java:52: error: malformed HTML * protected a < b ^ -AccessTest.java:56: error: malformed HTML +AccessTest.java:57: error: malformed HTML * package-private a < b ^ 6 errors diff --git a/langtools/test/tools/doclint/AccessTest.private.out b/langtools/test/tools/doclint/AccessTest.private.out index db01a84f1ee..1b07917700c 100644 --- a/langtools/test/tools/doclint/AccessTest.private.out +++ b/langtools/test/tools/doclint/AccessTest.private.out @@ -1,25 +1,25 @@ -AccessTest.java:23: error: malformed HTML +AccessTest.java:24: error: malformed HTML * public a < b ^ -AccessTest.java:28: error: malformed HTML +AccessTest.java:29: error: malformed HTML * protected a < b ^ -AccessTest.java:33: error: malformed HTML +AccessTest.java:34: error: malformed HTML * package-private a < b ^ -AccessTest.java:38: error: malformed HTML +AccessTest.java:39: error: malformed HTML * private a < b ^ -AccessTest.java:46: error: malformed HTML +AccessTest.java:47: error: malformed HTML * public a < b ^ -AccessTest.java:51: error: malformed HTML +AccessTest.java:52: error: malformed HTML * protected a < b ^ -AccessTest.java:56: error: malformed HTML +AccessTest.java:57: error: malformed HTML * package-private a < b ^ -AccessTest.java:61: error: malformed HTML +AccessTest.java:62: error: malformed HTML * private a < b ^ 8 errors diff --git a/langtools/test/tools/doclint/AccessTest.protected.out b/langtools/test/tools/doclint/AccessTest.protected.out index 8aabbeef08e..480b56b9f58 100644 --- a/langtools/test/tools/doclint/AccessTest.protected.out +++ b/langtools/test/tools/doclint/AccessTest.protected.out @@ -1,7 +1,7 @@ -AccessTest.java:23: error: malformed HTML +AccessTest.java:24: error: malformed HTML * public a < b ^ -AccessTest.java:28: error: malformed HTML +AccessTest.java:29: error: malformed HTML * protected a < b ^ 2 errors diff --git a/langtools/test/tools/doclint/AccessTest.public.out b/langtools/test/tools/doclint/AccessTest.public.out index 69685905130..3fc3999782f 100644 --- a/langtools/test/tools/doclint/AccessTest.public.out +++ b/langtools/test/tools/doclint/AccessTest.public.out @@ -1,4 +1,4 @@ -AccessTest.java:23: error: malformed HTML +AccessTest.java:24: error: malformed HTML * public a < b ^ 1 error diff --git a/langtools/test/tools/doclint/AccessibilityTest.java b/langtools/test/tools/doclint/AccessibilityTest.java index e49d680c3f0..305c1543766 100644 --- a/langtools/test/tools/doclint/AccessibilityTest.java +++ b/langtools/test/tools/doclint/AccessibilityTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8004832 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:-accessibility AccessibilityTest.java * @run main DocLintTester -ref AccessibilityTest.out AccessibilityTest.java diff --git a/langtools/test/tools/doclint/AccessibilityTest.out b/langtools/test/tools/doclint/AccessibilityTest.out index b489b460c42..20354af7982 100644 --- a/langtools/test/tools/doclint/AccessibilityTest.out +++ b/langtools/test/tools/doclint/AccessibilityTest.out @@ -1,13 +1,13 @@ -AccessibilityTest.java:14: error: header used out of sequence:

                          +AccessibilityTest.java:15: error: header used out of sequence:

                          *

                          ...

                          ^ -AccessibilityTest.java:20: error: header used out of sequence:

                          +AccessibilityTest.java:21: error: header used out of sequence:

                          *

                          ...

                          ^ -AccessibilityTest.java:25: error: no "alt" attribute for image +AccessibilityTest.java:26: error: no "alt" attribute for image * ^ -AccessibilityTest.java:40: error: no summary or caption for table +AccessibilityTest.java:41: error: no summary or caption for table *
                          head
                          data
                          ^ 4 errors diff --git a/langtools/test/tools/doclint/AnchorTest.java b/langtools/test/tools/doclint/AnchorTest.java index 08e19031b4a..c867b7d9e2b 100644 --- a/langtools/test/tools/doclint/AnchorTest.java +++ b/langtools/test/tools/doclint/AnchorTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8004832 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -ref AnchorTest.out AnchorTest.java */ diff --git a/langtools/test/tools/doclint/AnchorTest.out b/langtools/test/tools/doclint/AnchorTest.out index d6b5b770c18..70bb1383ee3 100644 --- a/langtools/test/tools/doclint/AnchorTest.out +++ b/langtools/test/tools/doclint/AnchorTest.out @@ -1,49 +1,49 @@ -AnchorTest.java:19: error: anchor already defined: "foo" +AnchorTest.java:20: error: anchor already defined: "foo" * ^ -AnchorTest.java:24: error: invalid name for anchor: "" +AnchorTest.java:25: error: invalid name for anchor: "" * ^ -AnchorTest.java:29: error: invalid name for anchor: "123" +AnchorTest.java:30: error: invalid name for anchor: "123" * ^ -AnchorTest.java:34: error: no value given for anchor +AnchorTest.java:35: error: no value given for anchor * ^ -AnchorTest.java:46: error: anchor already defined: "foo" +AnchorTest.java:47: error: anchor already defined: "foo" * ^ -AnchorTest.java:51: error: invalid name for anchor: "" +AnchorTest.java:52: error: invalid name for anchor: "" * ^ -AnchorTest.java:51: error: anchor already defined: "" +AnchorTest.java:52: error: anchor already defined: "" * ^ -AnchorTest.java:56: error: invalid name for anchor: "123" +AnchorTest.java:57: error: invalid name for anchor: "123" * ^ -AnchorTest.java:56: error: anchor already defined: "123" +AnchorTest.java:57: error: anchor already defined: "123" * ^ -AnchorTest.java:61: error: no value given for anchor +AnchorTest.java:62: error: no value given for anchor * ^ -AnchorTest.java:73: error: anchor already defined: "foo" +AnchorTest.java:74: error: anchor already defined: "foo" *

                          text

                          ^ -AnchorTest.java:78: error: invalid name for anchor: "" +AnchorTest.java:79: error: invalid name for anchor: "" *

                          text

                          ^ -AnchorTest.java:78: error: anchor already defined: "" +AnchorTest.java:79: error: anchor already defined: "" *

                          text

                          ^ -AnchorTest.java:83: error: invalid name for anchor: "123" +AnchorTest.java:84: error: invalid name for anchor: "123" *

                          text

                          ^ -AnchorTest.java:83: error: anchor already defined: "123" +AnchorTest.java:84: error: anchor already defined: "123" *

                          text

                          ^ -AnchorTest.java:88: error: no value given for anchor +AnchorTest.java:89: error: no value given for anchor *

                          text

                          ^ 16 errors diff --git a/langtools/test/tools/doclint/AnchorTest2.java b/langtools/test/tools/doclint/AnchorTest2.java index 7d7441fbd37..179f9009cf6 100644 --- a/langtools/test/tools/doclint/AnchorTest2.java +++ b/langtools/test/tools/doclint/AnchorTest2.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8020313 * @summary doclint doesn't reset HTML anchors correctly + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -ref AnchorTest2.out AnchorTest2.java AnchorTest2a.java * @run main DocLintTester -ref AnchorTest2.out AnchorTest2a.java AnchorTest2.java diff --git a/langtools/test/tools/doclint/AnchorTest2.out b/langtools/test/tools/doclint/AnchorTest2.out index 2d92f3ee241..755e6073eb6 100644 --- a/langtools/test/tools/doclint/AnchorTest2.out +++ b/langtools/test/tools/doclint/AnchorTest2.out @@ -1,4 +1,4 @@ -AnchorTest2.java:15: error: anchor already defined: "AnchorTest2" +AnchorTest2.java:16: error: anchor already defined: "AnchorTest2" /** */ ^ 1 error diff --git a/langtools/test/tools/doclint/BadPackageCommentTest.java b/langtools/test/tools/doclint/BadPackageCommentTest.java index a3f71f0849b..6fbb73fdb39 100644 --- a/langtools/test/tools/doclint/BadPackageCommentTest.java +++ b/langtools/test/tools/doclint/BadPackageCommentTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8020278 * @summary NPE in javadoc (bad handling of bad tag in package-info.java) + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -ref BadPackageCommentTest.out BadPackageCommentTest.java */ diff --git a/langtools/test/tools/doclint/BadPackageCommentTest.out b/langtools/test/tools/doclint/BadPackageCommentTest.out index 768d9cb457d..11153088426 100644 --- a/langtools/test/tools/doclint/BadPackageCommentTest.out +++ b/langtools/test/tools/doclint/BadPackageCommentTest.out @@ -1,13 +1,13 @@ -BadPackageCommentTest.java:13: warning: documentation comment not expected here +BadPackageCommentTest.java:14: warning: documentation comment not expected here package p; ^ -BadPackageCommentTest.java:11: error: no tag name after @ +BadPackageCommentTest.java:12: error: no tag name after @ * @@@ ^ -BadPackageCommentTest.java:11: error: no tag name after @ +BadPackageCommentTest.java:12: error: no tag name after @ * @@@ ^ -BadPackageCommentTest.java:11: error: no tag name after @ +BadPackageCommentTest.java:12: error: no tag name after @ * @@@ ^ 3 errors diff --git a/langtools/test/tools/doclint/CoverageExtras.java b/langtools/test/tools/doclint/CoverageExtras.java index e083d70cda6..965753eba6b 100644 --- a/langtools/test/tools/doclint/CoverageExtras.java +++ b/langtools/test/tools/doclint/CoverageExtras.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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,6 +25,7 @@ * @test * @bug 8006263 * @summary Supplementary test cases needed for doclint + * @modules jdk.compiler/com.sun.tools.doclint */ import com.sun.tools.doclint.Checker; diff --git a/langtools/test/tools/doclint/CustomTagTest.java b/langtools/test/tools/doclint/CustomTagTest.java index 64ae347e436..61dcea94e47 100644 --- a/langtools/test/tools/doclint/CustomTagTest.java +++ b/langtools/test/tools/doclint/CustomTagTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8006248 8028318 * @summary DocLint should report unknown tags + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester CustomTagTest.java * @run main DocLintTester -XcustomTags: -ref CustomTagTest.out CustomTagTest.java diff --git a/langtools/test/tools/doclint/CustomTagTest.out b/langtools/test/tools/doclint/CustomTagTest.out index 4c58a3d3604..729a550e426 100644 --- a/langtools/test/tools/doclint/CustomTagTest.out +++ b/langtools/test/tools/doclint/CustomTagTest.out @@ -1,10 +1,10 @@ -CustomTagTest.java:14: error: unknown tag: customTag +CustomTagTest.java:15: error: unknown tag: customTag * @customTag Text for a custom tag. ^ -CustomTagTest.java:15: error: unknown tag: custom.tag +CustomTagTest.java:16: error: unknown tag: custom.tag * @custom.tag Text for another custom tag. ^ -CustomTagTest.java:16: error: unknown tag: unknownTag +CustomTagTest.java:17: error: unknown tag: unknownTag * @unknownTag Text for an unknown tag. ^ 3 errors diff --git a/langtools/test/tools/doclint/CustomTagTestWithOption.out b/langtools/test/tools/doclint/CustomTagTestWithOption.out index f5b67cf1d93..340f5a8a440 100644 --- a/langtools/test/tools/doclint/CustomTagTestWithOption.out +++ b/langtools/test/tools/doclint/CustomTagTestWithOption.out @@ -1,4 +1,4 @@ -CustomTagTest.java:16: error: unknown tag: unknownTag +CustomTagTest.java:17: error: unknown tag: unknownTag * @unknownTag Text for an unknown tag. ^ 1 error diff --git a/langtools/test/tools/doclint/EmptyAuthorTest.java b/langtools/test/tools/doclint/EmptyAuthorTest.java index 6188f7a598d..0a5db470e6b 100644 --- a/langtools/test/tools/doclint/EmptyAuthorTest.java +++ b/langtools/test/tools/doclint/EmptyAuthorTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8004832 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:-syntax EmptyAuthorTest.java * @run main DocLintTester -Xmsgs:syntax -ref EmptyAuthorTest.out EmptyAuthorTest.java diff --git a/langtools/test/tools/doclint/EmptyAuthorTest.out b/langtools/test/tools/doclint/EmptyAuthorTest.out index f2858d03928..90be0134464 100644 --- a/langtools/test/tools/doclint/EmptyAuthorTest.out +++ b/langtools/test/tools/doclint/EmptyAuthorTest.out @@ -1,4 +1,4 @@ -EmptyAuthorTest.java:10: warning: no description for @author +EmptyAuthorTest.java:11: warning: no description for @author /** @author */ ^ 1 warning diff --git a/langtools/test/tools/doclint/EmptyExceptionTest.java b/langtools/test/tools/doclint/EmptyExceptionTest.java index 8ffc7aa2c66..6a5db240020 100644 --- a/langtools/test/tools/doclint/EmptyExceptionTest.java +++ b/langtools/test/tools/doclint/EmptyExceptionTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8004832 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:-syntax EmptyExceptionTest.java * @run main DocLintTester -Xmsgs:syntax -ref EmptyExceptionTest.out EmptyExceptionTest.java diff --git a/langtools/test/tools/doclint/EmptyExceptionTest.out b/langtools/test/tools/doclint/EmptyExceptionTest.out index 118a0850abd..620f37d215e 100644 --- a/langtools/test/tools/doclint/EmptyExceptionTest.out +++ b/langtools/test/tools/doclint/EmptyExceptionTest.out @@ -1,4 +1,4 @@ -EmptyExceptionTest.java:12: warning: no description for @exception +EmptyExceptionTest.java:13: warning: no description for @exception /** @exception NullPointerException */ ^ 1 warning diff --git a/langtools/test/tools/doclint/EmptyParamTest.java b/langtools/test/tools/doclint/EmptyParamTest.java index ba21ca98404..37f76ae075c 100644 --- a/langtools/test/tools/doclint/EmptyParamTest.java +++ b/langtools/test/tools/doclint/EmptyParamTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8004832 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:-syntax EmptyParamTest.java * @run main DocLintTester -Xmsgs:syntax -ref EmptyParamTest.out EmptyParamTest.java diff --git a/langtools/test/tools/doclint/EmptyParamTest.out b/langtools/test/tools/doclint/EmptyParamTest.out index 9e96df352f4..aa78dd46904 100644 --- a/langtools/test/tools/doclint/EmptyParamTest.out +++ b/langtools/test/tools/doclint/EmptyParamTest.out @@ -1,4 +1,4 @@ -EmptyParamTest.java:12: warning: no description for @param +EmptyParamTest.java:13: warning: no description for @param /** @param i */ ^ 1 warning diff --git a/langtools/test/tools/doclint/EmptyPreTest.java b/langtools/test/tools/doclint/EmptyPreTest.java index ada4995f41c..79cc01bc587 100644 --- a/langtools/test/tools/doclint/EmptyPreTest.java +++ b/langtools/test/tools/doclint/EmptyPreTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, 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,6 +25,7 @@ * @test * @bug 8010317 * @summary DocLint incorrectly reports some
                           tags as empty
                          + * @modules jdk.compiler/com.sun.tools.doclint
                            * @build DocLintTester
                            * @run main DocLintTester -Xmsgs:html EmptyPreTest.java
                            */
                          diff --git a/langtools/test/tools/doclint/EmptyReturnTest.java b/langtools/test/tools/doclint/EmptyReturnTest.java
                          index 3cc850dc235..b0c787fe6fe 100644
                          --- a/langtools/test/tools/doclint/EmptyReturnTest.java
                          +++ b/langtools/test/tools/doclint/EmptyReturnTest.java
                          @@ -2,6 +2,7 @@
                            * @test /nodynamiccopyright/
                            * @bug 8004832
                            * @summary Add new doclint package
                          + * @modules jdk.compiler/com.sun.tools.doclint
                            * @build DocLintTester
                            * @run main DocLintTester -Xmsgs:-syntax EmptyReturnTest.java
                            * @run main DocLintTester -Xmsgs:syntax -ref EmptyReturnTest.out EmptyReturnTest.java
                          diff --git a/langtools/test/tools/doclint/EmptyReturnTest.out b/langtools/test/tools/doclint/EmptyReturnTest.out
                          index 5576c9eb1a4..f5d7829737f 100644
                          --- a/langtools/test/tools/doclint/EmptyReturnTest.out
                          +++ b/langtools/test/tools/doclint/EmptyReturnTest.out
                          @@ -1,4 +1,4 @@
                          -EmptyReturnTest.java:12: warning: no description for @return
                          +EmptyReturnTest.java:13: warning: no description for @return
                               /** @return */
                                   ^
                           1 warning
                          diff --git a/langtools/test/tools/doclint/EmptySerialDataTest.java b/langtools/test/tools/doclint/EmptySerialDataTest.java
                          index 8abca700cd3..38c04659910 100644
                          --- a/langtools/test/tools/doclint/EmptySerialDataTest.java
                          +++ b/langtools/test/tools/doclint/EmptySerialDataTest.java
                          @@ -2,6 +2,7 @@
                            * @test /nodynamiccopyright/
                            * @bug 8004832
                            * @summary Add new doclint package
                          + * @modules jdk.compiler/com.sun.tools.doclint
                            * @build DocLintTester
                            * @run main DocLintTester -Xmsgs:-syntax EmptySerialDataTest.java
                            * @run main DocLintTester -Xmsgs:syntax -ref EmptySerialDataTest.out EmptySerialDataTest.java
                          diff --git a/langtools/test/tools/doclint/EmptySerialDataTest.out b/langtools/test/tools/doclint/EmptySerialDataTest.out
                          index d53e566c4de..f34a77a144c 100644
                          --- a/langtools/test/tools/doclint/EmptySerialDataTest.out
                          +++ b/langtools/test/tools/doclint/EmptySerialDataTest.out
                          @@ -1,4 +1,4 @@
                          -EmptySerialDataTest.java:15: warning: no description for @serialData
                          +EmptySerialDataTest.java:16: warning: no description for @serialData
                               /** @serialData */
                                   ^
                           1 warning
                          diff --git a/langtools/test/tools/doclint/EmptySerialFieldTest.java b/langtools/test/tools/doclint/EmptySerialFieldTest.java
                          index 34782fe90a8..533370969ab 100644
                          --- a/langtools/test/tools/doclint/EmptySerialFieldTest.java
                          +++ b/langtools/test/tools/doclint/EmptySerialFieldTest.java
                          @@ -2,6 +2,7 @@
                            * @test /nodynamiccopyright/
                            * @bug 8004832
                            * @summary Add new doclint package
                          + * @modules jdk.compiler/com.sun.tools.doclint
                            * @build DocLintTester
                            * @run main DocLintTester -Xmsgs:-syntax EmptySerialFieldTest.java
                            * @run main DocLintTester -Xmsgs:syntax -ref EmptySerialFieldTest.out EmptySerialFieldTest.java
                          diff --git a/langtools/test/tools/doclint/EmptySerialFieldTest.out b/langtools/test/tools/doclint/EmptySerialFieldTest.out
                          index 6d959f3a447..394e097e7c3 100644
                          --- a/langtools/test/tools/doclint/EmptySerialFieldTest.out
                          +++ b/langtools/test/tools/doclint/EmptySerialFieldTest.out
                          @@ -1,4 +1,4 @@
                          -EmptySerialFieldTest.java:17: warning: no description for @serialField
                          +EmptySerialFieldTest.java:18: warning: no description for @serialField
                                * @serialField empty    String
                                  ^
                           1 warning
                          diff --git a/langtools/test/tools/doclint/EmptySinceTest.java b/langtools/test/tools/doclint/EmptySinceTest.java
                          index f950462942c..4af2249a18c 100644
                          --- a/langtools/test/tools/doclint/EmptySinceTest.java
                          +++ b/langtools/test/tools/doclint/EmptySinceTest.java
                          @@ -2,6 +2,7 @@
                            * @test /nodynamiccopyright/
                            * @bug 8004832
                            * @summary Add new doclint package
                          + * @modules jdk.compiler/com.sun.tools.doclint
                            * @build DocLintTester
                            * @run main DocLintTester -Xmsgs:-syntax EmptySinceTest.java
                            * @run main DocLintTester -Xmsgs:syntax -ref EmptySinceTest.out EmptySinceTest.java
                          diff --git a/langtools/test/tools/doclint/EmptySinceTest.out b/langtools/test/tools/doclint/EmptySinceTest.out
                          index 3bf463e077f..a9b8e4de94f 100644
                          --- a/langtools/test/tools/doclint/EmptySinceTest.out
                          +++ b/langtools/test/tools/doclint/EmptySinceTest.out
                          @@ -1,4 +1,4 @@
                          -EmptySinceTest.java:12: warning: no description for @since
                          +EmptySinceTest.java:13: warning: no description for @since
                               /** @since */
                                   ^
                           1 warning
                          diff --git a/langtools/test/tools/doclint/EmptyVersionTest.java b/langtools/test/tools/doclint/EmptyVersionTest.java
                          index 473ab736a47..43590818cc0 100644
                          --- a/langtools/test/tools/doclint/EmptyVersionTest.java
                          +++ b/langtools/test/tools/doclint/EmptyVersionTest.java
                          @@ -2,6 +2,7 @@
                            * @test /nodynamiccopyright/
                            * @bug 8004832
                            * @summary Add new doclint package
                          + * @modules jdk.compiler/com.sun.tools.doclint
                            * @build DocLintTester
                            * @run main DocLintTester -Xmsgs:-syntax EmptyVersionTest.java
                            * @run main DocLintTester -Xmsgs:syntax -ref EmptyVersionTest.out EmptyVersionTest.java
                          diff --git a/langtools/test/tools/doclint/EmptyVersionTest.out b/langtools/test/tools/doclint/EmptyVersionTest.out
                          index ebd57104153..5caf83b0e4d 100644
                          --- a/langtools/test/tools/doclint/EmptyVersionTest.out
                          +++ b/langtools/test/tools/doclint/EmptyVersionTest.out
                          @@ -1,4 +1,4 @@
                          -EmptyVersionTest.java:12: warning: no description for @version
                          +EmptyVersionTest.java:13: warning: no description for @version
                               /** @version */
                                   ^
                           1 warning
                          diff --git a/langtools/test/tools/doclint/EndTagsTest.java b/langtools/test/tools/doclint/EndTagsTest.java
                          index 154f516324a..512c1ecf710 100644
                          --- a/langtools/test/tools/doclint/EndTagsTest.java
                          +++ b/langtools/test/tools/doclint/EndTagsTest.java
                          @@ -2,6 +2,7 @@
                            * @test /nodynamiccopyright/
                            * @bug 8006236
                            * @summary doclint: structural issue hidden
                          + * @modules jdk.compiler/com.sun.tools.doclint
                            * @build DocLintTester
                            * @run main DocLintTester -Xmsgs:-html EndTagsTest.java
                            * @run main DocLintTester -ref EndTagsTest.out EndTagsTest.java
                          diff --git a/langtools/test/tools/doclint/EndTagsTest.out b/langtools/test/tools/doclint/EndTagsTest.out
                          index 61af632535c..3367a62b8c7 100644
                          --- a/langtools/test/tools/doclint/EndTagsTest.out
                          +++ b/langtools/test/tools/doclint/EndTagsTest.out
                          @@ -1,25 +1,25 @@
                          -EndTagsTest.java:18: error: unexpected end tag: 
                          +EndTagsTest.java:19: error: unexpected end tag: 
                               /**  */
                                   ^
                          -EndTagsTest.java:21: error: unexpected end tag: 
                          +EndTagsTest.java:22: error: unexpected end tag: 
                               /** 

                          */ ^ -EndTagsTest.java:24: error: unexpected end tag: +EndTagsTest.java:25: error: unexpected end tag: /**

                          text

                          */ ^ -EndTagsTest.java:27: error: invalid end tag: +EndTagsTest.java:28: error: invalid end tag: /** image */ ^ -EndTagsTest.java:30: error: unknown tag: invalid +EndTagsTest.java:31: error: unknown tag: invalid /** */ ^ -EndTagsTest.java:30: error: unknown tag: invalid +EndTagsTest.java:31: error: unknown tag: invalid /** */ ^ -EndTagsTest.java:33: error: unknown tag: invalid +EndTagsTest.java:34: error: unknown tag: invalid /** */ ^ -EndTagsTest.java:36: error: unknown tag: invalid +EndTagsTest.java:37: error: unknown tag: invalid /** */ ^ 8 errors diff --git a/langtools/test/tools/doclint/EndWithIdentifierTest.java b/langtools/test/tools/doclint/EndWithIdentifierTest.java index afd20a3353c..11b7b0b6e0f 100644 --- a/langtools/test/tools/doclint/EndWithIdentifierTest.java +++ b/langtools/test/tools/doclint/EndWithIdentifierTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8007096 * @summary DocLint parsing problems with some comments + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:-html EndWithIdentifierTest.java * @run main DocLintTester -Xmsgs -ref EndWithIdentifierTest.out EndWithIdentifierTest.java diff --git a/langtools/test/tools/doclint/EndWithIdentifierTest.out b/langtools/test/tools/doclint/EndWithIdentifierTest.out index 4f8896e1925..bc0f033628c 100644 --- a/langtools/test/tools/doclint/EndWithIdentifierTest.out +++ b/langtools/test/tools/doclint/EndWithIdentifierTest.out @@ -1,19 +1,19 @@ -EndWithIdentifierTest.java:14: error: syntax error in reference +EndWithIdentifierTest.java:15: error: syntax error in reference /**{@link*/ ^ -EndWithIdentifierTest.java:17: error: reference not found +EndWithIdentifierTest.java:18: error: reference not found /**@see List*/ ^ -EndWithIdentifierTest.java:20: error: semicolon missing +EndWithIdentifierTest.java:21: error: semicolon missing /**&*/ ^ -EndWithIdentifierTest.java:23: error: malformed HTML +EndWithIdentifierTest.java:24: error: malformed HTML /** text

                          ^ -HtmlAttrsTest.java:18: warning: attribute obsolete: name +HtmlAttrsTest.java:19: warning: attribute obsolete: name * alt ^ -HtmlAttrsTest.java:23: warning: attribute obsolete, use CSS instead: size +HtmlAttrsTest.java:24: warning: attribute obsolete, use CSS instead: size * text ^ 1 error diff --git a/langtools/test/tools/doclint/HtmlTagsTest.java b/langtools/test/tools/doclint/HtmlTagsTest.java index 7ff2c36e6a8..216b8acd47d 100644 --- a/langtools/test/tools/doclint/HtmlTagsTest.java +++ b/langtools/test/tools/doclint/HtmlTagsTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8004832 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:-html HtmlTagsTest.java * @run main DocLintTester -ref HtmlTagsTest.out HtmlTagsTest.java diff --git a/langtools/test/tools/doclint/HtmlTagsTest.out b/langtools/test/tools/doclint/HtmlTagsTest.out index 217341ea5b3..9e0b22de3dc 100644 --- a/langtools/test/tools/doclint/HtmlTagsTest.out +++ b/langtools/test/tools/doclint/HtmlTagsTest.out @@ -1,47 +1,47 @@ -HtmlTagsTest.java:13: error: unknown tag: xyz +HtmlTagsTest.java:14: error: unknown tag: xyz * ... ^ -HtmlTagsTest.java:13: error: unknown tag: xyz +HtmlTagsTest.java:14: error: unknown tag: xyz * ... ^ -HtmlTagsTest.java:18: error: unknown tag: xyz +HtmlTagsTest.java:19: error: unknown tag: xyz *
                          ^ -HtmlTagsTest.java:23: error: self-closing element not allowed +HtmlTagsTest.java:24: error: self-closing element not allowed *
                          ^ -HtmlTagsTest.java:28: error: element not allowed in documentation comments: +HtmlTagsTest.java:29: error: element not allowed in documentation comments: * ^ -HtmlTagsTest.java:28: error: element not closed: html +HtmlTagsTest.java:29: error: element not closed: html * ^ -HtmlTagsTest.java:33: error: block element not allowed within inline element : p +HtmlTagsTest.java:34: error: block element not allowed within inline element : p *

                          ^ -HtmlTagsTest.java:38: error: block element not allowed within @link: p - * {@link java.lang.String

                          } - ^ HtmlTagsTest.java:39: error: block element not allowed within @link: p * {@link java.lang.String

                          } ^ -HtmlTagsTest.java:44: error: invalid end tag: +HtmlTagsTest.java:40: error: block element not allowed within @link: p + * {@link java.lang.String

                          } + ^ +HtmlTagsTest.java:45: error: invalid end tag: * alt ^ -HtmlTagsTest.java:49: error: end tag missing: +HtmlTagsTest.java:50: error: end tag missing: * ^ -HtmlTagsTest.java:54: error: unexpected end tag: +HtmlTagsTest.java:55: error: unexpected end tag: * ^ -HtmlTagsTest.java:54: warning: empty tag +HtmlTagsTest.java:55: warning: empty tag * ^ -HtmlTagsTest.java:59: error: text not allowed in

                            element +HtmlTagsTest.java:60: error: text not allowed in
                              element *
                                text
                              • ...
                              ^ -HtmlTagsTest.java:64: error: tag not allowed here: +HtmlTagsTest.java:65: error: tag not allowed here: *
                                text
                              • ...
                              ^ 14 errors -1 warning \ No newline at end of file +1 warning diff --git a/langtools/test/tools/doclint/HtmlVersionTest.java b/langtools/test/tools/doclint/HtmlVersionTest.java index d14679f6f46..600302529bd 100644 --- a/langtools/test/tools/doclint/HtmlVersionTest.java +++ b/langtools/test/tools/doclint/HtmlVersionTest.java @@ -26,6 +26,7 @@ * @bug 8072945 * @summary test HTML version * @library .. + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -XhtmlVersion:html5 HtmlVersionTest.java * @run main DocLintTester -XhtmlVersion:html4 HtmlVersionTest.java diff --git a/langtools/test/tools/doclint/LiteralTest.java b/langtools/test/tools/doclint/LiteralTest.java index 008246edee6..25e0d5ece54 100644 --- a/langtools/test/tools/doclint/LiteralTest.java +++ b/langtools/test/tools/doclint/LiteralTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8006228 * @summary Doclint doesn't detect {@code nested inline} + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -ref LiteralTest.out LiteralTest.java */ diff --git a/langtools/test/tools/doclint/LiteralTest.out b/langtools/test/tools/doclint/LiteralTest.out index 4cb41d9d7bb..c6ed1045287 100644 --- a/langtools/test/tools/doclint/LiteralTest.out +++ b/langtools/test/tools/doclint/LiteralTest.out @@ -1,4 +1,4 @@ -LiteralTest.java:14: warning: {@code} within +LiteralTest.java:15: warning: {@code} within /** abc {@code < & > } def */ ^ 1 warning diff --git a/langtools/test/tools/doclint/MissingCommentTest.java b/langtools/test/tools/doclint/MissingCommentTest.java index 165ff314db0..163a701eda8 100644 --- a/langtools/test/tools/doclint/MissingCommentTest.java +++ b/langtools/test/tools/doclint/MissingCommentTest.java @@ -1,5 +1,6 @@ /* * @test /nodynamiccopyright/ + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:-missing MissingCommentTest.java * @run main DocLintTester -Xmsgs:missing -ref MissingCommentTest.out MissingCommentTest.java diff --git a/langtools/test/tools/doclint/MissingCommentTest.out b/langtools/test/tools/doclint/MissingCommentTest.out index 8739f14cf4a..3b9c42e38b2 100644 --- a/langtools/test/tools/doclint/MissingCommentTest.out +++ b/langtools/test/tools/doclint/MissingCommentTest.out @@ -1,13 +1,13 @@ -MissingCommentTest.java:8: warning: no comment +MissingCommentTest.java:9: warning: no comment public class MissingCommentTest { ^ -MissingCommentTest.java:9: warning: no comment +MissingCommentTest.java:10: warning: no comment MissingCommentTest() { } ^ -MissingCommentTest.java:11: warning: no comment +MissingCommentTest.java:12: warning: no comment int missingComment; ^ -MissingCommentTest.java:13: warning: no comment +MissingCommentTest.java:14: warning: no comment void missingComment() { } ^ 4 warnings diff --git a/langtools/test/tools/doclint/MissingParamsTest.java b/langtools/test/tools/doclint/MissingParamsTest.java index 0dcbeb3462d..a16dbd40c09 100644 --- a/langtools/test/tools/doclint/MissingParamsTest.java +++ b/langtools/test/tools/doclint/MissingParamsTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8004832 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:-missing MissingParamsTest.java * @run main DocLintTester -Xmsgs:missing -ref MissingParamsTest.out MissingParamsTest.java diff --git a/langtools/test/tools/doclint/MissingParamsTest.out b/langtools/test/tools/doclint/MissingParamsTest.out index c05276762bc..52a7082316c 100644 --- a/langtools/test/tools/doclint/MissingParamsTest.out +++ b/langtools/test/tools/doclint/MissingParamsTest.out @@ -1,13 +1,13 @@ -MissingParamsTest.java:13: warning: no @param for param +MissingParamsTest.java:14: warning: no @param for param MissingParamsTest(int param) { } ^ -MissingParamsTest.java:16: warning: no @param for +MissingParamsTest.java:17: warning: no @param for MissingParamsTest() { } ^ -MissingParamsTest.java:19: warning: no @param for param +MissingParamsTest.java:20: warning: no @param for param void missingParam(int param) { } ^ -MissingParamsTest.java:22: warning: no @param for +MissingParamsTest.java:23: warning: no @param for void missingTyparam() { } ^ 4 warnings diff --git a/langtools/test/tools/doclint/MissingReturnTest.java b/langtools/test/tools/doclint/MissingReturnTest.java index f7871a471dc..471a2ee1443 100644 --- a/langtools/test/tools/doclint/MissingReturnTest.java +++ b/langtools/test/tools/doclint/MissingReturnTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8004832 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:-missing MissingReturnTest.java * @run main DocLintTester -Xmsgs:missing -ref MissingReturnTest.out MissingReturnTest.java diff --git a/langtools/test/tools/doclint/MissingReturnTest.out b/langtools/test/tools/doclint/MissingReturnTest.out index 2e04dc428ac..ee78ec22b78 100644 --- a/langtools/test/tools/doclint/MissingReturnTest.out +++ b/langtools/test/tools/doclint/MissingReturnTest.out @@ -1,4 +1,4 @@ -MissingReturnTest.java:22: warning: no @return +MissingReturnTest.java:23: warning: no @return int missingReturn() { } ^ 1 warning diff --git a/langtools/test/tools/doclint/MissingThrowsTest.java b/langtools/test/tools/doclint/MissingThrowsTest.java index 93e140939b2..9876e42c3ac 100644 --- a/langtools/test/tools/doclint/MissingThrowsTest.java +++ b/langtools/test/tools/doclint/MissingThrowsTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8004832 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:-missing MissingThrowsTest.java * @run main DocLintTester -Xmsgs:missing -ref MissingThrowsTest.out MissingThrowsTest.java diff --git a/langtools/test/tools/doclint/MissingThrowsTest.out b/langtools/test/tools/doclint/MissingThrowsTest.out index bf2eb3ad5cd..0c96ab36300 100644 --- a/langtools/test/tools/doclint/MissingThrowsTest.out +++ b/langtools/test/tools/doclint/MissingThrowsTest.out @@ -1,4 +1,4 @@ -MissingThrowsTest.java:13: warning: no @throws for java.lang.Exception +MissingThrowsTest.java:14: warning: no @throws for java.lang.Exception void missingThrows() throws Exception { } ^ 1 warning diff --git a/langtools/test/tools/doclint/OptionTest.java b/langtools/test/tools/doclint/OptionTest.java index 570bc60a7e1..e03df80fa02 100644 --- a/langtools/test/tools/doclint/OptionTest.java +++ b/langtools/test/tools/doclint/OptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, 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,6 +25,7 @@ * @test * @bug 8004832 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint */ import com.sun.tools.doclint.DocLint; diff --git a/langtools/test/tools/doclint/OverridesTest.java b/langtools/test/tools/doclint/OverridesTest.java index b7a0c095609..beb7a5af250 100644 --- a/langtools/test/tools/doclint/OverridesTest.java +++ b/langtools/test/tools/doclint/OverridesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, 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,6 +25,7 @@ * @test * @bug 8004832 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:all OverridesTest.java */ diff --git a/langtools/test/tools/doclint/ParaTagTest.java b/langtools/test/tools/doclint/ParaTagTest.java index eb7a0a59af4..6a629c56072 100644 --- a/langtools/test/tools/doclint/ParaTagTest.java +++ b/langtools/test/tools/doclint/ParaTagTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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,6 +25,7 @@ * @test * @bug 8007566 * @summary DocLint too aggressive with not allowed here:

                              + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs ParaTagTest.java */ diff --git a/langtools/test/tools/doclint/ReferenceTest.java b/langtools/test/tools/doclint/ReferenceTest.java index 1ffd633e866..ccee4b25400 100644 --- a/langtools/test/tools/doclint/ReferenceTest.java +++ b/langtools/test/tools/doclint/ReferenceTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8004832 8020556 8002154 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:-reference ReferenceTest.java * @run main DocLintTester -ref ReferenceTest.out ReferenceTest.java diff --git a/langtools/test/tools/doclint/ReferenceTest.out b/langtools/test/tools/doclint/ReferenceTest.out index ab288a34b00..f48396db54b 100644 --- a/langtools/test/tools/doclint/ReferenceTest.out +++ b/langtools/test/tools/doclint/ReferenceTest.out @@ -1,40 +1,40 @@ -ReferenceTest.java:13: error: invalid use of @param +ReferenceTest.java:14: error: invalid use of @param * @param x description ^ -ReferenceTest.java:18: error: invalid use of @param +ReferenceTest.java:19: error: invalid use of @param * @param x description ^ -ReferenceTest.java:23: error: @param name not found +ReferenceTest.java:24: error: @param name not found * @param x description ^ -ReferenceTest.java:25: warning: no @param for a +ReferenceTest.java:26: warning: no @param for a public void param_name_not_found(int a) { } ^ -ReferenceTest.java:28: error: @param name not found +ReferenceTest.java:29: error: @param name not found * @param description ^ -ReferenceTest.java:33: error: reference not found +ReferenceTest.java:34: error: reference not found * @see Object#tooStrong() ^ -ReferenceTest.java:38: error: invalid use of @return +ReferenceTest.java:39: error: invalid use of @return * @return x description ^ -ReferenceTest.java:43: error: invalid use of @return +ReferenceTest.java:44: error: invalid use of @return * @return x description ^ -ReferenceTest.java:48: error: exception not thrown: java.lang.Exception +ReferenceTest.java:49: error: exception not thrown: java.lang.Exception * @throws Exception description ^ -ReferenceTest.java:59: error: type arguments not allowed here +ReferenceTest.java:60: error: type arguments not allowed here * {@link java.util.List} ^ -ReferenceTest.java:60: error: type arguments not allowed here +ReferenceTest.java:61: error: type arguments not allowed here * {@link java.util.List#equals} ^ -ReferenceTest.java:61: error: type arguments not allowed here +ReferenceTest.java:62: error: type arguments not allowed here * @see java.util.List ^ -ReferenceTest.java:62: error: type arguments not allowed here +ReferenceTest.java:63: error: type arguments not allowed here * @see java.util.List#equals ^ 12 errors diff --git a/langtools/test/tools/doclint/ResourceTest.java b/langtools/test/tools/doclint/ResourceTest.java index 46f79adb775..6384be7ab16 100644 --- a/langtools/test/tools/doclint/ResourceTest.java +++ b/langtools/test/tools/doclint/ResourceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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,6 +25,7 @@ * @test * @bug 8006615 * @summary move remaining messages into resource bundle + * @modules jdk.compiler/com.sun.tools.doclint */ import java.io.IOException; diff --git a/langtools/test/tools/doclint/RunTest.java b/langtools/test/tools/doclint/RunTest.java index 99662e7bac7..2dfeefbc41c 100644 --- a/langtools/test/tools/doclint/RunTest.java +++ b/langtools/test/tools/doclint/RunTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, 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,6 +25,7 @@ * @bug 8004832 8000103 * @summary Add new doclint package * @summary Create doclint utility + * @modules jdk.compiler/com.sun.tools.doclint */ import java.io.File; diff --git a/langtools/test/tools/doclint/SyntaxTest.java b/langtools/test/tools/doclint/SyntaxTest.java index 8e50a7d9c35..b030a0c84ff 100644 --- a/langtools/test/tools/doclint/SyntaxTest.java +++ b/langtools/test/tools/doclint/SyntaxTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8004832 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:-syntax SyntaxTest.java * @run main DocLintTester -ref SyntaxTest.out SyntaxTest.java diff --git a/langtools/test/tools/doclint/SyntaxTest.out b/langtools/test/tools/doclint/SyntaxTest.out index 246b63673ce..5a5cee1b1cc 100644 --- a/langtools/test/tools/doclint/SyntaxTest.out +++ b/langtools/test/tools/doclint/SyntaxTest.out @@ -1,4 +1,4 @@ -SyntaxTest.java:13: error: malformed HTML +SyntaxTest.java:14: error: malformed HTML * a < b ^ 1 error diff --git a/langtools/test/tools/doclint/SyntheticTest.java b/langtools/test/tools/doclint/SyntheticTest.java index 82362927f28..6d7ac87cf12 100644 --- a/langtools/test/tools/doclint/SyntheticTest.java +++ b/langtools/test/tools/doclint/SyntheticTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, 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,6 +25,7 @@ * @test * @bug 8004832 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:all SyntheticTest.java */ diff --git a/langtools/test/tools/doclint/UnfinishedInlineTagTest.java b/langtools/test/tools/doclint/UnfinishedInlineTagTest.java index 7b4345554d8..80d4c71ce27 100644 --- a/langtools/test/tools/doclint/UnfinishedInlineTagTest.java +++ b/langtools/test/tools/doclint/UnfinishedInlineTagTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8007096 * @summary DocLint parsing problems with some comments + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:-html UnfinishedInlineTagTest.java * @run main DocLintTester -Xmsgs -ref UnfinishedInlineTagTest.out UnfinishedInlineTagTest.java diff --git a/langtools/test/tools/doclint/UnfinishedInlineTagTest.out b/langtools/test/tools/doclint/UnfinishedInlineTagTest.out index eb70f3a66b9..27ca981f73a 100644 --- a/langtools/test/tools/doclint/UnfinishedInlineTagTest.out +++ b/langtools/test/tools/doclint/UnfinishedInlineTagTest.out @@ -1,4 +1,4 @@ -UnfinishedInlineTagTest.java:14: error: unterminated inline tag +UnfinishedInlineTagTest.java:15: error: unterminated inline tag */ ^ 1 error diff --git a/langtools/test/tools/doclint/ValidTest.java b/langtools/test/tools/doclint/ValidTest.java index 588889e3366..fb1f73457a5 100644 --- a/langtools/test/tools/doclint/ValidTest.java +++ b/langtools/test/tools/doclint/ValidTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, 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,6 +25,7 @@ * @test * @bug 8004832 8048806 * @summary Add new doclint package + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester ValidTest.java */ diff --git a/langtools/test/tools/doclint/ValueTest.java b/langtools/test/tools/doclint/ValueTest.java index f9de36daf15..8b7a5c027f0 100644 --- a/langtools/test/tools/doclint/ValueTest.java +++ b/langtools/test/tools/doclint/ValueTest.java @@ -2,6 +2,7 @@ * @test /nodynamiccopyright/ * @bug 8025272 * @summary doclint needs to check for valid usage of at-value tag + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -ref ValueTest.out ValueTest.java */ diff --git a/langtools/test/tools/doclint/ValueTest.out b/langtools/test/tools/doclint/ValueTest.out index 3b2977f9f72..423d8876b00 100644 --- a/langtools/test/tools/doclint/ValueTest.out +++ b/langtools/test/tools/doclint/ValueTest.out @@ -1,22 +1,22 @@ -ValueTest.java:39: error: {@value} not allowed here +ValueTest.java:40: error: {@value} not allowed here /** invalid class C: {@value} */ ^ -ValueTest.java:42: error: {@value} not allowed here +ValueTest.java:43: error: {@value} not allowed here /** invalid enum E: {@value} */ ^ -ValueTest.java:44: error: {@value} not allowed here +ValueTest.java:45: error: {@value} not allowed here /** invalid enum constant E1: {@value} */ ^ -ValueTest.java:48: error: {@value} not allowed here +ValueTest.java:49: error: {@value} not allowed here /** invalid field 1: {@value} */ ^ -ValueTest.java:51: error: {@value} not allowed here +ValueTest.java:52: error: {@value} not allowed here /** invalid field 2: {@value} */ ^ -ValueTest.java:62: error: value does not refer to a constant +ValueTest.java:63: error: value does not refer to a constant /** invalid method: {@value Object#toString} */ ^ -ValueTest.java:65: error: value does not refer to a constant +ValueTest.java:66: error: value does not refer to a constant /** invalid enum constant: {@value Thread.State#NEW} */ ^ 7 errors diff --git a/langtools/test/tools/doclint/anchorTests/p/Test.java b/langtools/test/tools/doclint/anchorTests/p/Test.java index 131629d7ac6..abac0617feb 100644 --- a/langtools/test/tools/doclint/anchorTests/p/Test.java +++ b/langtools/test/tools/doclint/anchorTests/p/Test.java @@ -2,6 +2,7 @@ * @bug 8025246 * @summary doclint is showing error on anchor already defined when it's not * @library ../.. + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -ref Test.out Test.java * @compile/fail/ref=Test.javac.out -XDrawDiagnostics -Werror -Xdoclint:all Test.java diff --git a/langtools/test/tools/doclint/anchorTests/p/Test.javac.out b/langtools/test/tools/doclint/anchorTests/p/Test.javac.out index d3a8e33d48a..ed2314b7168 100644 --- a/langtools/test/tools/doclint/anchorTests/p/Test.javac.out +++ b/langtools/test/tools/doclint/anchorTests/p/Test.javac.out @@ -1,7 +1,7 @@ -Test.java:14:7: compiler.err.proc.messager: anchor already defined: "dupTest" -Test.java:24:12: compiler.err.proc.messager: anchor already defined: "dupTestField" -Test.java:27:12: compiler.err.proc.messager: anchor already defined: "dupTestMethod" -Test.java:32:11: compiler.err.proc.messager: anchor already defined: "dupNested" -Test.java:40:15: compiler.err.proc.messager: anchor already defined: "dupNestedField" -Test.java:47:15: compiler.err.proc.messager: anchor already defined: "dupNestedMethod" +Test.java:15:7: compiler.err.proc.messager: anchor already defined: "dupTest" +Test.java:25:12: compiler.err.proc.messager: anchor already defined: "dupTestField" +Test.java:28:12: compiler.err.proc.messager: anchor already defined: "dupTestMethod" +Test.java:33:11: compiler.err.proc.messager: anchor already defined: "dupNested" +Test.java:41:15: compiler.err.proc.messager: anchor already defined: "dupNestedField" +Test.java:48:15: compiler.err.proc.messager: anchor already defined: "dupNestedMethod" 6 errors diff --git a/langtools/test/tools/doclint/anchorTests/p/Test.out b/langtools/test/tools/doclint/anchorTests/p/Test.out index cb307c29bf4..3448c423e98 100644 --- a/langtools/test/tools/doclint/anchorTests/p/Test.out +++ b/langtools/test/tools/doclint/anchorTests/p/Test.out @@ -1,19 +1,19 @@ -Test.java:14: error: anchor already defined: "dupTest" +Test.java:15: error: anchor already defined: "dupTest" * dupTest again ^ -Test.java:24: error: anchor already defined: "dupTestField" +Test.java:25: error: anchor already defined: "dupTestField" /** dupTestField again */ ^ -Test.java:27: error: anchor already defined: "dupTestMethod" +Test.java:28: error: anchor already defined: "dupTestMethod" /** dupTestMethod again */ ^ -Test.java:32: error: anchor already defined: "dupNested" +Test.java:33: error: anchor already defined: "dupNested" * dupNested again ^ -Test.java:40: error: anchor already defined: "dupNestedField" +Test.java:41: error: anchor already defined: "dupNestedField" * dupNestedField ^ -Test.java:47: error: anchor already defined: "dupNestedMethod" +Test.java:48: error: anchor already defined: "dupNestedMethod" * dupNestedMethod ^ 6 errors diff --git a/langtools/test/tools/doclint/anchorTests/p/package-info.java b/langtools/test/tools/doclint/anchorTests/p/package-info.java index af7682a3676..c2a35a2f824 100644 --- a/langtools/test/tools/doclint/anchorTests/p/package-info.java +++ b/langtools/test/tools/doclint/anchorTests/p/package-info.java @@ -2,6 +2,7 @@ * @bug 8025246 * @summary doclint is showing error on anchor already defined when it's not * @library ../.. + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -ref package-info.out package-info.java * @compile/fail/ref=package-info.javac.out -XDrawDiagnostics -Werror -Xdoclint:all package-info.java diff --git a/langtools/test/tools/doclint/anchorTests/p/package-info.javac.out b/langtools/test/tools/doclint/anchorTests/p/package-info.javac.out index b79985b8c43..f6b8948560d 100644 --- a/langtools/test/tools/doclint/anchorTests/p/package-info.javac.out +++ b/langtools/test/tools/doclint/anchorTests/p/package-info.javac.out @@ -1,2 +1,2 @@ -package-info.java:12:7: compiler.err.proc.messager: anchor already defined: "here" +package-info.java:13:7: compiler.err.proc.messager: anchor already defined: "here" 1 error diff --git a/langtools/test/tools/doclint/anchorTests/p/package-info.out b/langtools/test/tools/doclint/anchorTests/p/package-info.out index eee3192a24b..4eaa98adc9c 100644 --- a/langtools/test/tools/doclint/anchorTests/p/package-info.out +++ b/langtools/test/tools/doclint/anchorTests/p/package-info.out @@ -1,4 +1,4 @@ -package-info.java:12: error: anchor already defined: "here" +package-info.java:13: error: anchor already defined: "here" * here again ^ 1 error diff --git a/langtools/test/tools/doclint/html/BlockTagsTest.java b/langtools/test/tools/doclint/html/BlockTagsTest.java index aaddc068de5..66406673c38 100644 --- a/langtools/test/tools/doclint/html/BlockTagsTest.java +++ b/langtools/test/tools/doclint/html/BlockTagsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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 @@ -26,6 +26,7 @@ * @bug 8006251 * @summary test block tags * @library .. + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs BlockTagsTest.java */ diff --git a/langtools/test/tools/doclint/html/EntitiesTest.java b/langtools/test/tools/doclint/html/EntitiesTest.java index 3c05f4207a0..1dd6e825156 100644 --- a/langtools/test/tools/doclint/html/EntitiesTest.java +++ b/langtools/test/tools/doclint/html/EntitiesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, 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 @@ -26,6 +26,7 @@ * @bug 8006263 * @summary Supplementary test cases needed for doclint * @library .. + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -Xmsgs:-html EntitiesTest.java * @run main DocLintTester -Xmsgs:html -ref EntitiesTest.out EntitiesTest.java diff --git a/langtools/test/tools/doclint/html/EntitiesTest.out b/langtools/test/tools/doclint/html/EntitiesTest.out index 98a20d454e0..4fe91975464 100644 --- a/langtools/test/tools/doclint/html/EntitiesTest.out +++ b/langtools/test/tools/doclint/html/EntitiesTest.out @@ -1,19 +1,19 @@ -EntitiesTest.java:300: error: invalid entity &bad; +EntitiesTest.java:301: error: invalid entity &bad; * &bad; ^ -EntitiesTest.java:305: error: invalid entity  +EntitiesTest.java:306: error: invalid entity  *  ^ -EntitiesTest.java:306: error: invalid entity ࡏ +EntitiesTest.java:307: error: invalid entity ࡏ * ࡏ ^ -EntitiesTest.java:311: error: invalid entity ― +EntitiesTest.java:312: error: invalid entity ― * ― ^ -EntitiesTest.java:312: error: invalid entity ⌫ +EntitiesTest.java:313: error: invalid entity ⌫ * ⌫ ^ -EntitiesTest.java:313: error: invalid entity ￿ +EntitiesTest.java:314: error: invalid entity ￿ * ￿ ^ 6 errors diff --git a/langtools/test/tools/doclint/html/HtmlVersionTagsAttrsTest.java b/langtools/test/tools/doclint/html/HtmlVersionTagsAttrsTest.java index 16cd211ed61..2ae4ca91478 100644 --- a/langtools/test/tools/doclint/html/HtmlVersionTagsAttrsTest.java +++ b/langtools/test/tools/doclint/html/HtmlVersionTagsAttrsTest.java @@ -3,6 +3,7 @@ * @bug 8072945 * @summary test tags and attributes specific to the output HTML version * @library .. + * @modules jdk.compiler/com.sun.tools.doclint * @build DocLintTester * @run main DocLintTester -XhtmlVersion:html5 -ref HtmlVersionTagsAttrsTestHtml5.out HtmlVersionTagsAttrsTest.java * @run main DocLintTester -XhtmlVersion:html4 -ref HtmlVersionTagsAttrsTestHtml4.out HtmlVersionTagsAttrsTest.java diff --git a/langtools/test/tools/doclint/html/HtmlVersionTagsAttrsTestHtml4.out b/langtools/test/tools/doclint/html/HtmlVersionTagsAttrsTestHtml4.out index c48a7612160..faa26eeebe0 100644 --- a/langtools/test/tools/doclint/html/HtmlVersionTagsAttrsTestHtml4.out +++ b/langtools/test/tools/doclint/html/HtmlVersionTagsAttrsTestHtml4.out @@ -1,211 +1,211 @@ -HtmlVersionTagsAttrsTest.java:21: warning: attribute obsolete: name +HtmlVersionTagsAttrsTest.java:22: warning: attribute obsolete: name * alt ^ -HtmlVersionTagsAttrsTest.java:25: error: no summary or caption for table +HtmlVersionTagsAttrsTest.java:26: error: no summary or caption for table * ^ -HtmlVersionTagsAttrsTest.java:28: warning: attribute obsolete, use CSS instead: align +HtmlVersionTagsAttrsTest.java:29: warning: attribute obsolete, use CSS instead: align * ^ -HtmlVersionTagsAttrsTest.java:28: warning: attribute obsolete, use CSS instead: bgcolor +HtmlVersionTagsAttrsTest.java:29: warning: attribute obsolete, use CSS instead: bgcolor *
                              ^ -HtmlVersionTagsAttrsTest.java:29: warning: attribute obsolete, use CSS instead: align +HtmlVersionTagsAttrsTest.java:30: warning: attribute obsolete, use CSS instead: align * ^ -HtmlVersionTagsAttrsTest.java:37: warning: attribute obsolete, use CSS instead: bgcolor +HtmlVersionTagsAttrsTest.java:38: warning: attribute obsolete, use CSS instead: bgcolor * ^ -HtmlVersionTagsAttrsTest.java:37: warning: attribute obsolete, use CSS instead: height +HtmlVersionTagsAttrsTest.java:38: warning: attribute obsolete, use CSS instead: height * ^ -HtmlVersionTagsAttrsTest.java:37: warning: attribute obsolete, use CSS instead: width +HtmlVersionTagsAttrsTest.java:38: warning: attribute obsolete, use CSS instead: width * ^ -HtmlVersionTagsAttrsTest.java:37: warning: attribute obsolete, use CSS instead: nowrap +HtmlVersionTagsAttrsTest.java:38: warning: attribute obsolete, use CSS instead: nowrap * ^ -HtmlVersionTagsAttrsTest.java:49: warning: attribute obsolete, use CSS instead: bgcolor +HtmlVersionTagsAttrsTest.java:50: warning: attribute obsolete, use CSS instead: bgcolor * ^ -HtmlVersionTagsAttrsTest.java:49: warning: attribute obsolete, use CSS instead: height +HtmlVersionTagsAttrsTest.java:50: warning: attribute obsolete, use CSS instead: height * ^ -HtmlVersionTagsAttrsTest.java:49: warning: attribute obsolete, use CSS instead: width +HtmlVersionTagsAttrsTest.java:50: warning: attribute obsolete, use CSS instead: width * ^ -HtmlVersionTagsAttrsTest.java:49: warning: attribute obsolete, use CSS instead: nowrap +HtmlVersionTagsAttrsTest.java:50: warning: attribute obsolete, use CSS instead: nowrap * ^ -HtmlVersionTagsAttrsTest.java:54: warning: attribute obsolete, use CSS instead: clear +HtmlVersionTagsAttrsTest.java:55: warning: attribute obsolete, use CSS instead: clear *
                              ^ -HtmlVersionTagsAttrsTest.java:55: warning: attribute obsolete, use CSS instead: compact +HtmlVersionTagsAttrsTest.java:56: warning: attribute obsolete, use CSS instead: compact *
                                ^ -HtmlVersionTagsAttrsTest.java:60: warning: attribute obsolete, use CSS instead: type +HtmlVersionTagsAttrsTest.java:61: warning: attribute obsolete, use CSS instead: type *
                              1. Test list
                              2. ^ -HtmlVersionTagsAttrsTest.java:63: warning: attribute obsolete, use CSS instead: compact +HtmlVersionTagsAttrsTest.java:64: warning: attribute obsolete, use CSS instead: compact *
                                ^ -HtmlVersionTagsAttrsTest.java:67: warning: attribute obsolete, use CSS instead: hspace +HtmlVersionTagsAttrsTest.java:68: warning: attribute obsolete, use CSS instead: hspace * imgTest ^ -HtmlVersionTagsAttrsTest.java:67: warning: attribute obsolete, use CSS instead: vspace +HtmlVersionTagsAttrsTest.java:68: warning: attribute obsolete, use CSS instead: vspace * imgTest ^ -HtmlVersionTagsAttrsTest.java:67: warning: attribute obsolete, use CSS instead: border +HtmlVersionTagsAttrsTest.java:68: warning: attribute obsolete, use CSS instead: border * imgTest ^ -HtmlVersionTagsAttrsTest.java:68: warning: attribute obsolete, use CSS instead: size +HtmlVersionTagsAttrsTest.java:69: warning: attribute obsolete, use CSS instead: size *
                                ^ -HtmlVersionTagsAttrsTest.java:68: warning: attribute obsolete, use CSS instead: noshade +HtmlVersionTagsAttrsTest.java:69: warning: attribute obsolete, use CSS instead: noshade *
                                ^ -HtmlVersionTagsAttrsTest.java:69: warning: attribute obsolete, use CSS instead: width +HtmlVersionTagsAttrsTest.java:70: warning: attribute obsolete, use CSS instead: width *
                                Test Pre
                                ^ -HtmlVersionTagsAttrsTest.java:73: error: no summary or caption for table +HtmlVersionTagsAttrsTest.java:74: error: no summary or caption for table *
                              Test table, caption, col, colgroup, tbody, ^ -HtmlVersionTagsAttrsTest.java:36: warning: attribute obsolete, use CSS instead: bgcolor +HtmlVersionTagsAttrsTest.java:37: warning: attribute obsolete, use CSS instead: bgcolor *
                              HeadCol1HeadCol1HeadCol1HeadCol1BodyCol1BodyCol1BodyCol1BodyCol1
                              ^ -HtmlVersionTagsAttrsTest.java:78: error: attribute not supported in HTML4: reversed +HtmlVersionTagsAttrsTest.java:79: error: attribute not supported in HTML4: reversed *

                                ^ -HtmlVersionTagsAttrsTest.java:83: error: attribute not supported in HTML4: crossorigin +HtmlVersionTagsAttrsTest.java:84: error: attribute not supported in HTML4: crossorigin * imgTest ^ -HtmlVersionTagsAttrsTest.java:84: error: attribute not supported in HTML4: aria-labelledby +HtmlVersionTagsAttrsTest.java:85: error: attribute not supported in HTML4: aria-labelledby *
                                ^ -HtmlVersionTagsAttrsTest.java:84: error: attribute not supported in HTML4: aria-describedby +HtmlVersionTagsAttrsTest.java:85: error: attribute not supported in HTML4: aria-describedby *
                                ^ -HtmlVersionTagsAttrsTest.java:87: error: attribute not supported in HTML4: aria-label +HtmlVersionTagsAttrsTest.java:88: error: attribute not supported in HTML4: aria-label *

                                Label test

                                ^ -HtmlVersionTagsAttrsTest.java:95: warning: attribute obsolete, use CSS instead: size +HtmlVersionTagsAttrsTest.java:96: warning: attribute obsolete, use CSS instead: size * Font test ^ -HtmlVersionTagsAttrsTest.java:98: error: tag not supported in the generated HTML version: section +HtmlVersionTagsAttrsTest.java:99: error: tag not supported in the generated HTML version: section *
                                ^ -HtmlVersionTagsAttrsTest.java:99: error: unknown tag: hgroup +HtmlVersionTagsAttrsTest.java:100: error: unknown tag: hgroup *
                                ^ -HtmlVersionTagsAttrsTest.java:102: error: unknown tag: hgroup +HtmlVersionTagsAttrsTest.java:103: error: unknown tag: hgroup *
                                ^ -HtmlVersionTagsAttrsTest.java:105: error: unknown tag: details +HtmlVersionTagsAttrsTest.java:106: error: unknown tag: details *
                                ^ -HtmlVersionTagsAttrsTest.java:106: error: unknown tag: summary +HtmlVersionTagsAttrsTest.java:107: error: unknown tag: summary * Summary ^ -HtmlVersionTagsAttrsTest.java:106: error: unknown tag: summary +HtmlVersionTagsAttrsTest.java:107: error: unknown tag: summary * Summary ^ -HtmlVersionTagsAttrsTest.java:108: error: unknown tag: details +HtmlVersionTagsAttrsTest.java:109: error: unknown tag: details *
                                ^ -HtmlVersionTagsAttrsTest.java:113: error: tag not supported in the generated HTML version: section +HtmlVersionTagsAttrsTest.java:114: error: tag not supported in the generated HTML version: section *
                                ^ -HtmlVersionTagsAttrsTest.java:118: error: tag not supported in the generated HTML version: article +HtmlVersionTagsAttrsTest.java:119: error: tag not supported in the generated HTML version: article *
                                ^ -HtmlVersionTagsAttrsTest.java:123: error: tag not supported in the generated HTML version: header +HtmlVersionTagsAttrsTest.java:124: error: tag not supported in the generated HTML version: header *
                                ^ -HtmlVersionTagsAttrsTest.java:124: error: tag not supported in the generated HTML version: nav +HtmlVersionTagsAttrsTest.java:125: error: tag not supported in the generated HTML version: nav * ^ -HtmlVersionTagsAttrsTest.java:127: error: tag not supported in the generated HTML version: footer +HtmlVersionTagsAttrsTest.java:128: error: tag not supported in the generated HTML version: footer *