From ad15c7bbe456172bf310536f0fe26fbe7b73a365 Mon Sep 17 00:00:00 2001
From: Robbin Ehn
Date: Thu, 16 Mar 2017 07:27:14 +0100
Subject: [PATCH 01/40] 8176533: REGRESSION: a java process is not recognized
by jcmd/jinfo/jstack/jmap tool
Reviewed-by: sspitsyn, dsamersoff
---
.../tools/common/ProcessArgumentMatcher.java | 14 ++++++++++++
.../share/classes/sun/tools/jcmd/JCmd.java | 12 +++++-----
.../share/classes/sun/tools/jinfo/JInfo.java | 22 +++++++++----------
.../share/classes/sun/tools/jmap/JMap.java | 9 ++++----
.../classes/sun/tools/jstack/JStack.java | 12 +++++-----
5 files changed, 41 insertions(+), 28 deletions(-)
diff --git a/jdk/src/jdk.jcmd/share/classes/sun/tools/common/ProcessArgumentMatcher.java b/jdk/src/jdk.jcmd/share/classes/sun/tools/common/ProcessArgumentMatcher.java
index 8dab8e040bf..7e1da1c8d92 100644
--- a/jdk/src/jdk.jcmd/share/classes/sun/tools/common/ProcessArgumentMatcher.java
+++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/common/ProcessArgumentMatcher.java
@@ -30,6 +30,7 @@ import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.stream.Collectors;
import com.sun.tools.attach.VirtualMachine;
import com.sun.tools.attach.VirtualMachineDescriptor;
@@ -145,4 +146,17 @@ public class ProcessArgumentMatcher {
return this.getVirtualMachineDescriptors(null);
}
+ public Collection getVirtualMachinePids(Class> excludeClass) {
+ if (singlePid != null) {
+ // There is a bug in AttachProvider, when VM is debuggee-suspended it's not listed by the AttachProvider.
+ // If we are talking about a specific pid, just return it.
+ return List.of(singlePid);
+ } else {
+ return getVMDs(excludeClass, matchClass).stream().map(x -> {return x.id();}).collect(Collectors.toList());
+ }
+ }
+
+ public Collection getVirtualMachinePids() {
+ return this.getVirtualMachinePids(null);
+ }
}
diff --git a/jdk/src/jdk.jcmd/share/classes/sun/tools/jcmd/JCmd.java b/jdk/src/jdk.jcmd/share/classes/sun/tools/jcmd/JCmd.java
index 8a77c955fc8..18b33af2b5d 100644
--- a/jdk/src/jdk.jcmd/share/classes/sun/tools/jcmd/JCmd.java
+++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/jcmd/JCmd.java
@@ -80,22 +80,22 @@ public class JCmd {
System.exit(0);
}
- Collection vids = ap.getVirtualMachineDescriptors(JCmd.class);
+ Collection pids = ap.getVirtualMachinePids(JCmd.class);
- if (vids.isEmpty()) {
+ if (pids.isEmpty()) {
System.err.println("Could not find any processes matching : '"
+ arg.getProcessString() + "'");
System.exit(1);
}
boolean success = true;
- for (VirtualMachineDescriptor vid : vids) {
- System.out.println(vid.id() + ":");
+ for (String pid : pids) {
+ System.out.println(pid + ":");
if (arg.isListCounters()) {
- listCounters(vid.id());
+ listCounters(pid);
} else {
try {
- executeCommandForPid(vid.id(), arg.getCommand());
+ executeCommandForPid(pid, arg.getCommand());
} catch(AttachOperationFailedException ex) {
System.err.println(ex.getMessage());
success = false;
diff --git a/jdk/src/jdk.jcmd/share/classes/sun/tools/jinfo/JInfo.java b/jdk/src/jdk.jcmd/share/classes/sun/tools/jinfo/JInfo.java
index 2c955af2f4f..99b0b3f0562 100644
--- a/jdk/src/jdk.jcmd/share/classes/sun/tools/jinfo/JInfo.java
+++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/jinfo/JInfo.java
@@ -96,37 +96,37 @@ final public class JInfo {
String parg = args[optionCount];
ProcessArgumentMatcher ap = new ProcessArgumentMatcher(parg);
- Collection vids = ap.getVirtualMachineDescriptors(JInfo.class);
+ Collection pids = ap.getVirtualMachinePids(JInfo.class);
- if (vids.isEmpty()) {
+ if (pids.isEmpty()) {
System.err.println("Could not find any processes matching : '" + parg + "'");
System.exit(1);
}
- for (VirtualMachineDescriptor vid : vids) {
- if (vids.size() > 1) {
- System.out.println("Pid:" + vid.id());
+ for (String pid : pids) {
+ if (pids.size() > 1) {
+ System.out.println("Pid:" + pid);
}
if (!doFlag && !doFlags && !doSysprops) {
// Print flags and sysporps if no options given
- sysprops(vid.id());
+ sysprops(pid);
System.out.println();
- flags(vid.id());
+ flags(pid);
System.out.println();
- commandLine(vid.id());
+ commandLine(pid);
}
if (doFlag) {
if (flag < 0) {
System.err.println("Missing flag");
usage(1);
}
- flag(vid.id(), args[flag]);
+ flag(pid, args[flag]);
}
if (doFlags) {
- flags(vid.id());
+ flags(pid);
}
if (doSysprops) {
- sysprops(vid.id());
+ sysprops(pid);
}
}
}
diff --git a/jdk/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java b/jdk/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java
index 178d0a458a0..222358f7580 100644
--- a/jdk/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java
+++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/jmap/JMap.java
@@ -91,16 +91,15 @@ public class JMap {
// As more options are added we should create an abstract tool class and
// have a table to map the options
ProcessArgumentMatcher ap = new ProcessArgumentMatcher(pidArg);
- Collection vids = ap.getVirtualMachineDescriptors(JMap.class);
+ Collection pids = ap.getVirtualMachinePids(JMap.class);
- if (vids.isEmpty()) {
+ if (pids.isEmpty()) {
System.err.println("Could not find any processes matching : '" + pidArg + "'");
System.exit(1);
}
- for (VirtualMachineDescriptor vid : vids) {
- String pid = vid.id();
- if (vids.size() > 1) {
+ for (String pid : pids) {
+ if (pids.size() > 1) {
System.out.println("Pid:" + pid);
}
if (option.equals("-histo")) {
diff --git a/jdk/src/jdk.jcmd/share/classes/sun/tools/jstack/JStack.java b/jdk/src/jdk.jcmd/share/classes/sun/tools/jstack/JStack.java
index 5e861cec69f..a4ed220ddf5 100644
--- a/jdk/src/jdk.jcmd/share/classes/sun/tools/jstack/JStack.java
+++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/jstack/JStack.java
@@ -84,18 +84,18 @@ public class JStack {
params = new String[0];
}
ProcessArgumentMatcher ap = new ProcessArgumentMatcher(pidArg);
- Collection vids = ap.getVirtualMachineDescriptors(JStack.class);
+ Collection pids = ap.getVirtualMachinePids(JStack.class);
- if (vids.isEmpty()) {
+ if (pids.isEmpty()) {
System.err.println("Could not find any processes matching : '" + pidArg + "'");
System.exit(1);
}
- for (VirtualMachineDescriptor vid : vids) {
- if (vids.size() > 1) {
- System.out.println("Pid:" + vid.id());
+ for (String pid : pids) {
+ if (pids.size() > 1) {
+ System.out.println("Pid:" + pid);
}
- runThreadDump(vid.id(), params);
+ runThreadDump(pid, params);
}
}
From 062caf2df981fd89fbebe09f80b8a1a05b44c596 Mon Sep 17 00:00:00 2001
From: Igor Ignatyev
Date: Wed, 15 Mar 2017 22:48:59 -0700
Subject: [PATCH 02/40] 8176176: fix @modules in jdk_svc tests
Reviewed-by: shurailine, sspitsyn
---
jdk/test/com/sun/jdi/AcceptTimeout.java | 3 +-
jdk/test/com/sun/jdi/AccessSpecifierTest.java | 16 ++--
.../com/sun/jdi/AfterThreadDeathTest.java | 16 ++--
jdk/test/com/sun/jdi/AllLineLocations.java | 17 ++--
jdk/test/com/sun/jdi/ArrayRangeTest.java | 20 ++---
jdk/test/com/sun/jdi/BacktraceFieldTest.java | 18 ++--
.../com/sun/jdi/ClassLoaderClassesTest.java | 2 -
jdk/test/com/sun/jdi/ClassesByName.java | 6 +-
jdk/test/com/sun/jdi/ClassesByName2Test.java | 17 ++--
.../com/sun/jdi/CompatibleConnectors.java | 1 -
jdk/test/com/sun/jdi/ConnectedVMs.java | 22 +++--
jdk/test/com/sun/jdi/ConstantPoolInfo.java | 16 ++--
jdk/test/com/sun/jdi/ConstantPoolInfoGC.java | 16 ++--
jdk/test/com/sun/jdi/CountEvent.java | 18 ++--
jdk/test/com/sun/jdi/CountFilterTest.java | 16 ++--
jdk/test/com/sun/jdi/DebuggerThreadTest.java | 16 ++--
jdk/test/com/sun/jdi/DeleteAllBkptsTest.java | 17 ++--
.../com/sun/jdi/DeleteEventRequestsTest.java | 16 ++--
.../com/sun/jdi/EarlyReturnNegativeTest.java | 15 ++--
jdk/test/com/sun/jdi/EarlyReturnTest.java | 23 +++--
jdk/test/com/sun/jdi/EnumTest.java | 16 ++--
.../com/sun/jdi/EventQueueDisconnectTest.java | 19 ++--
jdk/test/com/sun/jdi/ExceptionEvents.java | 60 ++++++-------
.../sun/jdi/ExpiredRequestDeletionTest.java | 17 ++--
jdk/test/com/sun/jdi/FieldWatchpoints.java | 16 ++--
jdk/test/com/sun/jdi/FilterMatch.java | 16 ++--
jdk/test/com/sun/jdi/FilterNoMatch.java | 16 ++--
jdk/test/com/sun/jdi/FinalLocalsTest.java | 20 ++---
jdk/test/com/sun/jdi/FinalizerTest.java | 15 ++--
jdk/test/com/sun/jdi/FramesTest.java | 16 ++--
jdk/test/com/sun/jdi/GenericsTest.java | 16 ++--
.../com/sun/jdi/GetLocalVariables2Test.java | 16 ++--
.../sun/jdi/GetUninitializedStringValue.java | 16 ++--
jdk/test/com/sun/jdi/HomeTest.java | 16 ++--
jdk/test/com/sun/jdi/ImmutableResourceTest.sh | 12 +--
jdk/test/com/sun/jdi/InstanceFilter.java | 18 ++--
jdk/test/com/sun/jdi/InstancesTest.java | 15 ++--
.../com/sun/jdi/InterfaceMethodsTest.java | 17 ++--
jdk/test/com/sun/jdi/InterruptHangTest.java | 16 ++--
jdk/test/com/sun/jdi/InvokeHangTest.java | 19 ++--
jdk/test/com/sun/jdi/InvokeTest.java | 17 ++--
jdk/test/com/sun/jdi/JITDebug.sh | 19 ++--
jdk/test/com/sun/jdi/Java_gTest.java | 16 ++--
jdk/test/com/sun/jdi/LambdaStepTest.java | 14 ++-
jdk/test/com/sun/jdi/LaunchCommandLine.java | 17 ++--
jdk/test/com/sun/jdi/LineNumberInfo.java | 1 -
jdk/test/com/sun/jdi/ListenAddress.java | 1 -
jdk/test/com/sun/jdi/LocalVariableEqual.java | 16 ++--
jdk/test/com/sun/jdi/LocationTest.java | 16 ++--
.../com/sun/jdi/MethodEntryExitEvents.java | 19 ++--
.../sun/jdi/MethodExitReturnValuesTest.java | 15 ++--
jdk/test/com/sun/jdi/MixedSuspendTest.sh | 22 +++--
.../com/sun/jdi/ModificationWatchpoints.java | 18 ++--
jdk/test/com/sun/jdi/ModulesTest.java | 13 ++-
jdk/test/com/sun/jdi/MonitorEventTest.java | 16 ++--
jdk/test/com/sun/jdi/MonitorFrameInfo.java | 19 ++--
.../com/sun/jdi/MultiBreakpointsTest.java | 16 ++--
.../com/sun/jdi/NativeInstanceFilter.java | 16 ++--
jdk/test/com/sun/jdi/NewInstanceTest.java | 18 ++--
jdk/test/com/sun/jdi/NoLaunchOptionTest.java | 3 +-
jdk/test/com/sun/jdi/NoLocInfoTest.java | 18 ++--
.../com/sun/jdi/NullThreadGroupNameTest.java | 11 ++-
jdk/test/com/sun/jdi/OnThrowTest.java | 17 ++--
jdk/test/com/sun/jdi/OptionTest.java | 17 ++--
jdk/test/com/sun/jdi/PopAndInvokeTest.java | 17 ++--
jdk/test/com/sun/jdi/PopAsynchronousTest.java | 18 ++--
jdk/test/com/sun/jdi/PopSynchronousTest.java | 18 ++--
jdk/test/com/sun/jdi/RedefineCrossEvent.java | 90 +++++++++----------
jdk/test/com/sun/jdi/RedefineCrossStart.java | 41 +++++----
jdk/test/com/sun/jdi/ReferrersTest.java | 15 ++--
jdk/test/com/sun/jdi/RepStep.java | 18 ++--
.../com/sun/jdi/RequestReflectionTest.java | 18 ++--
jdk/test/com/sun/jdi/ResumeOneThreadTest.java | 16 ++--
jdk/test/com/sun/jdi/SDENullTest.java | 15 ++--
jdk/test/com/sun/jdi/SimulResumerTest.java | 18 ++--
.../com/sun/jdi/SourceNameFilterTest.java | 20 ++---
jdk/test/com/sun/jdi/StepTest.java | 41 +++++----
jdk/test/com/sun/jdi/SuspendThreadTest.java | 16 ++--
jdk/test/com/sun/jdi/TEST.properties | 2 +
jdk/test/com/sun/jdi/TemplateTest.java | 16 ++--
jdk/test/com/sun/jdi/ThreadGroupTest.java | 17 ++--
jdk/test/com/sun/jdi/TwoThreadsTest.java | 16 ++--
jdk/test/com/sun/jdi/UTF8Test.java | 16 ++--
jdk/test/com/sun/jdi/UnpreparedByName.java | 19 ++--
jdk/test/com/sun/jdi/UnpreparedClasses.java | 19 ++--
jdk/test/com/sun/jdi/VMDeathLastTest.java | 18 ++--
jdk/test/com/sun/jdi/VMDeathRequestTest.java | 18 ++--
jdk/test/com/sun/jdi/VarargsTest.java | 16 ++--
jdk/test/com/sun/jdi/Vars.java | 14 ++-
jdk/test/com/sun/jdi/VisibleMethods.java | 16 ++--
.../jdi/connect/spi/GeneratedConnectors.java | 1 -
.../com/sun/jdi/redefine/RedefineTest.java | 24 ++---
.../sun/jdi/redefineMethod/RedefineTest.java | 21 +++--
.../com/sun/jdi/sde/FilterMangleTest.java | 49 +++++-----
jdk/test/com/sun/jdi/sde/MangleStepTest.java | 29 +++---
jdk/test/com/sun/jdi/sde/MangleTest.java | 21 +++--
.../sun/jdi/sde/SourceDebugExtensionTest.java | 21 +++--
.../com/sun/jdi/sde/TemperatureTableTest.java | 21 +++--
.../DcmdMBeanDoubleInvocationTest.java | 1 -
.../DcmdMBeanInvocationTest.java | 1 -
.../DcmdMBeanPermissionsTest.java | 4 +-
.../DiagnosticCommandMBean/DcmdMBeanTest.java | 1 -
.../GarbageCollectorMXBean/LastGCInfo.java | 1 -
.../GetDiagnosticOptions.java | 1 -
.../GetDoubleVMOption.java | 1 -
.../HotSpotDiagnosticMXBean/GetVMOption.java | 1 -
.../SetAllVMOptions.java | 1 -
.../HotSpotDiagnosticMXBean/SetVMOption.java | 1 -
.../GetCommittedVirtualMemorySize.java | 1 -
.../GetFreePhysicalMemorySize.java | 1 -
.../GetFreeSwapSpaceSize.java | 1 -
.../GetProcessCpuLoad.java | 1 -
.../GetProcessCpuTime.java | 1 -
.../GetSystemCpuLoad.java | 1 -
.../GetTotalPhysicalMemorySize.java | 1 -
.../MemoryStatusOverflow.java | 1 -
.../OperatingSystemMXBean/TestTotalSwap.java | 11 ++-
jdk/test/com/sun/management/TEST.properties | 2 +
.../ThreadMXBean/ThreadAllocatedMemory.java | 1 -
.../ThreadAllocatedMemoryArray.java | 1 -
.../ThreadMXBean/ThreadCpuTimeArray.java | 3 +-
.../GetMaxFileDescriptorCount.sh | 5 +-
.../GetOpenFileDescriptorCount.sh | 5 +-
.../sun/management/VMOptionOpenDataTest.java | 1 -
.../com/sun/tools/attach/PermissionTest.java | 12 ++-
.../com/sun/tools/attach/ProviderTest.java | 11 ++-
.../tools/attach/StartManagementAgent.java | 5 +-
.../com/sun/tools/attach/TempDirTest.java | 5 +-
.../lang/instrument/RedefineModuleTest.java | 2 +-
.../instrument/TestAgentWithLimitMods.java | 2 +-
.../ClassLoadingMXBean/LoadCounts.java | 2 +-
.../management/CompilationMXBean/Basic.java | 1 -
.../MemoryUsageCompositeData.java | 1 -
.../ThreadInfoCompositeData.java | 1 -
.../ManagementFactory/GetObjectName.java | 2 +-
.../ManagementFactory/GetPlatformMXBeans.java | 1 -
.../GetPlatformManagementInterfaces.java | 1 -
.../MBeanServerMXBeanUnsupportedTest.java | 2 +-
.../ManagementFactory/MXBeanException.java | 1 -
.../ManagementFactory/MXBeanProxyTest.java | 4 +-
.../PlatformMBeanServerTest.java | 4 +-
.../ManagementFactory/ProxyExceptions.java | 1 -
.../ManagementFactory/ProxyTypeMapping.java | 1 -
.../ManagementFactory/TEST.properties | 2 +
.../ManagementFactory/ThreadMXBeanProxy.java | 2 -
.../ManagementFactory/ValidateOpenTypes.java | 1 -
.../MemoryMXBean/LowMemoryTest.java | 9 +-
.../management/MemoryMXBean/LowMemoryTest2.sh | 7 +-
.../MemoryManagementConcMarkSweepGC.sh | 5 +-
.../MemoryManagementParallelGC.sh | 5 +-
.../MemoryMXBean/MemoryManagementSerialGC.sh | 5 +-
.../MemoryMXBean/MemoryTestAllGC.sh | 7 +-
.../lang/management/MemoryMXBean/Pending.java | 5 +-
.../MemoryMXBean/ResetPeakMemoryUsage.java | 9 +-
.../MemoryPoolMXBean/ThresholdTest.java | 1 -
.../TestSystemLoadAvg.sh | 3 +-
.../PlatformLoggingMXBean/TEST.properties | 2 +
.../RuntimeMXBean/GetSystemProperties.java | 1 -
.../RuntimeMXBean/PropertiesTest.java | 1 -
.../RuntimeMXBean/TestInputArgument.sh | 8 +-
.../lang/management/RuntimeMXBean/UpTime.java | 1 -
jdk/test/java/lang/management/TEST.properties | 2 +
.../management/ThreadMXBean/AllThreadIds.java | 3 +-
.../management/ThreadMXBean/DisableTest.java | 1 -
.../management/ThreadMXBean/EnableTest.java | 1 -
.../ThreadMXBean/FindDeadlocks.java | 1 -
.../ThreadMXBean/FindMonitorDeadlock.java | 1 -
.../ThreadMXBean/InvalidThreadID.java | 1 -
.../ThreadMXBean/LockedMonitors.java | 1 -
.../ThreadMXBean/LockedSynchronizers.java | 1 -
.../lang/management/ThreadMXBean/Locks.java | 4 +-
.../ThreadMXBean/MyOwnSynchronizer.java | 1 -
.../ThreadMXBean/ResetPeakThreadCount.java | 1 -
.../ThreadMXBean/SharedSynchronizer.java | 1 -
.../SynchronizationStatistics.java | 2 -
.../ThreadMXBean/ThreadBlockedCount.java | 2 +-
.../management/ThreadMXBean/ThreadCounts.java | 1 -
.../ThreadMXBean/ThreadCpuTime.java | 1 -
.../ThreadMXBean/ThreadDaemonTest.java | 1 -
.../management/ThreadMXBean/ThreadLists.java | 1 -
.../ThreadMXBean/ThreadMXBeanStateTest.java | 3 +-
.../ThreadMXBean/ThreadStackTrace.java | 1 -
.../ThreadMXBean/ThreadUserTime.java | 1 -
.../ImplVersionTest.java | 2 +-
.../Introspector/AnnotationSecurityTest.java | 5 +-
.../Introspector/AnnotationTest.java | 2 +-
.../Introspector/ChangingNotifsTest.java | 2 +-
.../Introspector/ClassLeakTest.java | 2 +-
.../Introspector/DuplicateGetterTest.java | 1 -
.../Introspector/FeatureOrderTest.java | 1 -
.../GetMBeanInfoExceptionTest.java | 2 +-
.../Introspector/IdenticalMBeanInfoTest.java | 2 +-
.../ImmutableNotificationInfoTest.java | 2 +-
.../Introspector/InvokeGettersTest.java | 2 +-
.../management/Introspector/IsMethodTest.java | 2 +-
.../LegacyConstructorPropertiesTest.java | 6 +-
.../Introspector/NotAnMBeanTest.java | 2 +-
.../Introspector/NotCompliantCauseTest.java | 9 +-
.../SetWrongTypeAttributeTest.java | 2 +-
.../UnregisterMBeanExceptionTest.java | 2 +-
.../MBeanInfo/EqualExceptionTest.java | 2 +-
.../MBeanInfo/MBeanInfoEqualsNPETest.java | 2 +-
.../MBeanInfo/MBeanInfoEqualsTest.java | 2 +-
.../MBeanInfo/MBeanInfoHashCodeNPETest.java | 2 +-
.../MBeanInfo/NullInfoArraysTest.java | 2 +-
.../MBeanInfo/SerializationTest.java | 2 +-
.../MBeanInfo/SerializationTest1.java | 2 +-
.../management/MBeanInfo/TooManyFooTest.java | 8 +-
.../AttributeListTypeSafeTest.java | 1 -
.../MBeanServer/MBeanExceptionTest.java | 3 +-
.../MBeanServer/MBeanFallbackTest.java | 2 +-
...nServerInvocationHandlerExceptionTest.java | 2 +-
.../management/MBeanServer/MBeanTest.java | 2 +-
.../MBeanServer/NewMBeanListenerTest.java | 2 +-
.../MBeanServer/NotifDeadlockTest.java | 2 +-
.../MBeanServer/PostExceptionTest.java | 3 +-
.../MBeanServer/PostRegisterDeadlockTest.java | 2 +-
.../PostRegisterDeadlockTest2.java | 2 +-
.../PreDeregisterDeadlockTest.java | 2 +-
.../MBeanServer/PreRegisterTest.java | 2 +-
.../ReleaseMBeanServerTest.java | 2 +-
.../MustBeValidCommand.java | 2 +-
.../ObjectInstance/MBeanInfoFailTest.java | 2 +-
.../ObjectInstanceNullTest.java | 2 +-
.../ObjectInstance/ToStringMethodTest.java | 2 +-
.../ObjectName/ApplyWildcardTest.java | 2 +-
.../management/ObjectName/ComparatorTest.java | 2 +-
.../DelegateNameWildcardNameTest.java | 2 +-
.../ObjectName/NullEmptyKeyValueTest.java | 2 +-
.../ObjectName/ObjectNameGetInstanceTest.java | 2 +-
.../ObjectName/RepositoryWildcardTest.java | 2 +-
.../ObjectName/SerialCompatTest.java | 2 +-
.../ObjectName/ValueWildcardTest.java | 2 +-
jdk/test/javax/management/TEST.properties | 2 +
.../descriptor/DefaultDescriptorTest.java | 2 +-
.../management/descriptor/DescriptorTest.java | 2 +-
.../descriptor/EqualsHashCodeTest.java | 2 +-
.../descriptor/ImmutableArrayFieldTest.java | 2 +-
.../ImmutableDescriptorSerialTest.java | 2 +-
.../ImmutableDescriptorSetFieldsTest.java | 2 +-
.../descriptor/MBeanInfoInteropTest.java | 2 +-
.../management/descriptor/UnionTest.java | 2 +-
.../management/generified/GenericTest.java | 2 +-
.../generified/ListTypeCheckTest.java | 2 +-
.../management/loading/ArrayClassTest.java | 2 +-
.../management/loading/DocumentRootTest.java | 2 +-
.../loading/GetMBeansFromURLTest.java | 2 +-
.../LibraryLoader/LibraryLoaderTest.java | 2 +-
.../loading/MLetCLR/MLetCommand.java | 2 +-
.../management/loading/MLetContentTest.java | 2 +-
.../loading/MletParserLocaleTest.java | 2 +-
.../loading/ParserInfiniteLoopTest.java | 2 +-
.../loading/SystemClassLoaderTest.java | 2 +-
...tributeChangeNotificationListenerTest.java | 2 +-
.../DescriptorSupportSerialTest.java | 2 +-
.../modelmbean/DescriptorSupportTest.java | 2 +-
.../DescriptorSupportXMLLocaleTest.java | 2 +-
.../modelmbean/DescriptorSupportXMLTest.java | 2 +-
.../modelmbean/ExoticTargetTypeTest.java | 2 +-
.../modelmbean/InfoSupportTest.java | 2 +-
.../modelmbean/LoggingExceptionTest.java | 4 +-
.../GetAllDescriptorsTest.java | 2 +-
.../modelmbean/OnUnregisterTest.java | 2 +-
.../RequiredModelMBeanGetAttributeTest.java | 2 +-
.../RequiredModelMBeanMethodTest.java | 2 +-
.../RequiredModelMBeanSetAttributeTest.java | 2 +-
.../SimpleModelMBeanCommand.java | 2 +-
.../monitor/CounterMonitorDeadlockTest.java | 2 +-
.../CounterMonitorInitThresholdTest.java | 2 +-
.../monitor/CounterMonitorTest.java | 2 +-
.../monitor/CounterMonitorThresholdTest.java | 2 +-
.../monitor/DerivedGaugeMonitorTest.java | 2 +-
.../monitor/GaugeMonitorDeadlockTest.java | 3 +-
.../management/monitor/MultiMonitorTest.java | 4 +-
.../NonComparableAttributeValueTest.java | 2 +-
.../monitor/NullAttributeValueTest.java | 2 +-
.../monitor/ReflectionExceptionTest.java | 4 +-
.../monitor/RuntimeExceptionTest.java | 2 +-
.../management/monitor/StartStopTest.java | 3 +-
.../monitor/StringMonitorDeadlockTest.java | 4 +-
.../management/monitor/ThreadPoolAccTest.java | 2 +-
.../management/monitor/ThreadPoolTest.java | 2 +-
.../mxbean/AmbiguousConstructorTest.java | 2 +-
.../mxbean/ComparatorExceptionTest.java | 1 -
.../mxbean/ExceptionDiagnosisTest.java | 1 -
.../management/mxbean/GenericTypeTest.java | 2 +-
.../mxbean/InvalidMXBeanRegistrationTest.java | 2 +-
.../javax/management/mxbean/LeakTest.java | 2 +-
.../mxbean/MBeanOperationInfoTest.java | 2 +-
.../mxbean/MXBeanAnnotationTest.java | 2 +-
.../management/mxbean/MXBeanFallbackTest.java | 2 +-
.../management/mxbean/MXBeanFlagTest.java | 2 +-
.../management/mxbean/MXBeanLoadingTest1.java | 3 +-
.../mxbean/MXBeanPreRegisterTest.java | 2 +-
.../management/mxbean/MXBeanRefTest.java | 2 +-
.../javax/management/mxbean/MiscTest.java | 2 +-
.../mxbean/OperationImpactTest.java | 2 +-
.../javax/management/mxbean/OverloadTest.java | 2 +-
.../mxbean/PreRegisterNameTest.java | 1 -
.../management/mxbean/PropertyNamesTest.java | 2 +-
.../mxbean/SameObjectTwoNamesTest.java | 2 +-
.../mxbean/StandardMBeanOverrideTest.java | 2 +-
.../management/mxbean/ThreadMXBeanTest.java | 4 +-
.../javax/management/mxbean/TypeNameTest.java | 1 -
.../BroadcasterSupportDeadlockTest.java | 2 +-
.../notification/FilterExceptionTest.java | 2 +-
.../notification/NotifExecutorTest.java | 2 +-
.../notification/NotifInfoTest.java | 2 +-
.../management/openmbean/ArrayTypeTest.java | 2 +-
.../openmbean/BadConstraintTest.java | 2 +-
.../openmbean/CompositeDataStringTest.java | 1 -
.../management/openmbean/ConstraintTest.java | 2 +-
.../management/openmbean/EqualsTest.java | 2 +-
.../management/openmbean/IsValueTest.java | 1 -
.../openmbean/NullConstructorParamsTest.java | 1 -
.../openmbean/OpenMBeanInfoEqualsNPETest.java | 2 +-
.../OpenMBeanInfoHashCodeNPETest.java | 2 +-
.../openmbean/OpenTypeDescriptorTest.java | 2 +-
.../proxy/JMXProxyFallbackTest.java | 2 +-
.../javax/management/proxy/JMXProxyTest.java | 2 +-
.../proxy/NotificationEmitterProxy.java | 2 +-
.../proxy/ProxyObjectMethodsTest.java | 2 +-
.../management/query/CustomQueryTest.java | 1 -
.../management/query/InstanceOfExpTest.java | 2 +-
.../management/query/QueryExpStringTest.java | 2 +-
.../management/query/QueryMatchTest.java | 2 +-
.../management/query/QuerySubstringTest.java | 2 +-
.../management/relation/NonArrayListTest.java | 2 +-
.../RelationNotificationSeqNoTest.java | 1 -
.../RelationNotificationSourceTest.java | 2 +-
.../management/relation/RelationTypeTest.java | 2 +-
.../remote/mandatory/TEST.properties | 2 +
.../management/remote/mandatory/URLTest.java | 2 +-
.../mandatory/connection/AddressableTest.java | 2 +-
.../connection/BrokenConnectionTest.java | 4 +-
.../connection/CloseFailedClientTest.java | 2 +-
.../mandatory/connection/CloseServerTest.java | 2 +-
.../connection/CloseUnconnectedTest.java | 2 +-
.../mandatory/connection/CloseableTest.java | 2 +-
.../ConnectionListenerNullTest.java | 2 +-
.../mandatory/connection/ConnectionTest.java | 2 +-
.../connection/DaemonRMIExporterTest.java | 2 +-
.../mandatory/connection/DeadLockTest.java | 2 +-
.../connection/FailedConnectionTest.java | 2 +-
.../connection/GetConnectionTest.java | 2 +-
.../mandatory/connection/IIOPURLTest.java | 2 +-
.../connection/JMXServiceURLLocaleTest.java | 2 +-
.../connection/MultiOpenCloseTest.java | 2 +-
.../connection/MultiThreadDeadLockTest.java | 2 +-
.../connection/RMIConnectionIdTest.java | 2 +-
.../RMIConnectorLogAttributesTest.java | 3 +
.../mandatory/connection/RMIExitTest.java | 2 +-
.../connection/RMISerializeTest.java | 2 +-
.../mandatory/connection/ReconnectTest.java | 2 +-
.../ConnectorStopDeadlockTest.java | 1 -
.../connectorServer/JNDIFailureTest.java | 2 +-
.../MBSFPreStartPostStartTest.java | 2 +-
.../loading/DefaultProviderTest.java | 2 +-
.../loading/DeserializeEncodedURLTest.java | 2 +-
.../mandatory/loading/MethodResultTest.java | 3 +-
.../mandatory/loading/MissingClassTest.java | 4 +-
.../mandatory/loading/RMIDownloadTest.java | 2 +-
.../mandatory/loading/TargetMBeanTest.java | 2 +-
.../loading/UserClassLoaderTest.java | 2 +-
.../remote/mandatory/notif/AddRemoveTest.java | 2 +-
.../notif/ConcurrentModificationTest.java | 2 +-
.../remote/mandatory/notif/DiffHBTest.java | 2 +-
.../notif/EmptyDomainNotificationTest.java | 2 +-
.../mandatory/notif/ListenerScaleTest.java | 2 +-
.../notif/NotSerializableNotifTest.java | 4 +-
.../NotifBufferSizePropertyNameTest.java | 2 +-
.../notif/NotifReconnectDeadlockTest.java | 2 +-
.../notif/NotificationBufferCreationTest.java | 2 +-
.../notif/NotificationBufferDeadlockTest.java | 2 +-
.../notif/NotificationEmissionTest.java | 4 +-
.../remote/mandatory/notif/RMINotifTest.java | 3 +-
.../remote/mandatory/notif/ServerNotifs.java | 2 +-
.../mandatory/notif/UnexpectedNotifTest.java | 2 +-
.../NonJMXPrincipalsTest.java | 2 +-
.../PasswordAccessFileTest.java | 2 +-
.../mandatory/provider/ProviderTest.java | 2 +-
.../RMISocketFactoriesTest.java | 2 +-
.../threads/ExecutorShutdownTest.java | 2 +-
.../mandatory/threads/ExecutorTest.java | 2 +-
.../threads/NoServerTimeoutTest.java | 2 +-
.../mandatory/version/ImplVersionTest.java | 2 +-
.../security/AvoidGetMBeanInfoCallsTest.java | 2 +-
.../security/MBeanPermissionTest.java | 2 +-
.../standardmbean/DeadlockTest.java | 2 +-
.../timer/MissingNotificationTest.java | 4 +-
.../javax/management/timer/StartTest.java | 2 +-
jdk/test/sun/jvmstat/TEST.properties | 2 +
.../HostIdentifier/HostIdentifierCreate.java | 4 +-
.../MonitoredVm/TestPollingInterval.java | 3 +-
.../VmIdentifierCreateResolve.java | 4 +-
.../PrologSanity/PrologSizeSanityCheck.java | 4 +-
.../GetClassInitializationTime.java | 2 +-
.../GetClassLoadingTime.java | 2 +-
.../GetInitializedClassCount.java | 2 +-
.../GetLoadedClassSize.java | 2 +-
.../GetMethodDataSize.java | 2 +-
.../GetUnloadedClassSize.java | 2 +-
.../GetSafepointCount.java | 2 +-
.../GetSafepointSyncTime.java | 2 +-
.../GetTotalSafepointTime.java | 2 +-
.../GetInternalThreads.java | 2 +-
.../sun/management/LazyCompositeDataTest.java | 4 +-
.../LoggingTest/LoggingWithJULTest.java | 7 +-
.../LoggingWithLoggerFinderTest.java | 4 +-
.../CompatibilityTest.java | 7 +-
jdk/test/sun/management/TEST.properties | 2 +
.../sun/management/jdp/JdpDefaultsTest.java | 3 +-
.../jdp/JdpJmxRemoteDynamicPortTest.java | 17 ++--
jdk/test/sun/management/jdp/JdpOffTest.java | 3 +-
.../jdp/JdpSpecificAddressTest.java | 3 +-
jdk/test/sun/management/jdp/TEST.properties | 3 +
.../LocalRMIServerSocketFactoryTest.java | 13 ++-
.../sun/management/jmxremote/TEST.properties | 3 +
.../bootstrap/JMXInterfaceBindingTest.java | 4 +-
.../bootstrap/PasswordFilePermissionTest.java | 8 +-
.../jmxremote/bootstrap/RmiBootstrapTest.sh | 9 +-
.../bootstrap/RmiRegistrySslTest.java | 7 +-
.../bootstrap/RmiSslBootstrapTest.sh | 5 +-
.../bootstrap/RmiSslNoKeyStoreTest.sh | 6 +-
.../SSLConfigFilePermissionTest.java | 10 +--
.../startstop/JMXStatusPerfCountersTest.java | 5 +-
.../jmxremote/startstop/JMXStatusTest.java | 3 +-
jdk/test/sun/tools/jcmd/TEST.properties | 2 +
jdk/test/sun/tools/jcmd/TestJcmdDefaults.java | 9 +-
jdk/test/sun/tools/jcmd/TestJcmdSanity.java | 9 +-
.../sun/tools/jconsole/ResourceCheckTest.java | 13 +--
jdk/test/sun/tools/jhsdb/TEST.properties | 3 +
.../jhsdb/heapconfig/JMapHeapConfigTest.java | 4 +-
jdk/test/sun/tools/jinfo/JInfoTest.java | 9 +-
jdk/test/sun/tools/jinfo/TEST.properties | 2 +
jdk/test/sun/tools/jmap/TEST.properties | 2 +
jdk/test/sun/tools/jstack/TEST.properties | 2 +
jdk/test/sun/tools/jstat/TEST.properties | 2 +
jdk/test/sun/tools/jstatd/TEST.properties | 5 ++
.../sun/tools/jstatd/TestJstatdDefaults.java | 3 +-
.../jstatd/TestJstatdExternalRegistry.java | 3 +-
jdk/test/sun/tools/jstatd/TestJstatdPort.java | 3 +-
.../tools/jstatd/TestJstatdPortAndServer.java | 3 +-
.../sun/tools/jstatd/TestJstatdServer.java | 3 +-
444 files changed, 1258 insertions(+), 1401 deletions(-)
create mode 100644 jdk/test/com/sun/jdi/TEST.properties
create mode 100644 jdk/test/com/sun/management/TEST.properties
create mode 100644 jdk/test/java/lang/management/ManagementFactory/TEST.properties
create mode 100644 jdk/test/java/lang/management/PlatformLoggingMXBean/TEST.properties
create mode 100644 jdk/test/java/lang/management/TEST.properties
create mode 100644 jdk/test/javax/management/TEST.properties
create mode 100644 jdk/test/javax/management/remote/mandatory/TEST.properties
create mode 100644 jdk/test/sun/jvmstat/TEST.properties
create mode 100644 jdk/test/sun/management/TEST.properties
create mode 100644 jdk/test/sun/management/jdp/TEST.properties
create mode 100644 jdk/test/sun/management/jmxremote/TEST.properties
create mode 100644 jdk/test/sun/tools/jcmd/TEST.properties
create mode 100644 jdk/test/sun/tools/jhsdb/TEST.properties
create mode 100644 jdk/test/sun/tools/jinfo/TEST.properties
create mode 100644 jdk/test/sun/tools/jmap/TEST.properties
create mode 100644 jdk/test/sun/tools/jstack/TEST.properties
create mode 100644 jdk/test/sun/tools/jstat/TEST.properties
create mode 100644 jdk/test/sun/tools/jstatd/TEST.properties
diff --git a/jdk/test/com/sun/jdi/AcceptTimeout.java b/jdk/test/com/sun/jdi/AcceptTimeout.java
index 313a2812035..d9479d52129 100644
--- a/jdk/test/com/sun/jdi/AcceptTimeout.java
+++ b/jdk/test/com/sun/jdi/AcceptTimeout.java
@@ -24,8 +24,7 @@
/* @test
* @bug 6198277
* @summary Test that each ListeningConnector that supports a "timeout" argument will
- * timeout with TransportTimeoutException
- * @modules jdk.jdi
+ * timeout with TransportTimeoutException
*/
import com.sun.jdi.Bootstrap;
import com.sun.jdi.connect.Connector;
diff --git a/jdk/test/com/sun/jdi/AccessSpecifierTest.java b/jdk/test/com/sun/jdi/AccessSpecifierTest.java
index d1c6e143395..1c4df30bb56 100644
--- a/jdk/test/com/sun/jdi/AccessSpecifierTest.java
+++ b/jdk/test/com/sun/jdi/AccessSpecifierTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4359628
- * @summary Test fix for JDI: methods Accessible.is...() lie about array types
+ * @test
+ * @bug 4359628
+ * @summary Test fix for JDI: methods Accessible.is...() lie about array types
+ * @author Tim Bell
*
- * @author Tim Bell
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g AccessSpecifierTest.java
- * @run driver AccessSpecifierTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g AccessSpecifierTest.java
+ * @run driver AccessSpecifierTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/AfterThreadDeathTest.java b/jdk/test/com/sun/jdi/AfterThreadDeathTest.java
index 93c21e6bc46..61435a64a61 100644
--- a/jdk/test/com/sun/jdi/AfterThreadDeathTest.java
+++ b/jdk/test/com/sun/jdi/AfterThreadDeathTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4364671
- * @summary Creating a StepRequest on a nonexistant thread fails
+ * @test
+ * @bug 4364671
+ * @summary Creating a StepRequest on a nonexistant thread fails
+ * @author jjh
*
- * @author jjh
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g AfterThreadDeathTest.java
- * @run driver AfterThreadDeathTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g AfterThreadDeathTest.java
+ * @run driver AfterThreadDeathTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/AllLineLocations.java b/jdk/test/com/sun/jdi/AllLineLocations.java
index 939880c5cca..6b171aec53c 100644
--- a/jdk/test/com/sun/jdi/AllLineLocations.java
+++ b/jdk/test/com/sun/jdi/AllLineLocations.java
@@ -22,17 +22,16 @@
*/
/**
- * @test
- * @bug 4248728
- * @summary Test ReferenceType.allLineLocations
- * @author Gordon Hirsch
+ * @test
+ * @bug 4248728
+ * @summary Test ReferenceType.allLineLocations
+ * @author Gordon Hirsch
*
- * @modules jdk.jdi
- * @run build JDIScaffold VMConnection
- * @run compile -g RefTypes.java
- * @run build AllLineLocations
+ * @run build JDIScaffold VMConnection
+ * @run compile -g RefTypes.java
+ * @run build AllLineLocations
*
- * @run driver AllLineLocations RefTypes
+ * @run driver AllLineLocations RefTypes
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/ArrayRangeTest.java b/jdk/test/com/sun/jdi/ArrayRangeTest.java
index c7df22fabbd..aa86011b165 100644
--- a/jdk/test/com/sun/jdi/ArrayRangeTest.java
+++ b/jdk/test/com/sun/jdi/ArrayRangeTest.java
@@ -22,18 +22,16 @@
*/
/**
- * @test
- * @bug 4439631
- * @bug 4448721
- * @bug 4448603
- * @summary Test access to ranges within ArrayReferences
+ * @test
+ * @bug 4439631
+ * @bug 4448721
+ * @bug 4448603
+ * @summary Test access to ranges within ArrayReferences
+ * @author Robert Field
*
- * @author Robert Field
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g ArrayRangeTest.java
- * @run driver ArrayRangeTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g ArrayRangeTest.java
+ * @run driver ArrayRangeTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/BacktraceFieldTest.java b/jdk/test/com/sun/jdi/BacktraceFieldTest.java
index 7136eb97121..294b858e2f7 100644
--- a/jdk/test/com/sun/jdi/BacktraceFieldTest.java
+++ b/jdk/test/com/sun/jdi/BacktraceFieldTest.java
@@ -22,17 +22,15 @@
*/
/**
- * @test
- * @bug 4446677
- * @bug 8158237
- * @summary debuggee used to crash when debugging under jbuilder
+ * @test
+ * @bug 4446677
+ * @bug 8158237
+ * @summary debuggee used to crash when debugging under jbuilder
+ * @author jjh
*
- * @author jjh
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g BacktraceFieldTest.java
- * @run driver BacktraceFieldTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g BacktraceFieldTest.java
+ * @run driver BacktraceFieldTest
*/
/*
diff --git a/jdk/test/com/sun/jdi/ClassLoaderClassesTest.java b/jdk/test/com/sun/jdi/ClassLoaderClassesTest.java
index a4f8450b7d0..60712f8aacd 100644
--- a/jdk/test/com/sun/jdi/ClassLoaderClassesTest.java
+++ b/jdk/test/com/sun/jdi/ClassLoaderClassesTest.java
@@ -27,10 +27,8 @@
* @summary Test ClassLoaderReference.visibleClasses() which is
* a direct pass-through of the JVMDI function GetClassLoaderClasses
* for inclusion of primitive arrays.
- *
* @author Robert Field
*
- * @modules jdk.jdi
* @run build TestScaffold VMConnection TargetListener TargetAdapter
* @run compile -g ClassLoaderClassesTest.java
* @run driver ClassLoaderClassesTest
diff --git a/jdk/test/com/sun/jdi/ClassesByName.java b/jdk/test/com/sun/jdi/ClassesByName.java
index 1e920328044..3857a9b03cf 100644
--- a/jdk/test/com/sun/jdi/ClassesByName.java
+++ b/jdk/test/com/sun/jdi/ClassesByName.java
@@ -24,16 +24,14 @@
/**
* @test
* @bug 4287992
+ * @summary ClassesByName verifies that all the classes in the
+ * loaded class list can be found with classesByName..
* @author Robert Field
*
- * @modules jdk.jdi
* @run build JDIScaffold VMConnection
* @run compile -g HelloWorld.java
* @run build ClassesByName
*
- * @summary ClassesByName verifies that all the classes in the
- * loaded class list can be found with classesByName..
- *
* @run driver ClassesByName HelloWorld
*/
import com.sun.jdi.*;
diff --git a/jdk/test/com/sun/jdi/ClassesByName2Test.java b/jdk/test/com/sun/jdi/ClassesByName2Test.java
index 2a7c5288cc3..c6407edcb28 100644
--- a/jdk/test/com/sun/jdi/ClassesByName2Test.java
+++ b/jdk/test/com/sun/jdi/ClassesByName2Test.java
@@ -22,16 +22,17 @@
*/
/**
- * @test
- * @bug 4406439 4925740
- * @summary ClassesByName2 verifies that all the classes in the loaded class list can be found with classesByName..
+ * @test
+ * @bug 4406439 4925740
+ * @summary ClassesByName2 verifies that all the classes in the loaded class list can be found with classesByName..
+ * @author Tim Bell (based on ClassesByName by Robert Field)
*
- * @author Tim Bell (based on ClassesByName by Robert Field)
+ * @modules jdk.jdi
+ * java.desktop
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g ClassesByName2Test.java
- * @run driver ClassesByName2Test
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g ClassesByName2Test.java
+ * @run driver ClassesByName2Test
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/CompatibleConnectors.java b/jdk/test/com/sun/jdi/CompatibleConnectors.java
index 189e1b2a6d0..57e0f146b55 100644
--- a/jdk/test/com/sun/jdi/CompatibleConnectors.java
+++ b/jdk/test/com/sun/jdi/CompatibleConnectors.java
@@ -27,7 +27,6 @@
*
* This test checks that VirtualMachineManager creates Connectors that
* are "compatible" those created by 1.4 or earilier releases.
- * @modules jdk.jdi
*/
import com.sun.jdi.*;
diff --git a/jdk/test/com/sun/jdi/ConnectedVMs.java b/jdk/test/com/sun/jdi/ConnectedVMs.java
index 7e41bb17d99..9bf0267c0cd 100644
--- a/jdk/test/com/sun/jdi/ConnectedVMs.java
+++ b/jdk/test/com/sun/jdi/ConnectedVMs.java
@@ -22,20 +22,18 @@
*/
/**
- * @test
- * @bug 4329140
- * @author Robert Field
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g InstTarg.java
- * @run driver ConnectedVMs Kill
- * @run driver ConnectedVMs Resume-to-exit
- * @run driver ConnectedVMs dispose()
- * @run driver ConnectedVMs exit()
- *
+ * @test
+ * @bug 4329140
* @summary ConnectedVMs checks the method
* VirtualMachineManager.connectedVirtualMachines()
+ * @author Robert Field
+ *
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g InstTarg.java
+ * @run driver ConnectedVMs Kill
+ * @run driver ConnectedVMs Resume-to-exit
+ * @run driver ConnectedVMs dispose()
+ * @run driver ConnectedVMs exit()
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/ConstantPoolInfo.java b/jdk/test/com/sun/jdi/ConstantPoolInfo.java
index 540d26e381d..097ab535cf2 100644
--- a/jdk/test/com/sun/jdi/ConstantPoolInfo.java
+++ b/jdk/test/com/sun/jdi/ConstantPoolInfo.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 5024104
- * @summary Test ReferenceType.majorVersion(), minorVersion, constantPoolCount and ConstantPool apis.
+ * @test
+ * @bug 5024104
+ * @summary Test ReferenceType.majorVersion(), minorVersion, constantPoolCount and ConstantPool apis.
+ * @author Swamy Venkataramanappa
*
- * @author Swamy Venkataramanappa
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection
- * @run compile -g ConstantPoolInfo.java
- * @run driver ConstantPoolInfo
+ * @run build TestScaffold VMConnection
+ * @run compile -g ConstantPoolInfo.java
+ * @run driver ConstantPoolInfo
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/ConstantPoolInfoGC.java b/jdk/test/com/sun/jdi/ConstantPoolInfoGC.java
index aacf78765a0..8aa57053c98 100644
--- a/jdk/test/com/sun/jdi/ConstantPoolInfoGC.java
+++ b/jdk/test/com/sun/jdi/ConstantPoolInfoGC.java
@@ -22,16 +22,16 @@
*/
/*
- * @test
- * @bug 6822627
- * @summary Test that ReferenceType.constantPool does not produce an NPE
+ * @test
+ * @bug 6822627
+ * @summary Test that ReferenceType.constantPool does not produce an NPE
+ * @author Egor Ushakov
*
- * @author Egor Ushakov
+ * @modules jdk.jdi/com.sun.tools.jdi:+open
*
- * @modules jdk.jdi/com.sun.tools.jdi:+open
- * @run build TestScaffold VMConnection
- * @run compile -g ConstantPoolInfoGC.java
- * @run main/othervm ConstantPoolInfoGC
+ * @run build TestScaffold VMConnection
+ * @run compile -g ConstantPoolInfoGC.java
+ * @run main/othervm ConstantPoolInfoGC
*/
import com.sun.jdi.ReferenceType;
diff --git a/jdk/test/com/sun/jdi/CountEvent.java b/jdk/test/com/sun/jdi/CountEvent.java
index 40086b3bfa6..37573b47a58 100644
--- a/jdk/test/com/sun/jdi/CountEvent.java
+++ b/jdk/test/com/sun/jdi/CountEvent.java
@@ -22,17 +22,15 @@
*/
/**
- * @test
- * @bug 4315352
- * @summary disabling EventRequest expired with addCountFilter() throws
- * InternalException.
+ * @test
+ * @bug 4315352
+ * @summary disabling EventRequest expired with addCountFilter() throws
+ * InternalException.
+ * @author Robert Field
*
- * @author Robert Field
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetAdapter TargetListener
- * @run compile -g CountEvent.java
- * @run driver CountEvent
+ * @run build TestScaffold VMConnection TargetAdapter TargetListener
+ * @run compile -g CountEvent.java
+ * @run driver CountEvent
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/CountFilterTest.java b/jdk/test/com/sun/jdi/CountFilterTest.java
index e71de811a3e..681a765eca5 100644
--- a/jdk/test/com/sun/jdi/CountFilterTest.java
+++ b/jdk/test/com/sun/jdi/CountFilterTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4321339
- * @summary Check correct processing of filters after a count filter
+ * @test
+ * @bug 4321339
+ * @summary Check correct processing of filters after a count filter
+ * @author Robert Field
*
- * @author Robert Field
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g CountFilterTest.java
- * @run driver CountFilterTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g CountFilterTest.java
+ * @run driver CountFilterTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/DebuggerThreadTest.java b/jdk/test/com/sun/jdi/DebuggerThreadTest.java
index 182c232e19a..496f023539a 100644
--- a/jdk/test/com/sun/jdi/DebuggerThreadTest.java
+++ b/jdk/test/com/sun/jdi/DebuggerThreadTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4513488
- * @summary Test for JDI: Internal JDI helper threads should setDaemon(true)
+ * @test
+ * @bug 4513488
+ * @summary Test for JDI: Internal JDI helper threads should setDaemon(true)
+ * @author Tim Bell
*
- * @author Tim Bell
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g DebuggerThreadTest.java
- * @run driver DebuggerThreadTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g DebuggerThreadTest.java
+ * @run driver DebuggerThreadTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/DeleteAllBkptsTest.java b/jdk/test/com/sun/jdi/DeleteAllBkptsTest.java
index a37cbb33133..df805d97ce9 100644
--- a/jdk/test/com/sun/jdi/DeleteAllBkptsTest.java
+++ b/jdk/test/com/sun/jdi/DeleteAllBkptsTest.java
@@ -22,17 +22,16 @@
*/
/**
- * @test
- * @bug 4528948
- * @summary Unable to finish a debugging in NetBeans IDE
+ * @test
+ * @bug 4528948
+ * @summary Unable to finish a debugging in NetBeans IDE
+ * @author jjh
*
- * @author jjh
+ * @library ..
*
- * @library ..
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g DeleteAllBkptsTest.java
- * @run driver DeleteAllBkptsTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g DeleteAllBkptsTest.java
+ * @run driver DeleteAllBkptsTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/DeleteEventRequestsTest.java b/jdk/test/com/sun/jdi/DeleteEventRequestsTest.java
index 7d4d8078798..c096ec7dbb8 100644
--- a/jdk/test/com/sun/jdi/DeleteEventRequestsTest.java
+++ b/jdk/test/com/sun/jdi/DeleteEventRequestsTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4331872
- * @summary erm.deleteEventRequests(erm.breakpointRequests()) throws exception
+ * @test
+ * @bug 4331872
+ * @summary erm.deleteEventRequests(erm.breakpointRequests()) throws exception
+ * @author Robert Field
*
- * @author Robert Field
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g DeleteEventRequestsTest.java
- * @run driver DeleteEventRequestsTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g DeleteEventRequestsTest.java
+ * @run driver DeleteEventRequestsTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/EarlyReturnNegativeTest.java b/jdk/test/com/sun/jdi/EarlyReturnNegativeTest.java
index 728130b4fff..15cb1ded7cc 100644
--- a/jdk/test/com/sun/jdi/EarlyReturnNegativeTest.java
+++ b/jdk/test/com/sun/jdi/EarlyReturnNegativeTest.java
@@ -22,15 +22,14 @@
*/
/**
- * @test
- * @bug 6431735
- * @summary Unexpected ClassCastException in ThreadReference.forceEarlyReturn
- * @author Jim Holmlund
+ * @test
+ * @bug 6431735
+ * @summary Unexpected ClassCastException in ThreadReference.forceEarlyReturn
+ * @author Jim Holmlund
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g EarlyReturnNegativeTest.java
- * @run driver EarlyReturnNegativeTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g EarlyReturnNegativeTest.java
+ * @run driver EarlyReturnNegativeTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/EarlyReturnTest.java b/jdk/test/com/sun/jdi/EarlyReturnTest.java
index e76310c2cae..ac7e5329d92 100644
--- a/jdk/test/com/sun/jdi/EarlyReturnTest.java
+++ b/jdk/test/com/sun/jdi/EarlyReturnTest.java
@@ -22,22 +22,21 @@
*/
/*
- * @test
- * @bug 6175634
- * @summary Allow early return from methods
+ * @test
+ * @bug 6175634
+ * @summary Allow early return from methods
*
- * @bug 6431720
- * @summary Unexpected InvalidTypeException when call ThreadReference.forceEarlyReturn with VoidValue
+ * @bug 6431720
+ * @summary Unexpected InvalidTypeException when call ThreadReference.forceEarlyReturn with VoidValue
*
- * @bug 6432855
- * @summary Need a way to create JDI VoidValue for use in ThreadReference.forceEarlyReturn
+ * @bug 6432855
+ * @summary Need a way to create JDI VoidValue for use in ThreadReference.forceEarlyReturn
*
- * @author Tim Bell (based on MethodExitReturnValuesTest by Jim Holmlund)
+ * @author Tim Bell (based on MethodExitReturnValuesTest by Jim Holmlund)
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g EarlyReturnTest.java
- * @run driver EarlyReturnTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g EarlyReturnTest.java
+ * @run driver EarlyReturnTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/EnumTest.java b/jdk/test/com/sun/jdi/EnumTest.java
index 660479b5a36..324f335b90f 100644
--- a/jdk/test/com/sun/jdi/EnumTest.java
+++ b/jdk/test/com/sun/jdi/EnumTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4728816
- * @summary JPDA: Add support for enums
+ * @test
+ * @bug 4728816
+ * @summary JPDA: Add support for enums
+ * @author jjh
*
- * @author jjh
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g EnumTest.java
- * @run driver EnumTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g EnumTest.java
+ * @run driver EnumTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/EventQueueDisconnectTest.java b/jdk/test/com/sun/jdi/EventQueueDisconnectTest.java
index 397373c451c..c050cb792eb 100644
--- a/jdk/test/com/sun/jdi/EventQueueDisconnectTest.java
+++ b/jdk/test/com/sun/jdi/EventQueueDisconnectTest.java
@@ -22,21 +22,20 @@
*/
/**
- * @test
- * @bug 4425852
- * @author Robert Field
+ * @test
+ * @bug 4425852
+ * @author Robert Field
*
- * @modules jdk.jdi
- * @run build VMConnection
- * @run compile -g EventQueueDisconnectTest.java
- * @run driver EventQueueDisconnectTest
- *
- * @summary EventQueueDisconnectTest checks to see that
- * VMDisconnectedException is never thrown before VMDisconnectEvent.
+ * @summary EventQueueDisconnectTest checks to see that
+ * VMDisconnectedException is never thrown before VMDisconnectEvent.
*
* Failure mode for this test is throwing VMDisconnectedException
* on vm.eventQueue().remove();
* Does not use a scaffold since we don't want that hiding the exception.
+ *
+ * @run build VMConnection
+ * @run compile -g EventQueueDisconnectTest.java
+ * @run driver EventQueueDisconnectTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/ExceptionEvents.java b/jdk/test/com/sun/jdi/ExceptionEvents.java
index 8835c4603f6..18015a9c71d 100644
--- a/jdk/test/com/sun/jdi/ExceptionEvents.java
+++ b/jdk/test/com/sun/jdi/ExceptionEvents.java
@@ -22,43 +22,41 @@
*/
/**
- * @test
- * @bug 4407397
- * @summary Test the requesting of exception events
+ * @test
+ * @bug 4407397
+ * @key intermittent
+ * @summary Test the requesting of exception events
+ * @author Robert Field
*
- * @author Robert Field
+ * @run build TestScaffold VMConnection
+ * @run compile -g ExceptionEvents.java
*
- * @key intermittent
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection
- * @run compile -g ExceptionEvents.java
- *
- * @run driver ExceptionEvents N A StackOverflowCaughtTarg java.lang.Exception
- * @run driver ExceptionEvents C A StackOverflowCaughtTarg null
- * @run driver ExceptionEvents C A StackOverflowCaughtTarg java.lang.Error
- * @run driver ExceptionEvents C A StackOverflowCaughtTarg java.lang.StackOverflowError
- * @run driver ExceptionEvents N A StackOverflowCaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents N A StackOverflowCaughtTarg java.lang.Exception
+ * @run driver ExceptionEvents C A StackOverflowCaughtTarg null
+ * @run driver ExceptionEvents C A StackOverflowCaughtTarg java.lang.Error
+ * @run driver ExceptionEvents C A StackOverflowCaughtTarg java.lang.StackOverflowError
+ * @run driver ExceptionEvents N A StackOverflowCaughtTarg java.lang.NullPointerException
- * @run driver ExceptionEvents N T StackOverflowCaughtTarg java.lang.Exception
- * @run driver ExceptionEvents C T StackOverflowCaughtTarg null
- * @run driver ExceptionEvents C T StackOverflowCaughtTarg java.lang.Error
- * @run driver ExceptionEvents C T StackOverflowCaughtTarg java.lang.StackOverflowError
- * @run driver ExceptionEvents N T StackOverflowCaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents N T StackOverflowCaughtTarg java.lang.Exception
+ * @run driver ExceptionEvents C T StackOverflowCaughtTarg null
+ * @run driver ExceptionEvents C T StackOverflowCaughtTarg java.lang.Error
+ * @run driver ExceptionEvents C T StackOverflowCaughtTarg java.lang.StackOverflowError
+ * @run driver ExceptionEvents N T StackOverflowCaughtTarg java.lang.NullPointerException
- * @run driver ExceptionEvents N N StackOverflowCaughtTarg java.lang.Exception
- * @run driver ExceptionEvents C N StackOverflowCaughtTarg null
- * @run driver ExceptionEvents C N StackOverflowCaughtTarg java.lang.Error
- * @run driver ExceptionEvents C N StackOverflowCaughtTarg java.lang.StackOverflowError
- * @run driver ExceptionEvents N N StackOverflowCaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents N N StackOverflowCaughtTarg java.lang.Exception
+ * @run driver ExceptionEvents C N StackOverflowCaughtTarg null
+ * @run driver ExceptionEvents C N StackOverflowCaughtTarg java.lang.Error
+ * @run driver ExceptionEvents C N StackOverflowCaughtTarg java.lang.StackOverflowError
+ * @run driver ExceptionEvents N N StackOverflowCaughtTarg java.lang.NullPointerException
- * @run driver ExceptionEvents N A StackOverflowUncaughtTarg java.lang.Exception
- * @run driver ExceptionEvents U A StackOverflowUncaughtTarg null
- * @run driver ExceptionEvents U A StackOverflowUncaughtTarg java.lang.Error
- * @run driver ExceptionEvents U A StackOverflowUncaughtTarg java.lang.StackOverflowError
- * @run driver ExceptionEvents N A StackOverflowUncaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents N A StackOverflowUncaughtTarg java.lang.Exception
+ * @run driver ExceptionEvents U A StackOverflowUncaughtTarg null
+ * @run driver ExceptionEvents U A StackOverflowUncaughtTarg java.lang.Error
+ * @run driver ExceptionEvents U A StackOverflowUncaughtTarg java.lang.StackOverflowError
+ * @run driver ExceptionEvents N A StackOverflowUncaughtTarg java.lang.NullPointerException
- * @run driver ExceptionEvents N T StackOverflowUncaughtTarg java.lang.NullPointerException
- * @run driver ExceptionEvents N N StackOverflowUncaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents N T StackOverflowUncaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents N N StackOverflowUncaughtTarg java.lang.NullPointerException
*/
import com.sun.jdi.*;
diff --git a/jdk/test/com/sun/jdi/ExpiredRequestDeletionTest.java b/jdk/test/com/sun/jdi/ExpiredRequestDeletionTest.java
index d8a30da9c64..f3c60121f44 100644
--- a/jdk/test/com/sun/jdi/ExpiredRequestDeletionTest.java
+++ b/jdk/test/com/sun/jdi/ExpiredRequestDeletionTest.java
@@ -22,17 +22,16 @@
*/
/**
- * @test
- * @bug 4453310
- * @summary Test the deletion of event requests that are expired
- * by virtue of addCountFilter.
+ * @test
+ * @bug 4453310
+ * @summary Test the deletion of event requests that are expired
+ * by virtue of addCountFilter.
*
- * @author Robert Field
+ * @author Robert Field
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g ExpiredRequestDeletionTest.java
- * @run driver ExpiredRequestDeletionTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g ExpiredRequestDeletionTest.java
+ * @run driver ExpiredRequestDeletionTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/FieldWatchpoints.java b/jdk/test/com/sun/jdi/FieldWatchpoints.java
index a465e9c63c6..60ee1018021 100644
--- a/jdk/test/com/sun/jdi/FieldWatchpoints.java
+++ b/jdk/test/com/sun/jdi/FieldWatchpoints.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4408582
- * @summary Test fix for: JDWP: WatchpointEvents outside of class filtered out
+ * @test
+ * @bug 4408582
+ * @summary Test fix for: JDWP: WatchpointEvents outside of class filtered out
+ * @author Tim Bell
*
- * @author Tim Bell
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g FieldWatchpoints.java
- * @run driver FieldWatchpoints
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g FieldWatchpoints.java
+ * @run driver FieldWatchpoints
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/FilterMatch.java b/jdk/test/com/sun/jdi/FilterMatch.java
index 478ec77f04a..07217583540 100644
--- a/jdk/test/com/sun/jdi/FilterMatch.java
+++ b/jdk/test/com/sun/jdi/FilterMatch.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4331522
- * @summary addClassFilter("Foo") acts like "Foo*"
+ * @test
+ * @bug 4331522
+ * @summary addClassFilter("Foo") acts like "Foo*"
+ * @author Robert Field/Jim Holmlund
*
- * @author Robert Field/Jim Holmlund
- *
- * @modules jdk.jdi
- * @run build JDIScaffold VMConnection
- * @run compile -g HelloWorld.java
- * @run driver FilterMatch
+ * @run build JDIScaffold VMConnection
+ * @run compile -g HelloWorld.java
+ * @run driver FilterMatch
*/
/* Look at patternMatch in JDK file:
diff --git a/jdk/test/com/sun/jdi/FilterNoMatch.java b/jdk/test/com/sun/jdi/FilterNoMatch.java
index 1c3d6b81656..bf823aba603 100644
--- a/jdk/test/com/sun/jdi/FilterNoMatch.java
+++ b/jdk/test/com/sun/jdi/FilterNoMatch.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4331522
- * @summary addClassFilter("Foo") acts like "Foo*"
+ * @test
+ * @bug 4331522
+ * @summary addClassFilter("Foo") acts like "Foo*"
+ * @author Robert Field/Jim Holmlund
*
- * @author Robert Field/Jim Holmlund
- *
- * @modules jdk.jdi
- * @run build JDIScaffold VMConnection
- * @run compile -g HelloWorld.java
- * @run driver FilterNoMatch
+ * @run build JDIScaffold VMConnection
+ * @run compile -g HelloWorld.java
+ * @run driver FilterNoMatch
*/
/* This tests the patternMatch function in JDK file:
diff --git a/jdk/test/com/sun/jdi/FinalLocalsTest.java b/jdk/test/com/sun/jdi/FinalLocalsTest.java
index f8e8deb39de..a76ee82f69a 100644
--- a/jdk/test/com/sun/jdi/FinalLocalsTest.java
+++ b/jdk/test/com/sun/jdi/FinalLocalsTest.java
@@ -22,18 +22,16 @@
*/
/**
- * @test
- * @bug 4326648 4768329
- * @summary Test to verify that table entries are generated for all final
- * locals when a class is built for debug, even if they could be
- * inlined otherwise.
+ * @test
+ * @bug 4326648 4768329
+ * @summary Test to verify that table entries are generated for all final
+ * locals when a class is built for debug, even if they could be
+ * inlined otherwise.
+ * @author Tim Bell
*
- * @author Tim Bell
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g FinalLocalsTest.java
- * @run driver FinalLocalsTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g FinalLocalsTest.java
+ * @run driver FinalLocalsTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/FinalizerTest.java b/jdk/test/com/sun/jdi/FinalizerTest.java
index 6ac34c7894f..1163607b133 100644
--- a/jdk/test/com/sun/jdi/FinalizerTest.java
+++ b/jdk/test/com/sun/jdi/FinalizerTest.java
@@ -22,16 +22,15 @@
*/
/**
- * @test
- * @bug 4272800 4274208 4392010
- * @summary Test debugger operations in finalize() methods
- * @author Gordon Hirsch (modified for HotSpot by tbell & rfield)
+ * @test
+ * @bug 4272800 4274208 4392010
+ * @summary Test debugger operations in finalize() methods
+ * @author Gordon Hirsch (modified for HotSpot by tbell & rfield)
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g FinalizerTest.java
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g FinalizerTest.java
*
- * @run driver FinalizerTest
+ * @run driver FinalizerTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/FramesTest.java b/jdk/test/com/sun/jdi/FramesTest.java
index 88065b8ea9d..b60e7253e47 100644
--- a/jdk/test/com/sun/jdi/FramesTest.java
+++ b/jdk/test/com/sun/jdi/FramesTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4434232
- * @summary Test ThreadReference.frames(int,int)
+ * @test
+ * @bug 4434232
+ * @summary Test ThreadReference.frames(int,int)
+ * @author Robert Field
*
- * @author Robert Field
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g FramesTest.java
- * @run driver FramesTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g FramesTest.java
+ * @run driver FramesTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/GenericsTest.java b/jdk/test/com/sun/jdi/GenericsTest.java
index 375839a37d3..28a3d69a8d6 100644
--- a/jdk/test/com/sun/jdi/GenericsTest.java
+++ b/jdk/test/com/sun/jdi/GenericsTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4421040
- * @summary JPDA: Add support for JSR-014 Generics
+ * @test
+ * @bug 4421040
+ * @summary JPDA: Add support for JSR-014 Generics
+ * @author jjh
*
- * @author jjh
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g GenericsTest.java
- * @run driver GenericsTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g GenericsTest.java
+ * @run driver GenericsTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/GetLocalVariables2Test.java b/jdk/test/com/sun/jdi/GetLocalVariables2Test.java
index 65029676bcc..422471501f2 100644
--- a/jdk/test/com/sun/jdi/GetLocalVariables2Test.java
+++ b/jdk/test/com/sun/jdi/GetLocalVariables2Test.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4349534 4690242 4695338
- * @summary regression - bad LocalVariableTable attribute when no initialization needed
+ * @test
+ * @bug 4349534 4690242 4695338
+ * @summary regression - bad LocalVariableTable attribute when no initialization needed
+ * @author Tim Bell
*
- * @author Tim Bell
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g GetLocalVariables2Test.java
- * @run driver GetLocalVariables2Test
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g GetLocalVariables2Test.java
+ * @run driver GetLocalVariables2Test
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/GetUninitializedStringValue.java b/jdk/test/com/sun/jdi/GetUninitializedStringValue.java
index 66bec8e876d..eb9ae7251c4 100644
--- a/jdk/test/com/sun/jdi/GetUninitializedStringValue.java
+++ b/jdk/test/com/sun/jdi/GetUninitializedStringValue.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 8021897
- * @summary Test getting the value for an uninitialized String object
+ * @test
+ * @bug 8021897
+ * @summary Test getting the value for an uninitialized String object
+ * @author Staffan Larsen
*
- * @author Staffan Larsen
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g GetUninitializedStringValue.java
- * @run driver GetUninitializedStringValue
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g GetUninitializedStringValue.java
+ * @run driver GetUninitializedStringValue
*/
import com.sun.jdi.ReferenceType;
import com.sun.jdi.StackFrame;
diff --git a/jdk/test/com/sun/jdi/HomeTest.java b/jdk/test/com/sun/jdi/HomeTest.java
index dcc23a013ea..d2905fd0ead 100644
--- a/jdk/test/com/sun/jdi/HomeTest.java
+++ b/jdk/test/com/sun/jdi/HomeTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4446294
- * @summary JDI spec/impl: default "home" for CommandLineLaunch isn't java.home
+ * @test
+ * @bug 4446294
+ * @summary JDI spec/impl: default "home" for CommandLineLaunch isn't java.home
+ * @author Tim Bell (based on "HomeTest.java" by Eugene I. Latkin)
*
- * @author Tim Bell (based on "HomeTest.java" by Eugene I. Latkin)
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g HomeTest.java
- * @run driver HomeTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g HomeTest.java
+ * @run driver HomeTest
*/
import com.sun.jdi.*;
import com.sun.jdi.connect.*;
diff --git a/jdk/test/com/sun/jdi/ImmutableResourceTest.sh b/jdk/test/com/sun/jdi/ImmutableResourceTest.sh
index 133925e4b19..b8b37f7e623 100644
--- a/jdk/test/com/sun/jdi/ImmutableResourceTest.sh
+++ b/jdk/test/com/sun/jdi/ImmutableResourceTest.sh
@@ -21,13 +21,15 @@
# questions.
#
-# @test
-# @bug 6287579
-# @summary SubClasses of ListResourceBundle should fix getContents()
-# @author Tim Bell
#
-# @run shell ImmutableResourceTest.sh
+# @test
+# @bug 6287579
+# @summary SubClasses of ListResourceBundle should fix getContents()
+# @author Tim Bell
#
+# @modules jdk.jdi/com.sun.tools.example.debug.tty
+#
+# @run shell ImmutableResourceTest.sh
#
# Beginning of subroutines:
diff --git a/jdk/test/com/sun/jdi/InstanceFilter.java b/jdk/test/com/sun/jdi/InstanceFilter.java
index 43cfeddaab0..9514779cf5b 100644
--- a/jdk/test/com/sun/jdi/InstanceFilter.java
+++ b/jdk/test/com/sun/jdi/InstanceFilter.java
@@ -22,17 +22,15 @@
*/
/**
- * @test
- * @bug 4312961
- * @summary Verify that an instance filter on a MethodEntryRequest works
- * properly.
+ * @test
+ * @bug 4312961
+ * @summary Verify that an instance filter on a MethodEntryRequest works
+ * properly.
+ * @author Robert Field/Jim Holmlund
*
- * @author Robert Field/Jim Holmlund
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetAdapter TargetListener
- * @run compile -g InstanceFilter.java
- * @run driver InstanceFilter
+ * @run build TestScaffold VMConnection TargetAdapter TargetListener
+ * @run compile -g InstanceFilter.java
+ * @run driver InstanceFilter
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/InstancesTest.java b/jdk/test/com/sun/jdi/InstancesTest.java
index 6f5cbb4c98d..9ef725794c9 100644
--- a/jdk/test/com/sun/jdi/InstancesTest.java
+++ b/jdk/test/com/sun/jdi/InstancesTest.java
@@ -22,15 +22,14 @@
*/
/**
- * @test
- * @bug 5024119
- * @summary Add ReferenceType.getAllInstances () method to JDI.
- * @author jjh
+ * @test
+ * @bug 5024119
+ * @summary Add ReferenceType.getAllInstances () method to JDI.
+ * @author jjh
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g InstancesTest.java
- * @run driver InstancesTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g InstancesTest.java
+ * @run driver InstancesTest
*/
/*
diff --git a/jdk/test/com/sun/jdi/InterfaceMethodsTest.java b/jdk/test/com/sun/jdi/InterfaceMethodsTest.java
index 953893b0d8a..163235b42e2 100644
--- a/jdk/test/com/sun/jdi/InterfaceMethodsTest.java
+++ b/jdk/test/com/sun/jdi/InterfaceMethodsTest.java
@@ -22,16 +22,15 @@
*/
/**
- * @test
- * @bug 8031195
- * @bug 8071657
- * @bug 8165827
- * @summary JDI: Add support for static, private and default methods in interfaces
+ * @test
+ * @bug 8031195
+ * @bug 8071657
+ * @bug 8165827
+ * @summary JDI: Add support for static, private and default methods in interfaces
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run build InterfaceMethodsTest
- * @run driver InterfaceMethodsTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run build InterfaceMethodsTest
+ * @run driver InterfaceMethodsTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/InterruptHangTest.java b/jdk/test/com/sun/jdi/InterruptHangTest.java
index 0e7a24ab785..b93bff7ad8d 100644
--- a/jdk/test/com/sun/jdi/InterruptHangTest.java
+++ b/jdk/test/com/sun/jdi/InterruptHangTest.java
@@ -26,16 +26,14 @@ import com.sun.jdi.event.*;
import com.sun.jdi.request.*;
/**
- * @test
- * @bug 6459476
- * @summary Debuggee is blocked, looks like running
+ * @test
+ * @bug 6459476
+ * @summary Debuggee is blocked, looks like running
+ * @author jjh
*
- * @author jjh
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g InterruptHangTest.java
- * @run driver InterruptHangTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g InterruptHangTest.java
+ * @run driver InterruptHangTest
*/
/**
diff --git a/jdk/test/com/sun/jdi/InvokeHangTest.java b/jdk/test/com/sun/jdi/InvokeHangTest.java
index 56ccbc23677..528a25c62c6 100644
--- a/jdk/test/com/sun/jdi/InvokeHangTest.java
+++ b/jdk/test/com/sun/jdi/InvokeHangTest.java
@@ -22,17 +22,18 @@
*/
/**
- * @test
- * @bug 6293795
- * @summary Backend hangs when invokeMethod is called from a JDI eventHandler
+ * @test
+ * @bug 6293795
+ * @summary Backend hangs when invokeMethod is called from a JDI eventHandler
+ * @author jjh
*
- * @author jjh
+ * @library /test/lib
+ * @modules java.management
+ * jdk.jdi
*
- * @modules jdk.jdi
- * @library /test/lib
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g InvokeHangTest.java
- * @run driver InvokeHangTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g InvokeHangTest.java
+ * @run driver InvokeHangTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/InvokeTest.java b/jdk/test/com/sun/jdi/InvokeTest.java
index 09fcc775e86..bacfc38bf91 100644
--- a/jdk/test/com/sun/jdi/InvokeTest.java
+++ b/jdk/test/com/sun/jdi/InvokeTest.java
@@ -22,17 +22,16 @@
*/
/**
- * @test
- * @bug 4451941 4527072
- * @summary Test argument types for invoke
+ * @test
+ * @bug 4451941 4527072
+ * @summary Test argument types for invoke
+ * @author Robert Field
*
- * @author Robert Field
+ * @library ..
*
- * @library ..
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g InvokeTest.java
- * @run driver InvokeTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g InvokeTest.java
+ * @run driver InvokeTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/JITDebug.sh b/jdk/test/com/sun/jdi/JITDebug.sh
index 0f8378618a9..21ac8d9f27b 100644
--- a/jdk/test/com/sun/jdi/JITDebug.sh
+++ b/jdk/test/com/sun/jdi/JITDebug.sh
@@ -24,17 +24,16 @@
#
#
-# @test JITDebug.sh 1.7 03/09/05
-# @bug 4291701 4376819 4422312 4522770 4913748
-# @summary Test JIT debugging - assure that launching on
-# uncaught exception works
-# @author Tim Bell
-# Based on test/java/awt/TEMPLATE/AutomaticShellTest.sh
+# @test JITDebug.sh 1.7 03/09/05
+# @bug 4291701 4376819 4422312 4522770 4913748
+# @summary Test JIT debugging - assure that launching on
+# uncaught exception works
+# @author Tim Bell
+# Based on test/java/awt/TEMPLATE/AutomaticShellTest.sh
#
-# @modules jdk.jdi
-# @run build TestScaffold VMConnection TargetListener TargetAdapter
-# @run compile -g JITDebug.java
-# @run shell JITDebug.sh
+# @run build TestScaffold VMConnection TargetListener TargetAdapter
+# @run compile -g JITDebug.java
+# @run shell JITDebug.sh
# Beginning of subroutines:
status=1
diff --git a/jdk/test/com/sun/jdi/Java_gTest.java b/jdk/test/com/sun/jdi/Java_gTest.java
index 5d4c811e465..a87da73eea9 100644
--- a/jdk/test/com/sun/jdi/Java_gTest.java
+++ b/jdk/test/com/sun/jdi/Java_gTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4500906 4433599 4740097
- * @summary vmexec= debug java fails for SunCommandLineLauncher
+ * @test
+ * @bug 4500906 4433599 4740097
+ * @summary vmexec= debug java fails for SunCommandLineLauncher
+ * @author jjh
*
- * @author jjh
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g Java_gTest.java
- * @run driver Java_gTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g Java_gTest.java
+ * @run driver Java_gTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/LambdaStepTest.java b/jdk/test/com/sun/jdi/LambdaStepTest.java
index 2b594f83997..a5fd06a6ebd 100644
--- a/jdk/test/com/sun/jdi/LambdaStepTest.java
+++ b/jdk/test/com/sun/jdi/LambdaStepTest.java
@@ -22,15 +22,13 @@
*/
/**
- * @test
- * @summary Test stepping through lambdas
+ * @test
+ * @summary Test stepping through lambdas
+ * @author Staffan Larsen
*
- * @author Staffan Larsen
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g LambdaStepTest.java
- * @run driver LambdaStepTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g LambdaStepTest.java
+ * @run driver LambdaStepTest
*/
import com.sun.jdi.LocalVariable;
import com.sun.jdi.ObjectReference;
diff --git a/jdk/test/com/sun/jdi/LaunchCommandLine.java b/jdk/test/com/sun/jdi/LaunchCommandLine.java
index 3a55a5ce66d..e75a5bc982d 100644
--- a/jdk/test/com/sun/jdi/LaunchCommandLine.java
+++ b/jdk/test/com/sun/jdi/LaunchCommandLine.java
@@ -22,17 +22,16 @@
*/
/**
- * @test
- * @bug 4245011
- * @summary Test launcher command line construction
- * @author Gordon Hirsch
+ * @test
+ * @bug 4245011
+ * @summary Test launcher command line construction
+ * @author Gordon Hirsch
*
- * @modules jdk.jdi
- * @run build JDIScaffold VMConnection
- * @run compile -g HelloWorld.java
- * @run build LaunchCommandLine
+ * @run build JDIScaffold VMConnection
+ * @run compile -g HelloWorld.java
+ * @run build LaunchCommandLine
*
- * @run driver LaunchCommandLine
+ * @run driver LaunchCommandLine
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/LineNumberInfo.java b/jdk/test/com/sun/jdi/LineNumberInfo.java
index 5b7ff743efa..5172dc16154 100644
--- a/jdk/test/com/sun/jdi/LineNumberInfo.java
+++ b/jdk/test/com/sun/jdi/LineNumberInfo.java
@@ -27,7 +27,6 @@
* @summary Test javac regressions in the generation of line number info
* @author Gordon Hirsch
*
- * @modules jdk.jdi
* @run build TestScaffold VMConnection TargetListener TargetAdapter
* @run compile -XDstringConcat=inline -g LineNumberInfo.java ControlFlow.java
*
diff --git a/jdk/test/com/sun/jdi/ListenAddress.java b/jdk/test/com/sun/jdi/ListenAddress.java
index 25613905141..46ec16a263c 100644
--- a/jdk/test/com/sun/jdi/ListenAddress.java
+++ b/jdk/test/com/sun/jdi/ListenAddress.java
@@ -26,7 +26,6 @@
* @summary Test that startListening(Map) method of the com.sun.jdi.SocketListen
* Connector returns an address that is usable for the address option on
* remove debuggees.
- * @modules jdk.jdi
*/
import java.net.InetAddress;
import java.net.Inet4Address;
diff --git a/jdk/test/com/sun/jdi/LocalVariableEqual.java b/jdk/test/com/sun/jdi/LocalVariableEqual.java
index ed3ef665fc1..7663bfaad0e 100644
--- a/jdk/test/com/sun/jdi/LocalVariableEqual.java
+++ b/jdk/test/com/sun/jdi/LocalVariableEqual.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4916263
- * @summary Test
+ * @test
+ * @bug 4916263
+ * @summary Test
+ * @author Serguei Spitsyn
*
- * @author Serguei Spitsyn
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g LocalVariableEqual.java
- * @run driver LocalVariableEqual
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g LocalVariableEqual.java
+ * @run driver LocalVariableEqual
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/LocationTest.java b/jdk/test/com/sun/jdi/LocationTest.java
index 52a34e29658..64b91a660cd 100644
--- a/jdk/test/com/sun/jdi/LocationTest.java
+++ b/jdk/test/com/sun/jdi/LocationTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4419453
- * @summary Test that Method.location() returns the right values
+ * @test
+ * @bug 4419453
+ * @summary Test that Method.location() returns the right values
+ * @author Robert Field
*
- * @author Robert Field
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g LocationTest.java
- * @run driver LocationTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g LocationTest.java
+ * @run driver LocationTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/MethodEntryExitEvents.java b/jdk/test/com/sun/jdi/MethodEntryExitEvents.java
index 174505f399d..5901546614b 100644
--- a/jdk/test/com/sun/jdi/MethodEntryExitEvents.java
+++ b/jdk/test/com/sun/jdi/MethodEntryExitEvents.java
@@ -22,17 +22,16 @@
*/
/**
- * @test
- * @bug 4409241 4432820
- * @summary Test the bug fix for: MethodExitEvents disappear when Object-Methods are called from main
- * @author Tim Bell
+ * @test
+ * @bug 4409241 4432820
+ * @summary Test the bug fix for: MethodExitEvents disappear when Object-Methods are called from main
+ * @author Tim Bell
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g MethodEntryExitEvents.java
- * @run driver MethodEntryExitEvents SUSPEND_EVENT_THREAD MethodEntryExitEventsDebugee
- * @run driver MethodEntryExitEvents SUSPEND_NONE MethodEntryExitEventsDebugee
- * @run driver MethodEntryExitEvents SUSPEND_ALL MethodEntryExitEventsDebugee
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g MethodEntryExitEvents.java
+ * @run driver MethodEntryExitEvents SUSPEND_EVENT_THREAD MethodEntryExitEventsDebugee
+ * @run driver MethodEntryExitEvents SUSPEND_NONE MethodEntryExitEventsDebugee
+ * @run driver MethodEntryExitEvents SUSPEND_ALL MethodEntryExitEventsDebugee
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java b/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java
index d9131b00b00..9f55258ce04 100644
--- a/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java
+++ b/jdk/test/com/sun/jdi/MethodExitReturnValuesTest.java
@@ -22,15 +22,14 @@
*/
/**
- * @test
- * @bug 4195445 6204179
- * @summary JDWP, JDI: Add return value to Method Exit Event
- * @author Jim Holmlund
+ * @test
+ * @bug 4195445 6204179
+ * @summary JDWP, JDI: Add return value to Method Exit Event
+ * @author Jim Holmlund
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g MethodExitReturnValuesTest.java
- * @run driver MethodExitReturnValuesTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g MethodExitReturnValuesTest.java
+ * @run driver MethodExitReturnValuesTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/MixedSuspendTest.sh b/jdk/test/com/sun/jdi/MixedSuspendTest.sh
index e18b20bd120..00f5f5dec56 100644
--- a/jdk/test/com/sun/jdi/MixedSuspendTest.sh
+++ b/jdk/test/com/sun/jdi/MixedSuspendTest.sh
@@ -23,16 +23,14 @@
# questions.
#
-# @test
-# @bug 6224859
-# @summary JDWP: Mixing application suspends and debugger suspends can cause hangs
-#
-# @author Jim Holmlund
-#
-# @key intermittent
-# @modules jdk.jdi
-# @run build TestScaffold VMConnection TargetListener TargetAdapter
-# @run shell MixedSuspendTest.sh
+# @test
+# @bug 6224859
+# @key intermittent
+# @summary JDWP: Mixing application suspends and debugger suspends can cause hangs
+# @author Jim Holmlund
+#
+# @run build TestScaffold VMConnection TargetListener TargetAdapter
+# @run shell MixedSuspendTest.sh
classname=MixedSuspendTarg
@@ -84,7 +82,7 @@ public class $classname extends Thread {
int i = 0;
}
}
-
+
System.out.println("Debuggee: end of thread");
}
@@ -113,7 +111,7 @@ mysetup()
for ii in . $TESTSRC $TESTSRC/.. ; do
if [ -r "$ii/ShellScaffold.sh" ] ; then
- . $ii/ShellScaffold.sh
+ . $ii/ShellScaffold.sh
break
fi
done
diff --git a/jdk/test/com/sun/jdi/ModificationWatchpoints.java b/jdk/test/com/sun/jdi/ModificationWatchpoints.java
index 482f8b78ef9..48f259eb4a6 100644
--- a/jdk/test/com/sun/jdi/ModificationWatchpoints.java
+++ b/jdk/test/com/sun/jdi/ModificationWatchpoints.java
@@ -22,17 +22,15 @@
*/
/**
- * @test
- * @bug 4409582
- * @summary Test all info returned by modification watchpoints
+ * @test
+ * @bug 4409582
+ * @summary Test all info returned by modification watchpoints
+ * @author Daniel Prusa (or someone in the FFJ group)
+ * @author Robert Field (modified to JDIScaffold)
*
- * @author Daniel Prusa (or someone in the FFJ group)
- * @author Robert Field (modified to JDIScaffold)
- *
- * @modules jdk.jdi
- * @run build JDIScaffold VMConnection
- * @run compile -g ModificationWatchpoints.java
- * @run driver ModificationWatchpoints
+ * @run build JDIScaffold VMConnection
+ * @run compile -g ModificationWatchpoints.java
+ * @run driver ModificationWatchpoints
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/ModulesTest.java b/jdk/test/com/sun/jdi/ModulesTest.java
index 359293f6297..e3495af74fd 100644
--- a/jdk/test/com/sun/jdi/ModulesTest.java
+++ b/jdk/test/com/sun/jdi/ModulesTest.java
@@ -22,14 +22,13 @@
*/
/**
- * @test
- * @bug 8049365
- * @summary Tests the JDI and JDWP update for modules
+ * @test
+ * @bug 8049365
+ * @summary Tests the JDI and JDWP update for modules
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g ModulesTest.java
- * @run driver ModulesTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g ModulesTest.java
+ * @run driver ModulesTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/MonitorEventTest.java b/jdk/test/com/sun/jdi/MonitorEventTest.java
index 8f33071dc3e..d8e10b21cfd 100644
--- a/jdk/test/com/sun/jdi/MonitorEventTest.java
+++ b/jdk/test/com/sun/jdi/MonitorEventTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4401399
- * @summary Simple basic test of jdi Monitor request and event.
+ * @test
+ * @bug 4401399
+ * @summary Simple basic test of jdi Monitor request and event.
+ * @author Swamy Venkataramanappa
*
- * @author Swamy Venkataramanappa
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g MonitorEventTest.java
- * @run driver MonitorEventTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g MonitorEventTest.java
+ * @run driver MonitorEventTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/MonitorFrameInfo.java b/jdk/test/com/sun/jdi/MonitorFrameInfo.java
index 420170644c5..796039c93e4 100644
--- a/jdk/test/com/sun/jdi/MonitorFrameInfo.java
+++ b/jdk/test/com/sun/jdi/MonitorFrameInfo.java
@@ -22,17 +22,16 @@
*/
/**
- * @test
- * @bug 6230699
- * @summary Test ThreadReference.ownedMonitorsAndFrames()
- * @bug 6701700
- * @summary MonitorInfo objects aren't invalidated when the owning thread is resumed
- * @author Swamy Venkataramanappa
+ * @test
+ * @bug 6230699
+ * @summary Test ThreadReference.ownedMonitorsAndFrames()
+ * @bug 6701700
+ * @summary MonitorInfo objects aren't invalidated when the owning thread is resumed
+ * @author Swamy Venkataramanappa
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g MonitorFrameInfo.java
- * @run driver MonitorFrameInfo
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g MonitorFrameInfo.java
+ * @run driver MonitorFrameInfo
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/MultiBreakpointsTest.java b/jdk/test/com/sun/jdi/MultiBreakpointsTest.java
index eda894ee470..0d007cd410d 100644
--- a/jdk/test/com/sun/jdi/MultiBreakpointsTest.java
+++ b/jdk/test/com/sun/jdi/MultiBreakpointsTest.java
@@ -23,16 +23,14 @@
/**
- * @test
- * @bug 4359247
- * @summary Breakpoints on multiple threads have problems.
+ * @test
+ * @bug 4359247
+ * @summary Breakpoints on multiple threads have problems.
+ * @author tbell, jjh
*
- * @author tbell, jjh
- *
- * @modules jdk.jdi
- * @build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g MultiBreakpointsTest.java
- * @run driver MultiBreakpointsTest
+ * @build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g MultiBreakpointsTest.java
+ * @run driver MultiBreakpointsTest
*/
/*
diff --git a/jdk/test/com/sun/jdi/NativeInstanceFilter.java b/jdk/test/com/sun/jdi/NativeInstanceFilter.java
index c14960860e1..04cb2acb4ec 100644
--- a/jdk/test/com/sun/jdi/NativeInstanceFilter.java
+++ b/jdk/test/com/sun/jdi/NativeInstanceFilter.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 6426034
- * @summary Instance filter doesn't filter event if it occurs in native method
+ * @test
+ * @bug 6426034
+ * @summary Instance filter doesn't filter event if it occurs in native method
+ * @author Keith McGuigan
*
- * @author Keith McGuigan
- *
- * @modules jdk.jdi
- * @run build JDIScaffold VMConnection
- * @compile -XDignore.symbol.file NativeInstanceFilterTarg.java
- * @run driver NativeInstanceFilter
+ * @run build JDIScaffold VMConnection
+ * @compile -XDignore.symbol.file NativeInstanceFilterTarg.java
+ * @run driver NativeInstanceFilter
*/
/*
diff --git a/jdk/test/com/sun/jdi/NewInstanceTest.java b/jdk/test/com/sun/jdi/NewInstanceTest.java
index 3950462cbd2..42069f17ef5 100644
--- a/jdk/test/com/sun/jdi/NewInstanceTest.java
+++ b/jdk/test/com/sun/jdi/NewInstanceTest.java
@@ -22,17 +22,15 @@
*/
/**
- * @test
- * @bug 4419450
- * @summary Test newInstance() for arrays - currently covers
- * only reference type arrays (see bug #4450091).
+ * @test
+ * @bug 4419450
+ * @summary Test newInstance() for arrays - currently covers
+ * only reference type arrays (see bug #4450091).
+ * @author Robert Field
*
- * @author Robert Field
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g NewInstanceTest.java
- * @run driver NewInstanceTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g NewInstanceTest.java
+ * @run driver NewInstanceTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/NoLaunchOptionTest.java b/jdk/test/com/sun/jdi/NoLaunchOptionTest.java
index fdaa4adc374..2927dd32ead 100644
--- a/jdk/test/com/sun/jdi/NoLaunchOptionTest.java
+++ b/jdk/test/com/sun/jdi/NoLaunchOptionTest.java
@@ -30,8 +30,9 @@ import jdk.testlibrary.ProcessTools;
* @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
diff --git a/jdk/test/com/sun/jdi/NoLocInfoTest.java b/jdk/test/com/sun/jdi/NoLocInfoTest.java
index 71263c2fc39..4bb75bbc6a8 100644
--- a/jdk/test/com/sun/jdi/NoLocInfoTest.java
+++ b/jdk/test/com/sun/jdi/NoLocInfoTest.java
@@ -22,17 +22,15 @@
*/
/**
- * @test
- * @bug 4642611
- * @summary Test that method.allLineLocations() should
- * throw AbsentInformationException exception
+ * @test
+ * @bug 4642611
+ * @summary Test that method.allLineLocations() should
+ * throw AbsentInformationException exception
+ * @author Serguei Spitsyn
*
- * @author Serguei Spitsyn
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g:none NoLocInfoTest.java
- * @run driver NoLocInfoTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g:none NoLocInfoTest.java
+ * @run driver NoLocInfoTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/NullThreadGroupNameTest.java b/jdk/test/com/sun/jdi/NullThreadGroupNameTest.java
index 2afad2121cb..66f576fed2c 100644
--- a/jdk/test/com/sun/jdi/NullThreadGroupNameTest.java
+++ b/jdk/test/com/sun/jdi/NullThreadGroupNameTest.java
@@ -22,13 +22,12 @@
*/
/**
- * @test
- * @bug 7105883
- * @summary Ensure that JDWP doesn't crash with a null thread group name
+ * @test
+ * @bug 7105883
+ * @summary Ensure that JDWP doesn't crash with a null thread group name
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run driver NullThreadGroupNameTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run driver NullThreadGroupNameTest
*/
import com.sun.jdi.*;
import com.sun.jdi.connect.*;
diff --git a/jdk/test/com/sun/jdi/OnThrowTest.java b/jdk/test/com/sun/jdi/OnThrowTest.java
index ce9725663c6..a62970591ca 100644
--- a/jdk/test/com/sun/jdi/OnThrowTest.java
+++ b/jdk/test/com/sun/jdi/OnThrowTest.java
@@ -22,16 +22,15 @@
*/
/*
- * @test OnThrowTest.java
- * @bug 6263814
- * @summary Test for -agentlib::[onthrow,launch]
- * @author Kelly O'Hair
+ * @test OnThrowTest.java
+ * @bug 6263814
+ * @summary Test for -agentlib::[onthrow,launch]
+ * @author Kelly O'Hair
*
- * @modules jdk.jdi
- * @run compile -g OnThrowTest.java
- * @run compile -g OnThrowTarget.java
- * @run compile -g VMConnection.java
- * @run driver OnThrowTest
+ * @run compile -g OnThrowTest.java
+ * @run compile -g OnThrowTarget.java
+ * @run compile -g VMConnection.java
+ * @run driver OnThrowTest
*/
import java.io.File;
diff --git a/jdk/test/com/sun/jdi/OptionTest.java b/jdk/test/com/sun/jdi/OptionTest.java
index 967146c737f..9d7dbb2abe1 100644
--- a/jdk/test/com/sun/jdi/OptionTest.java
+++ b/jdk/test/com/sun/jdi/OptionTest.java
@@ -22,16 +22,15 @@
*/
/*
- * @test OptionTest
- * @bug 5095072
- * @summary Test for misc jdwp options, just that the option is parsed
- * @author Kelly O'Hair (copied from Tim Bell's NoLaunchOptionTest)
+ * @test OptionTest
+ * @bug 5095072
+ * @summary Test for misc jdwp options, just that the option is parsed
+ * @author Kelly O'Hair (copied from Tim Bell's NoLaunchOptionTest)
*
- * @modules jdk.jdi
- * @run compile -g OptionTest.java
- * @run compile -g HelloWorld.java
- * @run compile -g VMConnection.java
- * @run driver OptionTest
+ * @run compile -g OptionTest.java
+ * @run compile -g HelloWorld.java
+ * @run compile -g VMConnection.java
+ * @run driver OptionTest
*/
import java.net.ServerSocket;
diff --git a/jdk/test/com/sun/jdi/PopAndInvokeTest.java b/jdk/test/com/sun/jdi/PopAndInvokeTest.java
index 65cd5a5a0d4..7f265f937ee 100644
--- a/jdk/test/com/sun/jdi/PopAndInvokeTest.java
+++ b/jdk/test/com/sun/jdi/PopAndInvokeTest.java
@@ -22,17 +22,16 @@
*/
/**
- * @test
- * @bug 6517249
- * @modules jdk.jdi
- * @ignore 6951287
- * @summary JDWP: Cannot do an invokeMethod after a popFrames operation
+ * @test
+ * @bug 6517249
+ * @summary JDWP: Cannot do an invokeMethod after a popFrames operation
+ * @author jjh
*
- * @author jjh
+ * @ignore 6951287
*
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g PopAndInvokeTest.java
- * @run driver PopAndInvokeTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g PopAndInvokeTest.java
+ * @run driver PopAndInvokeTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/PopAsynchronousTest.java b/jdk/test/com/sun/jdi/PopAsynchronousTest.java
index 2adf47e7c56..203b5475c80 100644
--- a/jdk/test/com/sun/jdi/PopAsynchronousTest.java
+++ b/jdk/test/com/sun/jdi/PopAsynchronousTest.java
@@ -22,17 +22,15 @@
*/
/**
- * @test
- * @bug 4467564
- * @summary Test the popping of frames in an asynchronous context
- * (that is, when suspended by the debugger at random points)
+ * @test
+ * @bug 4467564
+ * @summary Test the popping of frames in an asynchronous context
+ * (that is, when suspended by the debugger at random points)
+ * @author Robert Field
*
- * @author Robert Field
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g PopAsynchronousTest.java
- * @run driver PopAsynchronousTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g PopAsynchronousTest.java
+ * @run driver PopAsynchronousTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/PopSynchronousTest.java b/jdk/test/com/sun/jdi/PopSynchronousTest.java
index 674e17e26c8..29809bfaabe 100644
--- a/jdk/test/com/sun/jdi/PopSynchronousTest.java
+++ b/jdk/test/com/sun/jdi/PopSynchronousTest.java
@@ -22,17 +22,15 @@
*/
/**
- * @test
- * @bug 4467564
- * @summary Test the popping of frames in synchronous context
- * (that is, when stopped at an event)
+ * @test
+ * @bug 4467564
+ * @summary Test the popping of frames in synchronous context
+ * (that is, when stopped at an event)
+ * @author Robert Field
*
- * @author Robert Field
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g PopSynchronousTest.java
- * @run driver PopSynchronousTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g PopSynchronousTest.java
+ * @run driver PopSynchronousTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/RedefineCrossEvent.java b/jdk/test/com/sun/jdi/RedefineCrossEvent.java
index 69f24b33b99..c61dd3cb92f 100644
--- a/jdk/test/com/sun/jdi/RedefineCrossEvent.java
+++ b/jdk/test/com/sun/jdi/RedefineCrossEvent.java
@@ -22,52 +22,52 @@
*/
/**
- * @test
- * @bug 4628726
- * @summary Test class redefinition at each event cross tested with other tests
+ * @test
+ * @bug 4628726
+ * @summary Test class redefinition at each event cross tested with other tests
+ * @author Robert Field
*
- * @author Robert Field
+ * @modules java.corba
+ * jdk.jdi
*
- * @modules java.corba
- * jdk.jdi
- * @run build TestScaffold VMConnection TargetAdapter TargetListener
- * @run compile -g AccessSpecifierTest.java
- * @run compile -g AfterThreadDeathTest.java
- * @run compile -g ArrayRangeTest.java
- * @run compile -g BacktraceFieldTest.java
- * @run compile -g ClassesByName2Test.java
- * @run compile -g DebuggerThreadTest.java
- * @run compile -g DeleteEventRequestsTest.java
- * @run compile -g ExceptionEvents.java
- * @run compile -g ExpiredRequestDeletionTest.java
- * @run compile -g FieldWatchpoints.java
- * @run build InstanceFilter
- * @run compile -g LocationTest.java
- * @run compile -g NewInstanceTest.java
- * @run compile -g PopSynchronousTest.java
- * @run compile -g RepStepTarg.java
- * @run compile -g RequestReflectionTest.java
+ * @run build TestScaffold VMConnection TargetAdapter TargetListener
+ * @run compile -g AccessSpecifierTest.java
+ * @run compile -g AfterThreadDeathTest.java
+ * @run compile -g ArrayRangeTest.java
+ * @run compile -g BacktraceFieldTest.java
+ * @run compile -g ClassesByName2Test.java
+ * @run compile -g DebuggerThreadTest.java
+ * @run compile -g DeleteEventRequestsTest.java
+ * @run compile -g ExceptionEvents.java
+ * @run compile -g ExpiredRequestDeletionTest.java
+ * @run compile -g FieldWatchpoints.java
+ * @run build InstanceFilter
+ * @run compile -g LocationTest.java
+ * @run compile -g NewInstanceTest.java
+ * @run compile -g PopSynchronousTest.java
+ * @run compile -g RepStepTarg.java
+ * @run compile -g RequestReflectionTest.java
*
- * @run driver AccessSpecifierTest -redefstart -redefevent
- * @run driver AfterThreadDeathTest -redefstart -redefevent
- * @run driver ArrayRangeTest -redefstart -redefevent
- * @run driver BacktraceFieldTest -redefstart -redefevent
- * @run driver ClassesByName2Test -redefstart -redefevent
- * @run driver DebuggerThreadTest -redefstart -redefevent
- * @run driver DeleteEventRequestsTest -redefstart -redefevent
- * @run driver ExceptionEvents -redefstart -redefevent N A StackOverflowCaughtTarg java.lang.Exception
- * @run driver ExceptionEvents -redefstart -redefevent C A StackOverflowCaughtTarg null
- * @run driver ExceptionEvents -redefstart -redefevent C A StackOverflowCaughtTarg java.lang.StackOverflowError
- * @run driver ExceptionEvents -redefstart -redefevent N A StackOverflowCaughtTarg java.lang.NullPointerException
- * @run driver ExceptionEvents -redefstart -redefevent C T StackOverflowCaughtTarg java.lang.Error
- * @run driver ExceptionEvents -redefstart -redefevent N T StackOverflowCaughtTarg java.lang.NullPointerException
- * @run driver ExceptionEvents -redefstart -redefevent N N StackOverflowCaughtTarg java.lang.Exception
- * @run driver ExceptionEvents -redefstart -redefevent C N StackOverflowCaughtTarg java.lang.Error
- * @run driver ExceptionEvents -redefstart -redefevent N A StackOverflowUncaughtTarg java.lang.Exception
- * @run driver ExpiredRequestDeletionTest -redefstart -redefevent
- * @run driver FieldWatchpoints -redefstart -redefevent
- * @run driver InstanceFilter -redefstart -redefevent
- * @run driver LocationTest -redefstart -redefevent
- * @run driver NewInstanceTest -redefstart -redefevent
- * @run driver RequestReflectionTest -redefstart -redefevent
+ * @run driver AccessSpecifierTest -redefstart -redefevent
+ * @run driver AfterThreadDeathTest -redefstart -redefevent
+ * @run driver ArrayRangeTest -redefstart -redefevent
+ * @run driver BacktraceFieldTest -redefstart -redefevent
+ * @run driver ClassesByName2Test -redefstart -redefevent
+ * @run driver DebuggerThreadTest -redefstart -redefevent
+ * @run driver DeleteEventRequestsTest -redefstart -redefevent
+ * @run driver ExceptionEvents -redefstart -redefevent N A StackOverflowCaughtTarg java.lang.Exception
+ * @run driver ExceptionEvents -redefstart -redefevent C A StackOverflowCaughtTarg null
+ * @run driver ExceptionEvents -redefstart -redefevent C A StackOverflowCaughtTarg java.lang.StackOverflowError
+ * @run driver ExceptionEvents -redefstart -redefevent N A StackOverflowCaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents -redefstart -redefevent C T StackOverflowCaughtTarg java.lang.Error
+ * @run driver ExceptionEvents -redefstart -redefevent N T StackOverflowCaughtTarg java.lang.NullPointerException
+ * @run driver ExceptionEvents -redefstart -redefevent N N StackOverflowCaughtTarg java.lang.Exception
+ * @run driver ExceptionEvents -redefstart -redefevent C N StackOverflowCaughtTarg java.lang.Error
+ * @run driver ExceptionEvents -redefstart -redefevent N A StackOverflowUncaughtTarg java.lang.Exception
+ * @run driver ExpiredRequestDeletionTest -redefstart -redefevent
+ * @run driver FieldWatchpoints -redefstart -redefevent
+ * @run driver InstanceFilter -redefstart -redefevent
+ * @run driver LocationTest -redefstart -redefevent
+ * @run driver NewInstanceTest -redefstart -redefevent
+ * @run driver RequestReflectionTest -redefstart -redefevent
*/
diff --git a/jdk/test/com/sun/jdi/RedefineCrossStart.java b/jdk/test/com/sun/jdi/RedefineCrossStart.java
index 51869c6cf36..5bacec137d3 100644
--- a/jdk/test/com/sun/jdi/RedefineCrossStart.java
+++ b/jdk/test/com/sun/jdi/RedefineCrossStart.java
@@ -22,29 +22,28 @@
*/
/**
- * @test
- * @bug 4628726
- * @summary Test class redefinition at start only (they use breakpoint
- * or resumeTo()) cross tested with other tests.
- * ExceptionEvents/StackOverflowUncaughtTarg are here because they hit
- * an unrelated crash in event testing.
+ * @test
+ * @bug 4628726
+ * @summary Test class redefinition at start only (they use breakpoint
+ * or resumeTo()) cross tested with other tests.
+ * ExceptionEvents/StackOverflowUncaughtTarg are here because they hit
+ * an unrelated crash in event testing.
*
- * @author Robert Field
+ * @author Robert Field
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g CountEvent.java
- * @run compile -g CountFilterTest.java
- * @run compile -g FramesTest.java
- * @run compile -g InvokeTest.java
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g CountEvent.java
+ * @run compile -g CountFilterTest.java
+ * @run compile -g FramesTest.java
+ * @run compile -g InvokeTest.java
*
- * @run driver CountEvent -redefstart
- * @run driver CountFilterTest -redefstart
- * @run driver FramesTest -redefstart
- * @run driver InvokeTest -redefstart
+ * @run driver CountEvent -redefstart
+ * @run driver CountFilterTest -redefstart
+ * @run driver FramesTest -redefstart
+ * @run driver InvokeTest -redefstart
*
- * @run driver ExceptionEvents -redefstart U A StackOverflowUncaughtTarg null
- * @run driver ExceptionEvents -redefstart U A StackOverflowUncaughtTarg java.lang.Error
- * @run driver ExceptionEvents -redefstart U A StackOverflowUncaughtTarg java.lang.StackOverflowError
- * @run driver PopSynchronousTest -redefstart
+ * @run driver ExceptionEvents -redefstart U A StackOverflowUncaughtTarg null
+ * @run driver ExceptionEvents -redefstart U A StackOverflowUncaughtTarg java.lang.Error
+ * @run driver ExceptionEvents -redefstart U A StackOverflowUncaughtTarg java.lang.StackOverflowError
+ * @run driver PopSynchronousTest -redefstart
*/
diff --git a/jdk/test/com/sun/jdi/ReferrersTest.java b/jdk/test/com/sun/jdi/ReferrersTest.java
index 3293b089f31..385292061b6 100644
--- a/jdk/test/com/sun/jdi/ReferrersTest.java
+++ b/jdk/test/com/sun/jdi/ReferrersTest.java
@@ -22,15 +22,14 @@
*/
/**
- * @test
- * @bug 5089849
- * @summary Add support for backtracking reference graph.
- * @author jjh
+ * @test
+ * @bug 5089849
+ * @summary Add support for backtracking reference graph.
+ * @author jjh
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g ReferrersTest.java
- * @run driver ReferrersTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g ReferrersTest.java
+ * @run driver ReferrersTest
*/
/*
diff --git a/jdk/test/com/sun/jdi/RepStep.java b/jdk/test/com/sun/jdi/RepStep.java
index fce9c2bda8b..252cf4d2eea 100644
--- a/jdk/test/com/sun/jdi/RepStep.java
+++ b/jdk/test/com/sun/jdi/RepStep.java
@@ -22,18 +22,16 @@
*/
/**
- * @test
- * @bug 4334008
- * @author Robert Field
- *
- * @modules jdk.jdi
- * @run compile -g RepStepTarg.java
- * @run build VMConnection RepStep
- *
- * @run driver RepStep
- *
+ * @test
+ * @bug 4334008
* @summary RepStep detects missed step events due to lack of
* frame pop events (in back-end).
+ * @author Robert Field
+ *
+ * @run compile -g RepStepTarg.java
+ * @run build VMConnection RepStep
+ *
+ * @run driver RepStep
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/RequestReflectionTest.java b/jdk/test/com/sun/jdi/RequestReflectionTest.java
index 41e3e4f4b7c..7983b87e387 100644
--- a/jdk/test/com/sun/jdi/RequestReflectionTest.java
+++ b/jdk/test/com/sun/jdi/RequestReflectionTest.java
@@ -22,17 +22,15 @@
*/
/**
- * @test
- * @bug 4425840
- * @author Robert Field
+ * @test
+ * @bug 4425840
+ * @summary RequestReflectionTest checks to see that reflective
+ * accessors on EventRequests return what they are given.
+ * @author Robert Field
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g RequestReflectionTest.java
- * @run driver RequestReflectionTest
- *
- * @summary RequestReflectionTest checks to see that reflective
- * accessors on EventRequests return what they are given.
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g RequestReflectionTest.java
+ * @run driver RequestReflectionTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/ResumeOneThreadTest.java b/jdk/test/com/sun/jdi/ResumeOneThreadTest.java
index 39bc76a0743..68a43c65a0a 100644
--- a/jdk/test/com/sun/jdi/ResumeOneThreadTest.java
+++ b/jdk/test/com/sun/jdi/ResumeOneThreadTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 6700889
- * @summary Thread resume invalidates all stack frames, even from other threads
+ * @test
+ * @bug 6700889
+ * @summary Thread resume invalidates all stack frames, even from other threads
+ * @author jjh
*
- * @author jjh
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g ResumeOneThreadTest.java
- * @run driver ResumeOneThreadTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g ResumeOneThreadTest.java
+ * @run driver ResumeOneThreadTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/SDENullTest.java b/jdk/test/com/sun/jdi/SDENullTest.java
index 32c08b74482..d5e4c9da07a 100644
--- a/jdk/test/com/sun/jdi/SDENullTest.java
+++ b/jdk/test/com/sun/jdi/SDENullTest.java
@@ -22,16 +22,15 @@
*/
/**
- * @test
- * @bug 4621289
- * @summary vm.setDefaultStratum(null) causes a Null Ptr exception
+ * @test
+ * @bug 4621289
+ * @summary vm.setDefaultStratum(null) causes a Null Ptr exception
*
- * @author jjh
+ * @author jjh
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g SDENullTest.java
- * @run driver SDENullTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g SDENullTest.java
+ * @run driver SDENullTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/SimulResumerTest.java b/jdk/test/com/sun/jdi/SimulResumerTest.java
index 7d9fae6c2a9..e27fa353087 100644
--- a/jdk/test/com/sun/jdi/SimulResumerTest.java
+++ b/jdk/test/com/sun/jdi/SimulResumerTest.java
@@ -22,17 +22,15 @@
*/
/**
- * @test
- * @bug 6751643
- * @summary ThreadReference.ownedMonitors() can return null
+ * @test
+ * @bug 6751643
+ * @key intermittent
+ * @summary ThreadReference.ownedMonitors() can return null
+ * @author jjh
*
- * @author jjh
- *
- * @key intermittent
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g SimulResumerTest.java
- * @run driver SimulResumerTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g SimulResumerTest.java
+ * @run driver SimulResumerTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/SourceNameFilterTest.java b/jdk/test/com/sun/jdi/SourceNameFilterTest.java
index ae3a0a2fd9f..ec5d097f562 100644
--- a/jdk/test/com/sun/jdi/SourceNameFilterTest.java
+++ b/jdk/test/com/sun/jdi/SourceNameFilterTest.java
@@ -22,18 +22,16 @@
*/
/**
- * @test
- * @bug 4836939 6646613
- * @summary JDI add addSourceNameFilter to ClassPrepareRequest
+ * @test
+ * @bug 4836939 6646613
+ * @summary JDI add addSourceNameFilter to ClassPrepareRequest
+ * @author jjh
*
- * @author jjh
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g SourceNameFilterTest.java
- * @run driver SourceNameFilterTest
- * @run compile -g:none SourceNameFilterTest.java
- * @run driver SourceNameFilterTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g SourceNameFilterTest.java
+ * @run driver SourceNameFilterTest
+ * @run compile -g:none SourceNameFilterTest.java
+ * @run driver SourceNameFilterTest
*/
// The compile -g:none suppresses the lineNumber table to trigger bug 6646613.
diff --git a/jdk/test/com/sun/jdi/StepTest.java b/jdk/test/com/sun/jdi/StepTest.java
index 4e829e94bfa..8d07334f715 100644
--- a/jdk/test/com/sun/jdi/StepTest.java
+++ b/jdk/test/com/sun/jdi/StepTest.java
@@ -22,16 +22,15 @@
*/
/**
- * @test
- * @bug 4270488 4787861
- * @author Gordon Hirsch
+ * @test
+ * @bug 4270488 4787861
+ * @author Gordon Hirsch
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetAdapter TargetListener
- * @run compile -g MethodCalls.java
- * @run compile -g MethodCallsReflection.java
- * @run compile -g ControlFlow.java
- * @run build StepTest
+ * @run build TestScaffold VMConnection TargetAdapter TargetListener
+ * @run compile -g MethodCalls.java
+ * @run compile -g MethodCallsReflection.java
+ * @run compile -g ControlFlow.java
+ * @run build StepTest
*
* @summary StepTest starts at a method named "go()" in the debuggee and
* repetitively steps. It will do a step into until the maximum
@@ -46,21 +45,21 @@
* for the debuggee files- MethodCalls.java, ...
* See LineNumberInfo.java for more info.
*
- * +--- maximum stack depth in debuggee
- * | +--- step granularity: "line" or "min"
- * | | +---Expected number of steps
- * | | | +--- Debuggee command Line
- * V V V V Workaround-----+
- * V
- * @run driver StepTest 2 line 2 MethodCalls
- * @run driver StepTest 3 line 14 MethodCalls
+ * +--- maximum stack depth in debuggee
+ * | +--- step granularity: "line" or "min"
+ * | | +---Expected number of steps
+ * | | | +--- Debuggee command Line
+ * V V V V Workaround-----+
+ * V
+ * @run driver StepTest 2 line 2 MethodCalls
+ * @run driver StepTest 3 line 14 MethodCalls
*
- * @run driver StepTest 2 line 18 MethodCallsReflection 12
+ * @run driver StepTest 2 line 18 MethodCallsReflection 12
*
- * @run driver StepTest 2 min 4 MethodCalls
- * @run driver StepTest 3 min 43 MethodCalls
+ * @run driver StepTest 2 min 4 MethodCalls
+ * @run driver StepTest 3 min 43 MethodCalls
*
- * @run driver StepTest 2 line 65 ControlFlow 64
+ * @run driver StepTest 2 line 65 ControlFlow 64
*/
/*
diff --git a/jdk/test/com/sun/jdi/SuspendThreadTest.java b/jdk/test/com/sun/jdi/SuspendThreadTest.java
index 49b488864d5..5e386724568 100644
--- a/jdk/test/com/sun/jdi/SuspendThreadTest.java
+++ b/jdk/test/com/sun/jdi/SuspendThreadTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 6485605
- * @summary com.sun.jdi.InternalException: Inconsistent suspend policy in internal event handler
+ * @test
+ * @bug 6485605
+ * @summary com.sun.jdi.InternalException: Inconsistent suspend policy in internal event handler
+ * @author jjh
*
- * @author jjh
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g SuspendThreadTest.java
- * @run driver SuspendThreadTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g SuspendThreadTest.java
+ * @run driver SuspendThreadTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/TEST.properties b/jdk/test/com/sun/jdi/TEST.properties
new file mode 100644
index 00000000000..8db30faef7c
--- /dev/null
+++ b/jdk/test/com/sun/jdi/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.jdi
+
diff --git a/jdk/test/com/sun/jdi/TemplateTest.java b/jdk/test/com/sun/jdi/TemplateTest.java
index cff19abd733..4f5425a656a 100644
--- a/jdk/test/com/sun/jdi/TemplateTest.java
+++ b/jdk/test/com/sun/jdi/TemplateTest.java
@@ -25,16 +25,14 @@
// TEMPLATE: change bug number and fill out and
// TEMPLATE: delete TEMPLATE lines
/**
- * @test
- * @bug 0000000
- * @summary
+ * @test
+ * @bug 0000000
+ * @summary
+ * @author
*
- * @author
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g TemplateTest.java
- * @run driver TemplateTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g TemplateTest.java
+ * @run driver TemplateTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/ThreadGroupTest.java b/jdk/test/com/sun/jdi/ThreadGroupTest.java
index cdd0f361f8d..bcd6ea32eb5 100644
--- a/jdk/test/com/sun/jdi/ThreadGroupTest.java
+++ b/jdk/test/com/sun/jdi/ThreadGroupTest.java
@@ -22,16 +22,15 @@
*/
/**
- * @test
- * @bug 4893530
- * @summary If JDI is initially started from a thread group that is subsequently
- * destroyed this should not impact subsequent thread creation by
- * the virtual machine manager.
+ * @test
+ * @bug 4893530
+ * @summary If JDI is initially started from a thread group that is subsequently
+ * destroyed this should not impact subsequent thread creation by
+ * the virtual machine manager.
*
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile ThreadGroupTest.java
- * @run driver ThreadGroupTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile ThreadGroupTest.java
+ * @run driver ThreadGroupTest
*/
import com.sun.jdi.*;
import com.sun.jdi.connect.*;
diff --git a/jdk/test/com/sun/jdi/TwoThreadsTest.java b/jdk/test/com/sun/jdi/TwoThreadsTest.java
index ca981d9b6e9..3e560ea5bb9 100644
--- a/jdk/test/com/sun/jdi/TwoThreadsTest.java
+++ b/jdk/test/com/sun/jdi/TwoThreadsTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 6296125
- * @summary JDI: Disabling an EventRequest can cause a multi-threaded debuggee to hang
+ * @test
+ * @bug 6296125
+ * @summary JDI: Disabling an EventRequest can cause a multi-threaded debuggee to hang
+ * @author jjh
*
- * @author jjh
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g TwoThreadsTest.java
- * @run driver TwoThreadsTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g TwoThreadsTest.java
+ * @run driver TwoThreadsTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/UTF8Test.java b/jdk/test/com/sun/jdi/UTF8Test.java
index 1325a0a48db..945a5354124 100644
--- a/jdk/test/com/sun/jdi/UTF8Test.java
+++ b/jdk/test/com/sun/jdi/UTF8Test.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 5033550
- * @summary JDWP back end uses modified UTF-8
+ * @test
+ * @bug 5033550
+ * @summary JDWP back end uses modified UTF-8
+ * @author jjh
*
- * @author jjh
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g UTF8Test.java
- * @run driver UTF8Test
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g UTF8Test.java
+ * @run driver UTF8Test
*/
/*
diff --git a/jdk/test/com/sun/jdi/UnpreparedByName.java b/jdk/test/com/sun/jdi/UnpreparedByName.java
index aa7c6639f1e..43ec5678a91 100644
--- a/jdk/test/com/sun/jdi/UnpreparedByName.java
+++ b/jdk/test/com/sun/jdi/UnpreparedByName.java
@@ -22,18 +22,17 @@
*/
/**
- * @test
- * @bug 4368402
- * @summary UnpreparedByName verifies that unprepared classes
- * won't be returned by classesByName.
- * @author Robert Field
+ * @test
+ * @bug 4368402
+ * @summary UnpreparedByName verifies that unprepared classes
+ * won't be returned by classesByName.
+ * @author Robert Field
*
- * @modules jdk.jdi
- * @run build JDIScaffold VMConnection
- * @run compile -g InnerTarg.java
- * @run build UnpreparedByName
+ * @run build JDIScaffold VMConnection
+ * @run compile -g InnerTarg.java
+ * @run build UnpreparedByName
*
- * @run driver UnpreparedByName InnerTarg
+ * @run driver UnpreparedByName InnerTarg
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/UnpreparedClasses.java b/jdk/test/com/sun/jdi/UnpreparedClasses.java
index 4e96fb6415e..fd21a76089d 100644
--- a/jdk/test/com/sun/jdi/UnpreparedClasses.java
+++ b/jdk/test/com/sun/jdi/UnpreparedClasses.java
@@ -22,18 +22,17 @@
*/
/**
- * @test
- * @bug 4368402
- * @summary UnpreparedClasses verifies that all the classes in the
- * loaded class list are prepared classes.
- * @author Robert Field
+ * @test
+ * @bug 4368402
+ * @summary UnpreparedClasses verifies that all the classes in the
+ * loaded class list are prepared classes.
+ * @author Robert Field
*
- * @modules jdk.jdi
- * @run build JDIScaffold VMConnection
- * @run compile -g InnerTarg.java
- * @run build UnpreparedClasses
+ * @run build JDIScaffold VMConnection
+ * @run compile -g InnerTarg.java
+ * @run build UnpreparedClasses
*
- * @run driver UnpreparedClasses InnerTarg
+ * @run driver UnpreparedClasses InnerTarg
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/VMDeathLastTest.java b/jdk/test/com/sun/jdi/VMDeathLastTest.java
index 0df54af3894..47b59c96ff0 100644
--- a/jdk/test/com/sun/jdi/VMDeathLastTest.java
+++ b/jdk/test/com/sun/jdi/VMDeathLastTest.java
@@ -22,17 +22,15 @@
*/
/**
- * @test
- * @bug 4420844 4449394
- * @summary Checks that no events are sent after VMDeath, and test vm.canBeModified
+ * @test
+ * @bug 4420844 4449394
+ * @summary Checks that no events are sent after VMDeath, and test vm.canBeModified
+ * @author Robert Field
*
- * @author Robert Field
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g HelloWorld.java
- * @run build VMDeathLastTest
- * @run driver VMDeathLastTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g HelloWorld.java
+ * @run build VMDeathLastTest
+ * @run driver VMDeathLastTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/VMDeathRequestTest.java b/jdk/test/com/sun/jdi/VMDeathRequestTest.java
index 784ddaf4a30..67eaad369a2 100644
--- a/jdk/test/com/sun/jdi/VMDeathRequestTest.java
+++ b/jdk/test/com/sun/jdi/VMDeathRequestTest.java
@@ -22,22 +22,20 @@
*/
/**
- * @test
- * @bug 4419314
- * @author Robert Field
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g HelloWorld.java
- * @run build VMDeathRequestTest
- * @run driver VMDeathRequestTest
- *
+ * @test
+ * @bug 4419314
* @summary VMDeathRequestTest checks to see that
* VMDisconnectedException is never thrown before VMDisconnectEvent.
*
* Failure mode for this test is throwing VMDisconnectedException
* on vm.eventQueue().remove();
* Does not use a scaffold since we don't want that hiding the exception.
+ * @author Robert Field
+ *
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g HelloWorld.java
+ * @run build VMDeathRequestTest
+ * @run driver VMDeathRequestTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/VarargsTest.java b/jdk/test/com/sun/jdi/VarargsTest.java
index 4bb015e8950..4bdeb15d24a 100644
--- a/jdk/test/com/sun/jdi/VarargsTest.java
+++ b/jdk/test/com/sun/jdi/VarargsTest.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @bug 4870984
- * @summary JPDA: Add support for RFE 4856541 - varargs
+ * @test
+ * @bug 4870984
+ * @summary JPDA: Add support for RFE 4856541 - varargs
+ * @author jjh
*
- * @author jjh
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g VarargsTest.java
- * @run driver VarargsTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g VarargsTest.java
+ * @run driver VarargsTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/Vars.java b/jdk/test/com/sun/jdi/Vars.java
index edffff3f720..bb5e955679a 100644
--- a/jdk/test/com/sun/jdi/Vars.java
+++ b/jdk/test/com/sun/jdi/Vars.java
@@ -22,15 +22,13 @@
*/
/**
- * @test
- * @summary Test Method.variables() and the like.
+ * @test
+ * @summary Test Method.variables() and the like.
+ * @author Robert Field
*
- * @author Robert Field
- *
- * @modules jdk.jdi
- * @run build JDIScaffold VMConnection
- * @run compile -g Vars.java
- * @run driver Vars
+ * @run build JDIScaffold VMConnection
+ * @run compile -g Vars.java
+ * @run driver Vars
*/
import com.sun.jdi.*;
diff --git a/jdk/test/com/sun/jdi/VisibleMethods.java b/jdk/test/com/sun/jdi/VisibleMethods.java
index 2cc088571e5..95c42b8b651 100644
--- a/jdk/test/com/sun/jdi/VisibleMethods.java
+++ b/jdk/test/com/sun/jdi/VisibleMethods.java
@@ -22,16 +22,14 @@
*/
/**
- * @test
- * @summary Test ReferenceType.visibleMethods
- * @bug 8028430
+ * @test
+ * @summary Test ReferenceType.visibleMethods
+ * @bug 8028430
+ * @author Staffan Larsen
*
- * @author Staffan Larsen
- *
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g VisibleMethods.java
- * @run driver VisibleMethods
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g VisibleMethods.java
+ * @run driver VisibleMethods
*/
import com.sun.jdi.Method;
import com.sun.jdi.ReferenceType;
diff --git a/jdk/test/com/sun/jdi/connect/spi/GeneratedConnectors.java b/jdk/test/com/sun/jdi/connect/spi/GeneratedConnectors.java
index dd3dec369fa..a726e19192f 100644
--- a/jdk/test/com/sun/jdi/connect/spi/GeneratedConnectors.java
+++ b/jdk/test/com/sun/jdi/connect/spi/GeneratedConnectors.java
@@ -30,7 +30,6 @@
* to encapsulate the transport. This tests that the connectors are
* created and that they have an "address" argument.
*
- * @modules jdk.jdi/com.sun.tools.jdi
* @build GeneratedConnectors NullTransportService SimpleLaunchingConnector
* @run main/othervm GeneratedConnectors
*/
diff --git a/jdk/test/com/sun/jdi/redefine/RedefineTest.java b/jdk/test/com/sun/jdi/redefine/RedefineTest.java
index 1f8d1256900..1ef2a0c3b10 100644
--- a/jdk/test/com/sun/jdi/redefine/RedefineTest.java
+++ b/jdk/test/com/sun/jdi/redefine/RedefineTest.java
@@ -22,20 +22,20 @@
*/
/**
- * @test
- * @bug 4287595
- * @bug 4462989
- * @bug 4531511
- * @summary Test class redefinition
+ * @test
+ * @bug 4287595
+ * @bug 4462989
+ * @bug 4531511
+ * @summary Test class redefinition
*
- * @author Robert Field
+ * @author Robert Field
*
- * @library ..
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g RedefineTest.java
- * @run shell RedefineSetUp.sh
- * @run driver RedefineTest
+ * @library ..
+ *
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g RedefineTest.java
+ * @run shell RedefineSetUp.sh
+ * @run driver RedefineTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/redefineMethod/RedefineTest.java b/jdk/test/com/sun/jdi/redefineMethod/RedefineTest.java
index d504a0e5cdc..a3ae8b00d9e 100644
--- a/jdk/test/com/sun/jdi/redefineMethod/RedefineTest.java
+++ b/jdk/test/com/sun/jdi/redefineMethod/RedefineTest.java
@@ -22,19 +22,18 @@
*/
/**
- * @test
- * @bug 4628726
- * @summary Test class redefinition - method data line numbers and local vars,
+ * @test
+ * @bug 4628726
+ * @summary Test class redefinition - method data line numbers and local vars,
+ * @author Robert Field
*
- * @author Robert Field
+ * @library ..
*
- * @library ..
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter
- * @run compile -g RedefineTest.java
- * @run shell RedefineSetUp.sh
- * @run driver RedefineTest -repeat 3
- * @run driver RedefineTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter
+ * @run compile -g RedefineTest.java
+ * @run shell RedefineSetUp.sh
+ * @run driver RedefineTest -repeat 3
+ * @run driver RedefineTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/sde/FilterMangleTest.java b/jdk/test/com/sun/jdi/sde/FilterMangleTest.java
index 349a73ffbb1..96461095c15 100644
--- a/jdk/test/com/sun/jdi/sde/FilterMangleTest.java
+++ b/jdk/test/com/sun/jdi/sde/FilterMangleTest.java
@@ -1,31 +1,30 @@
/**
- * @test
- * @bug 4836939
- * @summary JDI add addSourceNameFilter to ClassPrepareRequest
+ * @test
+ * @bug 4836939
+ * @key intermittent
+ * @summary JDI add addSourceNameFilter to ClassPrepareRequest
+ * @author Robert Field / Jim Holmlund
*
- * @author Robert Field / Jim Holmlund
+ * @library ..
*
- * @key intermittent
- * @library ..
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
- * @run compile FilterMangleTest.java
- * @run compile -g onion/pickle/Mangle.java
- * @run driver FilterMangleTest
- * @run driver FilterMangleTest SDE-pMangle.java*
- * @run driver FilterMangleTest SDE-pMangle.jav*
- * @run driver FilterMangleTest SDE-pMangle.j*
- * @run driver FilterMangleTest SDE-p*Mangle.java
- * @run driver FilterMangleTest SDE-p*angle.java
- * @run driver FilterMangleTest SDE-p*java
- * @run driver FilterMangleTest SDE-pMangle.xyz
- * @run driver FilterMangleTest SDE-pIncl.rats*
- * @run driver FilterMangleTest SDE-pIncl.rat*
- * @run driver FilterMangleTest SDE-p*angle.rats
- * @run driver FilterMangleTest SDE-f*Incl.rat
- * @run driver FilterMangleTest SDE-ffred
- * @run driver FilterMangleTest SDE-f*ratsx
- * @run driver FilterMangleTest SDE-fMangle.javax*
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
+ * @run compile FilterMangleTest.java
+ * @run compile -g onion/pickle/Mangle.java
+ * @run driver FilterMangleTest
+ * @run driver FilterMangleTest SDE-pMangle.java*
+ * @run driver FilterMangleTest SDE-pMangle.jav*
+ * @run driver FilterMangleTest SDE-pMangle.j*
+ * @run driver FilterMangleTest SDE-p*Mangle.java
+ * @run driver FilterMangleTest SDE-p*angle.java
+ * @run driver FilterMangleTest SDE-p*java
+ * @run driver FilterMangleTest SDE-pMangle.xyz
+ * @run driver FilterMangleTest SDE-pIncl.rats*
+ * @run driver FilterMangleTest SDE-pIncl.rat*
+ * @run driver FilterMangleTest SDE-p*angle.rats
+ * @run driver FilterMangleTest SDE-f*Incl.rat
+ * @run driver FilterMangleTest SDE-ffred
+ * @run driver FilterMangleTest SDE-f*ratsx
+ * @run driver FilterMangleTest SDE-fMangle.javax*
*/
/*
diff --git a/jdk/test/com/sun/jdi/sde/MangleStepTest.java b/jdk/test/com/sun/jdi/sde/MangleStepTest.java
index 0d135f9411d..15f1d1ff0fc 100644
--- a/jdk/test/com/sun/jdi/sde/MangleStepTest.java
+++ b/jdk/test/com/sun/jdi/sde/MangleStepTest.java
@@ -1,21 +1,20 @@
/**
- * @test
- * @bug 4390869
- * @bug 4460328
- * @summary Test Stepping in the new SourceDebugExtension facility
+ * @test
+ * @bug 4390869
+ * @bug 4460328
+ * @summary Test Stepping in the new SourceDebugExtension facility
+ * @author Robert Field
*
- * @author Robert Field
+ * @library ..
*
- * @library ..
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
- * @run compile MangleStepTest.java
- * @run compile -g onion/pickle/Mangle.java
- * @run driver MangleStepTest unset
- * @run driver MangleStepTest Java
- * @run driver MangleStepTest XYZ
- * @run driver MangleStepTest Rats
- * @run driver MangleStepTest bogus
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
+ * @run compile MangleStepTest.java
+ * @run compile -g onion/pickle/Mangle.java
+ * @run driver MangleStepTest unset
+ * @run driver MangleStepTest Java
+ * @run driver MangleStepTest XYZ
+ * @run driver MangleStepTest Rats
+ * @run driver MangleStepTest bogus
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/sde/MangleTest.java b/jdk/test/com/sun/jdi/sde/MangleTest.java
index c766ffa5616..301bef0d59f 100644
--- a/jdk/test/com/sun/jdi/sde/MangleTest.java
+++ b/jdk/test/com/sun/jdi/sde/MangleTest.java
@@ -1,17 +1,16 @@
/**
- * @test
- * @bug 4390869
- * @bug 4460328
- * @summary Test the new SourceDebugExtension facility
+ * @test
+ * @bug 4390869
+ * @bug 4460328
+ * @summary Test the new SourceDebugExtension facility
+ * @author Robert Field
*
- * @author Robert Field
+ * @library ..
*
- * @library ..
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
- * @run compile MangleTest.java
- * @run compile -g onion/pickle/Mangle.java
- * @run driver MangleTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
+ * @run compile MangleTest.java
+ * @run compile -g onion/pickle/Mangle.java
+ * @run driver MangleTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/sde/SourceDebugExtensionTest.java b/jdk/test/com/sun/jdi/sde/SourceDebugExtensionTest.java
index 62b65147ea0..fb4372f85d6 100644
--- a/jdk/test/com/sun/jdi/sde/SourceDebugExtensionTest.java
+++ b/jdk/test/com/sun/jdi/sde/SourceDebugExtensionTest.java
@@ -1,17 +1,16 @@
/**
- * @test
- * @bug 4390869
- * @bug 4460328
- * @summary Test the new SourceDebugExtension facility
+ * @test
+ * @bug 4390869
+ * @bug 4460328
+ * @summary Test the new SourceDebugExtension facility
+ * @author Robert Field
*
- * @author Robert Field
+ * @library ..
*
- * @library ..
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
- * @run compile SourceDebugExtensionTest.java
- * @run compile -g SourceDebugExtensionTarg.java
- * @run driver SourceDebugExtensionTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE
+ * @run compile SourceDebugExtensionTest.java
+ * @run compile -g SourceDebugExtensionTarg.java
+ * @run driver SourceDebugExtensionTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/jdi/sde/TemperatureTableTest.java b/jdk/test/com/sun/jdi/sde/TemperatureTableTest.java
index 130e72a28ac..36c3e71c35f 100644
--- a/jdk/test/com/sun/jdi/sde/TemperatureTableTest.java
+++ b/jdk/test/com/sun/jdi/sde/TemperatureTableTest.java
@@ -1,17 +1,16 @@
/**
- * @test
- * @bug 4390869
- * @bug 4460328
- * @summary Test the new SourceDebugExtension facility
+ * @test
+ * @bug 4390869
+ * @bug 4460328
+ * @summary Test the new SourceDebugExtension facility
+ * @author Robert Field
*
- * @author Robert Field
+ * @library ..
*
- * @library ..
- * @modules jdk.jdi
- * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE HelloWorld
- * @run compile TemperatureTableTest.java
- * @run compile -g TemperatureTableServlet.java
- * @run driver TemperatureTableTest
+ * @run build TestScaffold VMConnection TargetListener TargetAdapter InstallSDE HelloWorld
+ * @run compile TemperatureTableTest.java
+ * @run compile -g TemperatureTableServlet.java
+ * @run driver TemperatureTableTest
*/
import com.sun.jdi.*;
import com.sun.jdi.event.*;
diff --git a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanDoubleInvocationTest.java b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanDoubleInvocationTest.java
index 3bfd07f89cf..34def0074d9 100644
--- a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanDoubleInvocationTest.java
+++ b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanDoubleInvocationTest.java
@@ -27,7 +27,6 @@
* @summary Basic Test for the DiagnosticCommandMBean
* @author Frederic Parain, Shanliang JIANG
*
- * @modules jdk.management
* @run main/othervm DcmdMBeanDoubleInvocationTest
*/
diff --git a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanInvocationTest.java b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanInvocationTest.java
index a42070d646b..f28e77a75ed 100644
--- a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanInvocationTest.java
+++ b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanInvocationTest.java
@@ -27,7 +27,6 @@
* @summary Basic Test for the DiagnosticCommandMBean
* @author Frederic Parain, Shanliang JIANG
*
- * @modules jdk.management
* @run main/othervm DcmdMBeanInvocationTest
*/
diff --git a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java
index 748e49a0915..545890f7347 100644
--- a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java
+++ b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanPermissionsTest.java
@@ -27,7 +27,9 @@
* @summary Permissions Tests for the DiagnosticCommandMBean
* @author Frederic Parain
*
- * @modules jdk.management
+ * @modules java.logging
+ * java.management
+ *
* @run main/othervm DcmdMBeanPermissionsTest
*/
diff --git a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java
index 8f988b2934a..3cc9f40b895 100644
--- a/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java
+++ b/jdk/test/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java
@@ -27,7 +27,6 @@
* @summary Basic Test for the DiagnosticCommandMBean
* @author Frederic Parain, Shanliang JIANG
*
- * @modules jdk.management
* @run main/othervm DcmdMBeanTest
*/
diff --git a/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java b/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java
index c580c49df17..bdb3a0cfd0a 100644
--- a/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java
+++ b/jdk/test/com/sun/management/GarbageCollectorMXBean/LastGCInfo.java
@@ -27,7 +27,6 @@
* @summary Sanity Test for GarbageCollectorMXBean.getLastGcInfo().
* @author Mandy Chung
*
- * @modules jdk.management
* @run main/othervm -XX:-ExplicitGCInvokesConcurrent LastGCInfo
*/
// Passing "-XX:-ExplicitGCInvokesConcurrent" to force System.gc()
diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java
index 7e3f247d36d..a40b9d41492 100644
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java
@@ -27,7 +27,6 @@
* @summary Basic Test for HotSpotDiagnosticMXBean.getDiagnosticOptions()
* @author Daniel Fuchs
*
- * @modules jdk.management
* @run main GetDiagnosticOptions
*/
diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDoubleVMOption.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDoubleVMOption.java
index d181677d2ba..4c9f8f36916 100644
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDoubleVMOption.java
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDoubleVMOption.java
@@ -27,7 +27,6 @@
* @summary Basic Test for HotSpotDiagnosticMXBean.getVMOption() and double values
* @author Jaroslav Bachorik
*
- * @modules jdk.management
* @run main/othervm -XX:CompileThresholdScaling=0.14 GetDoubleVMOption
*/
diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java
index 49edcc14415..f380338001d 100644
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java
@@ -27,7 +27,6 @@
* @summary Basic Test for HotSpotDiagnosticMXBean.getVMOption()
* @author Mandy Chung
*
- * @modules jdk.management
* @run main/othervm -XX:+HeapDumpOnOutOfMemoryError GetVMOption
*/
diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetAllVMOptions.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetAllVMOptions.java
index c630ef4d467..b433228cda4 100644
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetAllVMOptions.java
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetAllVMOptions.java
@@ -27,7 +27,6 @@
* @summary Basic Test for HotSpotDiagnosticMXBean.setVMOption()
* @author Tomas Hurka, Daniel Fuchs
*
- * @modules jdk.management
* @run main SetAllVMOptions
*/
diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java
index d11ec33fa7c..8cad178234a 100644
--- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java
+++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java
@@ -29,7 +29,6 @@
* @author Mandy Chung
* @author Jaroslav Bachorik
*
- * @modules jdk.management
* @run main/othervm -XX:+HeapDumpOnOutOfMemoryError SetVMOption
*/
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java
index 44307313787..b4f08ceb2ce 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetCommittedVirtualMemorySize.java
@@ -26,7 +26,6 @@
* @bug 4858522 6191542
* @summary Basic unit test of OperatingSystemMXBean.getCommittedVirtualMemorySize()
* @author Steve Bohne
- * @modules jdk.management
*/
/*
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreePhysicalMemorySize.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreePhysicalMemorySize.java
index 6747bc9c730..6d843ccbdb0 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreePhysicalMemorySize.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreePhysicalMemorySize.java
@@ -26,7 +26,6 @@
* @bug 4858522
* @summary Basic unit test of OperatingSystemMXBean.getFreePhysicalMemorySize()
* @author Steve Bohne
- * @modules jdk.management
*/
/*
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreeSwapSpaceSize.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreeSwapSpaceSize.java
index 82ed7250ba8..3df910d73c2 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreeSwapSpaceSize.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetFreeSwapSpaceSize.java
@@ -26,7 +26,6 @@
* @bug 4858522
* @summary Basic unit test of OperatingSystemMXBean.getFreeSwapSpaceSize()
* @author Steve Bohne
- * @modules jdk.management
*/
/*
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java
index 697717836bb..bbf26e099f3 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java
@@ -26,7 +26,6 @@
* @bug 7028071
* @summary Basic unit test of OperatingSystemMXBean.getProcessCpuLoad()
*
- * @modules jdk.management
* @run main GetProcessCpuLoad
*/
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuTime.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuTime.java
index 1e1132a3bac..f65b2616ae9 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuTime.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetProcessCpuTime.java
@@ -26,7 +26,6 @@
* @bug 4858522
* @summary Basic unit test of OperatingSystemMXBean.getProcessCpuTime()
* @author Steve Bohne
- * @modules jdk.management
*/
/*
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java
index 701b1fa0139..71ee209258a 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java
@@ -26,7 +26,6 @@
* @bug 7028071
* @summary Basic unit test of OperatingSystemMXBean.getProcessCpuLoad()
*
- * @modules jdk.management
* @run main GetSystemCpuLoad
*/
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalPhysicalMemorySize.java b/jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalPhysicalMemorySize.java
index 57eb80fc9c9..b3f55485924 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalPhysicalMemorySize.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/GetTotalPhysicalMemorySize.java
@@ -26,7 +26,6 @@
* @bug 4858522
* @summary Basic unit test of OperatingSystemMXBean.getTotalPhysicalMemorySize()
* @author Steve Bohne
- * @modules jdk.management
*/
/*
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/MemoryStatusOverflow.java b/jdk/test/com/sun/management/OperatingSystemMXBean/MemoryStatusOverflow.java
index 046dbcbce95..d016a11de59 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/MemoryStatusOverflow.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/MemoryStatusOverflow.java
@@ -29,7 +29,6 @@
* the GlobalMemoryStatus function can return incorrect information,
* reporting a value of -1 to indicate an overflow.
*
- * @modules jdk.management
* @run main MemoryStatusOverflow
*/
diff --git a/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java b/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java
index 8d5e7c919ba..b1151f97426 100644
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.java
@@ -25,14 +25,13 @@
* @test
* @bug 4858522
* @summary Basic unit test of OperatingSystemMXBean.getTotalSwapSpaceSize()
- *
- * @library /lib/testlibrary
- * @modules jdk.management
- * @build TestTotalSwap jdk.testlibrary.*
- * @run main TestTotalSwap
- *
* @author Steve Bohne
* @author Jaroslav Bachorik
+ *
+ * @library /lib/testlibrary
+ *
+ * @build TestTotalSwap jdk.testlibrary.*
+ * @run main TestTotalSwap
*/
/*
diff --git a/jdk/test/com/sun/management/TEST.properties b/jdk/test/com/sun/management/TEST.properties
new file mode 100644
index 00000000000..b6ae4201475
--- /dev/null
+++ b/jdk/test/com/sun/management/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.management
+
diff --git a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java
index 1729662347e..1fc134234dd 100644
--- a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java
+++ b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemory.java
@@ -26,7 +26,6 @@
* @bug 6173675
* @summary Basic test of ThreadMXBean.getThreadAllocatedBytes
* @author Paul Hohensee
- * @modules jdk.management
*/
import java.lang.management.*;
diff --git a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java
index 378abcada17..cbd3d1d3cab 100644
--- a/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java
+++ b/jdk/test/com/sun/management/ThreadMXBean/ThreadAllocatedMemoryArray.java
@@ -26,7 +26,6 @@
* @bug 6173675
* @summary Basic test of ThreadMXBean.getThreadAllocatedBytes(long[])
* @author Paul Hohensee
- * @modules jdk.management
*/
import java.lang.management.*;
diff --git a/jdk/test/com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java b/jdk/test/com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java
index 2e1046cc36e..c7fded7399e 100644
--- a/jdk/test/com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java
+++ b/jdk/test/com/sun/management/ThreadMXBean/ThreadCpuTimeArray.java
@@ -24,11 +24,10 @@
/*
* @test
* @bug 6173675
+ * @key randomness
* @summary Basic test of ThreadMXBean.getThreadCpuTime(long[]) and
* getThreadUserTime(long[]).
* @author Paul Hohensee
- * @key randomness
- * @modules jdk.management
*/
import java.lang.management.*;
diff --git a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh
index a131bb522ba..ef089a39786 100644
--- a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh
+++ b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh
@@ -24,10 +24,9 @@
#
# @test
# @bug 4858522
-# @summary
+# @summary
# @author Steve Bohne
#
-# @modules jdk.management
# @run shell GetMaxFileDescriptorCount.sh
#
@@ -40,7 +39,7 @@ if [ "${COMPILEJAVA}" = "" ]; then
fi
runOne()
-{
+{
echo "runOne $@"
$COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d $TESTCLASSES \
$TESTSRC/$@.java || exit 2
diff --git a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh
index f49069843c1..9074fabd005 100644
--- a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh
+++ b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh
@@ -24,10 +24,9 @@
#
# @test
# @bug 4858522
-# @summary
+# @summary
# @author Steve Bohne
#
-# @modules jdk.management
# @run shell GetOpenFileDescriptorCount.sh
#
@@ -39,7 +38,7 @@ if [ "${COMPILEJAVA}" = "" ]; then
COMPILEJAVA="${TESTJAVA}"
fi
runOne()
-{
+{
echo "runOne $@"
$COMPILEJAVA/bin/javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d $TESTCLASSES \
$TESTSRC/$@.java || exit 2
diff --git a/jdk/test/com/sun/management/VMOptionOpenDataTest.java b/jdk/test/com/sun/management/VMOptionOpenDataTest.java
index 5d255085250..12904a04b85 100644
--- a/jdk/test/com/sun/management/VMOptionOpenDataTest.java
+++ b/jdk/test/com/sun/management/VMOptionOpenDataTest.java
@@ -38,7 +38,6 @@ import static javax.management.openmbean.SimpleType.*;
* @test
* @bug 8042901
* @summary Check that MappedMXBeanType.toOpenTypeData supports VMOption
- * @modules jdk.management/com.sun.management
* @author Shanliang Jiang
*/
public class VMOptionOpenDataTest {
diff --git a/jdk/test/com/sun/tools/attach/PermissionTest.java b/jdk/test/com/sun/tools/attach/PermissionTest.java
index 3254431a9a1..1d74abb4155 100644
--- a/jdk/test/com/sun/tools/attach/PermissionTest.java
+++ b/jdk/test/com/sun/tools/attach/PermissionTest.java
@@ -31,17 +31,15 @@ import jdk.testlibrary.ProcessThread;
/*
* @test
* @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
- * @summary Basic unit tests for the VM attach mechanism.
- * @modules jdk.jartool/sun.tools.jar
+ * @summary Basic unit tests for the VM attach mechanism. Unit test for Attach
+ * API - this checks that a SecurityException is thrown as expected.
+ *
* @library /lib/testlibrary
- * @modules java.management
- * jdk.attach
+ * @modules jdk.attach
* jdk.jartool/sun.tools.jar
+ *
* @run build jdk.testlibrary.* Application
* @run main PermissionTest
- *
- * Unit test for Attach API -
- * this checks that a SecurityException is thrown as expected.
*/
public class PermissionTest {
diff --git a/jdk/test/com/sun/tools/attach/ProviderTest.java b/jdk/test/com/sun/tools/attach/ProviderTest.java
index 685cc47f7ac..6c0125bb270 100644
--- a/jdk/test/com/sun/tools/attach/ProviderTest.java
+++ b/jdk/test/com/sun/tools/attach/ProviderTest.java
@@ -31,16 +31,15 @@ import com.sun.tools.attach.spi.AttachProvider;
/*
* @test
* @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
- * @summary Basic unit tests for the VM attach mechanism.
- * @modules jdk.jartool/sun.tools.jar
+ * @summary Basic unit tests for the VM attach mechanism. The test will attach
+ * and detach to/from the running Application.
+ *
* @library /lib/testlibrary
- * @modules java.management
- * jdk.attach
+ * @modules jdk.attach
* jdk.jartool/sun.tools.jar
+ *
* @run build jdk.testlibrary.* SimpleProvider
* @run main ProviderTest
- *
- * The test will attach and detach to/from the running Application.
*/
public class ProviderTest {
diff --git a/jdk/test/com/sun/tools/attach/StartManagementAgent.java b/jdk/test/com/sun/tools/attach/StartManagementAgent.java
index 85256fb68c2..5abeba24606 100644
--- a/jdk/test/com/sun/tools/attach/StartManagementAgent.java
+++ b/jdk/test/com/sun/tools/attach/StartManagementAgent.java
@@ -39,11 +39,12 @@ import jdk.testlibrary.Utils;
/*
* @test
* @summary Test for VirtualMachine.startManagementAgent and VirtualMachine.startLocalManagementAgent
- * @modules jdk.jartool/sun.tools.jar
+ *
* @library /lib/testlibrary
- * @modules jdk.management.agent
+ * @modules java.management
* jdk.attach
* jdk.jartool/sun.tools.jar
+ *
* @run build Application SimpleProvider jdk.testlibrary.*
* @run main/timeout=300 StartManagementAgent
*/
diff --git a/jdk/test/com/sun/tools/attach/TempDirTest.java b/jdk/test/com/sun/tools/attach/TempDirTest.java
index ae388c860b8..0ae0a4648f8 100644
--- a/jdk/test/com/sun/tools/attach/TempDirTest.java
+++ b/jdk/test/com/sun/tools/attach/TempDirTest.java
@@ -37,10 +37,11 @@ import jdk.testlibrary.ProcessThread;
* @test
* @bug 8033104
* @summary Test to make sure attach and jvmstat works correctly when java.io.tmpdir is set
- * @modules jdk.jartool/sun.tools.jar
+ *
* @library /lib/testlibrary
- * @modules java.management
+ * @modules jdk.attach
* jdk.jartool/sun.tools.jar
+ *
* @run build jdk.testlibrary.* Application RunnerUtil
* @run main/timeout=200 TempDirTest
*/
diff --git a/jdk/test/java/lang/instrument/RedefineModuleTest.java b/jdk/test/java/lang/instrument/RedefineModuleTest.java
index bf54daf78cf..b3f79ba4cd1 100644
--- a/jdk/test/java/lang/instrument/RedefineModuleTest.java
+++ b/jdk/test/java/lang/instrument/RedefineModuleTest.java
@@ -24,7 +24,7 @@
/**
* @test
* @summary Basic test for redefineModule
- * @modules java.instrument
+ *
* @build java.base/java.lang.TestProvider
* java.base/jdk.internal.test.TestProviderImpl1
* java.base/jdk.internal.test.TestProviderImpl2
diff --git a/jdk/test/java/lang/instrument/TestAgentWithLimitMods.java b/jdk/test/java/lang/instrument/TestAgentWithLimitMods.java
index 4cdbeb6beac..ddf51b54399 100644
--- a/jdk/test/java/lang/instrument/TestAgentWithLimitMods.java
+++ b/jdk/test/java/lang/instrument/TestAgentWithLimitMods.java
@@ -26,7 +26,7 @@
* @test
* @summary Tests that the -javaagent option adds the java.instrument into
* the module graph
- * @modules java.instrument
+ *
* @run shell MakeJAR3.sh SimpleAgent
* @run main/othervm -javaagent:SimpleAgent.jar --limit-modules java.base TestAgentWithLimitMods
*
diff --git a/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java b/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java
index 83fa68e2523..203e263496a 100644
--- a/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java
+++ b/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java
@@ -28,7 +28,7 @@
* ClassLoadingMXBean.getTotalLoadedClassCount()
* ClassLoadingMXBean.getUnloadedClassCount()
* @author Alexei Guibadoulline
- * @modules java.management
+ *
* @run main/othervm LoadCounts
*/
diff --git a/jdk/test/java/lang/management/CompilationMXBean/Basic.java b/jdk/test/java/lang/management/CompilationMXBean/Basic.java
index c9738cc0163..fd98e5d9a6f 100644
--- a/jdk/test/java/lang/management/CompilationMXBean/Basic.java
+++ b/jdk/test/java/lang/management/CompilationMXBean/Basic.java
@@ -26,7 +26,6 @@
* @bug 5011189 8004928
* @summary Unit test for java.lang.management.CompilationMXBean
*
- * @modules java.management
* @run main/othervm -Xcomp -Xbatch Basic
*/
import java.lang.management.*;
diff --git a/jdk/test/java/lang/management/CompositeData/MemoryUsageCompositeData.java b/jdk/test/java/lang/management/CompositeData/MemoryUsageCompositeData.java
index cd0df923fad..3d6da59c422 100644
--- a/jdk/test/java/lang/management/CompositeData/MemoryUsageCompositeData.java
+++ b/jdk/test/java/lang/management/CompositeData/MemoryUsageCompositeData.java
@@ -28,7 +28,6 @@
* or throw exception if the input CompositeData is invalid.
* @author Mandy Chung
*
- * @modules java.management
* @build MemoryUsageCompositeData
* @run main MemoryUsageCompositeData
*/
diff --git a/jdk/test/java/lang/management/CompositeData/ThreadInfoCompositeData.java b/jdk/test/java/lang/management/CompositeData/ThreadInfoCompositeData.java
index 1a84226360e..3510b516cfc 100644
--- a/jdk/test/java/lang/management/CompositeData/ThreadInfoCompositeData.java
+++ b/jdk/test/java/lang/management/CompositeData/ThreadInfoCompositeData.java
@@ -29,7 +29,6 @@
* the input CompositeData is invalid.
* @author Mandy Chung
*
- * @modules java.management
* @compile OpenTypeConverter.java
* @build ThreadInfoCompositeData
* @run main ThreadInfoCompositeData
diff --git a/jdk/test/java/lang/management/ManagementFactory/GetObjectName.java b/jdk/test/java/lang/management/ManagementFactory/GetObjectName.java
index f8d3aac0025..d76bd2cb811 100644
--- a/jdk/test/java/lang/management/ManagementFactory/GetObjectName.java
+++ b/jdk/test/java/lang/management/ManagementFactory/GetObjectName.java
@@ -26,7 +26,7 @@
* @summary Test if getObjectName handles properly when called by
* multiple threads simultaneously. Run in othervm mode to
* make sure the object name is not initialized to begin with.
- * @modules java.management
+ *
* @run main/othervm GetObjectName
*/
diff --git a/jdk/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java b/jdk/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java
index 56f94fd7b76..4d62de59fa2 100644
--- a/jdk/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java
+++ b/jdk/test/java/lang/management/ManagementFactory/GetPlatformMXBeans.java
@@ -28,7 +28,6 @@
* methods and PlatformManagedObject.getObjectName()
* @author Mandy Chung
*
- * @modules jdk.management
* @run main GetPlatformMXBeans
*/
diff --git a/jdk/test/java/lang/management/ManagementFactory/GetPlatformManagementInterfaces.java b/jdk/test/java/lang/management/ManagementFactory/GetPlatformManagementInterfaces.java
index 307c6fc72bf..98ace42ff6c 100644
--- a/jdk/test/java/lang/management/ManagementFactory/GetPlatformManagementInterfaces.java
+++ b/jdk/test/java/lang/management/ManagementFactory/GetPlatformManagementInterfaces.java
@@ -28,7 +28,6 @@
* ManagementFactory.getPlatformManagementInterfaces() method
* @author Frederic Parain
*
- * @modules jdk.management
* @run main GetPlatformManagementInterfaces
*/
diff --git a/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java b/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java
index 97b3c0e5efe..4aef2866745 100644
--- a/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java
+++ b/jdk/test/java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java
@@ -27,7 +27,7 @@
* @summary Test that all the platform MXBeans are wrapped in StandardMBean so
* an MBeanServer which does not have support for MXBeans can be used.
* @author Luis-Miguel Alventosa
- * @modules jdk.management
+ *
* @run clean MBeanServerMXBeanUnsupportedTest
* @run build MBeanServerMXBeanUnsupportedTest
* @run main/othervm MBeanServerMXBeanUnsupportedTest
diff --git a/jdk/test/java/lang/management/ManagementFactory/MXBeanException.java b/jdk/test/java/lang/management/ManagementFactory/MXBeanException.java
index 2f7d6394d1c..40ec878914e 100644
--- a/jdk/test/java/lang/management/ManagementFactory/MXBeanException.java
+++ b/jdk/test/java/lang/management/ManagementFactory/MXBeanException.java
@@ -29,7 +29,6 @@
*
* @author Mandy Chung
*
- * @modules jdk.management
* @build MXBeanException
* @run main MXBeanException
*/
diff --git a/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java b/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java
index 73aa6392484..f9586e96057 100644
--- a/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java
+++ b/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java
@@ -25,9 +25,9 @@
* @test
* @bug 5024531
* @summary Basic Test for ManagementFactory.newPlatformMXBean().
- * @modules jdk.management
- * @run main/othervm MXBeanProxyTest
* @author Mandy Chung
+ *
+ * @run main/othervm MXBeanProxyTest
*/
import javax.management.*;
import java.lang.management.ClassLoadingMXBean;
diff --git a/jdk/test/java/lang/management/ManagementFactory/PlatformMBeanServerTest.java b/jdk/test/java/lang/management/ManagementFactory/PlatformMBeanServerTest.java
index b7c469a6da9..509a18da9c4 100644
--- a/jdk/test/java/lang/management/ManagementFactory/PlatformMBeanServerTest.java
+++ b/jdk/test/java/lang/management/ManagementFactory/PlatformMBeanServerTest.java
@@ -26,7 +26,9 @@
* @bug 4947536
* @summary Basic unit test of ManagementFactory.getPlatformMBeanServer()
* @author Mandy Chung
- * @modules jdk.management
+ *
+ * @modules java.logging
+ * jdk.management
*/
import java.lang.management.*;
diff --git a/jdk/test/java/lang/management/ManagementFactory/ProxyExceptions.java b/jdk/test/java/lang/management/ManagementFactory/ProxyExceptions.java
index 7916867a03c..f55b0d76646 100644
--- a/jdk/test/java/lang/management/ManagementFactory/ProxyExceptions.java
+++ b/jdk/test/java/lang/management/ManagementFactory/ProxyExceptions.java
@@ -27,7 +27,6 @@
* @summary Test type mapping of the platform MXBean proxy
* returned from Management.newPlatformMXBeanProxy().
* @author Mandy Chung
- * @modules jdk.management
*/
import java.lang.management.*;
import javax.management.*;
diff --git a/jdk/test/java/lang/management/ManagementFactory/ProxyTypeMapping.java b/jdk/test/java/lang/management/ManagementFactory/ProxyTypeMapping.java
index 516c75aaba9..ed95bc89f7f 100644
--- a/jdk/test/java/lang/management/ManagementFactory/ProxyTypeMapping.java
+++ b/jdk/test/java/lang/management/ManagementFactory/ProxyTypeMapping.java
@@ -28,7 +28,6 @@
* returned from Management.newPlatformMXBeanProxy().
* @author Mandy Chung
*
- * @modules jdk.management
* @compile ProxyTypeMapping.java
* @run main/othervm -verbose:gc ProxyTypeMapping
*/
diff --git a/jdk/test/java/lang/management/ManagementFactory/TEST.properties b/jdk/test/java/lang/management/ManagementFactory/TEST.properties
new file mode 100644
index 00000000000..b6ae4201475
--- /dev/null
+++ b/jdk/test/java/lang/management/ManagementFactory/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.management
+
diff --git a/jdk/test/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java b/jdk/test/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java
index dc3c97f9c08..3d46963be39 100644
--- a/jdk/test/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java
+++ b/jdk/test/java/lang/management/ManagementFactory/ThreadMXBeanProxy.java
@@ -26,10 +26,8 @@
* @bug 5086470 6358247 7193302
* @summary Test type conversion when invoking ThreadMXBean.dumpAllThreads
* through proxy.
- *
* @author Mandy Chung
*
- * @modules jdk.management
* @run main ThreadMXBeanProxy
*/
diff --git a/jdk/test/java/lang/management/ManagementFactory/ValidateOpenTypes.java b/jdk/test/java/lang/management/ManagementFactory/ValidateOpenTypes.java
index ab2bbad6516..f5ada9fe497 100644
--- a/jdk/test/java/lang/management/ManagementFactory/ValidateOpenTypes.java
+++ b/jdk/test/java/lang/management/ManagementFactory/ValidateOpenTypes.java
@@ -28,7 +28,6 @@
* MBeanServer.
* @author Mandy Chung
*
- * @modules jdk.management
* @compile ValidateOpenTypes.java
* @run main/othervm -verbose:gc ValidateOpenTypes
*/
diff --git a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java
index 6d4fae0b632..d029c8ffc4c 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java
+++ b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java
@@ -27,17 +27,16 @@
* @summary Basic unit test of memory management testing:
* 1) setUsageThreshold() and getUsageThreshold()
* 2) test low memory detection on the old generation.
- *
* @author Mandy Chung
*
- * @library /lib/testlibrary/
- * @modules java.management
- * @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil
- * @run main/timeout=600 LowMemoryTest
* @requires vm.gc == "null"
* @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
* @requires vm.opt.ExplicitGCInvokesConcurrentAndUnloadsClasses != "true"
* @requires vm.opt.DisableExplicitGC != "true"
+ * @library /lib/testlibrary/
+ *
+ * @build jdk.testlibrary.* LowMemoryTest MemoryUtil RunUtil
+ * @run main/timeout=600 LowMemoryTest
*/
import java.lang.management.*;
diff --git a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh
index ee3a351dd68..515cb8f9e2f 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh
+++ b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest2.sh
@@ -25,8 +25,9 @@
# @test
# @bug 4982128
# @summary Test low memory detection of non-heap memory pool
+#
# @requires vm.gc=="null"
-# @modules java.management
+#
# @run build LowMemoryTest2 MemoryUtil
# @run shell/timeout=600 LowMemoryTest2.sh
#
@@ -51,10 +52,10 @@ go() {
}
# Run test with each GC configuration
-#
+#
# Notes: To ensure that metaspace fills up we disable class unloading.
# Also we set the max metaspace to 8MB - otherwise the test takes too
-# long to run.
+# long to run.
go -noclassgc -XX:MaxMetaspaceSize=16m -XX:+UseSerialGC LowMemoryTest2
go -noclassgc -XX:MaxMetaspaceSize=16m -XX:+UseParallelGC LowMemoryTest2
diff --git a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh
index 1a0b02dae42..563ffe326f0 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh
+++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementConcMarkSweepGC.sh
@@ -26,8 +26,9 @@
# @bug 4530538
# @summary Run MemoryManagement test with concurrent mark sweep GC
# @author Mandy Chung
+#
# @requires vm.gc=="ConcMarkSweep" | vm.gc=="null"
-# @modules java.management
+#
# @run build MemoryManagement
# @run shell/timeout=600 MemoryManagementConcMarkSweepGC.sh
#
@@ -42,7 +43,7 @@ else
fi
runOne()
-{
+{
echo "runOne $@"
$TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 2
}
diff --git a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementParallelGC.sh b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementParallelGC.sh
index f04f6d481e3..ebe7e52ca3b 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementParallelGC.sh
+++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementParallelGC.sh
@@ -26,8 +26,9 @@
# @bug 4530538
# @summary Run MemoryManagement test with parallel GC
# @author Mandy Chung
+#
# @requires vm.gc=="Parallel" | vm.gc=="null"
-# @modules java.management
+#
# @run build MemoryManagement
# @run shell/timeout=600 MemoryManagementParallelGC.sh
#
@@ -42,7 +43,7 @@ else
fi
runOne()
-{
+{
echo "runOne $@"
$TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 2
}
diff --git a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementSerialGC.sh b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementSerialGC.sh
index 567aea7d63a..f9de8f575bd 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementSerialGC.sh
+++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagementSerialGC.sh
@@ -26,8 +26,9 @@
# @bug 4530538
# @summary Run MemoryManagement test with serial GC
# @author Mandy Chung
+#
# @requires vm.gc=="Serial" | vm.gc=="null"
-# @modules java.management
+#
# @run build MemoryManagement
# @run shell/timeout=600 MemoryManagementSerialGC.sh
#
@@ -42,7 +43,7 @@ else
fi
runOne()
-{
+{
echo "runOne $@"
$TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 2
}
diff --git a/jdk/test/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh b/jdk/test/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh
index 4a8eea25705..d66ba73b4c0 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh
+++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryTestAllGC.sh
@@ -24,10 +24,11 @@
#
# @test
# @bug 4530538
-# @summary
+# @summary
# @author Mandy Chung
+#
# @requires vm.gc=="Parallel" | vm.gc=="null"
-# @modules java.management
+#
# @run compile MemoryTest.java
# @run shell MemoryTestAllGC.sh
#
@@ -42,7 +43,7 @@ else
fi
runOne()
-{
+{
echo "runOne $@"
$TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 2
}
diff --git a/jdk/test/java/lang/management/MemoryMXBean/Pending.java b/jdk/test/java/lang/management/MemoryMXBean/Pending.java
index 156708249d5..fb7a9e609e6 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/Pending.java
+++ b/jdk/test/java/lang/management/MemoryMXBean/Pending.java
@@ -24,8 +24,6 @@
/*
* @test
* @bug 4530538
- * @modules java.base/jdk.internal.misc
- * java.management
* @summary Basic unit test of
* RuntimeMXBean.getObjectPendingFinalizationCount()
* 1. GC and runFinalization() to get the current pending number
@@ -34,6 +32,9 @@
* 4. GC and runFinalization() and the finalizable objects should
* be garbage collected.
* @author Alexei Guibadoulline and Mandy Chung
+ *
+ * @modules java.base/jdk.internal.misc
+ * java.management
*/
import java.lang.management.*;
diff --git a/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java b/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java
index 2d52eeb4299..a3d69a91c29 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java
+++ b/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java
@@ -32,13 +32,14 @@
* @summary Basic Test for MemoryPool.resetPeakUsage()
* @author Mandy Chung
*
- * @library /lib/testlibrary/
- * @modules jdk.management
- * @build jdk.testlibrary.* ResetPeakMemoryUsage MemoryUtil RunUtil
- * @run main ResetPeakMemoryUsage
* @requires vm.opt.ExplicitGCInvokesConcurrent != "true"
* @requires vm.opt.ExplicitGCInvokesConcurrentAndUnloadsClasses != "true"
* @requires vm.opt.DisableExplicitGC != "true"
+ * @library /lib/testlibrary/
+ * @modules jdk.management
+ *
+ * @build jdk.testlibrary.* ResetPeakMemoryUsage MemoryUtil RunUtil
+ * @run main ResetPeakMemoryUsage
*/
import java.lang.management.*;
diff --git a/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java b/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java
index 7f49e73dc56..03038a632cf 100644
--- a/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java
+++ b/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java
@@ -28,7 +28,6 @@
* MemoryPoolMXBean.isCollectionThresholdExceeded().
* @author Mandy Chung
*
- * @modules java.management
* @run main/othervm ThresholdTest
*/
diff --git a/jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh b/jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh
index 0e9ad0f679e..dcef82b4908 100644
--- a/jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh
+++ b/jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh
@@ -23,11 +23,10 @@
#
# @test
+# @bug 6336608 6367473 6511738
# @summary Tests OperatingSystemMXBean.getSystemLoadAverage() api.
# @author Mandy Chung
-# @bug 6336608 6367473 6511738
#
-# @modules java.management
# @run build GetSystemLoadAverage
# @run shell/timeout=300 TestSystemLoadAvg.sh
#
diff --git a/jdk/test/java/lang/management/PlatformLoggingMXBean/TEST.properties b/jdk/test/java/lang/management/PlatformLoggingMXBean/TEST.properties
new file mode 100644
index 00000000000..53fa38c49ad
--- /dev/null
+++ b/jdk/test/java/lang/management/PlatformLoggingMXBean/TEST.properties
@@ -0,0 +1,2 @@
+modules = java.logging
+
diff --git a/jdk/test/java/lang/management/RuntimeMXBean/GetSystemProperties.java b/jdk/test/java/lang/management/RuntimeMXBean/GetSystemProperties.java
index a0248681944..5f6923526ab 100644
--- a/jdk/test/java/lang/management/RuntimeMXBean/GetSystemProperties.java
+++ b/jdk/test/java/lang/management/RuntimeMXBean/GetSystemProperties.java
@@ -26,7 +26,6 @@
* @bug 4990512
* @summary Basic Test for RuntimeMXBean.getSystemProperties().
* @author Mandy Chung
- * @modules java.management
*/
import java.lang.management.ManagementFactory;
diff --git a/jdk/test/java/lang/management/RuntimeMXBean/PropertiesTest.java b/jdk/test/java/lang/management/RuntimeMXBean/PropertiesTest.java
index 47ba46a6321..1d9bff41afa 100644
--- a/jdk/test/java/lang/management/RuntimeMXBean/PropertiesTest.java
+++ b/jdk/test/java/lang/management/RuntimeMXBean/PropertiesTest.java
@@ -28,7 +28,6 @@
* properties contain another list of properties as the defaults.
* @author Mandy Chung
*
- * @modules java.management
* @run build PropertiesTest
* @run main PropertiesTest
*/
diff --git a/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh b/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh
index d76b2bd2c34..409ce8f0baa 100644
--- a/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh
+++ b/jdk/test/java/lang/management/RuntimeMXBean/TestInputArgument.sh
@@ -24,9 +24,9 @@
#
# @test
# @bug 4530538
-# @summary
+# @summary
# @author Mandy Chung
-# @modules java.management
+#
# @run compile InputArgument.java
# @run shell TestInputArgument.sh
#
@@ -41,12 +41,12 @@ else
fi
runOne()
-{
+{
echo "runOne $@"
$TESTJAVA/bin/java $TESTVMOPTS -classpath $TESTCLASSES "$@" || exit 2
}
-runOne InputArgument
+runOne InputArgument
runOne -XX:+UseFastJNIAccessors -Xlog:gc*=debug InputArgument
runOne -XX:+UseFastJNIAccessors -Xlog:gc*=debug InputArgument -XX:+UseFastJNIAccessors
diff --git a/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java b/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java
index aa529c98976..153e3b88eb2 100644
--- a/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java
+++ b/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java
@@ -26,7 +26,6 @@
* @bug 4530538
* @summary Basic unit test of RuntimeMXBean.getUptime()
* @author Alexei Guibadoulline
- * @modules java.management
*/
import java.lang.management.*;
diff --git a/jdk/test/java/lang/management/TEST.properties b/jdk/test/java/lang/management/TEST.properties
new file mode 100644
index 00000000000..81cb3fce719
--- /dev/null
+++ b/jdk/test/java/lang/management/TEST.properties
@@ -0,0 +1,2 @@
+modules = java.management
+
diff --git a/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java b/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java
index 167469b1412..1bb57d4ee50 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java
@@ -24,11 +24,10 @@
/*
* @test
* @bug 4530538
+ * @key intermittent
* @summary Basic unit test of ThreadMXBean.getAllThreadIds()
* @author Alexei Guibadoulline and Mandy Chung
*
- * @key intermittent
- * @modules java.management
* @run main/othervm AllThreadIds
*/
diff --git a/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java b/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java
index 759abf9e5bf..eaf07feff2b 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java
@@ -27,7 +27,6 @@
* @summary The capability is disabled regardless of number of times
* it was enabled.
* @author Mandy Chung
- * @modules java.management
*/
import java.lang.management.ThreadMXBean;
diff --git a/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java b/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java
index 0a3a658e36d..ed16a8e87f6 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java
@@ -29,7 +29,6 @@
* and ThreadMXBean.setThreadCpuTimeEnabled().
* @author Mandy Chung
*
- * @modules java.management
* @run main EnableTest
*/
diff --git a/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java b/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java
index b5a7702a1ea..c2fd2a651e4 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java
@@ -31,7 +31,6 @@
* - ThreadMXBean.findMonitorDeadlockedThreads()
* @author Mandy Chung
*
- * @modules java.management
* @build MonitorDeadlock
* @build SynchronizerDeadlock
* @build ThreadDump
diff --git a/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java b/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java
index 8833febad1e..6df72174c53 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java
@@ -28,7 +28,6 @@
* - ThreadMXBean.findMonitorDeadlockedThreads()
* @author Mandy Chung
*
- * @modules java.management
* @build MonitorDeadlock
* @build ThreadDump
* @run main/othervm FindMonitorDeadlock
diff --git a/jdk/test/java/lang/management/ThreadMXBean/InvalidThreadID.java b/jdk/test/java/lang/management/ThreadMXBean/InvalidThreadID.java
index 8f7608f2d2b..d178685d608 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/InvalidThreadID.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/InvalidThreadID.java
@@ -28,7 +28,6 @@
* if id <= 0 and returns -1 if the thread doesn't exist.
* @author Mandy Chung
*
- * @modules java.management
* @run main InvalidThreadID
*/
diff --git a/jdk/test/java/lang/management/ThreadMXBean/LockedMonitors.java b/jdk/test/java/lang/management/ThreadMXBean/LockedMonitors.java
index 85a3ebfbd90..6dad46d6f18 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/LockedMonitors.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/LockedMonitors.java
@@ -34,7 +34,6 @@
*
* @author Mandy Chung
*
- * @modules java.management
* @build Barrier
* @build LockingThread
* @build ThreadDump
diff --git a/jdk/test/java/lang/management/ThreadMXBean/LockedSynchronizers.java b/jdk/test/java/lang/management/ThreadMXBean/LockedSynchronizers.java
index 95299d5e5f1..9032438a9ea 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/LockedSynchronizers.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/LockedSynchronizers.java
@@ -30,7 +30,6 @@
*
* @author Mandy Chung
*
- * @modules java.management
* @build Barrier
* @build SynchronizerLockingThread
* @build ThreadDump
diff --git a/jdk/test/java/lang/management/ThreadMXBean/Locks.java b/jdk/test/java/lang/management/ThreadMXBean/Locks.java
index 95fa29d6596..fa7a5b63a6f 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/Locks.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/Locks.java
@@ -26,11 +26,11 @@
* @bug 4530538
* @summary Basic unit test of ThreadInfo.getLockName()
* and ThreadInfo.getLockOwnerName()
- * @library /lib/testlibrary
* @author Mandy Chung
* @author Jaroslav Bachorik
*
- * @modules java.management
+ * @library /lib/testlibrary
+ *
* @build jdk.testlibrary.*
* @run main/othervm Locks
*/
diff --git a/jdk/test/java/lang/management/ThreadMXBean/MyOwnSynchronizer.java b/jdk/test/java/lang/management/ThreadMXBean/MyOwnSynchronizer.java
index 3c6b1a68d08..69094b1e987 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/MyOwnSynchronizer.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/MyOwnSynchronizer.java
@@ -28,7 +28,6 @@
* and getThreadInfo of customized JSR-166 synchronizers.
* @author Mandy Chung
*
- * @modules java.management
* @build Barrier
* @build ThreadDump
* @run main/othervm MyOwnSynchronizer
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java b/jdk/test/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java
index 5253b687704..414ee4b41d0 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ResetPeakThreadCount.java
@@ -29,7 +29,6 @@
* @author Mandy Chung
* @author Jaroslav Bachorik
*
- * @modules java.management
* @build ResetPeakThreadCount
* @build ThreadDump
* @run main/othervm ResetPeakThreadCount
diff --git a/jdk/test/java/lang/management/ThreadMXBean/SharedSynchronizer.java b/jdk/test/java/lang/management/ThreadMXBean/SharedSynchronizer.java
index 4034830dacf..c714486e440 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/SharedSynchronizer.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/SharedSynchronizer.java
@@ -28,7 +28,6 @@
* in shared mode which has no owner when a thread is parked.
* @author Mandy Chung
*
- * @modules java.management
* @run main/othervm SharedSynchronizer
*/
diff --git a/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java b/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java
index 336389c0ef0..7d004ed8c72 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/SynchronizationStatistics.java
@@ -25,11 +25,9 @@
* @test
* @bug 4530538
* @summary Basic unit test of the synchronization statistics support:
- *
* @author Mandy Chung
* @author Jaroslav Bachorik
*
- * @modules java.management
* @run main/othervm SynchronizationStatistics
*/
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java
index 55c171cea74..b08eaa1a563 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadBlockedCount.java
@@ -27,7 +27,7 @@
* @summary Basic unit test of ThreadInfo.getBlockedCount()
* @author Alexei Guibadoulline and Mandy Chung
* @author Jaroslav Bachorik
- * @modules java.management
+ *
* @run main ThreadBlockedCount
*/
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadCounts.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadCounts.java
index 094144a86d7..265b4b20eaf 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadCounts.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadCounts.java
@@ -30,7 +30,6 @@
* mbean.getDaemonThreadCount()
* @author Alexei Guibadoulline
*
- * @modules java.management
* @run main ThreadCounts
*/
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadCpuTime.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadCpuTime.java
index ae9ddf63aeb..61fff639363 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadCpuTime.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadCpuTime.java
@@ -27,7 +27,6 @@
* @summary Basic test of ThreadMXBean.getThreadCpuTime and
* getCurrentThreadCpuTime.
* @author Mandy Chung
- * @modules java.management
*/
import java.lang.management.*;
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadDaemonTest.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadDaemonTest.java
index 0ec3fa8bbe3..35cad89268b 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadDaemonTest.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadDaemonTest.java
@@ -31,7 +31,6 @@ import java.util.concurrent.atomic.*;
* @bug 6588467
* @summary Basic test of ThreadInfo.isDaemon
* @author Jeremy Manson
- * @modules java.management
*/
public class ThreadDaemonTest {
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java
index 93bde6ff2d2..433a3f54c0d 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadLists.java
@@ -26,7 +26,6 @@
* @bug 5047639
* @summary Check that the "java-level" APIs provide a consistent view of
* the thread list
- * @modules java.management
*/
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadMXBean;
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java
index 492303aa114..6a9c9cacedf 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java
@@ -27,12 +27,11 @@
* @summary Basic unit test of thread states returned by
* ThreadMXBean.getThreadInfo.getThreadState().
* It also tests lock information returned by ThreadInfo.
- *
* @author Mandy Chung
*
* @library ../../Thread
* @library /lib/testlibrary
- * @modules java.management
+ *
* @build jdk.testlibrary.*
* @build ThreadMXBeanStateTest ThreadStateController
* @run main ThreadMXBeanStateTest
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadStackTrace.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadStackTrace.java
index e45ac93cce2..4842d623c35 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadStackTrace.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadStackTrace.java
@@ -28,7 +28,6 @@
* ThreadInfo.getThreadState()
* @author Mandy Chung
*
- * @modules java.management
* @run build Utils
* @run main ThreadStackTrace
*/
diff --git a/jdk/test/java/lang/management/ThreadMXBean/ThreadUserTime.java b/jdk/test/java/lang/management/ThreadMXBean/ThreadUserTime.java
index c90daa94bfe..8f38ef8b1fb 100644
--- a/jdk/test/java/lang/management/ThreadMXBean/ThreadUserTime.java
+++ b/jdk/test/java/lang/management/ThreadMXBean/ThreadUserTime.java
@@ -27,7 +27,6 @@
* @summary Basic test of ThreadMXBean.getThreadUserTime and
* getCurrentThreadUserTime.
* @author Mandy Chung
- * @modules java.management
*/
import java.lang.management.*;
diff --git a/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java b/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java
index ae454b5b7e0..cc77fced683 100644
--- a/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java
+++ b/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java
@@ -29,7 +29,7 @@
* test codebase has the java permission to read the "java.runtime.version"
* system property.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean ImplVersionTest ImplVersionCommand
* @run build ImplVersionTest ImplVersionCommand ImplVersionReader
* @run main ImplVersionTest
diff --git a/jdk/test/javax/management/Introspector/AnnotationSecurityTest.java b/jdk/test/javax/management/Introspector/AnnotationSecurityTest.java
index 0afb509272c..43b466fbdf6 100644
--- a/jdk/test/javax/management/Introspector/AnnotationSecurityTest.java
+++ b/jdk/test/javax/management/Introspector/AnnotationSecurityTest.java
@@ -27,7 +27,10 @@
* @summary Test that having a security manager doesn't trigger a
* NotCompliantMBeanException
* @author Daniel Fuchs, Yves Joan
- * @modules java.management
+ *
+ * @modules java.desktop
+ * java.management
+ *
* @run clean AnnotationSecurityTest Described UnDescribed DescribedMBean
* UnDescribedMBean SqeDescriptorKey DescribedMX DescribedMXBean
* @run build AnnotationSecurityTest Described UnDescribed DescribedMBean
diff --git a/jdk/test/javax/management/Introspector/AnnotationTest.java b/jdk/test/javax/management/Introspector/AnnotationTest.java
index f14502f310e..7d0021d6e09 100644
--- a/jdk/test/javax/management/Introspector/AnnotationTest.java
+++ b/jdk/test/javax/management/Introspector/AnnotationTest.java
@@ -27,7 +27,7 @@
* @summary Test that annotations in Standard MBean interfaces
* correctly produce Descriptor entries
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean AnnotationTest
* @run build AnnotationTest
* @run main AnnotationTest
diff --git a/jdk/test/javax/management/Introspector/ChangingNotifsTest.java b/jdk/test/javax/management/Introspector/ChangingNotifsTest.java
index ec2043c624b..57451d64cbc 100644
--- a/jdk/test/javax/management/Introspector/ChangingNotifsTest.java
+++ b/jdk/test/javax/management/Introspector/ChangingNotifsTest.java
@@ -27,7 +27,7 @@
* @summary Check that Standard MBeans can change their MBeanNotificationInfo[]
* and MXBeans cannot
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean ChangingNotifsTest
* @run build ChangingNotifsTest
* @run main ChangingNotifsTest
diff --git a/jdk/test/javax/management/Introspector/ClassLeakTest.java b/jdk/test/javax/management/Introspector/ClassLeakTest.java
index 5fe43fdd193..c6136333493 100644
--- a/jdk/test/javax/management/Introspector/ClassLeakTest.java
+++ b/jdk/test/javax/management/Introspector/ClassLeakTest.java
@@ -26,7 +26,7 @@
* @bug 4909536
* @summary Ensure that the Introspector does not retain refs to classes
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean ClassLeakTest
* @run build ClassLeakTest
* @run main ClassLeakTest
diff --git a/jdk/test/javax/management/Introspector/DuplicateGetterTest.java b/jdk/test/javax/management/Introspector/DuplicateGetterTest.java
index 7be19a00f4e..ec9ed438f41 100644
--- a/jdk/test/javax/management/Introspector/DuplicateGetterTest.java
+++ b/jdk/test/javax/management/Introspector/DuplicateGetterTest.java
@@ -27,7 +27,6 @@
* @summary Test that an MBean interface can inherit two methods with
* the same signature from two unrelated parent interfaces
* @author Eamonn McManus
- * @modules java.management
*/
import java.util.*;
diff --git a/jdk/test/javax/management/Introspector/FeatureOrderTest.java b/jdk/test/javax/management/Introspector/FeatureOrderTest.java
index 96ad78efed2..d109abf741b 100644
--- a/jdk/test/javax/management/Introspector/FeatureOrderTest.java
+++ b/jdk/test/javax/management/Introspector/FeatureOrderTest.java
@@ -27,7 +27,6 @@
* @summary Test that attributes and operations appear in the same order
* in MBeanInfo as they did in the Standard MBean or MXBean Interface.
* @author Eamonn McManus
- * @modules java.management
*/
/*
diff --git a/jdk/test/javax/management/Introspector/GetMBeanInfoExceptionTest.java b/jdk/test/javax/management/Introspector/GetMBeanInfoExceptionTest.java
index bfc71b73c41..7152e0dcd4c 100644
--- a/jdk/test/javax/management/Introspector/GetMBeanInfoExceptionTest.java
+++ b/jdk/test/javax/management/Introspector/GetMBeanInfoExceptionTest.java
@@ -27,7 +27,7 @@
* @summary Test that the exception thrown by DynamicMBean.getMBeanInfo()
* keeps the init cause.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean GetMBeanInfoExceptionTest
* @run build GetMBeanInfoExceptionTest
* @run main GetMBeanInfoExceptionTest
diff --git a/jdk/test/javax/management/Introspector/IdenticalMBeanInfoTest.java b/jdk/test/javax/management/Introspector/IdenticalMBeanInfoTest.java
index 9cbad773c74..d9718949387 100644
--- a/jdk/test/javax/management/Introspector/IdenticalMBeanInfoTest.java
+++ b/jdk/test/javax/management/Introspector/IdenticalMBeanInfoTest.java
@@ -27,7 +27,7 @@
* @summary Check that MBeans with the same class have identical MBeanInfo
* unless they are NotificationBroadcasters
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean IdenticalMBeanInfoTest
* @run build IdenticalMBeanInfoTest
* @run main IdenticalMBeanInfoTest
diff --git a/jdk/test/javax/management/Introspector/ImmutableNotificationInfoTest.java b/jdk/test/javax/management/Introspector/ImmutableNotificationInfoTest.java
index 4880493868e..4c7467a5681 100644
--- a/jdk/test/javax/management/Introspector/ImmutableNotificationInfoTest.java
+++ b/jdk/test/javax/management/Introspector/ImmutableNotificationInfoTest.java
@@ -27,7 +27,7 @@
* @summary Check that a StandardMBean has immutableInfo=true if it is
* a NotificationBroadcasterSupport that doesn't override getNotificationInfo()
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean ImmutableNotificationInfoTest
* @run build ImmutableNotificationInfoTest
* @run main ImmutableNotificationInfoTest
diff --git a/jdk/test/javax/management/Introspector/InvokeGettersTest.java b/jdk/test/javax/management/Introspector/InvokeGettersTest.java
index 5dacf04b102..6036069a6f5 100644
--- a/jdk/test/javax/management/Introspector/InvokeGettersTest.java
+++ b/jdk/test/javax/management/Introspector/InvokeGettersTest.java
@@ -26,7 +26,7 @@
* @bug 6317101
* @summary Test that the jmx.invoke.getters system property works
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean InvokeGettersTest
* @run build InvokeGettersTest
* @run main InvokeGettersTest
diff --git a/jdk/test/javax/management/Introspector/IsMethodTest.java b/jdk/test/javax/management/Introspector/IsMethodTest.java
index a1ec7dbb74d..8a719c628f3 100644
--- a/jdk/test/javax/management/Introspector/IsMethodTest.java
+++ b/jdk/test/javax/management/Introspector/IsMethodTest.java
@@ -26,7 +26,7 @@
* @bug 4947001 4954369 4954409 4954410
* @summary Test that "Boolean isX()" and "int isX()" define operations
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean IsMethodTest
* @run build IsMethodTest
* @run main IsMethodTest
diff --git a/jdk/test/javax/management/Introspector/LegacyConstructorPropertiesTest.java b/jdk/test/javax/management/Introspector/LegacyConstructorPropertiesTest.java
index 4848aad5473..f8f33ec9e92 100644
--- a/jdk/test/javax/management/Introspector/LegacyConstructorPropertiesTest.java
+++ b/jdk/test/javax/management/Introspector/LegacyConstructorPropertiesTest.java
@@ -37,8 +37,10 @@ import javax.management.ObjectName;
* j.b.ConstructorProperties and j.m.ConstructorProperties annotations
* only j.m.ConstructorProperties annotation is considered.
* @author Jaroslav Bachorik
- * @modules java.management
- * java.desktop
+ *
+ * @modules java.desktop
+ * java.management
+ *
* @run main LegacyConstructorPropertiesTest
*/
diff --git a/jdk/test/javax/management/Introspector/NotAnMBeanTest.java b/jdk/test/javax/management/Introspector/NotAnMBeanTest.java
index 4fccc43e9b5..3bcb68b8e27 100644
--- a/jdk/test/javax/management/Introspector/NotAnMBeanTest.java
+++ b/jdk/test/javax/management/Introspector/NotAnMBeanTest.java
@@ -26,7 +26,7 @@
* @bug 4914805
* @summary Ensure that the right exception is thrown for illegal MBeans
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean NotAnMBeanTest
* @run build NotAnMBeanTest
* @run main NotAnMBeanTest
diff --git a/jdk/test/javax/management/Introspector/NotCompliantCauseTest.java b/jdk/test/javax/management/Introspector/NotCompliantCauseTest.java
index 063d30c9cbc..056f00c6527 100644
--- a/jdk/test/javax/management/Introspector/NotCompliantCauseTest.java
+++ b/jdk/test/javax/management/Introspector/NotCompliantCauseTest.java
@@ -27,7 +27,7 @@
* @summary Test that NotCompliantMBeanException has a cause in case of
* type mapping problems.
* @author Daniel Fuchs, Alexander Shusherov
- * @modules java.management
+ *
* @run clean NotCompliantCauseTest
* @run build NotCompliantCauseTest
* @run main NotCompliantCauseTest
@@ -40,7 +40,6 @@
*/
import java.util.Random;
-import java.util.logging.Logger;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
@@ -54,12 +53,6 @@ import javax.management.openmbean.OpenDataException;
*/
public class NotCompliantCauseTest {
- /**
- * A logger for this class.
- **/
- private static final Logger LOG =
- Logger.getLogger(NotCompliantCauseTest.class.getName());
-
/**
* Creates a new instance of NotCompliantCauseTest
*/
diff --git a/jdk/test/javax/management/Introspector/SetWrongTypeAttributeTest.java b/jdk/test/javax/management/Introspector/SetWrongTypeAttributeTest.java
index 111aec1a422..b1762d0efbe 100644
--- a/jdk/test/javax/management/Introspector/SetWrongTypeAttributeTest.java
+++ b/jdk/test/javax/management/Introspector/SetWrongTypeAttributeTest.java
@@ -27,7 +27,7 @@
* @summary Check that setting the wrong type of an attribute in a Standard
* MBean or MXBean causes InvalidAttributeValueException
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean SetWrongTypeAttributeTest
* @run build SetWrongTypeAttributeTest
* @run main SetWrongTypeAttributeTest
diff --git a/jdk/test/javax/management/Introspector/UnregisterMBeanExceptionTest.java b/jdk/test/javax/management/Introspector/UnregisterMBeanExceptionTest.java
index c2695d76dd7..d18a72bc5a7 100644
--- a/jdk/test/javax/management/Introspector/UnregisterMBeanExceptionTest.java
+++ b/jdk/test/javax/management/Introspector/UnregisterMBeanExceptionTest.java
@@ -28,7 +28,7 @@
* the supplied MBean although DynamicMBean.getMBeanInfo() throws
* a runtime exception.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean UnregisterMBeanExceptionTest
* @run build UnregisterMBeanExceptionTest
* @run main UnregisterMBeanExceptionTest
diff --git a/jdk/test/javax/management/MBeanInfo/EqualExceptionTest.java b/jdk/test/javax/management/MBeanInfo/EqualExceptionTest.java
index 2e71b9d05a1..0f12667281f 100644
--- a/jdk/test/javax/management/MBeanInfo/EqualExceptionTest.java
+++ b/jdk/test/javax/management/MBeanInfo/EqualExceptionTest.java
@@ -26,7 +26,7 @@
* @bug 5071110
* @summary Test whether an null descriptor will cause an NullPointerException.
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean EqualExceptionTest
* @run build EqualExceptionTest
* @run main EqualExceptionTest
diff --git a/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsNPETest.java b/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsNPETest.java
index d433190d866..ff67ff71d6c 100644
--- a/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsNPETest.java
+++ b/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsNPETest.java
@@ -36,7 +36,7 @@ import javax.management.openmbean.SimpleType;
* @bug 8023954
* @summary Test that MBean*Info.equals do not throw NPE
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean MBeanInfoEqualsNPETest
* @run build MBeanInfoEqualsNPETest
* @run main MBeanInfoEqualsNPETest
diff --git a/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsTest.java b/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsTest.java
index 239cf5ceac9..f2dfeb90a88 100644
--- a/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsTest.java
+++ b/jdk/test/javax/management/MBeanInfo/MBeanInfoEqualsTest.java
@@ -26,7 +26,7 @@
* @bug 4719923
* @summary Test that MBeanInfo.equals works even for mutable subclasses
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean MBeanInfoEqualsTest
* @run build MBeanInfoEqualsTest
* @run main MBeanInfoEqualsTest
diff --git a/jdk/test/javax/management/MBeanInfo/MBeanInfoHashCodeNPETest.java b/jdk/test/javax/management/MBeanInfo/MBeanInfoHashCodeNPETest.java
index 2a175d76305..ee322338a4d 100644
--- a/jdk/test/javax/management/MBeanInfo/MBeanInfoHashCodeNPETest.java
+++ b/jdk/test/javax/management/MBeanInfo/MBeanInfoHashCodeNPETest.java
@@ -35,7 +35,7 @@ import javax.management.openmbean.SimpleType;
* @bug 8023669
* @summary Test that hashCode()throws NullPointerException
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean MBeanInfoHashCodeNPETest
* @run build MBeanInfoHashCodeNPETest
* @run main MBeanInfoHashCodeNPETest
diff --git a/jdk/test/javax/management/MBeanInfo/NullInfoArraysTest.java b/jdk/test/javax/management/MBeanInfo/NullInfoArraysTest.java
index c608d787f38..ca0c3321057 100644
--- a/jdk/test/javax/management/MBeanInfo/NullInfoArraysTest.java
+++ b/jdk/test/javax/management/MBeanInfo/NullInfoArraysTest.java
@@ -27,7 +27,7 @@
* @summary Test that an MBeanInfo works even if it is deserialized from
* an implementation where its array fields can be null.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean NullInfoArraysTest
* @run build NullInfoArraysTest
* @run main NullInfoArraysTest
diff --git a/jdk/test/javax/management/MBeanInfo/SerializationTest.java b/jdk/test/javax/management/MBeanInfo/SerializationTest.java
index c83fd92e9db..0781cdb4fca 100644
--- a/jdk/test/javax/management/MBeanInfo/SerializationTest.java
+++ b/jdk/test/javax/management/MBeanInfo/SerializationTest.java
@@ -26,7 +26,7 @@
* @bug 6288100
* @summary Test the new serialization/deserialization methods.
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean SerializationTest
* @run build SerializationTest
* @run main SerializationTest
diff --git a/jdk/test/javax/management/MBeanInfo/SerializationTest1.java b/jdk/test/javax/management/MBeanInfo/SerializationTest1.java
index a33898a6a8f..6ccd2066df1 100644
--- a/jdk/test/javax/management/MBeanInfo/SerializationTest1.java
+++ b/jdk/test/javax/management/MBeanInfo/SerializationTest1.java
@@ -26,7 +26,7 @@
* @bug 6783290
* @summary Test correct reading of an empty Descriptor.
* @author Jaroslav Bachorik
- * @modules java.management
+ *
* @run clean SerializationTest1
* @run build SerializationTest1
* @run main SerializationTest1
diff --git a/jdk/test/javax/management/MBeanInfo/TooManyFooTest.java b/jdk/test/javax/management/MBeanInfo/TooManyFooTest.java
index 55782e4d68d..03be5670344 100644
--- a/jdk/test/javax/management/MBeanInfo/TooManyFooTest.java
+++ b/jdk/test/javax/management/MBeanInfo/TooManyFooTest.java
@@ -27,7 +27,7 @@
* @summary Test that a method inherited from two different interfaces
* appears only once in MBeanInfo.
* @author dfuchs
- * @modules java.management
+ *
* @run clean TooManyFooTest
* @run build TooManyFooTest
* @run main TooManyFooTest
@@ -55,12 +55,6 @@ import javax.management.openmbean.OpenMBeanOperationInfo;
*/
public class TooManyFooTest {
- /**
- * A logger for this class.
- **/
- private static final Logger LOG =
- Logger.getLogger(TooManyFooTest.class.getName());
-
public static class NumberHolder {
public Integer getNumber() { return 0;}
public void setNumber(Integer n) {};
diff --git a/jdk/test/javax/management/MBeanServer/AttributeListTypeSafeTest.java b/jdk/test/javax/management/MBeanServer/AttributeListTypeSafeTest.java
index 3fec474ebfe..602e1f2ebd2 100644
--- a/jdk/test/javax/management/MBeanServer/AttributeListTypeSafeTest.java
+++ b/jdk/test/javax/management/MBeanServer/AttributeListTypeSafeTest.java
@@ -26,7 +26,6 @@
* @bug 6336968
* @summary Test adding non-Attribute values to an AttributeList.
* @author Eamonn McManus
- * @modules java.management
*/
import java.util.Collections;
diff --git a/jdk/test/javax/management/MBeanServer/MBeanExceptionTest.java b/jdk/test/javax/management/MBeanServer/MBeanExceptionTest.java
index 4e908b39766..31b8530e3e8 100644
--- a/jdk/test/javax/management/MBeanServer/MBeanExceptionTest.java
+++ b/jdk/test/javax/management/MBeanServer/MBeanExceptionTest.java
@@ -28,8 +28,7 @@
* RuntimeMBeanException and (for Standard MBeans) that checked exceptions
* are wrapped in MBeanException
* @author Eamonn McManus
- * @modules java.management
- * @compile MBeanExceptionTest.java
+ *
* @run main MBeanExceptionTest
*/
diff --git a/jdk/test/javax/management/MBeanServer/MBeanFallbackTest.java b/jdk/test/javax/management/MBeanServer/MBeanFallbackTest.java
index b6ab026f801..6cf508598de 100644
--- a/jdk/test/javax/management/MBeanServer/MBeanFallbackTest.java
+++ b/jdk/test/javax/management/MBeanServer/MBeanFallbackTest.java
@@ -33,7 +33,7 @@ import javax.management.ObjectName;
* It needs to be a separate class because the "jdk.jmx.mbeans.allowNonPublic"
* system property must be set before c.s.j.m.MBeanAnalyzer has been loaded.
* @author Jaroslav Bachorik
- * @modules java.management
+ *
* @run clean MBeanFallbackTest
* @run build MBeanFallbackTest
* @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true MBeanFallbackTest
diff --git a/jdk/test/javax/management/MBeanServer/MBeanServerInvocationHandlerExceptionTest.java b/jdk/test/javax/management/MBeanServer/MBeanServerInvocationHandlerExceptionTest.java
index b0008f34e74..441f18c9ba7 100644
--- a/jdk/test/javax/management/MBeanServer/MBeanServerInvocationHandlerExceptionTest.java
+++ b/jdk/test/javax/management/MBeanServer/MBeanServerInvocationHandlerExceptionTest.java
@@ -26,7 +26,7 @@
* @bug 5092515
* @summary Test how to unwrap a user specific exception
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean MBeanServerInvocationHandlerExceptionTest
* @run build MBeanServerInvocationHandlerExceptionTest
* @run main MBeanServerInvocationHandlerExceptionTest
diff --git a/jdk/test/javax/management/MBeanServer/MBeanTest.java b/jdk/test/javax/management/MBeanServer/MBeanTest.java
index 342e15d3b69..628b607f97c 100644
--- a/jdk/test/javax/management/MBeanServer/MBeanTest.java
+++ b/jdk/test/javax/management/MBeanServer/MBeanTest.java
@@ -31,7 +31,7 @@ import javax.management.ObjectName;
* @bug 8010285
* @summary General MBean test.
* @author Jaroslav Bachorik
- * @modules java.management
+ *
* @run clean MBeanTest
* @run build MBeanTest
* @run main MBeanTest
diff --git a/jdk/test/javax/management/MBeanServer/NewMBeanListenerTest.java b/jdk/test/javax/management/MBeanServer/NewMBeanListenerTest.java
index cbccf234e1c..ae92a91b20b 100644
--- a/jdk/test/javax/management/MBeanServer/NewMBeanListenerTest.java
+++ b/jdk/test/javax/management/MBeanServer/NewMBeanListenerTest.java
@@ -26,7 +26,7 @@
* @bug 4757273
* @summary Test that registered notification is sent early enough
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean NewMBeanListenerTest
* @run build NewMBeanListenerTest
* @run main NewMBeanListenerTest
diff --git a/jdk/test/javax/management/MBeanServer/NotifDeadlockTest.java b/jdk/test/javax/management/MBeanServer/NotifDeadlockTest.java
index c46a90fdc96..4020addf222 100644
--- a/jdk/test/javax/management/MBeanServer/NotifDeadlockTest.java
+++ b/jdk/test/javax/management/MBeanServer/NotifDeadlockTest.java
@@ -26,7 +26,7 @@
* @bug 4757273
* @summary Test deadlock in MBeanServerDelegate listeners
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean NotifDeadlockTest
* @run build NotifDeadlockTest
* @run main NotifDeadlockTest
diff --git a/jdk/test/javax/management/MBeanServer/PostExceptionTest.java b/jdk/test/javax/management/MBeanServer/PostExceptionTest.java
index 35db83c2dc7..3e3c802fc88 100644
--- a/jdk/test/javax/management/MBeanServer/PostExceptionTest.java
+++ b/jdk/test/javax/management/MBeanServer/PostExceptionTest.java
@@ -27,8 +27,7 @@
* @summary Check behaviour of MBeanServer when postRegister and postDeregister
* throw exceptions.
* @author Daniel Fuchs
- * @modules java.management
- * @compile PostExceptionTest.java
+ *
* @run main PostExceptionTest
*/
diff --git a/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest.java b/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest.java
index 81876af0274..cb198635219 100644
--- a/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest.java
+++ b/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest.java
@@ -26,7 +26,7 @@
* @bug 6417044
* @summary Test deadlock in MBeanRegistration.postRegister method
* @author Eamonn McManus, Daniel Fuchs
- * @modules java.management
+ *
* @run clean PostRegisterDeadlockTest
* @run build PostRegisterDeadlockTest
* @run main PostRegisterDeadlockTest
diff --git a/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest2.java b/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest2.java
index d6d52304add..c816a163c67 100644
--- a/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest2.java
+++ b/jdk/test/javax/management/MBeanServer/PostRegisterDeadlockTest2.java
@@ -26,7 +26,7 @@
* @bug 6417044
* @summary Test that a failing MBean registration does not lead to a deadlock
* @author Eamonn McManus
- * @modules java.management
+ *
* @run main PostRegisterDeadlockTest2
*/
diff --git a/jdk/test/javax/management/MBeanServer/PreDeregisterDeadlockTest.java b/jdk/test/javax/management/MBeanServer/PreDeregisterDeadlockTest.java
index f3eb915830f..33d8c592a13 100644
--- a/jdk/test/javax/management/MBeanServer/PreDeregisterDeadlockTest.java
+++ b/jdk/test/javax/management/MBeanServer/PreDeregisterDeadlockTest.java
@@ -26,7 +26,7 @@
* @bug 6318664
* @summary Test deadlock in MBeanRegistration.preDeregister method
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean PreDeregisterDeadlockTest
* @run build PreDeregisterDeadlockTest
* @run main PreDeregisterDeadlockTest
diff --git a/jdk/test/javax/management/MBeanServer/PreRegisterTest.java b/jdk/test/javax/management/MBeanServer/PreRegisterTest.java
index 7b1098184c6..4f72fec4d41 100644
--- a/jdk/test/javax/management/MBeanServer/PreRegisterTest.java
+++ b/jdk/test/javax/management/MBeanServer/PreRegisterTest.java
@@ -26,7 +26,7 @@
* @bug 4911846
* @summary Test that MBeanRegistration can change caller ObjectName
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean PreRegisterTest
* @run build PreRegisterTest
* @run main PreRegisterTest
diff --git a/jdk/test/javax/management/MBeanServerFactory/ReleaseMBeanServerTest.java b/jdk/test/javax/management/MBeanServerFactory/ReleaseMBeanServerTest.java
index d9d792b3ac5..aa3dd193847 100644
--- a/jdk/test/javax/management/MBeanServerFactory/ReleaseMBeanServerTest.java
+++ b/jdk/test/javax/management/MBeanServerFactory/ReleaseMBeanServerTest.java
@@ -27,7 +27,7 @@
* @summary Test that the releaseMBeanServer(MBeanServer mbeanServer) method
* throws IllegalArgumentException as expected
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean ReleaseMBeanServerTest
* @run build ReleaseMBeanServerTest
* @run main ReleaseMBeanServerTest
diff --git a/jdk/test/javax/management/MustBeValidMBeanInfo/MustBeValidCommand.java b/jdk/test/javax/management/MustBeValidMBeanInfo/MustBeValidCommand.java
index 005b1e73933..56a5e14c958 100644
--- a/jdk/test/javax/management/MustBeValidMBeanInfo/MustBeValidCommand.java
+++ b/jdk/test/javax/management/MustBeValidMBeanInfo/MustBeValidCommand.java
@@ -28,7 +28,7 @@
* IllegalArgumentException when attribute names, operation names, and
* Java type names do not strictly follow the expected Java syntax.
* @author Daniel Fuchs
- * @modules java.management
+ *
* @run clean MustBeValidCommand
* @run build MustBeValidCommand
* @run main MustBeValidCommand
diff --git a/jdk/test/javax/management/ObjectInstance/MBeanInfoFailTest.java b/jdk/test/javax/management/ObjectInstance/MBeanInfoFailTest.java
index 0435329d08b..2c45830cb8c 100644
--- a/jdk/test/javax/management/ObjectInstance/MBeanInfoFailTest.java
+++ b/jdk/test/javax/management/ObjectInstance/MBeanInfoFailTest.java
@@ -26,7 +26,7 @@
* @bug 5001857
* @summary Test queryNames() and queryMBeans() with a buggy DynamicMBean
* @author Daniel Fuchs
- * @modules java.management
+ *
* @run clean MBeanInfoFailTest
* @run build MBeanInfoFailTest
* @run main MBeanInfoFailTest
diff --git a/jdk/test/javax/management/ObjectInstance/ObjectInstanceNullTest.java b/jdk/test/javax/management/ObjectInstance/ObjectInstanceNullTest.java
index 33e8497119d..b44d32eb205 100644
--- a/jdk/test/javax/management/ObjectInstance/ObjectInstanceNullTest.java
+++ b/jdk/test/javax/management/ObjectInstance/ObjectInstanceNullTest.java
@@ -26,7 +26,7 @@
* @bug 5015663
* @summary Test ObjectInstance(name,null).hashCode() and .equals()
* @author Daniel Fuchs
- * @modules java.management
+ *
* @run clean ObjectInstanceNullTest
* @run build ObjectInstanceNullTest
* @run main ObjectInstanceNullTest
diff --git a/jdk/test/javax/management/ObjectInstance/ToStringMethodTest.java b/jdk/test/javax/management/ObjectInstance/ToStringMethodTest.java
index 166d06c8c55..b9be85632b6 100644
--- a/jdk/test/javax/management/ObjectInstance/ToStringMethodTest.java
+++ b/jdk/test/javax/management/ObjectInstance/ToStringMethodTest.java
@@ -26,7 +26,7 @@
* @bug 5080083
* @summary Test new added method "toString"
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean ToStringMethodTest
* @run build ToStringMethodTest
* @run main ToStringMethodTest
diff --git a/jdk/test/javax/management/ObjectName/ApplyWildcardTest.java b/jdk/test/javax/management/ObjectName/ApplyWildcardTest.java
index 88427122b15..8033e6b4397 100644
--- a/jdk/test/javax/management/ObjectName/ApplyWildcardTest.java
+++ b/jdk/test/javax/management/ObjectName/ApplyWildcardTest.java
@@ -27,7 +27,7 @@
* @summary Test the ObjectName.apply(ObjectName) method
* with wildcards in the key properties value part.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean ApplyWildcardTest
* @run build ApplyWildcardTest
* @run main ApplyWildcardTest
diff --git a/jdk/test/javax/management/ObjectName/ComparatorTest.java b/jdk/test/javax/management/ObjectName/ComparatorTest.java
index 2803302ffee..4f8f17e17dd 100644
--- a/jdk/test/javax/management/ObjectName/ComparatorTest.java
+++ b/jdk/test/javax/management/ObjectName/ComparatorTest.java
@@ -26,7 +26,7 @@
* @bug 5036680
* @summary Test the ObjectName.compareTo() method.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean ComparatorTest
* @run build ComparatorTest
* @run main ComparatorTest
diff --git a/jdk/test/javax/management/ObjectName/DelegateNameWildcardNameTest.java b/jdk/test/javax/management/ObjectName/DelegateNameWildcardNameTest.java
index 030b629c850..4d0bf2418ee 100644
--- a/jdk/test/javax/management/ObjectName/DelegateNameWildcardNameTest.java
+++ b/jdk/test/javax/management/ObjectName/DelegateNameWildcardNameTest.java
@@ -27,7 +27,7 @@
* @summary Test that MBeanServerDelegate.DELEGATE_NAME and ObjectName.WILDCARD
* public constants have been initialized properly.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean DelegateNameWildcardNameTest
* @run build DelegateNameWildcardNameTest
* @run main DelegateNameWildcardNameTest
diff --git a/jdk/test/javax/management/ObjectName/NullEmptyKeyValueTest.java b/jdk/test/javax/management/ObjectName/NullEmptyKeyValueTest.java
index 385b58c6f55..ac84c58ac6b 100644
--- a/jdk/test/javax/management/ObjectName/NullEmptyKeyValueTest.java
+++ b/jdk/test/javax/management/ObjectName/NullEmptyKeyValueTest.java
@@ -26,7 +26,7 @@
* @bug 6229396
* @summary Test null/empty key/values in ObjectName constructors.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean NullEmptyKeyValueTest
* @run build NullEmptyKeyValueTest
* @run main NullEmptyKeyValueTest
diff --git a/jdk/test/javax/management/ObjectName/ObjectNameGetInstanceTest.java b/jdk/test/javax/management/ObjectName/ObjectNameGetInstanceTest.java
index 12d0f1c5d95..b121c805de3 100644
--- a/jdk/test/javax/management/ObjectName/ObjectNameGetInstanceTest.java
+++ b/jdk/test/javax/management/ObjectName/ObjectNameGetInstanceTest.java
@@ -26,7 +26,7 @@
* @bug 4894801
* @summary Test that ObjectName.getInstance(ObjectName) preserves key order
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean ObjectNameGetInstanceTest
* @run build ObjectNameGetInstanceTest
* @run main ObjectNameGetInstanceTest
diff --git a/jdk/test/javax/management/ObjectName/RepositoryWildcardTest.java b/jdk/test/javax/management/ObjectName/RepositoryWildcardTest.java
index 6eba9ff0da8..821673df8c4 100644
--- a/jdk/test/javax/management/ObjectName/RepositoryWildcardTest.java
+++ b/jdk/test/javax/management/ObjectName/RepositoryWildcardTest.java
@@ -27,7 +27,7 @@
* @summary Test if the repository supports correctly the use of
* wildcards in the ObjectName key properties value part.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean RepositoryWildcardTest
* @run build RepositoryWildcardTest
* @run main RepositoryWildcardTest
diff --git a/jdk/test/javax/management/ObjectName/SerialCompatTest.java b/jdk/test/javax/management/ObjectName/SerialCompatTest.java
index cbab37d2484..14b8720987b 100644
--- a/jdk/test/javax/management/ObjectName/SerialCompatTest.java
+++ b/jdk/test/javax/management/ObjectName/SerialCompatTest.java
@@ -26,7 +26,7 @@
* @bug 6211220 6616825
* @summary Test that jmx.serial.form=1.0 works for ObjectName
* @author Eamonn McManus, Daniel Fuchs
- * @modules java.management
+ *
* @run clean SerialCompatTest
* @run build SerialCompatTest
* @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true -Djmx.serial.form=1.0 SerialCompatTest
diff --git a/jdk/test/javax/management/ObjectName/ValueWildcardTest.java b/jdk/test/javax/management/ObjectName/ValueWildcardTest.java
index ee436bdb551..bdc2db574b6 100644
--- a/jdk/test/javax/management/ObjectName/ValueWildcardTest.java
+++ b/jdk/test/javax/management/ObjectName/ValueWildcardTest.java
@@ -26,7 +26,7 @@
* @bug 4716807
* @summary Test wildcards in ObjectName key properties value part.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean ValueWildcardTest
* @run build ValueWildcardTest
* @run main ValueWildcardTest
diff --git a/jdk/test/javax/management/TEST.properties b/jdk/test/javax/management/TEST.properties
new file mode 100644
index 00000000000..81cb3fce719
--- /dev/null
+++ b/jdk/test/javax/management/TEST.properties
@@ -0,0 +1,2 @@
+modules = java.management
+
diff --git a/jdk/test/javax/management/descriptor/DefaultDescriptorTest.java b/jdk/test/javax/management/descriptor/DefaultDescriptorTest.java
index 9b3d120ebd4..0fc5edf39bb 100644
--- a/jdk/test/javax/management/descriptor/DefaultDescriptorTest.java
+++ b/jdk/test/javax/management/descriptor/DefaultDescriptorTest.java
@@ -26,7 +26,7 @@
* @bug 6204469
* @summary Test that MBean*Info can be constructed with default descriptor
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean DefaultDescriptorTest
* @run build DefaultDescriptorTest
* @run main DefaultDescriptorTest
diff --git a/jdk/test/javax/management/descriptor/DescriptorTest.java b/jdk/test/javax/management/descriptor/DescriptorTest.java
index cb2fd79e41e..e16446d6991 100644
--- a/jdk/test/javax/management/descriptor/DescriptorTest.java
+++ b/jdk/test/javax/management/descriptor/DescriptorTest.java
@@ -26,7 +26,7 @@
* @bug 6204469 6273765
* @summary Test various aspects of the Descriptor interface
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean DescriptorTest
* @run build DescriptorTest
* @run main DescriptorTest
diff --git a/jdk/test/javax/management/descriptor/EqualsHashCodeTest.java b/jdk/test/javax/management/descriptor/EqualsHashCodeTest.java
index ca8caaad6e2..de685655209 100644
--- a/jdk/test/javax/management/descriptor/EqualsHashCodeTest.java
+++ b/jdk/test/javax/management/descriptor/EqualsHashCodeTest.java
@@ -26,7 +26,7 @@
* @bug 6255956
* @summary Test equals and hashCode for descriptors
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean EqualsHashCodeTest
* @run build EqualsHashCodeTest
* @run main EqualsHashCodeTest
diff --git a/jdk/test/javax/management/descriptor/ImmutableArrayFieldTest.java b/jdk/test/javax/management/descriptor/ImmutableArrayFieldTest.java
index 43138457108..3826a687894 100644
--- a/jdk/test/javax/management/descriptor/ImmutableArrayFieldTest.java
+++ b/jdk/test/javax/management/descriptor/ImmutableArrayFieldTest.java
@@ -27,7 +27,7 @@
* @summary Test that immutability of ImmutableDescriptor cannot be
* compromised by modifying field values that are arrays.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean ImmutableArrayFieldTest
* @run build ImmutableArrayFieldTest
* @run main ImmutableArrayFieldTest
diff --git a/jdk/test/javax/management/descriptor/ImmutableDescriptorSerialTest.java b/jdk/test/javax/management/descriptor/ImmutableDescriptorSerialTest.java
index c1f8b20949b..61385e5f44c 100644
--- a/jdk/test/javax/management/descriptor/ImmutableDescriptorSerialTest.java
+++ b/jdk/test/javax/management/descriptor/ImmutableDescriptorSerialTest.java
@@ -26,7 +26,7 @@
* @bug 6204469
* @summary Test ImmutableDescriptor serialization.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean ImmutableDescriptorSerialTest
* @run build ImmutableDescriptorSerialTest
* @run main ImmutableDescriptorSerialTest
diff --git a/jdk/test/javax/management/descriptor/ImmutableDescriptorSetFieldsTest.java b/jdk/test/javax/management/descriptor/ImmutableDescriptorSetFieldsTest.java
index 49cbf6203dd..7e587bcb05a 100644
--- a/jdk/test/javax/management/descriptor/ImmutableDescriptorSetFieldsTest.java
+++ b/jdk/test/javax/management/descriptor/ImmutableDescriptorSetFieldsTest.java
@@ -28,7 +28,7 @@
* null name in it and calling setFields with a field names array with an
* empty name in it throw the expected exceptions.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean ImmutableDescriptorSetFieldsTest
* @run build ImmutableDescriptorSetFieldsTest
* @run main ImmutableDescriptorSetFieldsTest
diff --git a/jdk/test/javax/management/descriptor/MBeanInfoInteropTest.java b/jdk/test/javax/management/descriptor/MBeanInfoInteropTest.java
index 96a0101abdc..68a668cd59c 100644
--- a/jdk/test/javax/management/descriptor/MBeanInfoInteropTest.java
+++ b/jdk/test/javax/management/descriptor/MBeanInfoInteropTest.java
@@ -26,7 +26,7 @@
* @bug 6204469
* @summary Check that descriptors have not broken serial interop.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean MBeanInfoInteropTest SerializedInfo
* @run build MBeanInfoInteropTest SerializedInfo
* @run main MBeanInfoInteropTest SerializedInfo
diff --git a/jdk/test/javax/management/descriptor/UnionTest.java b/jdk/test/javax/management/descriptor/UnionTest.java
index 3fc8590fca1..27dc2b828ff 100644
--- a/jdk/test/javax/management/descriptor/UnionTest.java
+++ b/jdk/test/javax/management/descriptor/UnionTest.java
@@ -26,7 +26,7 @@
* @bug 6273752
* @summary Test ImmutableDescriptor.union
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean UnionTest
* @run build UnionTest
* @run main UnionTest
diff --git a/jdk/test/javax/management/generified/GenericTest.java b/jdk/test/javax/management/generified/GenericTest.java
index c445276d954..8a56f44ac66 100644
--- a/jdk/test/javax/management/generified/GenericTest.java
+++ b/jdk/test/javax/management/generified/GenericTest.java
@@ -26,7 +26,7 @@
* @bug 4847959 6191402
* @summary Test newly-generified APIs
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean GenericTest
* @run build GenericTest
* @run main GenericTest
diff --git a/jdk/test/javax/management/generified/ListTypeCheckTest.java b/jdk/test/javax/management/generified/ListTypeCheckTest.java
index 9a576784f5a..a28ffba92d4 100644
--- a/jdk/test/javax/management/generified/ListTypeCheckTest.java
+++ b/jdk/test/javax/management/generified/ListTypeCheckTest.java
@@ -26,7 +26,7 @@
* @bug 6250772
* @summary Test that *List objects are checked after asList is called.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean ListTypeCheckTest
* @run build ListTypeCheckTest
* @run main ListTypeCheckTest
diff --git a/jdk/test/javax/management/loading/ArrayClassTest.java b/jdk/test/javax/management/loading/ArrayClassTest.java
index 45a88cf302d..ce4cb4eff7a 100644
--- a/jdk/test/javax/management/loading/ArrayClassTest.java
+++ b/jdk/test/javax/management/loading/ArrayClassTest.java
@@ -27,7 +27,7 @@
* @summary Test that array classes can be found in signatures always
* and can be deserialized by the deprecated MBeanServer.deserialize method
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean ArrayClassTest
* @run build ArrayClassTest
* @run main ArrayClassTest
diff --git a/jdk/test/javax/management/loading/DocumentRootTest.java b/jdk/test/javax/management/loading/DocumentRootTest.java
index b517d634d2b..ae598ddd99e 100644
--- a/jdk/test/javax/management/loading/DocumentRootTest.java
+++ b/jdk/test/javax/management/loading/DocumentRootTest.java
@@ -27,7 +27,7 @@
* @summary Test parsing error when the mlet file is
* located in the web server's document root.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean DocumentRootTest
* @run build DocumentRootTest
* @run main DocumentRootTest
diff --git a/jdk/test/javax/management/loading/GetMBeansFromURLTest.java b/jdk/test/javax/management/loading/GetMBeansFromURLTest.java
index 8ca12dc13a6..5f4d889c91b 100644
--- a/jdk/test/javax/management/loading/GetMBeansFromURLTest.java
+++ b/jdk/test/javax/management/loading/GetMBeansFromURLTest.java
@@ -28,7 +28,7 @@
* given MLet instance throws a ServiceNotFoundException exception
* with a non null cause.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean GetMBeansFromURLTest
* @run build GetMBeansFromURLTest
* @run main GetMBeansFromURLTest
diff --git a/jdk/test/javax/management/loading/LibraryLoader/LibraryLoaderTest.java b/jdk/test/javax/management/loading/LibraryLoader/LibraryLoaderTest.java
index a858388e7f4..d2c07d2bb49 100644
--- a/jdk/test/javax/management/loading/LibraryLoader/LibraryLoaderTest.java
+++ b/jdk/test/javax/management/loading/LibraryLoader/LibraryLoaderTest.java
@@ -27,7 +27,7 @@
* @summary Test that the same native library coming from the same jar file can
* be loaded twice by two different MLets on the same JVM without conflict.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean LibraryLoaderTest
* @run build LibraryLoaderTest
* @run main/othervm LibraryLoaderTest
diff --git a/jdk/test/javax/management/loading/MLetCLR/MLetCommand.java b/jdk/test/javax/management/loading/MLetCLR/MLetCommand.java
index 728ee23ffa1..2519f4329b2 100644
--- a/jdk/test/javax/management/loading/MLetCLR/MLetCommand.java
+++ b/jdk/test/javax/management/loading/MLetCLR/MLetCommand.java
@@ -28,7 +28,7 @@
* for the test codebase as it is executed by the MLet code using
* doPrivileged.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean MLetCommand
* @run build MLetCommand
* @run main/othervm/java.security.policy=policy MLetCommand
diff --git a/jdk/test/javax/management/loading/MLetContentTest.java b/jdk/test/javax/management/loading/MLetContentTest.java
index 76f04b470ce..0fa9ce939f7 100644
--- a/jdk/test/javax/management/loading/MLetContentTest.java
+++ b/jdk/test/javax/management/loading/MLetContentTest.java
@@ -26,7 +26,7 @@
* @bug 4796780
* @summary The class MLetContentTest becomes public
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean MLetContentTest
* @run build MLetContentTest
* @run main MLetContentTest
diff --git a/jdk/test/javax/management/loading/MletParserLocaleTest.java b/jdk/test/javax/management/loading/MletParserLocaleTest.java
index b541e57a149..c1f25dd42bf 100644
--- a/jdk/test/javax/management/loading/MletParserLocaleTest.java
+++ b/jdk/test/javax/management/loading/MletParserLocaleTest.java
@@ -26,7 +26,7 @@
* @bug 7065236
* @summary Checking MletParser for Locale insensitive strings
* @author Harsha Wardhana B
- * @modules java.management
+ *
* @run clean MletParserLocaleTest
* @run build MletParserLocaleTest
* @run main/othervm/timeout=5 MletParserLocaleTest mlet4.html
diff --git a/jdk/test/javax/management/loading/ParserInfiniteLoopTest.java b/jdk/test/javax/management/loading/ParserInfiniteLoopTest.java
index f0f4da02355..0ae14339fb4 100644
--- a/jdk/test/javax/management/loading/ParserInfiniteLoopTest.java
+++ b/jdk/test/javax/management/loading/ParserInfiniteLoopTest.java
@@ -29,7 +29,7 @@
* terminated with the corresponding '>' and an opening '<' for
* the subsequent tag is encountered.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean ParserInfiniteLoopTest
* @run build ParserInfiniteLoopTest
* @run main/othervm/timeout=5 ParserInfiniteLoopTest mlet1.html
diff --git a/jdk/test/javax/management/loading/SystemClassLoaderTest.java b/jdk/test/javax/management/loading/SystemClassLoaderTest.java
index 73430b5b912..d31c5d11c7f 100644
--- a/jdk/test/javax/management/loading/SystemClassLoaderTest.java
+++ b/jdk/test/javax/management/loading/SystemClassLoaderTest.java
@@ -27,7 +27,7 @@
* @summary Test that a class can load MBeans from its class loader
* (at least if it is the system class loader)
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean SystemClassLoaderTest
* @run build SystemClassLoaderTest
* @run main SystemClassLoaderTest
diff --git a/jdk/test/javax/management/modelmbean/AddAttributeChangeNotificationListenerTest.java b/jdk/test/javax/management/modelmbean/AddAttributeChangeNotificationListenerTest.java
index 049e0be2720..609766adabc 100644
--- a/jdk/test/javax/management/modelmbean/AddAttributeChangeNotificationListenerTest.java
+++ b/jdk/test/javax/management/modelmbean/AddAttributeChangeNotificationListenerTest.java
@@ -30,7 +30,7 @@
* no other attributes.
* @author Yves Joan
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean AddAttributeChangeNotificationListenerTest
* @run build AddAttributeChangeNotificationListenerTest
* @run main AddAttributeChangeNotificationListenerTest
diff --git a/jdk/test/javax/management/modelmbean/DescriptorSupportSerialTest.java b/jdk/test/javax/management/modelmbean/DescriptorSupportSerialTest.java
index b83d2745bb8..c65af34c58c 100644
--- a/jdk/test/javax/management/modelmbean/DescriptorSupportSerialTest.java
+++ b/jdk/test/javax/management/modelmbean/DescriptorSupportSerialTest.java
@@ -26,7 +26,7 @@
* @bug 6332962
* @summary Test that DescriptorSupport does not serialize targetObject
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean DescriptorSupportSerialTest
* @run build DescriptorSupportSerialTest
* @run main DescriptorSupportSerialTest
diff --git a/jdk/test/javax/management/modelmbean/DescriptorSupportTest.java b/jdk/test/javax/management/modelmbean/DescriptorSupportTest.java
index a19044cc95c..ed33c737175 100644
--- a/jdk/test/javax/management/modelmbean/DescriptorSupportTest.java
+++ b/jdk/test/javax/management/modelmbean/DescriptorSupportTest.java
@@ -26,7 +26,7 @@
* @bug 4883712 4869006 4894856 5016685
* @summary Test that DescriptorSupport correctly validates fields
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean DescriptorSupportTest
* @run build DescriptorSupportTest
* @run main DescriptorSupportTest
diff --git a/jdk/test/javax/management/modelmbean/DescriptorSupportXMLLocaleTest.java b/jdk/test/javax/management/modelmbean/DescriptorSupportXMLLocaleTest.java
index 402bff7f6e0..340e4264d39 100644
--- a/jdk/test/javax/management/modelmbean/DescriptorSupportXMLLocaleTest.java
+++ b/jdk/test/javax/management/modelmbean/DescriptorSupportXMLLocaleTest.java
@@ -26,7 +26,7 @@
* @bug 7065236
* @summary Test for locale insensitive strings in DescriptorSupport class
* @author Harsha Wardhana B
- * @modules java.management
+ *
* @run clean DescriptorSupportXMLLocaleTest
* @run build DescriptorSupportXMLLocaleTest
* @run main DescriptorSupportXMLLocaleTest
diff --git a/jdk/test/javax/management/modelmbean/DescriptorSupportXMLTest.java b/jdk/test/javax/management/modelmbean/DescriptorSupportXMLTest.java
index 2e0aee671b3..dc66b2ad794 100644
--- a/jdk/test/javax/management/modelmbean/DescriptorSupportXMLTest.java
+++ b/jdk/test/javax/management/modelmbean/DescriptorSupportXMLTest.java
@@ -27,7 +27,7 @@
* @summary Test that DescriptorSupport.toXMLString() can be used to
* reconstruct an equivalent DescriptorSupport
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean DescriptorSupportXMLTest
* @run build DescriptorSupportXMLTest
* @run main DescriptorSupportXMLTest
diff --git a/jdk/test/javax/management/modelmbean/ExoticTargetTypeTest.java b/jdk/test/javax/management/modelmbean/ExoticTargetTypeTest.java
index a93791777a4..649379ed0d3 100644
--- a/jdk/test/javax/management/modelmbean/ExoticTargetTypeTest.java
+++ b/jdk/test/javax/management/modelmbean/ExoticTargetTypeTest.java
@@ -27,7 +27,7 @@
* @summary Test that a custom ModelMBean implementation can have custom
* targetType values in its ModelMBeanOperationInfo descriptors.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean ExoticTargetTypeTest
* @run build ExoticTargetTypeTest
* @run main ExoticTargetTypeTest
diff --git a/jdk/test/javax/management/modelmbean/InfoSupportTest.java b/jdk/test/javax/management/modelmbean/InfoSupportTest.java
index 01f92bae42e..4854a795697 100644
--- a/jdk/test/javax/management/modelmbean/InfoSupportTest.java
+++ b/jdk/test/javax/management/modelmbean/InfoSupportTest.java
@@ -29,7 +29,7 @@
* that getDescriptors("mbean") works, and that default values for
* MBean descriptors are correctly assigned.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean InfoSupportTest
* @run build InfoSupportTest
* @run main InfoSupportTest
diff --git a/jdk/test/javax/management/modelmbean/LoggingExceptionTest.java b/jdk/test/javax/management/modelmbean/LoggingExceptionTest.java
index 92516cd3956..94dfee092ea 100644
--- a/jdk/test/javax/management/modelmbean/LoggingExceptionTest.java
+++ b/jdk/test/javax/management/modelmbean/LoggingExceptionTest.java
@@ -29,7 +29,9 @@
* when traces enabled and no attributes.
* @author Luis-Miguel Alventosa
* @author Paul Cheeseman
- * @modules java.management
+ *
+ * @modules java.logging
+ * java.management
*/
import java.util.logging.ConsoleHandler;
diff --git a/jdk/test/javax/management/modelmbean/ModelMBeanInfoSupport/GetAllDescriptorsTest.java b/jdk/test/javax/management/modelmbean/ModelMBeanInfoSupport/GetAllDescriptorsTest.java
index fd272fbe1a3..b0b24f6510d 100644
--- a/jdk/test/javax/management/modelmbean/ModelMBeanInfoSupport/GetAllDescriptorsTest.java
+++ b/jdk/test/javax/management/modelmbean/ModelMBeanInfoSupport/GetAllDescriptorsTest.java
@@ -27,7 +27,7 @@
* @summary Test that ModelMBeanInfoSupport.getDescriptors(null) also
* returns the MBean's descriptor.
* @author Eamonn McManus, Daniel Fuchs
- * @modules java.management
+ *
* @run clean GetAllDescriptorsTest
* @run build GetAllDescriptorsTest
* @run main/othervm/java.security.policy=policy GetAllDescriptorsTest
diff --git a/jdk/test/javax/management/modelmbean/OnUnregisterTest.java b/jdk/test/javax/management/modelmbean/OnUnregisterTest.java
index dab8dc65512..4d8ada2308f 100644
--- a/jdk/test/javax/management/modelmbean/OnUnregisterTest.java
+++ b/jdk/test/javax/management/modelmbean/OnUnregisterTest.java
@@ -27,7 +27,7 @@
* @summary Check that OnUnregister is an allowed value for persistPolicy
* in ModelMBeanAttributeInfo
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean OnUnregisterTest
* @run build OnUnregisterTest
* @run main OnUnregisterTest
diff --git a/jdk/test/javax/management/modelmbean/RequiredModelMBeanGetAttributeTest.java b/jdk/test/javax/management/modelmbean/RequiredModelMBeanGetAttributeTest.java
index 855de5fb886..ca2a6768777 100644
--- a/jdk/test/javax/management/modelmbean/RequiredModelMBeanGetAttributeTest.java
+++ b/jdk/test/javax/management/modelmbean/RequiredModelMBeanGetAttributeTest.java
@@ -36,7 +36,7 @@
* - the declared name can be loaded by the value's class loader and
* produces a class to which the value can be assigned.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean RequiredModelMBeanGetAttributeTest
* @run build RequiredModelMBeanGetAttributeTest
* @run main RequiredModelMBeanGetAttributeTest
diff --git a/jdk/test/javax/management/modelmbean/RequiredModelMBeanMethodTest.java b/jdk/test/javax/management/modelmbean/RequiredModelMBeanMethodTest.java
index 54d86c82884..0ab0e7b59cc 100644
--- a/jdk/test/javax/management/modelmbean/RequiredModelMBeanMethodTest.java
+++ b/jdk/test/javax/management/modelmbean/RequiredModelMBeanMethodTest.java
@@ -28,7 +28,7 @@
* from the RequiredModelMBean class itself if they are not in the
* ModelMBeanInfo
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean RequiredModelMBeanMethodTest
* @run build RequiredModelMBeanMethodTest
* @run main RequiredModelMBeanMethodTest
diff --git a/jdk/test/javax/management/modelmbean/RequiredModelMBeanSetAttributeTest.java b/jdk/test/javax/management/modelmbean/RequiredModelMBeanSetAttributeTest.java
index 7f83c2839cc..949a56f9dc6 100644
--- a/jdk/test/javax/management/modelmbean/RequiredModelMBeanSetAttributeTest.java
+++ b/jdk/test/javax/management/modelmbean/RequiredModelMBeanSetAttributeTest.java
@@ -28,7 +28,7 @@
* MBeanException wrapping a ServiceNotFoundException is thrown is setAttribute
* called but no setMethod field has been provided.
* @author Jean-Francois Denise
- * @modules java.management
+ *
* @run clean RequiredModelMBeanSetAttributeTest
* @run build RequiredModelMBeanSetAttributeTest
* @run main RequiredModelMBeanSetAttributeTest
diff --git a/jdk/test/javax/management/modelmbean/SimpleModelMBean/SimpleModelMBeanCommand.java b/jdk/test/javax/management/modelmbean/SimpleModelMBean/SimpleModelMBeanCommand.java
index de7fba15686..5953935ef3c 100644
--- a/jdk/test/javax/management/modelmbean/SimpleModelMBean/SimpleModelMBeanCommand.java
+++ b/jdk/test/javax/management/modelmbean/SimpleModelMBean/SimpleModelMBeanCommand.java
@@ -28,7 +28,7 @@
* IllegalArgumentException when attribute names, operation names, and
* Java type names do not strictly follow the expected Java syntax.
* @author Eamonn McManus, Daniel Fuchs
- * @modules java.management
+ *
* @run clean SimpleModelMBeanCommand
* @run build SimpleModelMBeanCommand
* @run main/othervm/java.security.policy=policy SimpleModelMBeanCommand
diff --git a/jdk/test/javax/management/monitor/CounterMonitorDeadlockTest.java b/jdk/test/javax/management/monitor/CounterMonitorDeadlockTest.java
index 61115d6ee9f..be211c8346c 100644
--- a/jdk/test/javax/management/monitor/CounterMonitorDeadlockTest.java
+++ b/jdk/test/javax/management/monitor/CounterMonitorDeadlockTest.java
@@ -27,7 +27,7 @@
* @summary Test that no locks are held when a monitor attribute is sampled
* or notif delivered.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean CounterMonitorDeadlockTest
* @run build CounterMonitorDeadlockTest
* @run main CounterMonitorDeadlockTest 1
diff --git a/jdk/test/javax/management/monitor/CounterMonitorInitThresholdTest.java b/jdk/test/javax/management/monitor/CounterMonitorInitThresholdTest.java
index a0abb8825d1..ce55042d032 100644
--- a/jdk/test/javax/management/monitor/CounterMonitorInitThresholdTest.java
+++ b/jdk/test/javax/management/monitor/CounterMonitorInitThresholdTest.java
@@ -28,7 +28,7 @@
* objects added before the counter monitor is started as well as by
* the observed objects which are added once the monitor is started.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean CounterMonitorInitThresholdTest
* @run build CounterMonitorInitThresholdTest
* @run main CounterMonitorInitThresholdTest
diff --git a/jdk/test/javax/management/monitor/CounterMonitorTest.java b/jdk/test/javax/management/monitor/CounterMonitorTest.java
index 07dba0458ae..957789963fe 100644
--- a/jdk/test/javax/management/monitor/CounterMonitorTest.java
+++ b/jdk/test/javax/management/monitor/CounterMonitorTest.java
@@ -27,7 +27,7 @@
* @summary Test that the counter monitor, when running in difference mode,
* emits a notification every time the threshold is exceeded.
* @author Luis-Miguel Alventosa, Shanliang JIANG
- * @modules java.management
+ *
* @run clean CounterMonitorTest
* @run build CounterMonitorTest
* @run main CounterMonitorTest
diff --git a/jdk/test/javax/management/monitor/CounterMonitorThresholdTest.java b/jdk/test/javax/management/monitor/CounterMonitorThresholdTest.java
index 4463551ffdc..911ec6021a7 100644
--- a/jdk/test/javax/management/monitor/CounterMonitorThresholdTest.java
+++ b/jdk/test/javax/management/monitor/CounterMonitorThresholdTest.java
@@ -26,7 +26,7 @@
* @bug 6229368 8025207
* @summary Wrong threshold value in CounterMonitor with offset and modulus.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean CounterMonitorThresholdTest
* @run build CounterMonitorThresholdTest
* @run main CounterMonitorThresholdTest
diff --git a/jdk/test/javax/management/monitor/DerivedGaugeMonitorTest.java b/jdk/test/javax/management/monitor/DerivedGaugeMonitorTest.java
index 038df903dab..36b9dd40b50 100644
--- a/jdk/test/javax/management/monitor/DerivedGaugeMonitorTest.java
+++ b/jdk/test/javax/management/monitor/DerivedGaugeMonitorTest.java
@@ -26,7 +26,7 @@
* @bug 6683213
* @summary Test that the initial derived gauge is (Integer)0
* @author Daniel Fuchs
- * @modules java.management
+ *
* @run clean DerivedGaugeMonitorTest
* @run build DerivedGaugeMonitorTest
* @run main DerivedGaugeMonitorTest
diff --git a/jdk/test/javax/management/monitor/GaugeMonitorDeadlockTest.java b/jdk/test/javax/management/monitor/GaugeMonitorDeadlockTest.java
index 4f50b41a756..b6e3469ba78 100644
--- a/jdk/test/javax/management/monitor/GaugeMonitorDeadlockTest.java
+++ b/jdk/test/javax/management/monitor/GaugeMonitorDeadlockTest.java
@@ -27,8 +27,9 @@
* @summary Test that no locks are held when a monitor attribute is sampled
* or notif delivered.
* @author Eamonn McManus
+ *
* @library /lib/testlibrary
- * @modules java.management
+ *
* @run clean GaugeMonitorDeadlockTest
* @run build GaugeMonitorDeadlockTest
* @run main GaugeMonitorDeadlockTest 1
diff --git a/jdk/test/javax/management/monitor/MultiMonitorTest.java b/jdk/test/javax/management/monitor/MultiMonitorTest.java
index c8164d283b3..9f4c96063bf 100644
--- a/jdk/test/javax/management/monitor/MultiMonitorTest.java
+++ b/jdk/test/javax/management/monitor/MultiMonitorTest.java
@@ -24,13 +24,13 @@
/*
* @test
* @bug 4984057
+ * @key randomness
* @summary Test that monitors can sample a large number of attributes
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean MultiMonitorTest
* @run build MultiMonitorTest
* @run main MultiMonitorTest
- * @key randomness
*/
import java.util.*;
diff --git a/jdk/test/javax/management/monitor/NonComparableAttributeValueTest.java b/jdk/test/javax/management/monitor/NonComparableAttributeValueTest.java
index ada24cbc63c..2a4920a6453 100644
--- a/jdk/test/javax/management/monitor/NonComparableAttributeValueTest.java
+++ b/jdk/test/javax/management/monitor/NonComparableAttributeValueTest.java
@@ -28,7 +28,7 @@
* jmx.monitor.error.type notification when the attribute
* being monitored returns a non comparable value.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean NonComparableAttributeValueTest
* @run build NonComparableAttributeValueTest
* @run main NonComparableAttributeValueTest
diff --git a/jdk/test/javax/management/monitor/NullAttributeValueTest.java b/jdk/test/javax/management/monitor/NullAttributeValueTest.java
index 7bedeee13fa..f25b19bb0a3 100644
--- a/jdk/test/javax/management/monitor/NullAttributeValueTest.java
+++ b/jdk/test/javax/management/monitor/NullAttributeValueTest.java
@@ -29,7 +29,7 @@
* being monitored returns a null value.
* @author Luis-Miguel Alventosa
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean NullAttributeValueTest
* @run build NullAttributeValueTest
* @run main NullAttributeValueTest
diff --git a/jdk/test/javax/management/monitor/ReflectionExceptionTest.java b/jdk/test/javax/management/monitor/ReflectionExceptionTest.java
index a196c0d5a53..ff5acb2dd0d 100644
--- a/jdk/test/javax/management/monitor/ReflectionExceptionTest.java
+++ b/jdk/test/javax/management/monitor/ReflectionExceptionTest.java
@@ -24,11 +24,11 @@
/*
* @test
* @bug 6205072
+ * @key intermittent
* @summary Test that the jmx.monitor.error.runtime monitor notification
* is emitted when getAttribute throws ReflectionException.
* @author Luis-Miguel Alventosa
- * @key intermittent
- * @modules java.management
+ *
* @run clean ReflectionExceptionTest MBeanServerBuilderImpl
* MBeanServerForwarderInvocationHandler
* @run build ReflectionExceptionTest MBeanServerBuilderImpl
diff --git a/jdk/test/javax/management/monitor/RuntimeExceptionTest.java b/jdk/test/javax/management/monitor/RuntimeExceptionTest.java
index 097b0c29bd3..e6b5446195f 100644
--- a/jdk/test/javax/management/monitor/RuntimeExceptionTest.java
+++ b/jdk/test/javax/management/monitor/RuntimeExceptionTest.java
@@ -27,7 +27,7 @@
* @summary Test that the jmx.monitor.error.runtime monitor notification
* is emitted when getAttribute throws RuntimeException.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean RuntimeExceptionTest MBeanServerBuilderImpl
* MBeanServerForwarderInvocationHandler
* @run build RuntimeExceptionTest MBeanServerBuilderImpl
diff --git a/jdk/test/javax/management/monitor/StartStopTest.java b/jdk/test/javax/management/monitor/StartStopTest.java
index 5d5ff35cc12..82ff1619874 100644
--- a/jdk/test/javax/management/monitor/StartStopTest.java
+++ b/jdk/test/javax/management/monitor/StartStopTest.java
@@ -27,8 +27,9 @@
* @summary Test that tasks are cancelled properly when
* monitors are started and stopped in a loop.
* @author Luis-Miguel Alventosa
+ *
* @library /lib/testlibrary
- * @modules java.management
+ *
* @build jdk.testlibrary.*
* @run clean StartStopTest
* @run build StartStopTest
diff --git a/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java b/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java
index 1359ad4aa65..a89fef667f8 100644
--- a/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java
+++ b/jdk/test/javax/management/monitor/StringMonitorDeadlockTest.java
@@ -24,11 +24,11 @@
/*
* @test
* @bug 6303187
+ * @key intermittent
* @summary Test that no locks are held when a monitor attribute is sampled
* or notif delivered.
* @author Eamonn McManus
- * @key intermittent
- * @modules java.management
+ *
* @run clean StringMonitorDeadlockTest
* @run build StringMonitorDeadlockTest
* @run main StringMonitorDeadlockTest 1
diff --git a/jdk/test/javax/management/monitor/ThreadPoolAccTest.java b/jdk/test/javax/management/monitor/ThreadPoolAccTest.java
index 71b7c5ec064..5982fb1dc36 100644
--- a/jdk/test/javax/management/monitor/ThreadPoolAccTest.java
+++ b/jdk/test/javax/management/monitor/ThreadPoolAccTest.java
@@ -27,7 +27,7 @@
* @summary Test that each thread in the thread pool runs
* in the context of the monitor.start() caller.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean ThreadPoolAccTest
* @run build ThreadPoolAccTest
* @run main ThreadPoolAccTest
diff --git a/jdk/test/javax/management/monitor/ThreadPoolTest.java b/jdk/test/javax/management/monitor/ThreadPoolTest.java
index dce81dad808..b97a92e81a8 100644
--- a/jdk/test/javax/management/monitor/ThreadPoolTest.java
+++ b/jdk/test/javax/management/monitor/ThreadPoolTest.java
@@ -27,7 +27,7 @@
* @summary Test that all monitors will be well started when sharing
* a single thread pool.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean ThreadPoolTest
* @run build ThreadPoolTest
* @run main/othervm/timeout=300 ThreadPoolTest 1
diff --git a/jdk/test/javax/management/mxbean/AmbiguousConstructorTest.java b/jdk/test/javax/management/mxbean/AmbiguousConstructorTest.java
index 0766d1a8050..5ffb7c0c3b6 100644
--- a/jdk/test/javax/management/mxbean/AmbiguousConstructorTest.java
+++ b/jdk/test/javax/management/mxbean/AmbiguousConstructorTest.java
@@ -26,7 +26,7 @@
* @bug 6175517 6278707
* @summary Test that ambiguous ConstructorProperties annotations are detected.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean AmbiguousConstructorTest
* @run build AmbiguousConstructorTest
* @run main AmbiguousConstructorTest
diff --git a/jdk/test/javax/management/mxbean/ComparatorExceptionTest.java b/jdk/test/javax/management/mxbean/ComparatorExceptionTest.java
index 2de6cb1a528..ac9d0e41519 100644
--- a/jdk/test/javax/management/mxbean/ComparatorExceptionTest.java
+++ b/jdk/test/javax/management/mxbean/ComparatorExceptionTest.java
@@ -26,7 +26,6 @@
* @bug 6601652
* @summary Test exception when SortedMap or SortedSet has non-null Comparator
* @author Eamonn McManus
- * @modules java.management
*/
import java.util.SortedMap;
diff --git a/jdk/test/javax/management/mxbean/ExceptionDiagnosisTest.java b/jdk/test/javax/management/mxbean/ExceptionDiagnosisTest.java
index 16ece4db261..e944b51b0db 100644
--- a/jdk/test/javax/management/mxbean/ExceptionDiagnosisTest.java
+++ b/jdk/test/javax/management/mxbean/ExceptionDiagnosisTest.java
@@ -26,7 +26,6 @@
* @bug 6713777
* @summary Test that exception messages include all relevant information
* @author Eamonn McManus
- * @modules java.management
*/
import javax.management.ConstructorParameters;
diff --git a/jdk/test/javax/management/mxbean/GenericTypeTest.java b/jdk/test/javax/management/mxbean/GenericTypeTest.java
index 44cfbaa60fc..08015b4bca9 100644
--- a/jdk/test/javax/management/mxbean/GenericTypeTest.java
+++ b/jdk/test/javax/management/mxbean/GenericTypeTest.java
@@ -26,7 +26,7 @@
* @bug 6376416 6406447
* @summary Test use of generic types in MXBeans (mostly illegal).
* @author Eamonn McManus
- * @modules java.management
+ *
* @run main GenericTypeTest
*/
diff --git a/jdk/test/javax/management/mxbean/InvalidMXBeanRegistrationTest.java b/jdk/test/javax/management/mxbean/InvalidMXBeanRegistrationTest.java
index 21be355dd54..2fbb54fb454 100644
--- a/jdk/test/javax/management/mxbean/InvalidMXBeanRegistrationTest.java
+++ b/jdk/test/javax/management/mxbean/InvalidMXBeanRegistrationTest.java
@@ -27,7 +27,7 @@
* @summary Ensure the registration of an invalid MXBean
* throws NotCompliantMBeanException.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean InvalidMXBeanRegistrationTest
* @run build InvalidMXBeanRegistrationTest
* @run main InvalidMXBeanRegistrationTest
diff --git a/jdk/test/javax/management/mxbean/LeakTest.java b/jdk/test/javax/management/mxbean/LeakTest.java
index 43ac996ab5e..a715d0ea210 100644
--- a/jdk/test/javax/management/mxbean/LeakTest.java
+++ b/jdk/test/javax/management/mxbean/LeakTest.java
@@ -25,7 +25,7 @@
* @bug 6482247
* @summary Test that creating MXBeans does not introduce memory leaks.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run build LeakTest RandomMXBeanTest MerlinMXBean TigerMXBean
* @run main LeakTest
*/
diff --git a/jdk/test/javax/management/mxbean/MBeanOperationInfoTest.java b/jdk/test/javax/management/mxbean/MBeanOperationInfoTest.java
index 2f63e7f6a7a..960a084b933 100644
--- a/jdk/test/javax/management/mxbean/MBeanOperationInfoTest.java
+++ b/jdk/test/javax/management/mxbean/MBeanOperationInfoTest.java
@@ -26,7 +26,7 @@
* @bug 6359948
* @summary Check that MXBean operations have the expected ReturnType in MBeanOperationInfo
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean MBeanOperationInfoTest
* @run build MBeanOperationInfoTest
* @run main MBeanOperationInfoTest
diff --git a/jdk/test/javax/management/mxbean/MXBeanAnnotationTest.java b/jdk/test/javax/management/mxbean/MXBeanAnnotationTest.java
index 62d1f223f4b..793c68917ff 100644
--- a/jdk/test/javax/management/mxbean/MXBeanAnnotationTest.java
+++ b/jdk/test/javax/management/mxbean/MXBeanAnnotationTest.java
@@ -26,7 +26,7 @@
* @bug 6316491
* @summary Check that the MXBean annotation works as advertised
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean MXBeanAnnotationTest
* @run build MXBeanAnnotationTest
* @run main MXBeanAnnotationTest
diff --git a/jdk/test/javax/management/mxbean/MXBeanFallbackTest.java b/jdk/test/javax/management/mxbean/MXBeanFallbackTest.java
index e0243e8da08..00fd1c454c2 100644
--- a/jdk/test/javax/management/mxbean/MXBeanFallbackTest.java
+++ b/jdk/test/javax/management/mxbean/MXBeanFallbackTest.java
@@ -28,7 +28,7 @@
* It needs to be a separate class because the "jdk.jmx.mbeans.allowNonPublic"
* system property must be set before c.s.j.m.MBeanAnalyzer has been loaded.
* @author Jaroslav Bachorik
- * @modules java.management
+ *
* @run clean MXBeanFallbackTest
* @run build MXBeanFallbackTest
* @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true MXBeanFallbackTest
diff --git a/jdk/test/javax/management/mxbean/MXBeanFlagTest.java b/jdk/test/javax/management/mxbean/MXBeanFlagTest.java
index 71b1fc2f84c..36821d501ed 100644
--- a/jdk/test/javax/management/mxbean/MXBeanFlagTest.java
+++ b/jdk/test/javax/management/mxbean/MXBeanFlagTest.java
@@ -26,7 +26,7 @@
* @bug 6335337
* @summary Test correctness of mxbean flag in descriptor.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean MXBeanFlagTest
* @run build MXBeanFlagTest
* @run main MXBeanFlagTest
diff --git a/jdk/test/javax/management/mxbean/MXBeanLoadingTest1.java b/jdk/test/javax/management/mxbean/MXBeanLoadingTest1.java
index 2dd9abdaaa6..bcfc6fc00fc 100644
--- a/jdk/test/javax/management/mxbean/MXBeanLoadingTest1.java
+++ b/jdk/test/javax/management/mxbean/MXBeanLoadingTest1.java
@@ -26,8 +26,9 @@
* @bug 8058865
* @summary Checks correct collection of MXBean's class after unregistration
* @author Olivier Lagneau
- * @modules java.management
+ *
* @library /lib/testlibrary
+ *
* @run main/othervm/timeout=300 MXBeanLoadingTest1
*/
diff --git a/jdk/test/javax/management/mxbean/MXBeanPreRegisterTest.java b/jdk/test/javax/management/mxbean/MXBeanPreRegisterTest.java
index b8d9382f02d..72833c7dae0 100644
--- a/jdk/test/javax/management/mxbean/MXBeanPreRegisterTest.java
+++ b/jdk/test/javax/management/mxbean/MXBeanPreRegisterTest.java
@@ -27,7 +27,7 @@
* @summary Ensure that preRegister etc are called, but not when wrapped
* by the class StandardMBean
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean MXBeanPreRegisterTest
* @run build MXBeanPreRegisterTest
* @run main MXBeanPreRegisterTest
diff --git a/jdk/test/javax/management/mxbean/MXBeanRefTest.java b/jdk/test/javax/management/mxbean/MXBeanRefTest.java
index 19cf5f99e15..df46f698e23 100644
--- a/jdk/test/javax/management/mxbean/MXBeanRefTest.java
+++ b/jdk/test/javax/management/mxbean/MXBeanRefTest.java
@@ -26,7 +26,7 @@
* @bug 6296433 6283873
* @summary Test that inter-MXBean references work as expected.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean MXBeanRefTest
* @run build MXBeanRefTest
* @run main MXBeanRefTest
diff --git a/jdk/test/javax/management/mxbean/MiscTest.java b/jdk/test/javax/management/mxbean/MiscTest.java
index 27ce7bd4c8a..148d9e0d48b 100644
--- a/jdk/test/javax/management/mxbean/MiscTest.java
+++ b/jdk/test/javax/management/mxbean/MiscTest.java
@@ -28,7 +28,7 @@
* interfaceClassName, openType, originalType, StandardMBean,
* StandardEmitterMBean.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean MiscTest
* @run build MiscTest
* @run main MiscTest
diff --git a/jdk/test/javax/management/mxbean/OperationImpactTest.java b/jdk/test/javax/management/mxbean/OperationImpactTest.java
index 85e159777b4..29e3446b196 100644
--- a/jdk/test/javax/management/mxbean/OperationImpactTest.java
+++ b/jdk/test/javax/management/mxbean/OperationImpactTest.java
@@ -26,7 +26,7 @@
* @bug 6320104
* @summary Check that MXBean operations have impact UNKNOWN.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean OperationImpactTest
* @run build OperationImpactTest
* @run main OperationImpactTest
diff --git a/jdk/test/javax/management/mxbean/OverloadTest.java b/jdk/test/javax/management/mxbean/OverloadTest.java
index 6f6349c80d3..b22b1559638 100644
--- a/jdk/test/javax/management/mxbean/OverloadTest.java
+++ b/jdk/test/javax/management/mxbean/OverloadTest.java
@@ -26,7 +26,7 @@
* @bug 6175517
* @summary Test that MXBean interfaces can contain overloaded methods
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean OverloadTest
* @run build OverloadTest
* @run main OverloadTest
diff --git a/jdk/test/javax/management/mxbean/PreRegisterNameTest.java b/jdk/test/javax/management/mxbean/PreRegisterNameTest.java
index 2dabe17ea31..411b7bbf500 100644
--- a/jdk/test/javax/management/mxbean/PreRegisterNameTest.java
+++ b/jdk/test/javax/management/mxbean/PreRegisterNameTest.java
@@ -26,7 +26,6 @@
* @bug 6448042
* @summary Test that MXBeans can define their own names in preRegister
* @author Eamonn McManus
- * @modules java.management
*/
import java.lang.management.ManagementFactory;
diff --git a/jdk/test/javax/management/mxbean/PropertyNamesTest.java b/jdk/test/javax/management/mxbean/PropertyNamesTest.java
index 534f76c11d9..00be0c0ca9f 100644
--- a/jdk/test/javax/management/mxbean/PropertyNamesTest.java
+++ b/jdk/test/javax/management/mxbean/PropertyNamesTest.java
@@ -26,7 +26,7 @@
* @bug 6175517
* @summary Test the PropertyNames annotation with MXBeans
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean PropertyNamesTest
* @run build PropertyNamesTest
* @run main PropertyNamesTest
diff --git a/jdk/test/javax/management/mxbean/SameObjectTwoNamesTest.java b/jdk/test/javax/management/mxbean/SameObjectTwoNamesTest.java
index c71a256892d..10022c592f7 100644
--- a/jdk/test/javax/management/mxbean/SameObjectTwoNamesTest.java
+++ b/jdk/test/javax/management/mxbean/SameObjectTwoNamesTest.java
@@ -28,7 +28,7 @@
* names produces an exception
* @author Alexander Shusherov
* @author Eamonn McManus
- * @modules java.management
+ *
* @run main SameObjectTwoNamesTest
* @run main/othervm -Djmx.mxbean.multiname=true SameObjectTwoNamesTest
*/
diff --git a/jdk/test/javax/management/mxbean/StandardMBeanOverrideTest.java b/jdk/test/javax/management/mxbean/StandardMBeanOverrideTest.java
index c6c6be69332..9ae65e73693 100644
--- a/jdk/test/javax/management/mxbean/StandardMBeanOverrideTest.java
+++ b/jdk/test/javax/management/mxbean/StandardMBeanOverrideTest.java
@@ -29,7 +29,7 @@
* getMBeanInfo and getNotificationInfo in StandardMBean and
* StandardEmitterMBean.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean StandardMBeanOverrideTest
* @run build StandardMBeanOverrideTest
* @run main StandardMBeanOverrideTest
diff --git a/jdk/test/javax/management/mxbean/ThreadMXBeanTest.java b/jdk/test/javax/management/mxbean/ThreadMXBeanTest.java
index 2752d4beeb4..3bfef075721 100644
--- a/jdk/test/javax/management/mxbean/ThreadMXBeanTest.java
+++ b/jdk/test/javax/management/mxbean/ThreadMXBeanTest.java
@@ -24,13 +24,13 @@
/*
* @test
* @bug 6305746
+ * @key randomness
* @summary Test that the null values returned by the ThreadMXBean work.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean ThreadMXBeanTest
* @run build ThreadMXBeanTest
* @run main ThreadMXBeanTest
- * @key randomness
*/
import java.lang.management.*;
diff --git a/jdk/test/javax/management/mxbean/TypeNameTest.java b/jdk/test/javax/management/mxbean/TypeNameTest.java
index fdd7a94cc07..55c9b22835a 100644
--- a/jdk/test/javax/management/mxbean/TypeNameTest.java
+++ b/jdk/test/javax/management/mxbean/TypeNameTest.java
@@ -26,7 +26,6 @@
* @bug 6757225 6763051
* @summary Test that type names in MXBeans match their spec.
* @author Eamonn McManus
- * @modules java.management
*/
import java.lang.reflect.Field;
diff --git a/jdk/test/javax/management/notification/BroadcasterSupportDeadlockTest.java b/jdk/test/javax/management/notification/BroadcasterSupportDeadlockTest.java
index d4ba0bacc1b..be3f0d8caa8 100644
--- a/jdk/test/javax/management/notification/BroadcasterSupportDeadlockTest.java
+++ b/jdk/test/javax/management/notification/BroadcasterSupportDeadlockTest.java
@@ -27,7 +27,7 @@
* @summary Test that NotificationBroadcasterSupport can be subclassed
* and used with synchronized(this) without causing deadlock
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean BroadcasterSupportDeadlockTest
* @run build BroadcasterSupportDeadlockTest
* @run main BroadcasterSupportDeadlockTest
diff --git a/jdk/test/javax/management/notification/FilterExceptionTest.java b/jdk/test/javax/management/notification/FilterExceptionTest.java
index c0d02db1f8a..b2dcc8f2813 100644
--- a/jdk/test/javax/management/notification/FilterExceptionTest.java
+++ b/jdk/test/javax/management/notification/FilterExceptionTest.java
@@ -26,7 +26,7 @@
* @bug 6244855 6244863
* @summary Exception thrown by NotificationFilter should be ignored
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean FilterExceptionTest
* @run build FilterExceptionTest
* @run main FilterExceptionTest
diff --git a/jdk/test/javax/management/notification/NotifExecutorTest.java b/jdk/test/javax/management/notification/NotifExecutorTest.java
index 24e9e937be2..537135e1a19 100644
--- a/jdk/test/javax/management/notification/NotifExecutorTest.java
+++ b/jdk/test/javax/management/notification/NotifExecutorTest.java
@@ -26,7 +26,7 @@
* @bug 4661545
* @summary Tests to use an executor to send notifications.
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean NotifExecutorTest
* @run build NotifExecutorTest
* @run main NotifExecutorTest
diff --git a/jdk/test/javax/management/notification/NotifInfoTest.java b/jdk/test/javax/management/notification/NotifInfoTest.java
index f1ebaa15440..6980cc69f6b 100644
--- a/jdk/test/javax/management/notification/NotifInfoTest.java
+++ b/jdk/test/javax/management/notification/NotifInfoTest.java
@@ -26,7 +26,7 @@
* @bug 4506105 6303698
* @summary NotificationBroadcasterSupport should have a ctor with MBeanNotificationInfo[]
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean NotifInfoTest
* @run build NotifInfoTest
* @run main NotifInfoTest
diff --git a/jdk/test/javax/management/openmbean/ArrayTypeTest.java b/jdk/test/javax/management/openmbean/ArrayTypeTest.java
index c4b88b4047c..9f5acc954c7 100644
--- a/jdk/test/javax/management/openmbean/ArrayTypeTest.java
+++ b/jdk/test/javax/management/openmbean/ArrayTypeTest.java
@@ -26,7 +26,7 @@
* @bug 5045358
* @summary Test that Open MBeans support arrays of primitive types.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean ArrayTypeTest
* @run build ArrayTypeTest
* @run main ArrayTypeTest
diff --git a/jdk/test/javax/management/openmbean/BadConstraintTest.java b/jdk/test/javax/management/openmbean/BadConstraintTest.java
index 5f39ea83a2c..bd407eebb0d 100644
--- a/jdk/test/javax/management/openmbean/BadConstraintTest.java
+++ b/jdk/test/javax/management/openmbean/BadConstraintTest.java
@@ -27,7 +27,7 @@
* @summary Test that Open MBean attributes and parameters cannot have
* illegal constraints like min greater than max
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean BadConstraintTest
* @run build BadConstraintTest
* @run main BadConstraintTest
diff --git a/jdk/test/javax/management/openmbean/CompositeDataStringTest.java b/jdk/test/javax/management/openmbean/CompositeDataStringTest.java
index f49a6aa86ea..776c61de0a8 100644
--- a/jdk/test/javax/management/openmbean/CompositeDataStringTest.java
+++ b/jdk/test/javax/management/openmbean/CompositeDataStringTest.java
@@ -26,7 +26,6 @@
* @bug 6610174
* @summary Test that CompositeDataSupport.toString() represents arrays correctly
* @author Eamonn McManus
- * @modules java.management
*/
import javax.management.openmbean.ArrayType;
diff --git a/jdk/test/javax/management/openmbean/ConstraintTest.java b/jdk/test/javax/management/openmbean/ConstraintTest.java
index 5457ba03709..b74bada9ed3 100644
--- a/jdk/test/javax/management/openmbean/ConstraintTest.java
+++ b/jdk/test/javax/management/openmbean/ConstraintTest.java
@@ -26,7 +26,7 @@
* @bug 6204469
* @summary Test that Open MBean attributes and parameters check constraints
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean ConstraintTest
* @run build ConstraintTest
* @run main ConstraintTest
diff --git a/jdk/test/javax/management/openmbean/EqualsTest.java b/jdk/test/javax/management/openmbean/EqualsTest.java
index 7d63daff917..79fbe83b45b 100644
--- a/jdk/test/javax/management/openmbean/EqualsTest.java
+++ b/jdk/test/javax/management/openmbean/EqualsTest.java
@@ -26,7 +26,7 @@
* @bug 5072174
* @summary Test CompositeDataSupport.equals with ArrayType
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean EqualsTest
* @run build EqualsTest
* @run main EqualsTest
diff --git a/jdk/test/javax/management/openmbean/IsValueTest.java b/jdk/test/javax/management/openmbean/IsValueTest.java
index 93fa2514b24..94b83035b3c 100644
--- a/jdk/test/javax/management/openmbean/IsValueTest.java
+++ b/jdk/test/javax/management/openmbean/IsValueTest.java
@@ -26,7 +26,6 @@
* @bug 5072004
* @summary Test new rules for isValue
* @author Eamonn McManus
- * @modules java.management
*/
import javax.management.openmbean.*;
diff --git a/jdk/test/javax/management/openmbean/NullConstructorParamsTest.java b/jdk/test/javax/management/openmbean/NullConstructorParamsTest.java
index 0b0c4188666..167fb3d7c71 100644
--- a/jdk/test/javax/management/openmbean/NullConstructorParamsTest.java
+++ b/jdk/test/javax/management/openmbean/NullConstructorParamsTest.java
@@ -26,7 +26,6 @@
* @bug 6434298
* @summary Test IAE is thrown when typeName or description parameter is null for TabularType and CompositeType constructors
* @author Joel FERAUD
- * @modules java.management
*/
import javax.management.openmbean.*;
diff --git a/jdk/test/javax/management/openmbean/OpenMBeanInfoEqualsNPETest.java b/jdk/test/javax/management/openmbean/OpenMBeanInfoEqualsNPETest.java
index 2679615b759..d34c57d0dca 100644
--- a/jdk/test/javax/management/openmbean/OpenMBeanInfoEqualsNPETest.java
+++ b/jdk/test/javax/management/openmbean/OpenMBeanInfoEqualsNPETest.java
@@ -41,7 +41,7 @@ import javax.management.openmbean.SimpleType;
* @bug 8023529
* @summary Test that OpenMBean*Info.equals do not throw NPE
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean OpenMBeanInfoEqualsNPETest
* @run build OpenMBeanInfoEqualsNPETest
* @run main OpenMBeanInfoEqualsNPETest
diff --git a/jdk/test/javax/management/openmbean/OpenMBeanInfoHashCodeNPETest.java b/jdk/test/javax/management/openmbean/OpenMBeanInfoHashCodeNPETest.java
index 3cd70d30526..ee864d677a3 100644
--- a/jdk/test/javax/management/openmbean/OpenMBeanInfoHashCodeNPETest.java
+++ b/jdk/test/javax/management/openmbean/OpenMBeanInfoHashCodeNPETest.java
@@ -40,7 +40,7 @@ import javax.management.openmbean.SimpleType;
* @bug 8023529
* @summary Test that OpenMBean*Info.hashCode do not throw NPE
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean OpenMBeanInfoHashCodeNPETest
* @run build OpenMBeanInfoHashCodeNPETest
* @run main OpenMBeanInfoHashCodeNPETest
diff --git a/jdk/test/javax/management/openmbean/OpenTypeDescriptorTest.java b/jdk/test/javax/management/openmbean/OpenTypeDescriptorTest.java
index 885634e4707..33b209bb84e 100644
--- a/jdk/test/javax/management/openmbean/OpenTypeDescriptorTest.java
+++ b/jdk/test/javax/management/openmbean/OpenTypeDescriptorTest.java
@@ -28,7 +28,7 @@
* @summary Test that Open*MBeanInfo classes include "openType" in descriptor
* and also test serial compatibility with Java 5.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean OpenTypeDescriptorTest
* @run build OpenTypeDescriptorTest
* @run main OpenTypeDescriptorTest
diff --git a/jdk/test/javax/management/proxy/JMXProxyFallbackTest.java b/jdk/test/javax/management/proxy/JMXProxyFallbackTest.java
index f157457adad..c68a93654af 100644
--- a/jdk/test/javax/management/proxy/JMXProxyFallbackTest.java
+++ b/jdk/test/javax/management/proxy/JMXProxyFallbackTest.java
@@ -34,7 +34,7 @@ import javax.management.ObjectName;
* It needs to be a separate class because the "jdk.jmx.mbeans.allowNonPublic"
* system property must be set before c.s.j.m.MBeanAnalyzer has been loaded.
* @author Jaroslav Bachorik
- * @modules java.management
+ *
* @run clean JMXProxyFallbackTest
* @run build JMXProxyFallbackTest
* @run main/othervm -Djdk.jmx.mbeans.allowNonPublic=true JMXProxyFallbackTest
diff --git a/jdk/test/javax/management/proxy/JMXProxyTest.java b/jdk/test/javax/management/proxy/JMXProxyTest.java
index 33cae1dd3f9..d9e2fcd3d9c 100644
--- a/jdk/test/javax/management/proxy/JMXProxyTest.java
+++ b/jdk/test/javax/management/proxy/JMXProxyTest.java
@@ -33,7 +33,7 @@ import javax.management.ObjectName;
* @summary Tests that javax.management.JMX creates proxies only for the
* compliant MBeans/MXBeans
* @author Jaroslav Bachorik
- * @modules java.management
+ *
* @run clean JMXProxyTest
* @run build JMXProxyTest
* @run main JMXProxyTest
diff --git a/jdk/test/javax/management/proxy/NotificationEmitterProxy.java b/jdk/test/javax/management/proxy/NotificationEmitterProxy.java
index 2c602b9e032..c1f43f4c4d0 100644
--- a/jdk/test/javax/management/proxy/NotificationEmitterProxy.java
+++ b/jdk/test/javax/management/proxy/NotificationEmitterProxy.java
@@ -26,7 +26,7 @@
* @summary Test that we can create proxies which are NotificationEmitters.
* @bug 6411747
* @author Daniel Fuchs
- * @modules java.management
+ *
* @run clean NotificationEmitterProxy
* @run build NotificationEmitterProxy
* @run main NotificationEmitterProxy
diff --git a/jdk/test/javax/management/proxy/ProxyObjectMethodsTest.java b/jdk/test/javax/management/proxy/ProxyObjectMethodsTest.java
index 30238c8fb30..c554ca0b4a3 100644
--- a/jdk/test/javax/management/proxy/ProxyObjectMethodsTest.java
+++ b/jdk/test/javax/management/proxy/ProxyObjectMethodsTest.java
@@ -26,7 +26,7 @@
* @bug 6177524
* @summary Test how to execute the 3 Object methods by a Proxy.
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean ProxyObjectMethodsTest
* @run build ProxyObjectMethodsTest
* @run main ProxyObjectMethodsTest
diff --git a/jdk/test/javax/management/query/CustomQueryTest.java b/jdk/test/javax/management/query/CustomQueryTest.java
index 7ba7396c2c8..f1c3f59cf70 100644
--- a/jdk/test/javax/management/query/CustomQueryTest.java
+++ b/jdk/test/javax/management/query/CustomQueryTest.java
@@ -26,7 +26,6 @@
* @bug 6692027
* @summary Check that custom subclasses of QueryEval can be serialized.
* @author Eamonn McManus
- * @modules java.management
*/
import java.io.ByteArrayInputStream;
diff --git a/jdk/test/javax/management/query/InstanceOfExpTest.java b/jdk/test/javax/management/query/InstanceOfExpTest.java
index bd36da396a6..4478255aac5 100644
--- a/jdk/test/javax/management/query/InstanceOfExpTest.java
+++ b/jdk/test/javax/management/query/InstanceOfExpTest.java
@@ -26,7 +26,7 @@
* @bug 5072174 6335848
* @summary test the new method javax.management.Query.isInstanceOf("className")
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean InstanceOfExpTest
* @run build InstanceOfExpTest
* @run main InstanceOfExpTest
diff --git a/jdk/test/javax/management/query/QueryExpStringTest.java b/jdk/test/javax/management/query/QueryExpStringTest.java
index 79696585cc1..ab4eebbff96 100644
--- a/jdk/test/javax/management/query/QueryExpStringTest.java
+++ b/jdk/test/javax/management/query/QueryExpStringTest.java
@@ -26,7 +26,7 @@
* @bug 4886011
* @summary Test that QueryExp.toString() is reversible
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean QueryExpStringTest
* @run build QueryExpStringTest
* @run main QueryExpStringTest
diff --git a/jdk/test/javax/management/query/QueryMatchTest.java b/jdk/test/javax/management/query/QueryMatchTest.java
index ec5c2a0c5c9..fa359ab97a7 100644
--- a/jdk/test/javax/management/query/QueryMatchTest.java
+++ b/jdk/test/javax/management/query/QueryMatchTest.java
@@ -26,7 +26,7 @@
* @bug 6266438
* @summary Query.match code for character sequences like [a-z] is wrong.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean QueryMatchTest
* @run build QueryMatchTest
* @run main QueryMatchTest
diff --git a/jdk/test/javax/management/query/QuerySubstringTest.java b/jdk/test/javax/management/query/QuerySubstringTest.java
index 7b0a3d81b7d..925e853b73d 100644
--- a/jdk/test/javax/management/query/QuerySubstringTest.java
+++ b/jdk/test/javax/management/query/QuerySubstringTest.java
@@ -27,7 +27,7 @@
* @summary Query.{initial,any,final}SubString fail if the
* matching constraint string contains wildcards.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean QuerySubstringTest
* @run build QuerySubstringTest
* @run main QuerySubstringTest
diff --git a/jdk/test/javax/management/relation/NonArrayListTest.java b/jdk/test/javax/management/relation/NonArrayListTest.java
index 28de757f51b..0304c198333 100644
--- a/jdk/test/javax/management/relation/NonArrayListTest.java
+++ b/jdk/test/javax/management/relation/NonArrayListTest.java
@@ -26,7 +26,7 @@
* @bug 4848474
* @summary Test that relation service doesn't require List params to be ArrayList
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean NonArrayListTest
* @run build NonArrayListTest
* @run main NonArrayListTest
diff --git a/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java b/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java
index b4c974fb9f5..783fe2b8dbf 100644
--- a/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java
+++ b/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java
@@ -26,7 +26,6 @@
* @bug 6701459
* @summary Test sequence numbers in RelationService notifications.
* @author Eamonn McManus
- * @modules java.management
*/
/*
diff --git a/jdk/test/javax/management/relation/RelationNotificationSourceTest.java b/jdk/test/javax/management/relation/RelationNotificationSourceTest.java
index 0133d1a0d38..8a74fa1a122 100644
--- a/jdk/test/javax/management/relation/RelationNotificationSourceTest.java
+++ b/jdk/test/javax/management/relation/RelationNotificationSourceTest.java
@@ -26,7 +26,7 @@
* @bug 4892674
* @summary Test that RelationNotification can be constructed with ObjectName.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean RelationNotificationSourceTest
* @run build RelationNotificationSourceTest
* @run main RelationNotificationSourceTest
diff --git a/jdk/test/javax/management/relation/RelationTypeTest.java b/jdk/test/javax/management/relation/RelationTypeTest.java
index cfcb08884b8..b7fa3fcdb74 100644
--- a/jdk/test/javax/management/relation/RelationTypeTest.java
+++ b/jdk/test/javax/management/relation/RelationTypeTest.java
@@ -26,7 +26,7 @@
* @bug 4716675
* @summary Test that relation type checking uses isInstanceOf
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean RelationTypeTest
* @run build RelationTypeTest
* @run main RelationTypeTest
diff --git a/jdk/test/javax/management/remote/mandatory/TEST.properties b/jdk/test/javax/management/remote/mandatory/TEST.properties
new file mode 100644
index 00000000000..cbe51d3310e
--- /dev/null
+++ b/jdk/test/javax/management/remote/mandatory/TEST.properties
@@ -0,0 +1,2 @@
+modules = java.management.rmi
+
diff --git a/jdk/test/javax/management/remote/mandatory/URLTest.java b/jdk/test/javax/management/remote/mandatory/URLTest.java
index d10c1c71f0f..d3e39b5b7f1 100644
--- a/jdk/test/javax/management/remote/mandatory/URLTest.java
+++ b/jdk/test/javax/management/remote/mandatory/URLTest.java
@@ -26,7 +26,7 @@
* @bug 5057532
* @summary Tests that host names are parsed correctly in URLs
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean URLTest
* @run build URLTest
* @run main URLTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/AddressableTest.java b/jdk/test/javax/management/remote/mandatory/connection/AddressableTest.java
index eb8897e4019..556ef787d54 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/AddressableTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/AddressableTest.java
@@ -26,7 +26,7 @@
* @bug 6238815
* @summary test the new interface Addressable
* @author Shanliang JIANG
- * @modules java.management.rmi
+ *
* @run clean AddressableTest
* @run build AddressableTest
* @run main AddressableTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java b/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java
index 590c7263967..e3570a5c266 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/BrokenConnectionTest.java
@@ -24,10 +24,10 @@
/*
* @test
* @bug 4940957 8025205
+ * @key intermittent
* @summary Tests behaviour when connections break
* @author Eamonn McManus
- * @key intermittent
- * @modules java.management.rmi
+ *
* @run clean BrokenConnectionTest
* @run build BrokenConnectionTest
* @run main BrokenConnectionTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/CloseFailedClientTest.java b/jdk/test/javax/management/remote/mandatory/connection/CloseFailedClientTest.java
index 2eb59b30acf..b93b3bb946c 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/CloseFailedClientTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/CloseFailedClientTest.java
@@ -26,7 +26,7 @@
* @bug 4921888
* @summary Tests that we do not get a NullPointException.
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean CloseFailedClientTest
* @run build CloseFailedClientTest
* @run main CloseFailedClientTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/CloseServerTest.java b/jdk/test/javax/management/remote/mandatory/connection/CloseServerTest.java
index a1944baa8c5..e99be183a3d 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/CloseServerTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/CloseServerTest.java
@@ -26,7 +26,7 @@
* @bug 4838640
* @summary test server close in different conditions.
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean CloseServerTest
* @run build CloseServerTest
* @run main CloseServerTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/CloseUnconnectedTest.java b/jdk/test/javax/management/remote/mandatory/connection/CloseUnconnectedTest.java
index 34925683287..e933dd85387 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/CloseUnconnectedTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/CloseUnconnectedTest.java
@@ -26,7 +26,7 @@
* @bug 4897052
* @summary Tests that opening and immediately closing a connector works
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean CloseUnconnectedTest
* @run build CloseUnconnectedTest
* @run main CloseUnconnectedTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/CloseableTest.java b/jdk/test/javax/management/remote/mandatory/connection/CloseableTest.java
index 791cd89d9b3..d49cd7a88d9 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/CloseableTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/CloseableTest.java
@@ -28,7 +28,7 @@
* the method "void close() throws IOException;" extend
* or implement the java.io.Closeable interface.
* @author Luis-Miguel Alventosa
- * @modules java.management.rmi
+ *
* @run clean CloseableTest
* @run build CloseableTest
* @run main CloseableTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/ConnectionListenerNullTest.java b/jdk/test/javax/management/remote/mandatory/connection/ConnectionListenerNullTest.java
index cbe216526c5..18f49d2d25f 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/ConnectionListenerNullTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/ConnectionListenerNullTest.java
@@ -26,7 +26,7 @@
* @bug 4943248
* @summary Tests that NullPointerException is thrown when listener is null.
* @author Daniel Fuchs
- * @modules java.management.rmi
+ *
* @run clean ConnectionListenerNullTest
* @run build ConnectionListenerNullTest
* @run main ConnectionListenerNullTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/ConnectionTest.java b/jdk/test/javax/management/remote/mandatory/connection/ConnectionTest.java
index c16412d843b..db2f5ef0401 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/ConnectionTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/ConnectionTest.java
@@ -26,7 +26,7 @@
* @bug 4865397
* @summary Tests remote JMX connections
* @author Eamonn McManus
- * @modules java.management.rmi
+ *
* @run clean ConnectionTest
* @run build ConnectionTest
* @run main ConnectionTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/DaemonRMIExporterTest.java b/jdk/test/javax/management/remote/mandatory/connection/DaemonRMIExporterTest.java
index de0184ca3a2..73f04b6a361 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/DaemonRMIExporterTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/DaemonRMIExporterTest.java
@@ -28,7 +28,7 @@
* @summary test the connector server option that causes it not to prevent the
* VM from exiting
* @author Shanliang JIANG, Eamonn McManus
- * @modules java.management.rmi
+ *
* @run main/othervm DaemonRMIExporterTest
*/
import java.util.Arrays;
diff --git a/jdk/test/javax/management/remote/mandatory/connection/DeadLockTest.java b/jdk/test/javax/management/remote/mandatory/connection/DeadLockTest.java
index 65c40688f3a..e9f060248ec 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/DeadLockTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/DeadLockTest.java
@@ -26,7 +26,7 @@
* @bug 5039210
* @summary test on a client notification deadlock.
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean DeadLockTest
* @run build DeadLockTest
* @run main DeadLockTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/FailedConnectionTest.java b/jdk/test/javax/management/remote/mandatory/connection/FailedConnectionTest.java
index b231bbaa536..d1f3c7b2bf0 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/FailedConnectionTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/FailedConnectionTest.java
@@ -27,7 +27,7 @@
* @bug 4939578
* @summary test to get an IOException.
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean FailedConnectionTest
* @run build FailedConnectionTest
* @run main FailedConnectionTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/GetConnectionTest.java b/jdk/test/javax/management/remote/mandatory/connection/GetConnectionTest.java
index 7c3bf66fe52..f1615253e43 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/GetConnectionTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/GetConnectionTest.java
@@ -26,7 +26,7 @@
* @bug 4951414
* @summary Try to get an IOException.
* @author Shanliang JIANG
- * @modules java.management.rmi
+ *
* @run clean GetConnectionTest
* @run build GetConnectionTest
* @run main GetConnectionTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/IIOPURLTest.java b/jdk/test/javax/management/remote/mandatory/connection/IIOPURLTest.java
index 49aa0e426f0..cdbf829a9b2 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/IIOPURLTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/IIOPURLTest.java
@@ -26,7 +26,7 @@
* @bug 4886799
* @summary Check that IIOP URLs have /ior/ in the path
* @author Eamonn McManus
- * @modules java.management.rmi
+ *
* @run clean IIOPURLTest
* @run build IIOPURLTest
* @run main IIOPURLTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/JMXServiceURLLocaleTest.java b/jdk/test/javax/management/remote/mandatory/connection/JMXServiceURLLocaleTest.java
index 4ff6020ea41..1336b18377d 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/JMXServiceURLLocaleTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/JMXServiceURLLocaleTest.java
@@ -26,7 +26,7 @@
* @bug 7065236
* @summary Test for locale insensitive strings in JMXServiceURL class
* @author Harsha Wardhana B
- * @modules java.management
+ *
* @run clean JMXServiceURLLocaleTest
* @run build JMXServiceURLLocaleTest
* @run main JMXServiceURLLocaleTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/MultiOpenCloseTest.java b/jdk/test/javax/management/remote/mandatory/connection/MultiOpenCloseTest.java
index fc913a690dc..2fa29759529 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/MultiOpenCloseTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/MultiOpenCloseTest.java
@@ -26,7 +26,7 @@
* @bug 1234567
* @summary Open, connect then close multi-connectors.
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean MultiOpenCloseTest
* @run build MultiOpenCloseTest
* @run main MultiOpenCloseTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java b/jdk/test/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java
index 63542a464bf..4f82efc7d54 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java
@@ -45,7 +45,7 @@ import javax.management.remote.rmi.RMIConnectorServer;
* @bug 6697180
* @summary test on a client notification deadlock.
* @author Shanliang JIANG
- * @modules java.management.rmi
+ *
* @run clean MultiThreadDeadLockTest
* @run build MultiThreadDeadLockTest
* @run main MultiThreadDeadLockTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/RMIConnectionIdTest.java b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectionIdTest.java
index 3b86bc8eab9..e518ae64459 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/RMIConnectionIdTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectionIdTest.java
@@ -26,7 +26,7 @@
* @bug 4901808 7183800
* @summary Check that RMI connection ids include IP address of a client network interface
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean RMIConnectionIdTest
* @run build RMIConnectionIdTest
* @run main RMIConnectionIdTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorLogAttributesTest.java b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorLogAttributesTest.java
index 2284180d95b..dad29642754 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorLogAttributesTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/RMIConnectorLogAttributesTest.java
@@ -55,6 +55,9 @@ import javax.management.remote.JMXServiceURL;
* @bug 8147857
* @summary Tests whether RMIConnector logs attribute names correctly.
* @author Severin Gehwolf
+ *
+ * @modules java.logging
+ * java.management.rmi
*/
public class RMIConnectorLogAttributesTest {
diff --git a/jdk/test/javax/management/remote/mandatory/connection/RMIExitTest.java b/jdk/test/javax/management/remote/mandatory/connection/RMIExitTest.java
index df81b362187..06f8417372a 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/RMIExitTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/RMIExitTest.java
@@ -27,7 +27,7 @@
* @bug 4917237
* @summary test that process exit immediately after stop() / close() called
* @author Jean Francois Denise
- * @modules java.management.rmi
+ *
* @run clean RMIExitTest
* @run build RMIExitTest
* @run main RMIExitTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/RMISerializeTest.java b/jdk/test/javax/management/remote/mandatory/connection/RMISerializeTest.java
index ac5331d9fae..faba7b7c22a 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/RMISerializeTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/RMISerializeTest.java
@@ -26,7 +26,7 @@
* @summary Tests to serialize RMIConnector
* @bug 5032052
* @author Shanliang JIANG
- * @modules java.management.rmi
+ *
* @run clean RMISerializeTest
* @run build RMISerializeTest
* @run main RMISerializeTest
diff --git a/jdk/test/javax/management/remote/mandatory/connection/ReconnectTest.java b/jdk/test/javax/management/remote/mandatory/connection/ReconnectTest.java
index a2a110e2764..6c3ca9a1c67 100644
--- a/jdk/test/javax/management/remote/mandatory/connection/ReconnectTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connection/ReconnectTest.java
@@ -26,7 +26,7 @@
* @bug 4927217
* @summary test to reconnect
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean ReconnectTest
* @run build ReconnectTest
* @run main ReconnectTest
diff --git a/jdk/test/javax/management/remote/mandatory/connectorServer/ConnectorStopDeadlockTest.java b/jdk/test/javax/management/remote/mandatory/connectorServer/ConnectorStopDeadlockTest.java
index ad84f39142a..4a723283f81 100644
--- a/jdk/test/javax/management/remote/mandatory/connectorServer/ConnectorStopDeadlockTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connectorServer/ConnectorStopDeadlockTest.java
@@ -26,7 +26,6 @@
* @bug 6475157
* @summary Tests deadlock in simultaneous connection and connector-server close
* @author Eamonn McManus
- * @modules java.management.rmi
*/
/* This test is somewhat dependent on implementation details. If it suddenly
diff --git a/jdk/test/javax/management/remote/mandatory/connectorServer/JNDIFailureTest.java b/jdk/test/javax/management/remote/mandatory/connectorServer/JNDIFailureTest.java
index d102ecbd01d..3e2555bd198 100644
--- a/jdk/test/javax/management/remote/mandatory/connectorServer/JNDIFailureTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connectorServer/JNDIFailureTest.java
@@ -27,7 +27,7 @@
* @summary Tests that JNDI bind failure doesn't leave an orphan RMI
* Connector Server object
* @author Eamonn McManus
- * @modules java.management.rmi
+ *
* @run clean JNDIFailureTest
* @run build JNDIFailureTest
* @run main JNDIFailureTest
diff --git a/jdk/test/javax/management/remote/mandatory/connectorServer/MBSFPreStartPostStartTest.java b/jdk/test/javax/management/remote/mandatory/connectorServer/MBSFPreStartPostStartTest.java
index 1d0355edce3..7c3f1e7414b 100644
--- a/jdk/test/javax/management/remote/mandatory/connectorServer/MBSFPreStartPostStartTest.java
+++ b/jdk/test/javax/management/remote/mandatory/connectorServer/MBSFPreStartPostStartTest.java
@@ -27,7 +27,7 @@
* @summary Test that setting an MBeanServerForwarder on an already
* started RMI connector server has the expected behavior.
* @author Luis-Miguel Alventosa
- * @modules java.management.rmi
+ *
* @run clean MBSFPreStartPostStartTest
* @run build MBSFPreStartPostStartTest
* @run main MBSFPreStartPostStartTest
diff --git a/jdk/test/javax/management/remote/mandatory/loading/DefaultProviderTest.java b/jdk/test/javax/management/remote/mandatory/loading/DefaultProviderTest.java
index e0aab2f2415..8db4113f199 100644
--- a/jdk/test/javax/management/remote/mandatory/loading/DefaultProviderTest.java
+++ b/jdk/test/javax/management/remote/mandatory/loading/DefaultProviderTest.java
@@ -26,7 +26,7 @@
* @bug 4884913
* @summary Tests that default protocols are loaded correctly
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean DefaultProviderTest
* @run build DefaultProviderTest
* @run main DefaultProviderTest
diff --git a/jdk/test/javax/management/remote/mandatory/loading/DeserializeEncodedURLTest.java b/jdk/test/javax/management/remote/mandatory/loading/DeserializeEncodedURLTest.java
index 2cb8d8742e1..301b999a851 100644
--- a/jdk/test/javax/management/remote/mandatory/loading/DeserializeEncodedURLTest.java
+++ b/jdk/test/javax/management/remote/mandatory/loading/DeserializeEncodedURLTest.java
@@ -26,7 +26,7 @@
* @bug 4924683
* @summary Check RMI/JRMP stubs can be deserialized using user's loader
* @author Eamonn McManus
- * @modules java.management.rmi
+ *
* @run clean DeserializeEncodedURLTest SingleClassLoader
* @run build DeserializeEncodedURLTest SingleClassLoader
* @run main DeserializeEncodedURLTest
diff --git a/jdk/test/javax/management/remote/mandatory/loading/MethodResultTest.java b/jdk/test/javax/management/remote/mandatory/loading/MethodResultTest.java
index cb68a990d78..ce70611a1f6 100644
--- a/jdk/test/javax/management/remote/mandatory/loading/MethodResultTest.java
+++ b/jdk/test/javax/management/remote/mandatory/loading/MethodResultTest.java
@@ -26,8 +26,9 @@
* @bug 4898478
* @summary Tests client default class loader used before JSR 160 loader
* @author Eamonn McManus
- * @modules java.management
+ *
* @library /lib/testlibrary
+ *
* @run clean MethodResultTest
* @run build MethodResultTest
* @run main MethodResultTest
diff --git a/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java b/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java
index 7c93e0c3563..326dd37c9da 100644
--- a/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java
+++ b/jdk/test/javax/management/remote/mandatory/loading/MissingClassTest.java
@@ -24,13 +24,13 @@
/*
* @test
* @bug 4915825 4921009 4934965 4977469 8019584
+ * @key randomness
* @summary Tests behavior when client or server gets object of unknown class
* @author Eamonn McManus
- * @modules java.management.rmi
+ *
* @run clean MissingClassTest SingleClassLoader
* @run build MissingClassTest SingleClassLoader
* @run main MissingClassTest
- * @key randomness
*/
/*
diff --git a/jdk/test/javax/management/remote/mandatory/loading/RMIDownloadTest.java b/jdk/test/javax/management/remote/mandatory/loading/RMIDownloadTest.java
index ebdf181cdf5..c757baeaaca 100644
--- a/jdk/test/javax/management/remote/mandatory/loading/RMIDownloadTest.java
+++ b/jdk/test/javax/management/remote/mandatory/loading/RMIDownloadTest.java
@@ -26,7 +26,7 @@
* @bug 5021246
* @summary Check that class downloading is supported by RMI connector
* @author Eamonn McManus
- * @modules java.management.rmi
+ *
* @run main RMIDownloadTest receive without
* @run main RMIDownloadTest send without
* @run main RMIDownloadTest receive with
diff --git a/jdk/test/javax/management/remote/mandatory/loading/TargetMBeanTest.java b/jdk/test/javax/management/remote/mandatory/loading/TargetMBeanTest.java
index a5df3856ec8..9d949995351 100644
--- a/jdk/test/javax/management/remote/mandatory/loading/TargetMBeanTest.java
+++ b/jdk/test/javax/management/remote/mandatory/loading/TargetMBeanTest.java
@@ -26,7 +26,7 @@
* @bug 4910428
* @summary Tests target MBean class loader used before JSR 160 loader
* @author Eamonn McManus
- * @modules java.management.rmi
+ *
* @run clean TargetMBeanTest
* @run build TargetMBeanTest
* @run main TargetMBeanTest
diff --git a/jdk/test/javax/management/remote/mandatory/loading/UserClassLoaderTest.java b/jdk/test/javax/management/remote/mandatory/loading/UserClassLoaderTest.java
index e634d6cfc41..78367626911 100644
--- a/jdk/test/javax/management/remote/mandatory/loading/UserClassLoaderTest.java
+++ b/jdk/test/javax/management/remote/mandatory/loading/UserClassLoaderTest.java
@@ -26,7 +26,7 @@
* @bug 6356458
* @summary test to not lose a user classloader
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean UserClassLoaderTest
* @run build UserClassLoaderTest
* @run main UserClassLoaderTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/AddRemoveTest.java b/jdk/test/javax/management/remote/mandatory/notif/AddRemoveTest.java
index a3b433757a7..e4885b4a732 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/AddRemoveTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/AddRemoveTest.java
@@ -27,7 +27,7 @@
* @bug 4838640 4917194
* @summary test on add/remove NotificationListener
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean AddRemoveTest
* @run build AddRemoveTest
* @run main AddRemoveTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/ConcurrentModificationTest.java b/jdk/test/javax/management/remote/mandatory/notif/ConcurrentModificationTest.java
index a7830faf921..eb13087a7d9 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/ConcurrentModificationTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/ConcurrentModificationTest.java
@@ -26,7 +26,7 @@
* @bug 7120365
* @summary test on Concurrent Modification
* @author Shanliang JIANG
- * @modules java.management.rmi
+ *
* @run main ConcurrentModificationTest
*/
diff --git a/jdk/test/javax/management/remote/mandatory/notif/DiffHBTest.java b/jdk/test/javax/management/remote/mandatory/notif/DiffHBTest.java
index 8ed989c2b9e..467c84b7dc1 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/DiffHBTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/DiffHBTest.java
@@ -26,7 +26,7 @@
* @bug 4911721
* @summary test on add/remove NotificationListener
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean DiffHBTest
* @run build DiffHBTest
* @run main DiffHBTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java b/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java
index 5041a6bbd69..79d54760306 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java
@@ -27,7 +27,7 @@
* @summary Check that the expected notification is received by the JMX
* client even when the domain in the ObjectName is not specified
* @author Shanliang JIANG
- * @modules java.management.rmi
+ *
* @run clean EmptyDomainNotificationTest
* @run build EmptyDomainNotificationTest
* @run main EmptyDomainNotificationTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java b/jdk/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java
index bc6922f350d..e9e34455c13 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/ListenerScaleTest.java
@@ -26,9 +26,9 @@
* @bug 6338874
* @summary Check that notification dispatch is not linear in number of MBeans.
* @author Eamonn McManus
- * @modules java.management.rmi
*
* @library /lib/testlibrary
+ *
* @run build jdk.testlibrary.* ListenerScaleTest
* @run main ListenerScaleTest
*/
diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java
index 8bd7aea59e8..600f0de1f44 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/NotSerializableNotifTest.java
@@ -23,10 +23,10 @@
/*
* @test
- * @summary Tests to send a not serializable notification.
* @bug 5022196 8132003
+ * @summary Tests to send a not serializable notification.
* @author Shanliang JIANG
- * @modules java.management.rmi
+ *
* @run clean NotSerializableNotifTest
* @run build NotSerializableNotifTest
* @run main NotSerializableNotifTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java
index bb7af6c3518..94a06904282 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/NotifBufferSizePropertyNameTest.java
@@ -26,7 +26,7 @@
* @bug 6174229
* @summary Verify the property name specifying server notification buffer size.
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean NotifBufferSizePropertyNameTest
* @run build NotifBufferSizePropertyNameTest
* @run main NotifBufferSizePropertyNameTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java
index 74b2ee582ed..72319d72cb9 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java
@@ -26,7 +26,7 @@
* @bug 6199899
* @summary Tests reconnection done by a fetching notif thread.
* @author Shanliang JIANG
- * @modules java.management.rmi
+ *
* @run clean NotifReconnectDeadlockTest
* @run build NotifReconnectDeadlockTest
* @run main NotifReconnectDeadlockTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferCreationTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferCreationTest.java
index 030d9c2d1a0..cfc57651f17 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferCreationTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferCreationTest.java
@@ -26,7 +26,7 @@
* @bug 4934236
* @summary Tests that NotificationBuffer is created when used.
* @author jfd@...
- * @modules java.management.rmi
+ *
* @run clean NotificationBufferCreationTest NotificationSender
* @run build NotificationBufferCreationTest
* @run main NotificationBufferCreationTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java
index 68e712947ab..fd708e01f0b 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/NotificationBufferDeadlockTest.java
@@ -27,7 +27,7 @@
* @summary Tests NotificationBuffer doesn't hold locks when adding listeners,
* if test times out then deadlock is suspected.
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean NotificationBufferDeadlockTest
* @run build NotificationBufferDeadlockTest
* @run main NotificationBufferDeadlockTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java b/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java
index bdacde2ff4e..a54030d4c3e 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/NotificationEmissionTest.java
@@ -24,11 +24,11 @@
/*
* @test
* @bug 5106721
+ * @key intermittent
* @summary Check the emission of notifications when a Security Manager is
* installed. Test the property "jmx.remote.x.check.notification.emission".
* @author Luis-Miguel Alventosa
- * @key intermittent
- * @modules java.management.rmi
+ *
* @run clean NotificationEmissionTest
* @run build NotificationEmissionTest
* @run main NotificationEmissionTest 1
diff --git a/jdk/test/javax/management/remote/mandatory/notif/RMINotifTest.java b/jdk/test/javax/management/remote/mandatory/notif/RMINotifTest.java
index 6531b4414a5..9f1a91d680f 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/RMINotifTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/RMINotifTest.java
@@ -25,9 +25,8 @@
* @test
* @bug 7654321
* @summary Tests to receive notifications for opened and closed connections
-ions
* @author sjiang
- * @modules java.management.rmi
+ *
* @run clean RMINotifTest
* @run build RMINotifTest
* @run main RMINotifTest
diff --git a/jdk/test/javax/management/remote/mandatory/notif/ServerNotifs.java b/jdk/test/javax/management/remote/mandatory/notif/ServerNotifs.java
index 036ef7f1682..b222f9c22b1 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/ServerNotifs.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/ServerNotifs.java
@@ -27,7 +27,7 @@
* @summary Tests the reception of the notifications for opened and closed
* connections
* @author sjiang
- * @modules java.management.rmi
+ *
* @run clean ServerNotifs
* @run build ServerNotifs
* @run main ServerNotifs
diff --git a/jdk/test/javax/management/remote/mandatory/notif/UnexpectedNotifTest.java b/jdk/test/javax/management/remote/mandatory/notif/UnexpectedNotifTest.java
index 39a7f444157..3b7c7c631ba 100644
--- a/jdk/test/javax/management/remote/mandatory/notif/UnexpectedNotifTest.java
+++ b/jdk/test/javax/management/remote/mandatory/notif/UnexpectedNotifTest.java
@@ -27,7 +27,7 @@
* @summary Tests whether a listener receives notifs emitted before the
* listener is registered.
* @author Shanliang JIANG
- * @modules java.management.rmi
+ *
* @run clean UnexpectedNotifTest
* @run build UnexpectedNotifTest
* @run main UnexpectedNotifTest
diff --git a/jdk/test/javax/management/remote/mandatory/passwordAccessFile/NonJMXPrincipalsTest.java b/jdk/test/javax/management/remote/mandatory/passwordAccessFile/NonJMXPrincipalsTest.java
index b178b04b632..2726120e253 100644
--- a/jdk/test/javax/management/remote/mandatory/passwordAccessFile/NonJMXPrincipalsTest.java
+++ b/jdk/test/javax/management/remote/mandatory/passwordAccessFile/NonJMXPrincipalsTest.java
@@ -27,7 +27,7 @@
* @summary Tests that MBeanServerFileAccessController supports
* principals other than JMXPrincipal.
* @author Luis-Miguel Alventosa
- * @modules java.management.rmi
+ *
* @run clean NonJMXPrincipalsTest SimpleStandard SimpleStandardMBean
* @run build NonJMXPrincipalsTest SimpleStandard SimpleStandardMBean
* @run main NonJMXPrincipalsTest
diff --git a/jdk/test/javax/management/remote/mandatory/passwordAccessFile/PasswordAccessFileTest.java b/jdk/test/javax/management/remote/mandatory/passwordAccessFile/PasswordAccessFileTest.java
index 43e17772d5f..5e794366b3a 100644
--- a/jdk/test/javax/management/remote/mandatory/passwordAccessFile/PasswordAccessFileTest.java
+++ b/jdk/test/javax/management/remote/mandatory/passwordAccessFile/PasswordAccessFileTest.java
@@ -27,7 +27,7 @@
* @summary Tests the use of the "jmx.remote.x.password.file" and
* "jmx.remote.x.access.file" environment map properties.
* @author Luis-Miguel Alventosa
- * @modules java.management.rmi
+ *
* @run clean PasswordAccessFileTest SimpleStandard SimpleStandardMBean
* @run build PasswordAccessFileTest SimpleStandard SimpleStandardMBean
* @run main PasswordAccessFileTest
diff --git a/jdk/test/javax/management/remote/mandatory/provider/ProviderTest.java b/jdk/test/javax/management/remote/mandatory/provider/ProviderTest.java
index 8491f24caa1..1e02e92253c 100644
--- a/jdk/test/javax/management/remote/mandatory/provider/ProviderTest.java
+++ b/jdk/test/javax/management/remote/mandatory/provider/ProviderTest.java
@@ -24,7 +24,7 @@
/*
* @test ProviderTest.java
* @summary Tests jar services provider are called
- * @modules java.management.rmi
+ *
* @run clean ProviderTest provider.JMXConnectorProviderImpl provider.JMXConnectorServerProviderImpl
* @run build ProviderTest provider.JMXConnectorProviderImpl provider.JMXConnectorServerProviderImpl
* @run main ProviderTest
diff --git a/jdk/test/javax/management/remote/mandatory/socketFactories/RMISocketFactoriesTest.java b/jdk/test/javax/management/remote/mandatory/socketFactories/RMISocketFactoriesTest.java
index c8aa8bdf269..cbdb5e6e1d4 100644
--- a/jdk/test/javax/management/remote/mandatory/socketFactories/RMISocketFactoriesTest.java
+++ b/jdk/test/javax/management/remote/mandatory/socketFactories/RMISocketFactoriesTest.java
@@ -26,7 +26,7 @@
* @bug 7654321
* @summary Tests the use of the custom RMI socket factories.
* @author Luis-Miguel Alventosa
- * @modules java.management.rmi
+ *
* @run clean RMISocketFactoriesTest
* @run build RMISocketFactoriesTest RMIClientFactory RMIServerFactory
* @run main RMISocketFactoriesTest test_server_factory
diff --git a/jdk/test/javax/management/remote/mandatory/threads/ExecutorShutdownTest.java b/jdk/test/javax/management/remote/mandatory/threads/ExecutorShutdownTest.java
index 003780cc474..7620b0ce1a8 100644
--- a/jdk/test/javax/management/remote/mandatory/threads/ExecutorShutdownTest.java
+++ b/jdk/test/javax/management/remote/mandatory/threads/ExecutorShutdownTest.java
@@ -26,7 +26,7 @@
* @bug 8141591
* @summary Tests if notifications are received after executor is shutdown
* @author Harsha Wardhana B
- * @modules java.management
+ *
* @run clean ExecutorShutdownTest
* @run build ExecutorShutdownTest
* @run main ExecutorShutdownTest
diff --git a/jdk/test/javax/management/remote/mandatory/threads/ExecutorTest.java b/jdk/test/javax/management/remote/mandatory/threads/ExecutorTest.java
index 02351a6eb7c..a1248fef437 100644
--- a/jdk/test/javax/management/remote/mandatory/threads/ExecutorTest.java
+++ b/jdk/test/javax/management/remote/mandatory/threads/ExecutorTest.java
@@ -26,7 +26,7 @@
* @bug 6190873
* @summary Tests that thread creation can use a user-supplied Executor
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean ExecutorTest
* @run build ExecutorTest
* @run main ExecutorTest
diff --git a/jdk/test/javax/management/remote/mandatory/threads/NoServerTimeoutTest.java b/jdk/test/javax/management/remote/mandatory/threads/NoServerTimeoutTest.java
index ec88e51d093..f07840e03e4 100644
--- a/jdk/test/javax/management/remote/mandatory/threads/NoServerTimeoutTest.java
+++ b/jdk/test/javax/management/remote/mandatory/threads/NoServerTimeoutTest.java
@@ -26,7 +26,7 @@
* @bug 6192124
* @summary Tests that you can turn off the server connection timeout thread
* @author Eamonn McManus
- * @modules java.management
+ *
* @run clean NoServerTimeoutTest
* @run build NoServerTimeoutTest
* @run main NoServerTimeoutTest
diff --git a/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java b/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java
index 1e3662cc1ed..8ee4e769cd8 100644
--- a/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java
+++ b/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java
@@ -29,7 +29,7 @@
* test codebase has the java permission to read the "java.runtime.version"
* system property.
* @author Luis-Miguel Alventosa, Joel Feraud
- * @modules java.management
+ *
* @run clean ImplVersionTest ImplVersionCommand
* @run build ImplVersionTest ImplVersionCommand ImplVersionReader
* @run main ImplVersionTest
diff --git a/jdk/test/javax/management/security/AvoidGetMBeanInfoCallsTest.java b/jdk/test/javax/management/security/AvoidGetMBeanInfoCallsTest.java
index b4a781bfbf1..cd91a82b37a 100644
--- a/jdk/test/javax/management/security/AvoidGetMBeanInfoCallsTest.java
+++ b/jdk/test/javax/management/security/AvoidGetMBeanInfoCallsTest.java
@@ -27,7 +27,7 @@
* @summary Test that MBeanServer.queryNames doesn't call getMBeanInfo on every
* resultant MBean when there is no security manager installed.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean AvoidGetMBeanInfoCallsTest
* @run build AvoidGetMBeanInfoCallsTest
* @run main AvoidGetMBeanInfoCallsTest
diff --git a/jdk/test/javax/management/security/MBeanPermissionTest.java b/jdk/test/javax/management/security/MBeanPermissionTest.java
index 6ac0fc2c071..21a032c76b0 100644
--- a/jdk/test/javax/management/security/MBeanPermissionTest.java
+++ b/jdk/test/javax/management/security/MBeanPermissionTest.java
@@ -26,7 +26,7 @@
* @bug 6228749
* @summary MBeanPermission(null,"") should throw IllegalArgumentException.
* @author Luis-Miguel Alventosa
- * @modules java.management
+ *
* @run clean MBeanPermissionTest
* @run build MBeanPermissionTest
* @run main MBeanPermissionTest
diff --git a/jdk/test/javax/management/standardmbean/DeadlockTest.java b/jdk/test/javax/management/standardmbean/DeadlockTest.java
index 7bd67394800..3381240d063 100644
--- a/jdk/test/javax/management/standardmbean/DeadlockTest.java
+++ b/jdk/test/javax/management/standardmbean/DeadlockTest.java
@@ -26,7 +26,7 @@
* @bug 6331746
* @summary Test a deadlock and will be blocked forever if the deadlock is present.
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run main DeadlockTest
*/
diff --git a/jdk/test/javax/management/timer/MissingNotificationTest.java b/jdk/test/javax/management/timer/MissingNotificationTest.java
index e4bb8c21d92..16de79ce568 100644
--- a/jdk/test/javax/management/timer/MissingNotificationTest.java
+++ b/jdk/test/javax/management/timer/MissingNotificationTest.java
@@ -24,13 +24,13 @@
/*
* @test
* @bug 6809322
+ * @key randomness
* @summary Test for missing notifications in a high concurrency environment
* @author Jaroslav Bachorik
- * @modules java.management
+ *
* @run clean MissingNotificationTest
* @run build MissingNotificationTest
* @run main MissingNotificationTest
- * @key randomness
*/
import java.util.Date;
diff --git a/jdk/test/javax/management/timer/StartTest.java b/jdk/test/javax/management/timer/StartTest.java
index 50f03d4a704..a29a6711b7a 100644
--- a/jdk/test/javax/management/timer/StartTest.java
+++ b/jdk/test/javax/management/timer/StartTest.java
@@ -26,7 +26,7 @@
* @bug 6659215
* @summary Test on timer start method with past notifications
* @author Shanliang JIANG
- * @modules java.management
+ *
* @run clean StartTest
* @run build StartTest
* @run main StartTest
diff --git a/jdk/test/sun/jvmstat/TEST.properties b/jdk/test/sun/jvmstat/TEST.properties
new file mode 100644
index 00000000000..0f0bd8b2056
--- /dev/null
+++ b/jdk/test/sun/jvmstat/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.internal.jvmstat/sun.jvmstat.monitor
+
diff --git a/jdk/test/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java b/jdk/test/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java
index 38c464ebc91..98b6781a5c8 100644
--- a/jdk/test/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java
+++ b/jdk/test/sun/jvmstat/monitor/HostIdentifier/HostIdentifierCreate.java
@@ -24,8 +24,10 @@
/*
* @test
* @bug 4990825
- * @modules jdk.internal.jvmstat/sun.jvmstat.monitor
* @summary test that HostIdentifier objects get created as expected
+ *
+ * @modules java.xml
+ * jdk.internal.jvmstat/sun.jvmstat.monitor
*/
import java.io.*;
diff --git a/jdk/test/sun/jvmstat/monitor/MonitoredVm/TestPollingInterval.java b/jdk/test/sun/jvmstat/monitor/MonitoredVm/TestPollingInterval.java
index 8f9d9d693ac..35482604c44 100644
--- a/jdk/test/sun/jvmstat/monitor/MonitoredVm/TestPollingInterval.java
+++ b/jdk/test/sun/jvmstat/monitor/MonitoredVm/TestPollingInterval.java
@@ -40,9 +40,10 @@ import sun.jvmstat.monitor.VmIdentifier;
* @test
* @bug 6672135
* @summary setInterval() for local MonitoredHost and local MonitoredVm
- * @modules jdk.internal.jvmstat/sun.jvmstat.monitor
+ *
* @library /lib/testlibrary
* @library /test/lib
+ *
* @build jdk.testlibrary.*
* @build jdk.test.lib.apps.*
* @run main TestPollingInterval
diff --git a/jdk/test/sun/jvmstat/monitor/VmIdentifier/VmIdentifierCreateResolve.java b/jdk/test/sun/jvmstat/monitor/VmIdentifier/VmIdentifierCreateResolve.java
index e3bdb4c9b91..f5f157929be 100644
--- a/jdk/test/sun/jvmstat/monitor/VmIdentifier/VmIdentifierCreateResolve.java
+++ b/jdk/test/sun/jvmstat/monitor/VmIdentifier/VmIdentifierCreateResolve.java
@@ -24,8 +24,10 @@
/*
* @test
* @bug 4990825
- * @modules jdk.internal.jvmstat/sun.jvmstat.monitor
* @summary test that VmIdentifier objects get created as expected
+ *
+ * @modules java.xml
+ * jdk.internal.jvmstat/sun.jvmstat.monitor
*/
import java.io.*;
diff --git a/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java b/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java
index 24438815d6e..edacd65d875 100644
--- a/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java
+++ b/jdk/test/sun/jvmstat/perfdata/PrologSanity/PrologSizeSanityCheck.java
@@ -24,9 +24,9 @@
/*
* @test
* @bug 4990825
- * @modules jdk.internal.jvmstat/sun.jvmstat.monitor
- * @run main/othervm -XX:+UsePerfData PrologSizeSanityCheck
* @summary prolog size and overflow sanity checks
+ *
+ * @run main/othervm -XX:+UsePerfData PrologSizeSanityCheck
*/
import sun.jvmstat.monitor.*;
diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassInitializationTime.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassInitializationTime.java
index 51111af24c4..fd450029d51 100644
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassInitializationTime.java
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassInitializationTime.java
@@ -26,7 +26,7 @@
* @bug 4858522
* @summary Basic unit test of HotspotClassLoadingMBean.getClassInitializationTime()
* @author Steve Bohne
- * @modules java.management/sun.management
+ *
* @run main/othervm -XX:+UsePerfData GetClassInitializationTime
*/
diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java
index 37971f7e2cc..1e1d5aa1b99 100644
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetClassLoadingTime.java
@@ -26,7 +26,7 @@
* @bug 4858522
* @summary Basic unit test of HotspotClassLoadingMBean.getClassLoadingTime()
* @author Steve Bohne
- * @modules java.management/sun.management
+ *
* @build ClassToLoad0
* @run main/othervm -XX:+UsePerfData GetClassLoadingTime
*/
diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetInitializedClassCount.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetInitializedClassCount.java
index 72025d85962..b6f966c999a 100644
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetInitializedClassCount.java
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetInitializedClassCount.java
@@ -26,7 +26,7 @@
* @bug 4858522
* @summary Basic unit test of HotspotClassLoadingMBean.getInitializedClassCount()
* @author Steve Bohne
- * @modules java.management/sun.management
+ *
* @run main/othervm -XX:+UsePerfData GetInitializedClassCount
*/
diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetLoadedClassSize.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetLoadedClassSize.java
index 2ca1b85f528..9ba6fe6b268 100644
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetLoadedClassSize.java
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetLoadedClassSize.java
@@ -26,7 +26,7 @@
* @bug 4858522
* @summary Basic unit test of HotspotClassLoadingMBean.getLoadedClassSize()
* @author Steve Bohne
- * @modules java.management/sun.management
+ *
* @run main/othervm -XX:+UsePerfData GetLoadedClassSize
*/
diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetMethodDataSize.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetMethodDataSize.java
index a8e5f43dcd1..8164ba71367 100644
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetMethodDataSize.java
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetMethodDataSize.java
@@ -26,7 +26,7 @@
* @bug 4858522
* @summary Basic unit test of HotspotClassLoadingMBean.getMethodDataSize()
* @author Steve Bohne
- * @modules java.management/sun.management
+ *
* @run main/othervm -XX:+UsePerfData GetMethodDataSize
*/
diff --git a/jdk/test/sun/management/HotspotClassLoadingMBean/GetUnloadedClassSize.java b/jdk/test/sun/management/HotspotClassLoadingMBean/GetUnloadedClassSize.java
index 6319c9abe5f..84e84452cb4 100644
--- a/jdk/test/sun/management/HotspotClassLoadingMBean/GetUnloadedClassSize.java
+++ b/jdk/test/sun/management/HotspotClassLoadingMBean/GetUnloadedClassSize.java
@@ -26,7 +26,7 @@
* @bug 4858522
* @summary Basic unit test of HotspotClassLoadingMBean.getUnloadedClassSize()
* @author Steve Bohne
- * @modules java.management/sun.management
+ *
* @run main/othervm -XX:+UsePerfData GetUnloadedClassSize
*/
diff --git a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointCount.java b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointCount.java
index 7d85e417100..a96d282afba 100644
--- a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointCount.java
+++ b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointCount.java
@@ -26,7 +26,7 @@
* @bug 4858522
* @summary Basic unit test of HotspotClassLoadingMBean.getSafepointCount()
* @author Steve Bohne
- * @modules java.management/sun.management
+ *
* @run main/othervm -XX:+UsePerfData GetSafepointCount
*/
diff --git a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java
index d2a5a7c3646..7b25aaf81b0 100644
--- a/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java
+++ b/jdk/test/sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java
@@ -26,7 +26,7 @@
* @bug 4858522
* @summary Basic unit test of HotspotRuntimeMBean.getSafepointSyncTime()
* @author Steve Bohne
- * @modules java.management/sun.management
+ *
* @run main/othervm -XX:+UsePerfData GetSafepointSyncTime
*/
diff --git a/jdk/test/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java b/jdk/test/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java
index 9502285a405..b2769e2c02a 100644
--- a/jdk/test/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java
+++ b/jdk/test/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java
@@ -24,8 +24,8 @@
/*
* @test
* @bug 4858522
- * @modules java.management/sun.management
* @summary Basic unit test of HotspotRuntimeMBean.getTotalSafepointTime()
+ *
* @run main/othervm -XX:+UsePerfData GetTotalSafepointTime
*/
diff --git a/jdk/test/sun/management/HotspotThreadMBean/GetInternalThreads.java b/jdk/test/sun/management/HotspotThreadMBean/GetInternalThreads.java
index 5d8fe4853fe..9990adc533c 100644
--- a/jdk/test/sun/management/HotspotThreadMBean/GetInternalThreads.java
+++ b/jdk/test/sun/management/HotspotThreadMBean/GetInternalThreads.java
@@ -27,7 +27,7 @@
* @summary Basic Test for HotspotThreadMBean.getInternalThreadCount()
* and getInternalThreadCpuTime()
* @author Mandy Chung
- * @modules java.management/sun.management
+ *
* @run main/othervm -XX:+UsePerfData GetInternalThreads
*/
diff --git a/jdk/test/sun/management/LazyCompositeDataTest.java b/jdk/test/sun/management/LazyCompositeDataTest.java
index c3d06523022..7835dd1e35e 100644
--- a/jdk/test/sun/management/LazyCompositeDataTest.java
+++ b/jdk/test/sun/management/LazyCompositeDataTest.java
@@ -36,7 +36,6 @@ import sun.management.LazyCompositeData;
* @test
* @bug 8139870
* @summary sun.management.LazyCompositeData.isTypeMatched() fails for composite types with items of ArrayType
- * @modules java.management/sun.management
* @author Jaroslav Bachorik
*/
@@ -160,4 +159,5 @@ public class LazyCompositeDataTest {
}
System.out.println("=== PASSED");
}
-}
\ No newline at end of file
+}
+
diff --git a/jdk/test/sun/management/LoggingTest/LoggingWithJULTest.java b/jdk/test/sun/management/LoggingTest/LoggingWithJULTest.java
index a15e5296ec7..a2c7e791507 100644
--- a/jdk/test/sun/management/LoggingTest/LoggingWithJULTest.java
+++ b/jdk/test/sun/management/LoggingTest/LoggingWithJULTest.java
@@ -26,11 +26,14 @@ import java.nio.file.Paths;
/**
* @test
* @bug 8172971
- * @modules java.management java.logging
* @summary Smoke test to check that logging in java.management works as expected.
+ * @author danielfuchs
+ *
+ * @modules java.management
+ * java.logging
+ *
* @build LoggingTest LoggingWithJULTest
* @run main/othervm LoggingWithJULTest
- * @author danielfuchs
*/
public class LoggingWithJULTest {
diff --git a/jdk/test/sun/management/LoggingTest/LoggingWithLoggerFinderTest.java b/jdk/test/sun/management/LoggingTest/LoggingWithLoggerFinderTest.java
index feec435db2b..27671f1fd41 100644
--- a/jdk/test/sun/management/LoggingTest/LoggingWithLoggerFinderTest.java
+++ b/jdk/test/sun/management/LoggingTest/LoggingWithLoggerFinderTest.java
@@ -24,13 +24,13 @@
/**
* @test
* @bug 8172971
- * @modules java.management
* @summary Smoke test to check that logging in java.management is performed
* through System.Logger. This test installs a LoggerFinder service
* provider and verifies that it gets the traces.
+ * @author danielfuchs
+ *
* @build test.loggerfinder/test.loggerfinder.TestLoggerFinder LoggingTest LoggingWithLoggerFinderTest
* @run main/othervm --add-modules test.loggerfinder LoggingWithLoggerFinderTest
- * @author danielfuchs
*/
public class LoggingWithLoggerFinderTest {
diff --git a/jdk/test/sun/management/StackTraceElementCompositeData/CompatibilityTest.java b/jdk/test/sun/management/StackTraceElementCompositeData/CompatibilityTest.java
index 00789c89d59..6984eb7657a 100644
--- a/jdk/test/sun/management/StackTraceElementCompositeData/CompatibilityTest.java
+++ b/jdk/test/sun/management/StackTraceElementCompositeData/CompatibilityTest.java
@@ -15,9 +15,9 @@ import static org.testng.Assert.*;
* @test
* @bug 8139587
* @summary Check backward compatibility of StackTraceElementCompositeData
- * @modules java.management/sun.management
- * @run testng CompatibilityTest
* @author Jaroslav Bachorik
+ *
+ * @run testng CompatibilityTest
*/
public class CompatibilityTest {
@@ -69,4 +69,5 @@ public class CompatibilityTest {
assertNull(ste.getModuleName());
assertNull(ste.getModuleVersion());
}
-}
\ No newline at end of file
+}
+
diff --git a/jdk/test/sun/management/TEST.properties b/jdk/test/sun/management/TEST.properties
new file mode 100644
index 00000000000..d2adce131f1
--- /dev/null
+++ b/jdk/test/sun/management/TEST.properties
@@ -0,0 +1,2 @@
+modules = java.management/sun.management
+
diff --git a/jdk/test/sun/management/jdp/JdpDefaultsTest.java b/jdk/test/sun/management/jdp/JdpDefaultsTest.java
index 9ce8bd9fb98..2f407470c23 100644
--- a/jdk/test/sun/management/jdp/JdpDefaultsTest.java
+++ b/jdk/test/sun/management/jdp/JdpDefaultsTest.java
@@ -30,8 +30,9 @@
/*
* @test JdpDefaultsTest
* @summary Assert that we can read JDP packets from a multicast socket connection, on default IP and port.
+ *
* @library /lib/testlibrary
- * @modules jdk.management.agent/sun.management.jdp
+ *
* @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher
* @run main/othervm JdpDefaultsTest
*/
diff --git a/jdk/test/sun/management/jdp/JdpJmxRemoteDynamicPortTest.java b/jdk/test/sun/management/jdp/JdpJmxRemoteDynamicPortTest.java
index 993cf930846..b5d04d5bace 100644
--- a/jdk/test/sun/management/jdp/JdpJmxRemoteDynamicPortTest.java
+++ b/jdk/test/sun/management/jdp/JdpJmxRemoteDynamicPortTest.java
@@ -22,14 +22,15 @@
*/
/**
- * @test JdpJmxRemoteDynamicPortTest.java
- * @bug 8167337
- * @summary Verify a non-zero value is assigned to jmxremote.port
- * when VM is started with jmxremote.port=0.
- * @library /lib/testlibrary
- * @modules jdk.management.agent/sun.management.jdp
- * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpJmxRemoteDynamicPortTestCase DynamicLauncher
- * @run main/othervm JdpJmxRemoteDynamicPortTest
+ * @test JdpJmxRemoteDynamicPortTest.java
+ * @bug 8167337
+ * @summary Verify a non-zero value is assigned to jmxremote.port
+ * when VM is started with jmxremote.port=0.
+ *
+ * @library /lib/testlibrary
+ *
+ * @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpJmxRemoteDynamicPortTestCase DynamicLauncher
+ * @run main/othervm JdpJmxRemoteDynamicPortTest
*/
import java.lang.management.ManagementFactory;
diff --git a/jdk/test/sun/management/jdp/JdpOffTest.java b/jdk/test/sun/management/jdp/JdpOffTest.java
index 7f105e8c21a..2f50e8416ef 100644
--- a/jdk/test/sun/management/jdp/JdpOffTest.java
+++ b/jdk/test/sun/management/jdp/JdpOffTest.java
@@ -31,8 +31,9 @@
/*
* @test JdpOffTest.java
* @summary Assert that no JDP packets are sent to the default address and port.
+ *
* @library /lib/testlibrary
- * @modules jdk.management.agent/sun.management.jdp
+ *
* @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOffTestCase DynamicLauncher
* @run main/othervm JdpOffTest
*/
diff --git a/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java b/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java
index cf95e5fcc7e..f628e54df00 100644
--- a/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java
+++ b/jdk/test/sun/management/jdp/JdpSpecificAddressTest.java
@@ -30,8 +30,9 @@
/*
* @test JdpSpecificAddressTest
* @summary Assert that we can read JDP packets from a multicast socket connection, on specific IP and port.
+ *
* @library /lib/testlibrary
- * @modules jdk.management.agent/sun.management.jdp
+ *
* @build jdk.testlibrary.* ClientConnection JdpTestUtil JdpTestCase JdpOnTestCase DynamicLauncher
* @run main/othervm JdpSpecificAddressTest
*/
diff --git a/jdk/test/sun/management/jdp/TEST.properties b/jdk/test/sun/management/jdp/TEST.properties
new file mode 100644
index 00000000000..122ad1c7e4c
--- /dev/null
+++ b/jdk/test/sun/management/jdp/TEST.properties
@@ -0,0 +1,3 @@
+modules = jdk.management.agent/sun.management.jdp \
+ java.logging
+
diff --git a/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java b/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java
index 6179a33dc3b..223d252686f 100644
--- a/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java
+++ b/jdk/test/sun/management/jmxremote/LocalRMIServerSocketFactoryTest.java
@@ -22,15 +22,14 @@
*/
/**
- * @test LocalRMIServerSocketFactoryTest.java
- * @bug 6774170
- * @summary Connect to a server socket returned by the LocalRMIServerSocketFactory.
+ * @test LocalRMIServerSocketFactoryTest.java
+ * @bug 6774170
+ * @summary Connect to a server socket returned by the LocalRMIServerSocketFactory.
*
- * @author Daniel Fuchs
+ * @author Daniel Fuchs
*
- * @modules jdk.management.agent/sun.management.jmxremote
- * @run compile -XDignore.symbol.file=true -g LocalRMIServerSocketFactoryTest.java
- * @run main LocalRMIServerSocketFactoryTest
+ * @run compile -XDignore.symbol.file=true -g LocalRMIServerSocketFactoryTest.java
+ * @run main LocalRMIServerSocketFactoryTest
*/
import sun.management.jmxremote.LocalRMIServerSocketFactory;
diff --git a/jdk/test/sun/management/jmxremote/TEST.properties b/jdk/test/sun/management/jmxremote/TEST.properties
new file mode 100644
index 00000000000..c8468535b94
--- /dev/null
+++ b/jdk/test/sun/management/jmxremote/TEST.properties
@@ -0,0 +1,3 @@
+modules = jdk.management.agent/jdk.internal.agent \
+ jdk.management.agent/sun.management.jmxremote
+
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java b/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java
index a7ed6e4fdfc..862c46a23c6 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java
@@ -48,9 +48,9 @@ import jdk.testlibrary.ProcessTools;
* @summary Test JMX agent host address binding. Same ports but different
* interfaces to bind to (using plain sockets and SSL sockets).
*
- * @modules jdk.management.agent/jdk.internal.agent
- * jdk.management.agent/sun.management.jmxremote
* @library /lib/testlibrary
+ * @modules java.management.rmi
+ *
* @build jdk.testlibrary.* JMXAgentInterfaceBinding
* @run main/timeout=5 JMXInterfaceBindingTest
*/
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java b/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java
index 22f18a48da5..1d9a28024ed 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.java
@@ -25,14 +25,14 @@ import java.io.IOException;
/**
* @test
- * @library /lib/testlibrary
* @bug 6557093
* @summary Check SSL config file permission for out-of-the-box management
- * @modules jdk.management.agent
+ * @author Taras Ledkov
+ *
+ * @library /lib/testlibrary
+ *
* @build jdk.testlibrary.* AbstractFilePermissionTest Dummy
* @run main/timeout=300 PasswordFilePermissionTest
- *
- * @author Taras Ledkov
*/
public class PasswordFilePermissionTest extends AbstractFilePermissionTest {
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh b/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh
index d4da383d52b..f767505b020 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh
@@ -24,12 +24,11 @@
#
# @test
# @bug 6528083
+# @key intermittent
# @summary Test RMI Bootstrap
#
-# @key intermittent
# @library /lib/testlibrary
-# @modules jdk.management.agent/jdk.internal.agent
-# jdk.management.agent/sun.management.jmxremote
+#
# @build jdk.testlibrary.* TestLogger Utils RmiBootstrapTest
# @run shell/timeout=300 RmiBootstrapTest.sh
@@ -44,7 +43,7 @@ generatePropertyPasswordFiles `ls ${TESTSRC}/*_test*.in`
rm -rf ${TESTCLASSES}/ssl
mkdir -p ${TESTCLASSES}/ssl
-cp -rf ${TESTSRC}/ssl/*store ${TESTCLASSES}/ssl
+cp -rf ${TESTSRC}/ssl/*store ${TESTCLASSES}/ssl
chmod -R 777 ${TESTCLASSES}/ssl
DEBUGOPTIONS=""
@@ -56,7 +55,7 @@ export EXTRAOPTIONS
# Call the common generic test
#
-# No need to since bug 4267864 is now fixed.
+# No need to since bug 4267864 is now fixed.
#
echo -------------------------------------------------------------
echo Launching test for `basename $0 .sh`
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java b/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java
index f1110063c34..1aeaeb7c3ec 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java
@@ -39,13 +39,14 @@ import java.util.regex.Pattern;
/**
* @test
- * @library /lib/testlibrary
* @bug 6228231
* @summary Test that RMI registry uses SSL.
- * @modules jdk.management.agent
+ * @author Luis-Miguel Alventosa, Taras Ledkov
+ *
+ * @library /lib/testlibrary
+ *
* @build jdk.testlibrary.* RmiRegistrySslTestApp
* @run main/timeout=300 RmiRegistrySslTest
- * @author Luis-Miguel Alventosa, Taras Ledkov
*/
public class RmiRegistrySslTest {
private final String TEST_CLASS_PATH = System.getProperty("test.class.path");
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh
index cd1fde0a39a..67ae17b51bc 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh
@@ -27,8 +27,7 @@
# @summary Test RMI Bootstrap with SSL
#
# @library /lib/testlibrary
-# @modules jdk.management.agent/jdk.internal.agent
-# jdk.management.agent/sun.management.jmxremote
+#
# @build jdk.testlibrary.* TestLogger Utils RmiBootstrapTest
# @run shell/timeout=300 RmiSslBootstrapTest.sh
@@ -43,7 +42,7 @@ generatePropertyPasswordFiles `ls ${TESTSRC}/*_ssltest*.in`
rm -rf ${TESTCLASSES}/ssl
mkdir -p ${TESTCLASSES}/ssl
-cp -rf ${TESTSRC}/ssl/*store ${TESTCLASSES}/ssl
+cp -rf ${TESTSRC}/ssl/*store ${TESTCLASSES}/ssl
chmod -R 777 ${TESTCLASSES}/ssl
DEBUGOPTIONS=""
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh
index 5b88d90e75d..a257cdcc271 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh
+++ b/jdk/test/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh
@@ -24,10 +24,8 @@
#
# @test
# @summary Test RMI Bootstrap with SSL and no keystore.
-#
# @bug 4932854
-# @modules jdk.management.agent/jdk.internal.agent
-# jdk.management.agent/sun.management.jmxremote
+#
# @build TestLogger RmiSslNoKeyStoreTest
# @run shell/timeout=300 RmiSslNoKeyStoreTest.sh
@@ -42,7 +40,7 @@ generatePropertyPasswordFiles `ls ${TESTSRC}/*_ssltest*.in`
rm -rf ${TESTCLASSES}/ssl
mkdir -p ${TESTCLASSES}/ssl
-cp -rf ${TESTSRC}/ssl/*store ${TESTCLASSES}/ssl
+cp -rf ${TESTSRC}/ssl/*store ${TESTCLASSES}/ssl
chmod -R 777 ${TESTCLASSES}/ssl
DEBUGOPTIONS=""
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java b/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java
index 749d927adeb..176f1546f2d 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.java
@@ -25,14 +25,14 @@ import java.io.IOException;
/**
* @test
- * @library /lib/testlibrary
* @bug 6557093
- * @modules jdk.management.agent
- * @build jdk.testlibrary.* Dummy AbstractFilePermissionTest
* @summary Check SSL config file permission for out-of-the-box management
- * @run main/timeout=300 SSLConfigFilePermissionTest
- *
* @author Taras Ledkov
+ *
+ * @library /lib/testlibrary
+ *
+ * @build jdk.testlibrary.* Dummy AbstractFilePermissionTest
+ * @run main/timeout=300 SSLConfigFilePermissionTest
*/
public class SSLConfigFilePermissionTest extends AbstractFilePermissionTest {
diff --git a/jdk/test/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java b/jdk/test/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java
index 2fb8ef6fe4c..14298f8e568 100644
--- a/jdk/test/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java
+++ b/jdk/test/sun/management/jmxremote/startstop/JMXStatusPerfCountersTest.java
@@ -38,11 +38,12 @@ import jdk.testlibrary.ProcessTools;
/**
* @test
* @bug 8075926
+ * @key intermittent
* @summary Makes sure that the current management agent status is reflected
* in the related performance counters.
- * @key intermittent
+ *
* @library /lib/testlibrary
- * @modules jdk.management.agent/jdk.internal.agent
+ *
* @build jdk.testlibrary.* PortAllocator TestApp ManagementAgentJcmd
* @run testng/othervm -XX:+UsePerfData JMXStatusPerfCountersTest
*/
diff --git a/jdk/test/sun/management/jmxremote/startstop/JMXStatusTest.java b/jdk/test/sun/management/jmxremote/startstop/JMXStatusTest.java
index 31c96c3407e..ddc951bf081 100644
--- a/jdk/test/sun/management/jmxremote/startstop/JMXStatusTest.java
+++ b/jdk/test/sun/management/jmxremote/startstop/JMXStatusTest.java
@@ -37,8 +37,9 @@ import jdk.testlibrary.ProcessTools;
* @summary Performs a sanity test for the ManagementAgent.status diagnostic command.
* Management agent may be disabled, started (only local connections) and started.
* The test asserts that the expected text is being printed.
+ *
* @library /lib/testlibrary
- * @modules jdk.management.agent/jdk.internal.agent
+ *
* @build jdk.testlibrary.* PortAllocator TestApp ManagementAgentJcmd
* JMXStatusTest JMXStatus1Test JMXStatus2Test
* @run testng/othervm -XX:+UsePerfData JMXStatus1Test
diff --git a/jdk/test/sun/tools/jcmd/TEST.properties b/jdk/test/sun/tools/jcmd/TEST.properties
new file mode 100644
index 00000000000..0bd03a75b92
--- /dev/null
+++ b/jdk/test/sun/tools/jcmd/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.jcmd
+
diff --git a/jdk/test/sun/tools/jcmd/TestJcmdDefaults.java b/jdk/test/sun/tools/jcmd/TestJcmdDefaults.java
index 36481d6ebce..22da2ff4420 100644
--- a/jdk/test/sun/tools/jcmd/TestJcmdDefaults.java
+++ b/jdk/test/sun/tools/jcmd/TestJcmdDefaults.java
@@ -34,15 +34,14 @@ import jdk.testlibrary.JcmdBase;
import jdk.testlibrary.OutputAnalyzer;
import jdk.testlibrary.Utils;
-/**
- * Unit test for jcmd utility. Tests jcmd options which do not send
- * requests to a specific JVM process.
- */
/*
* @test
* @bug 7104647
+ * @summary Unit test for jcmd utility. Tests jcmd options which do not send
+ * requests to a specific JVM process.
+ *
* @library /lib/testlibrary
- * @modules java.management
+ *
* @build jdk.testlibrary.*
* @run main TestJcmdDefaults
*/
diff --git a/jdk/test/sun/tools/jcmd/TestJcmdSanity.java b/jdk/test/sun/tools/jcmd/TestJcmdSanity.java
index c36c9e895b2..9a2140455aa 100644
--- a/jdk/test/sun/tools/jcmd/TestJcmdSanity.java
+++ b/jdk/test/sun/tools/jcmd/TestJcmdSanity.java
@@ -35,15 +35,14 @@ import jdk.testlibrary.OutputAnalyzer;
import jdk.testlibrary.ProcessTools;
import jdk.testlibrary.Utils;
-/**
- * Unit test for jcmd utility. The test will send different diagnostic command
- * requests to the current java process.
- */
/*
* @test
* @bug 7104647 7154822
+ * @summary Unit test for jcmd utility. The test will send different diagnostic
+ * command requests to the current java process.
+ *
* @library /lib/testlibrary
- * @modules java.management
+ *
* @build jdk.testlibrary.*
* @run main/othervm -XX:+UsePerfData TestJcmdSanity
*/
diff --git a/jdk/test/sun/tools/jconsole/ResourceCheckTest.java b/jdk/test/sun/tools/jconsole/ResourceCheckTest.java
index 6d91b5b3eff..6a8b62d0d2c 100644
--- a/jdk/test/sun/tools/jconsole/ResourceCheckTest.java
+++ b/jdk/test/sun/tools/jconsole/ResourceCheckTest.java
@@ -22,13 +22,14 @@
*/
/**
+ * @test
+ * @bug 5008856 5023573 5024917 5062569 7172176
+ * @summary 'missing resource key' error for key = "Operating system"
*
- * @test
- * @bug 5008856 5023573 5024917 5062569 7172176
- * @summary 'missing resource key' error for key = "Operating system"
- * @modules jdk.jconsole/sun.tools.jconsole
- * jdk.jconsole/sun.tools.jconsole.resources:open
- * @run main ResourceCheckTest
+ * @modules jdk.jconsole/sun.tools.jconsole
+ * jdk.jconsole/sun.tools.jconsole.resources:open
+ *
+ * @run main ResourceCheckTest
*/
import java.lang.reflect.Field;
diff --git a/jdk/test/sun/tools/jhsdb/TEST.properties b/jdk/test/sun/tools/jhsdb/TEST.properties
new file mode 100644
index 00000000000..7b91d856e43
--- /dev/null
+++ b/jdk/test/sun/tools/jhsdb/TEST.properties
@@ -0,0 +1,3 @@
+modules = jdk.hotspot.agent \
+ java.management
+
diff --git a/jdk/test/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java b/jdk/test/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java
index 75437fa4ed3..f4162f5df62 100644
--- a/jdk/test/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java
+++ b/jdk/test/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java
@@ -36,9 +36,11 @@ import jdk.test.lib.Platform;
* @test
* @bug 8042397
* @summary Unit test for jmap utility test heap configuration reader
- * @modules jdk.hotspot.agent/sun.jvm.hotspot
+ *
* @library /test/lib
* @library /lib/testlibrary
+ * @modules jdk.hotspot.agent/sun.jvm.hotspot
+ *
* @build jdk.testlibrary.*
* @build jdk.test.lib.apps.*
* @build JMapHeapConfigTest TmtoolTestScenario
diff --git a/jdk/test/sun/tools/jinfo/JInfoTest.java b/jdk/test/sun/tools/jinfo/JInfoTest.java
index 260486e1bf6..a7b6bc3832a 100644
--- a/jdk/test/sun/tools/jinfo/JInfoTest.java
+++ b/jdk/test/sun/tools/jinfo/JInfoTest.java
@@ -36,11 +36,12 @@ import jdk.test.lib.apps.LingeredApp;
/*
* @test
* @summary Unit test for jinfo utility
- * @modules java.base/jdk.internal.misc
+ *
* @library /test/lib
- * @build jdk.test.lib.*
- * @build jdk.test.lib.apps.*
- * @build jdk.test.lib.process.*
+ * @modules java.base/jdk.internal.misc
+ * java.management
+ * jdk.jcmd
+ *
* @run main JInfoTest
*/
public class JInfoTest {
diff --git a/jdk/test/sun/tools/jinfo/TEST.properties b/jdk/test/sun/tools/jinfo/TEST.properties
new file mode 100644
index 00000000000..0bd03a75b92
--- /dev/null
+++ b/jdk/test/sun/tools/jinfo/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.jcmd
+
diff --git a/jdk/test/sun/tools/jmap/TEST.properties b/jdk/test/sun/tools/jmap/TEST.properties
new file mode 100644
index 00000000000..0bd03a75b92
--- /dev/null
+++ b/jdk/test/sun/tools/jmap/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.jcmd
+
diff --git a/jdk/test/sun/tools/jstack/TEST.properties b/jdk/test/sun/tools/jstack/TEST.properties
new file mode 100644
index 00000000000..0bd03a75b92
--- /dev/null
+++ b/jdk/test/sun/tools/jstack/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.jcmd
+
diff --git a/jdk/test/sun/tools/jstat/TEST.properties b/jdk/test/sun/tools/jstat/TEST.properties
new file mode 100644
index 00000000000..0bd03a75b92
--- /dev/null
+++ b/jdk/test/sun/tools/jstat/TEST.properties
@@ -0,0 +1,2 @@
+modules = jdk.jcmd
+
diff --git a/jdk/test/sun/tools/jstatd/TEST.properties b/jdk/test/sun/tools/jstatd/TEST.properties
new file mode 100644
index 00000000000..4741e99f37a
--- /dev/null
+++ b/jdk/test/sun/tools/jstatd/TEST.properties
@@ -0,0 +1,5 @@
+modules = java.management \
+ java.rmi
+ jdk.jcmd \
+ jdk.jstatd
+
diff --git a/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java b/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java
index 1b0011b70f5..9cecd9cd642 100644
--- a/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java
+++ b/jdk/test/sun/tools/jstatd/TestJstatdDefaults.java
@@ -25,8 +25,9 @@
* @test
* @bug 4990825
* @key intermittent
+ *
* @library /lib/testlibrary
- * @modules java.management
+ *
* @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
* @run main/timeout=60 TestJstatdDefaults
*/
diff --git a/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java b/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java
index 9c9b564349c..bed70457464 100644
--- a/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java
+++ b/jdk/test/sun/tools/jstatd/TestJstatdExternalRegistry.java
@@ -25,8 +25,9 @@
* @test
* @bug 4990825 7092186
* @key intermittent
+ *
* @library /lib/testlibrary
- * @modules java.management
+ *
* @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
* @run main/timeout=60 TestJstatdExternalRegistry
*/
diff --git a/jdk/test/sun/tools/jstatd/TestJstatdPort.java b/jdk/test/sun/tools/jstatd/TestJstatdPort.java
index 8443b3e1bee..393def6f37b 100644
--- a/jdk/test/sun/tools/jstatd/TestJstatdPort.java
+++ b/jdk/test/sun/tools/jstatd/TestJstatdPort.java
@@ -25,8 +25,9 @@
* @test
* @bug 4990825
* @key intermittent
+ *
* @library /lib/testlibrary
- * @modules java.management
+ *
* @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
* @run main/timeout=60 TestJstatdPort
*/
diff --git a/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java b/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java
index 9cce98a347d..c2d6faf44b5 100644
--- a/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java
+++ b/jdk/test/sun/tools/jstatd/TestJstatdPortAndServer.java
@@ -25,8 +25,9 @@
* @test
* @bug 4990825
* @key intermittent
+ *
* @library /lib/testlibrary
- * @modules java.management
+ *
* @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
* @run main/timeout=60 TestJstatdPortAndServer
*/
diff --git a/jdk/test/sun/tools/jstatd/TestJstatdServer.java b/jdk/test/sun/tools/jstatd/TestJstatdServer.java
index 565f799765d..8d440d2681b 100644
--- a/jdk/test/sun/tools/jstatd/TestJstatdServer.java
+++ b/jdk/test/sun/tools/jstatd/TestJstatdServer.java
@@ -25,8 +25,9 @@
* @test
* @bug 4990825
* @key intermittent
+ *
* @library /lib/testlibrary
- * @modules java.management
+ *
* @build jdk.testlibrary.* JstatdTest JstatGCUtilParser
* @run main/timeout=60 TestJstatdServer
*/
From 972a49157ae429135c2b5a1966b5ed8a030851d4 Mon Sep 17 00:00:00 2001
From: Igor Ignatyev
Date: Wed, 22 Mar 2017 17:57:22 -0700
Subject: [PATCH 03/40] 8177374: fix module dependency declaration in jdk_svc
tests
Reviewed-by: mchung, sspitsyn
---
jdk/test/com/sun/tools/attach/BasicTests.java | 9 +++++----
.../PlatformLoggingMXBean/LoggingMXBeanTest.java | 1 -
.../PlatformLoggingMXBeanTest.java | 2 --
.../jmxremote/bootstrap/CustomLauncherTest.java | 8 ++++++--
.../jmxremote/bootstrap/JvmstatCountersTest.java | 6 +++++-
.../jmxremote/bootstrap/LocalManagementTest.java | 8 ++++++--
.../jmxremote/startstop/JMXStartStopTest.java | 14 +++++++++-----
.../tools/jhsdb/heapconfig/JMapHeapConfigTest.java | 5 ++---
8 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/jdk/test/com/sun/tools/attach/BasicTests.java b/jdk/test/com/sun/tools/attach/BasicTests.java
index 720ae0004dd..2a394d0182a 100644
--- a/jdk/test/com/sun/tools/attach/BasicTests.java
+++ b/jdk/test/com/sun/tools/attach/BasicTests.java
@@ -40,16 +40,17 @@ import com.sun.tools.attach.VirtualMachineDescriptor;
/*
* @test
* @bug 6173612 6273707 6277253 6335921 6348630 6342019 6381757
- * @summary Basic unit tests for the VM attach mechanism.
* @key intermittent
+ * @summary Basic unit tests for the VM attach mechanism. This test will perform
+ * a number of basic attach tests.
+ *
* @library /lib/testlibrary
* @modules java.instrument
- * java.management
+ * jdk.attach
* jdk.jartool/sun.tools.jar
+ *
* @run build jdk.testlibrary.* Agent BadAgent RedefineAgent Application RedefineDummy RunnerUtil
* @run main BasicTests
- *
- * This test will perform a number of basic attach tests.
*/
public class BasicTests {
diff --git a/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java b/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java
index 2cdd8957ac2..55aa90ccce4 100644
--- a/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java
+++ b/jdk/test/java/lang/management/PlatformLoggingMXBean/LoggingMXBeanTest.java
@@ -27,7 +27,6 @@
* @summary Test if proxy for PlatformLoggingMXBean is equivalent
* to proxy for LoggingMXBean
*
- * @modules jdk.management
* @build LoggingMXBeanTest
* @run main LoggingMXBeanTest
*/
diff --git a/jdk/test/java/lang/management/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java b/jdk/test/java/lang/management/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java
index 63f5c5fbc31..9b9779af204 100644
--- a/jdk/test/java/lang/management/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java
+++ b/jdk/test/java/lang/management/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java
@@ -24,12 +24,10 @@
/*
* @test
* @bug 6876135 7024172 7067691
- *
* @summary Test PlatformLoggingMXBean
* This test performs similar testing as
* java/util/logging/LoggingMXBeanTest.
*
- * @modules jdk.management
* @build PlatformLoggingMXBeanTest
* @run main PlatformLoggingMXBeanTest
*/
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java b/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java
index 0e1ebcf5319..bba04f4f73b 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.java
@@ -40,12 +40,16 @@ import jdk.testlibrary.ProcessTools;
/**
* @test
* @bug 6434402 8004926
+ * @author Jaroslav Bachorik
+ *
* @library /lib/testlibrary
- * @modules jdk.management.agent/jdk.internal.agent
+ * @modules java.management
+ * jdk.attach
+ * jdk.management.agent/jdk.internal.agent
+ *
* @build jdk.testlibrary.*
* @build TestManager TestApplication CustomLauncherTest
* @run main/othervm CustomLauncherTest
- * @author Jaroslav Bachorik
*/
public class CustomLauncherTest {
private static final String TEST_CLASSPATH = System.getProperty("test.class.path");
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java b/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java
index f731c07245e..75f903f9115 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java
@@ -27,7 +27,11 @@
* @summary Tests that the jvmstat counters published by the out-of-the-box
* management agent for the JMX connection details are correct.
* @author Luis-Miguel Alventosa
- * @modules jdk.management.agent/jdk.internal.agent
+ *
+ * @modules java.management
+ * jdk.attach
+ * jdk.management.agent/jdk.internal.agent
+ *
* @run clean JvmstatCountersTest
* @run build JvmstatCountersTest
* @run main/othervm/timeout=600 -XX:+UsePerfData JvmstatCountersTest 1
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java b/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java
index ae935f3edea..7a72e4fe23e 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java
@@ -32,13 +32,17 @@ import jdk.testlibrary.Utils;
/**
* @test
- * @library /lib/testlibrary
* @bug 5016507 6173612 6319776 6342019 6484550 8004926
* @summary Start a managed VM and test that a management tool can connect
* without connection or username/password details.
* TestManager will attempt a connection to the address obtained from
* both agent properties and jvmstat buffer.
- * @modules jdk.management.agent/jdk.internal.agent
+ *
+ * @library /lib/testlibrary
+ * @modules java.management
+ * jdk.attach
+ * jdk.management.agent/jdk.internal.agent
+ *
* @build jdk.testlibrary.* TestManager TestApplication
* @run main/othervm/timeout=300 LocalManagementTest
*/
diff --git a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java
index 4bdc9496e84..b4313e0fd9f 100644
--- a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java
+++ b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java
@@ -53,13 +53,17 @@ import jdk.internal.agent.ConnectorAddressLink;
/**
* @test
* @bug 7110104
- * @library /lib/testlibrary
- * @modules jdk.management.agent/jdk.internal.agent
- * @build jdk.testlibrary.* JMXStartStopTest PortAllocator TestApp ManagementAgentJcmd
- * @run main/othervm/timeout=600 -XX:+UsePerfData JMXStartStopTest
+ * @key randomness intermittent
* @summary Makes sure that enabling/disabling the management agent through JCMD
* achieves the desired results
- * @key randomness intermittent
+ *
+ * @library /lib/testlibrary
+ * @modules java.management
+ * java.rmi
+ * jdk.management.agent/jdk.internal.agent
+ *
+ * @build jdk.testlibrary.* JMXStartStopTest PortAllocator TestApp ManagementAgentJcmd
+ * @run main/othervm/timeout=600 -XX:+UsePerfData JMXStartStopTest
*/
public class JMXStartStopTest {
private static final String TEST_APP_NAME = "TestApp";
diff --git a/jdk/test/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java b/jdk/test/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java
index f4162f5df62..9e5a1f15586 100644
--- a/jdk/test/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java
+++ b/jdk/test/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java
@@ -39,10 +39,9 @@ import jdk.test.lib.Platform;
*
* @library /test/lib
* @library /lib/testlibrary
- * @modules jdk.hotspot.agent/sun.jvm.hotspot
+ * @modules java.management
+ * jdk.hotspot.agent/sun.jvm.hotspot
*
- * @build jdk.testlibrary.*
- * @build jdk.test.lib.apps.*
* @build JMapHeapConfigTest TmtoolTestScenario
* @run main JMapHeapConfigTest
*/
From 340ebfef08f65602a44495f6429795e8bb953b8b Mon Sep 17 00:00:00 2001
From: Mandy Chung
Date: Mon, 27 Mar 2017 15:12:01 -0700
Subject: [PATCH 04/40] 8174826: jlink support for linking in service provider
modules
Reviewed-by: alanb, anazarov
---
.../classes/jdk/tools/jimage/JImageTask.java | 51 +--
.../jdk/tools/jlink/internal/Jlink.java | 87 ++++--
.../jdk/tools/jlink/internal/JlinkTask.java | 294 ++++++++++++++----
.../jdk/tools/jlink/internal/TaskHelper.java | 70 +++--
.../packager/AppRuntimeImageBuilder.java | 12 +-
.../tools/jlink/resources/jlink.properties | 40 ++-
jdk/test/tools/jlink/IntegrationTest.java | 10 +-
jdk/test/tools/jlink/JLinkTest.java | 6 +-
.../jlink/bindservices/BindServices.java | 200 ++++++++++++
.../jlink/bindservices/SuggestProviders.java | 209 +++++++++++++
.../bindservices/src/m1/module-info.java | 28 ++
.../jlink/bindservices/src/m1/p1/Impl.java | 30 ++
.../jlink/bindservices/src/m1/p1/Main.java | 53 ++++
.../tools/jlink/bindservices/src/m1/p1/S.java | 28 ++
.../bindservices/src/m2/module-info.java | 30 ++
.../jlink/bindservices/src/m2/p2/Impl.java | 33 ++
.../tools/jlink/bindservices/src/m2/p2/T.java | 28 ++
.../bindservices/src/m3/module-info.java | 27 ++
.../jlink/bindservices/src/m3/p3/Impl.java | 29 ++
19 files changed, 1098 insertions(+), 167 deletions(-)
create mode 100644 jdk/test/tools/jlink/bindservices/BindServices.java
create mode 100644 jdk/test/tools/jlink/bindservices/SuggestProviders.java
create mode 100644 jdk/test/tools/jlink/bindservices/src/m1/module-info.java
create mode 100644 jdk/test/tools/jlink/bindservices/src/m1/p1/Impl.java
create mode 100644 jdk/test/tools/jlink/bindservices/src/m1/p1/Main.java
create mode 100644 jdk/test/tools/jlink/bindservices/src/m1/p1/S.java
create mode 100644 jdk/test/tools/jlink/bindservices/src/m2/module-info.java
create mode 100644 jdk/test/tools/jlink/bindservices/src/m2/p2/Impl.java
create mode 100644 jdk/test/tools/jlink/bindservices/src/m2/p2/T.java
create mode 100644 jdk/test/tools/jlink/bindservices/src/m3/module-info.java
create mode 100644 jdk/test/tools/jlink/bindservices/src/m3/p3/Impl.java
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java
index 344b920a8bf..c9cafff1ce2 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2017, 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
@@ -35,8 +35,12 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
+import java.util.Locale;
import java.util.MissingResourceException;
import java.util.function.Predicate;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
import jdk.internal.jimage.BasicImageReader;
import jdk.internal.jimage.ImageHeader;
import jdk.internal.jimage.ImageLocation;
@@ -99,7 +103,7 @@ class JImageTask {
}
static class OptionsValues {
- Task task = Task.LIST;
+ Task task = null;
String directory = ".";
String include = "";
boolean fullVersion;
@@ -172,24 +176,31 @@ class JImageTask {
}
try {
- List unhandled = OPTION_HELPER.handleOptions(this, args);
+ String command;
+ String[] remaining = args;
+ try {
+ command = args[0];
+ options.task = Enum.valueOf(Task.class, args[0].toUpperCase(Locale.ENGLISH));
+ remaining = args.length > 1 ? Arrays.copyOfRange(args, 1, args.length)
+ : new String[0];
+ } catch (IllegalArgumentException ex) {
+ command = null;
+ options.task = null;
+ }
- if(!unhandled.isEmpty()) {
- try {
- options.task = Enum.valueOf(Task.class, unhandled.get(0).toUpperCase());
- } catch (IllegalArgumentException ex) {
- throw TASK_HELPER.newBadArgs("err.not.a.task", unhandled.get(0));
- }
+ // process arguments
+ List unhandled = OPTION_HELPER.handleOptions(this, remaining);
+ for (String f : unhandled) {
+ options.jimages.add(new File(f));
+ }
- for(int i = 1; i < unhandled.size(); i++) {
- options.jimages.add(new File(unhandled.get(i)));
- }
- } else if (!options.help && !options.version && !options.fullVersion) {
- throw TASK_HELPER.newBadArgs("err.invalid.task", "");
+ if (options.task == null && !options.help && !options.version && !options.fullVersion) {
+ throw TASK_HELPER.newBadArgs("err.not.a.task",
+ command != null ? command : "");
}
if (options.help) {
- if (unhandled.isEmpty()) {
+ if (options.task == null) {
log.println(TASK_HELPER.getMessage("main.usage", PROGNAME));
Arrays.asList(RECOGNIZED_OPTIONS).stream()
.filter(option -> !option.isHidden())
@@ -203,15 +214,19 @@ class JImageTask {
log.println(TASK_HELPER.getMessage("main.usage." +
options.task.toString().toLowerCase()));
} catch (MissingResourceException ex) {
- throw TASK_HELPER.newBadArgs("err.not.a.task", unhandled.get(0));
+ throw TASK_HELPER.newBadArgs("err.not.a.task", command);
}
}
return EXIT_OK;
}
if (options.version || options.fullVersion) {
- TASK_HELPER.showVersion(options.fullVersion);
+ if (options.task == null && !unhandled.isEmpty()) {
+ throw TASK_HELPER.newBadArgs("err.not.a.task",
+ Stream.of(args).collect(Collectors.joining(" ")));
+ }
+ TASK_HELPER.showVersion(options.fullVersion);
if (unhandled.isEmpty()) {
return EXIT_OK;
}
@@ -435,7 +450,7 @@ class JImageTask {
iterate(this::listTitle, null, this::verify);
break;
default:
- throw TASK_HELPER.newBadArgs("err.invalid.task",
+ throw TASK_HELPER.newBadArgs("err.not.a.task",
options.task.name()).showUsage(true);
}
return true;
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java
index ecb63cd0a96..5ab1bfca53a 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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,6 +24,8 @@
*/
package jdk.tools.jlink.internal;
+import java.lang.module.Configuration;
+import java.lang.module.ModuleFinder;
import java.lang.reflect.Layer;
import java.nio.ByteOrder;
import java.nio.file.Path;
@@ -33,6 +35,8 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
+
+import jdk.internal.module.ModulePath;
import jdk.tools.jlink.plugin.Plugin;
import jdk.tools.jlink.plugin.PluginException;
import jdk.tools.jlink.builder.ImageBuilder;
@@ -147,8 +151,8 @@ public final class Jlink {
private final Path output;
private final Set modules;
private final Set limitmods;
-
private final ByteOrder endian;
+ private final ModuleFinder finder;
/**
* jlink configuration,
@@ -160,31 +164,23 @@ public final class Jlink {
* @param endian Jimage byte order. Native order by default
*/
public JlinkConfiguration(Path output,
- List modulepaths,
- Set modules,
- Set limitmods,
- ByteOrder endian) {
- this.output = output;
- this.modulepaths = modulepaths == null ? Collections.emptyList() : modulepaths;
- this.modules = modules == null ? Collections.emptySet() : modules;
- this.limitmods = limitmods == null ? Collections.emptySet() : limitmods;
- this.endian = endian == null ? ByteOrder.nativeOrder() : endian;
- }
+ List modulepaths,
+ Set modules,
+ Set limitmods,
+ ByteOrder endian) {
+ if (Objects.requireNonNull(modulepaths).isEmpty()) {
+ throw new IllegalArgumentException("Empty module path");
+ }
+ if (Objects.requireNonNull(modules).isEmpty()) {
+ throw new IllegalArgumentException("Empty modules");
+ }
- /**
- * jlink configuration,
- *
- * @param output Output directory, must not exist.
- * @param modulepaths Modules paths
- * @param modules Root modules to resolve
- * @param limitmods Limit the universe of observable modules
- */
- public JlinkConfiguration(Path output,
- List modulepaths,
- Set modules,
- Set limitmods) {
- this(output, modulepaths, modules, limitmods,
- ByteOrder.nativeOrder());
+ this.output = output;
+ this.modulepaths = modulepaths;
+ this.modules = modules;
+ this.limitmods = Objects.requireNonNull(limitmods);
+ this.endian = Objects.requireNonNull(endian);
+ this.finder = moduleFinder();
}
/**
@@ -222,6 +218,45 @@ public final class Jlink {
return limitmods;
}
+ /**
+ * Returns {@link ModuleFinder} that finds all observable modules
+ * for this jlink configuration.
+ */
+ public ModuleFinder finder() {
+ return finder;
+ }
+
+ /**
+ * Returns a {@link Configuration} of the given module path,
+ * root modules with full service binding.
+ */
+ public Configuration resolveAndBind()
+ {
+ return Configuration.empty().resolveAndBind(finder,
+ ModuleFinder.of(),
+ modules);
+ }
+
+ /**
+ * Returns a {@link Configuration} of the given module path,
+ * root modules with no service binding.
+ */
+ public Configuration resolve()
+ {
+ return Configuration.empty().resolve(finder,
+ ModuleFinder.of(),
+ modules);
+ }
+
+ private ModuleFinder moduleFinder() {
+ Path[] entries = modulepaths.toArray(new Path[0]);
+ ModuleFinder finder = ModulePath.of(Runtime.version(), true, entries);
+ if (!limitmods.isEmpty()) {
+ finder = JlinkTask.limitFinder(finder, limitmods, modules);
+ }
+ return finder;
+ }
+
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java
index 42032b6ab00..e7644ab84a7 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -110,6 +110,12 @@ public class JlinkTask {
Path path = Paths.get(arg);
task.options.output = path;
}, "--output"),
+ new Option(false, (task, opt, arg) -> {
+ task.options.bindServices = true;
+ }, "--bind-services"),
+ new Option(false, (task, opt, arg) -> {
+ task.options.suggestProviders = true;
+ }, "--suggest-providers", "", true),
new Option(true, (task, opt, arg) -> {
String[] values = arg.split("=");
// check values
@@ -140,6 +146,9 @@ public class JlinkTask {
throw taskHelper.newBadArgs("err.unknown.byte.order", arg);
}
}, "--endian"),
+ new Option(false, (task, opt, arg) -> {
+ task.options.verbose = true;
+ }, "--verbose", "-v"),
new Option(false, (task, opt, arg) -> {
task.options.version = true;
}, "--version"),
@@ -185,6 +194,7 @@ public class JlinkTask {
static class OptionsValues {
boolean help;
String saveoptsfile;
+ boolean verbose;
boolean version;
boolean fullVersion;
final List modulePath = new ArrayList<>();
@@ -195,6 +205,8 @@ public class JlinkTask {
Path packagedModulesPath;
ByteOrder endian = ByteOrder.nativeOrder();
boolean ignoreSigning = false;
+ boolean bindServices = false;
+ boolean suggestProviders = false;
}
int run(String[] args) {
@@ -203,7 +215,11 @@ public class JlinkTask {
new PrintWriter(System.err, true));
}
try {
- optionsHelper.handleOptionsNoUnhandled(this, args);
+ List remaining = optionsHelper.handleOptions(this, args);
+ if (remaining.size() > 0 && !options.suggestProviders) {
+ throw taskHelper.newBadArgs("err.orphan.arguments", toString(remaining))
+ .showUsage(true);
+ }
if (options.help) {
optionsHelper.showHelp(PROGNAME);
return EXIT_OK;
@@ -217,17 +233,24 @@ public class JlinkTask {
return EXIT_OK;
}
- if (taskHelper.getExistingImage() == null) {
- if (options.modulePath.isEmpty()) {
- throw taskHelper.newBadArgs("err.modulepath.must.be.specified").showUsage(true);
- }
- createImage();
- } else {
+ if (taskHelper.getExistingImage() != null) {
postProcessOnly(taskHelper.getExistingImage());
+ return EXIT_OK;
}
- if (options.saveoptsfile != null) {
- Files.write(Paths.get(options.saveoptsfile), getSaveOpts().getBytes());
+ if (options.modulePath.isEmpty()) {
+ throw taskHelper.newBadArgs("err.modulepath.must.be.specified")
+ .showUsage(true);
+ }
+
+ JlinkConfiguration config = initJlinkConfig();
+ if (options.suggestProviders) {
+ suggestProviders(config, remaining);
+ } else {
+ createImage(config);
+ if (options.saveoptsfile != null) {
+ Files.write(Paths.get(options.saveoptsfile), getSaveOpts().getBytes());
+ }
}
return EXIT_OK;
@@ -266,25 +289,13 @@ public class JlinkTask {
Objects.requireNonNull(config.getOutput());
plugins = plugins == null ? new PluginsConfiguration() : plugins;
- if (config.getModulepaths().isEmpty()) {
- throw new IllegalArgumentException("Empty module paths");
- }
-
- ModuleFinder finder = newModuleFinder(config.getModulepaths(),
- config.getLimitmods(),
- config.getModules());
-
- if (config.getModules().isEmpty()) {
- throw new IllegalArgumentException("No modules to add");
- }
-
// First create the image provider
ImageProvider imageProvider =
- createImageProvider(finder,
- config.getModules(),
- config.getByteOrder(),
+ createImageProvider(config,
null,
IGNORE_SIGNING_DEFAULT,
+ false,
+ false,
null);
// Then create the Plugin Stack
@@ -319,20 +330,24 @@ public class JlinkTask {
// the token for "all modules on the module path"
private static final String ALL_MODULE_PATH = "ALL-MODULE-PATH";
- private void createImage() throws Exception {
- if (options.output == null) {
- throw taskHelper.newBadArgs("err.output.must.be.specified").showUsage(true);
- }
-
+ private JlinkConfiguration initJlinkConfig() throws BadArgs {
if (options.addMods.isEmpty()) {
throw taskHelper.newBadArgs("err.mods.must.be.specified", "--add-modules")
- .showUsage(true);
+ .showUsage(true);
}
Set roots = new HashSet<>();
for (String mod : options.addMods) {
if (mod.equals(ALL_MODULE_PATH)) {
- ModuleFinder finder = modulePathFinder();
+ Path[] entries = options.modulePath.toArray(new Path[0]);
+ ModuleFinder finder = ModulePath.of(Runtime.version(), true, entries);
+ if (!options.limitMods.isEmpty()) {
+ // finder for the observable modules specified in
+ // the --module-path and --limit-modules options
+ finder = limitFinder(finder, options.limitMods, Collections.emptySet());
+ }
+
+ // all observable modules are roots
finder.findAll()
.stream()
.map(ModuleReference::descriptor)
@@ -343,40 +358,34 @@ public class JlinkTask {
}
}
- ModuleFinder finder = newModuleFinder(options.modulePath,
- options.limitMods,
- roots);
+ return new JlinkConfiguration(options.output,
+ options.modulePath,
+ roots,
+ options.limitMods,
+ options.endian);
+ }
+ private void createImage(JlinkConfiguration config) throws Exception {
+ if (options.output == null) {
+ throw taskHelper.newBadArgs("err.output.must.be.specified").showUsage(true);
+ }
// First create the image provider
- ImageProvider imageProvider = createImageProvider(finder,
- roots,
- options.endian,
+ ImageProvider imageProvider = createImageProvider(config,
options.packagedModulesPath,
options.ignoreSigning,
+ options.bindServices,
+ options.verbose,
log);
// Then create the Plugin Stack
- ImagePluginStack stack = ImagePluginConfiguration.
- parseConfiguration(taskHelper.getPluginsConfig(options.output, options.launchers));
+ ImagePluginStack stack = ImagePluginConfiguration.parseConfiguration(
+ taskHelper.getPluginsConfig(options.output, options.launchers));
//Ask the stack to proceed
stack.operate(imageProvider);
}
- /**
- * Returns a module finder to find the observable modules specified in
- * the --module-path and --limit-modules options
- */
- private ModuleFinder modulePathFinder() {
- Path[] entries = options.modulePath.toArray(new Path[0]);
- ModuleFinder finder = ModulePath.of(Runtime.version(), true, entries);
- if (!options.limitMods.isEmpty()) {
- finder = limitFinder(finder, options.limitMods, Collections.emptySet());
- }
- return finder;
- }
-
/*
* Returns a module finder of the given module path that limits
* the observable modules to those in the transitive closure of
@@ -405,22 +414,32 @@ public class JlinkTask {
return Paths.get(uri);
}
- private static ImageProvider createImageProvider(ModuleFinder finder,
- Set roots,
- ByteOrder order,
+
+ private static ImageProvider createImageProvider(JlinkConfiguration config,
Path retainModulesPath,
boolean ignoreSigning,
+ boolean bindService,
+ boolean verbose,
PrintWriter log)
throws IOException
{
- if (roots.isEmpty()) {
- throw new IllegalArgumentException("empty modules and limitmods");
- }
+ Configuration cf = bindService ? config.resolveAndBind()
+ : config.resolve();
- Configuration cf = Configuration.empty()
- .resolve(finder,
- ModuleFinder.of(),
- roots);
+ if (verbose && log != null) {
+ // print modules to be linked in
+ cf.modules().stream()
+ .sorted(Comparator.comparing(ResolvedModule::name))
+ .forEach(rm -> log.format("module %s (%s)%n",
+ rm.name(), rm.reference().location().get()));
+
+ // print provider info
+ Set references = cf.modules().stream()
+ .map(ResolvedModule::reference).collect(Collectors.toSet());
+
+ String msg = String.format("%n%s:", taskHelper.getMessage("providers.header"));
+ printProviders(log, msg, references);
+ }
// emit a warning for any incubating modules in the configuration
if (log != null) {
@@ -438,16 +457,16 @@ public class JlinkTask {
Map mods = cf.modules().stream()
.collect(Collectors.toMap(ResolvedModule::name, JlinkTask::toPathLocation));
- return new ImageHelper(cf, mods, order, retainModulesPath, ignoreSigning);
+ return new ImageHelper(cf, mods, config.getByteOrder(), retainModulesPath, ignoreSigning);
}
/*
* Returns a ModuleFinder that limits observability to the given root
* modules, their transitive dependences, plus a set of other modules.
*/
- private static ModuleFinder limitFinder(ModuleFinder finder,
- Set roots,
- Set otherMods) {
+ public static ModuleFinder limitFinder(ModuleFinder finder,
+ Set roots,
+ Set otherMods) {
// resolve all root modules
Configuration cf = Configuration.empty()
@@ -484,6 +503,147 @@ public class JlinkTask {
};
}
+ /*
+ * Returns a map of each service type to the modules that use it
+ */
+ private static Map> uses(Set modules) {
+ // collects the services used by the modules and print uses
+ Map> uses = new HashMap<>();
+ modules.stream()
+ .map(ModuleReference::descriptor)
+ .forEach(md -> md.uses().forEach(s ->
+ uses.computeIfAbsent(s, _k -> new HashSet<>()).add(md.name()))
+ );
+ return uses;
+ }
+
+ private static void printProviders(PrintWriter log,
+ String header,
+ Set modules) {
+ printProviders(log, header, modules, uses(modules));
+ }
+
+ /*
+ * Prints the providers that are used by the services specified in
+ * the given modules.
+ *
+ * The specified uses maps a service type name to the modules
+ * using the service type and that may or may not be present
+ * the given modules.
+ */
+ private static void printProviders(PrintWriter log,
+ String header,
+ Set modules,
+ Map> uses) {
+ if (modules.isEmpty())
+ return;
+
+ // Build a map of a service type to the provider modules
+ Map> providers = new HashMap<>();
+ modules.stream()
+ .map(ModuleReference::descriptor)
+ .forEach(md -> {
+ md.provides().stream()
+ .filter(p -> uses.containsKey(p.service()))
+ .forEach(p -> providers.computeIfAbsent(p.service(), _k -> new HashSet<>())
+ .add(md));
+ });
+
+ if (!providers.isEmpty()) {
+ log.println(header);
+ }
+
+ // print the providers of the service types used by the specified modules
+ // sorted by the service type name and then provider's module name
+ providers.entrySet().stream()
+ .sorted(Map.Entry.comparingByKey())
+ .forEach(e -> {
+ String service = e.getKey();
+ e.getValue().stream()
+ .sorted(Comparator.comparing(ModuleDescriptor::name))
+ .forEach(md ->
+ md.provides().stream()
+ .filter(p -> p.service().equals(service))
+ .forEach(p -> log.format(" module %s provides %s, used by %s%n",
+ md.name(), p.service(),
+ uses.get(p.service()).stream()
+ .sorted()
+ .collect(Collectors.joining(","))))
+ );
+ });
+ }
+
+ private void suggestProviders(JlinkConfiguration config, List args)
+ throws BadArgs
+ {
+ if (args.size() > 1) {
+ throw taskHelper.newBadArgs("err.orphan.argument",
+ toString(args.subList(1, args.size())))
+ .showUsage(true);
+ }
+
+ if (options.bindServices) {
+ log.println(taskHelper.getMessage("no.suggested.providers"));
+ return;
+ }
+
+ ModuleFinder finder = config.finder();
+ if (args.isEmpty()) {
+ // print providers used by the modules resolved without service binding
+ Configuration cf = config.resolve();
+ Set mrefs = cf.modules().stream()
+ .map(ResolvedModule::reference)
+ .collect(Collectors.toSet());
+
+ // print uses of the modules that would be linked into the image
+ mrefs.stream()
+ .sorted(Comparator.comparing(mref -> mref.descriptor().name()))
+ .forEach(mref -> {
+ ModuleDescriptor md = mref.descriptor();
+ log.format("module %s located (%s)%n", md.name(),
+ mref.location().get());
+ md.uses().stream().sorted()
+ .forEach(s -> log.format(" uses %s%n", s));
+ });
+
+ String msg = String.format("%n%s:", taskHelper.getMessage("suggested.providers.header"));
+ printProviders(log, msg, finder.findAll(), uses(mrefs));
+
+ } else {
+ // comma-separated service types, if specified
+ Set names = Stream.of(args.get(0).split(","))
+ .collect(Collectors.toSet());
+ // find the modules that provide the specified service
+ Set mrefs = finder.findAll().stream()
+ .filter(mref -> mref.descriptor().provides().stream()
+ .map(ModuleDescriptor.Provides::service)
+ .anyMatch(names::contains))
+ .collect(Collectors.toSet());
+
+ // the specified services may or may not be in the modules that
+ // would be linked in. So find uses declared in all observable modules
+ Map> uses = uses(finder.findAll());
+
+ // check if any name given on the command line are unused service
+ mrefs.stream()
+ .flatMap(mref -> mref.descriptor().provides().stream()
+ .map(ModuleDescriptor.Provides::service))
+ .forEach(names::remove);
+ if (!names.isEmpty()) {
+ log.println(taskHelper.getMessage("warn.unused.services",
+ toString(names)));
+ }
+
+ String msg = String.format("%n%s:", taskHelper.getMessage("suggested.providers.header"));
+ printProviders(log, msg, mrefs, uses);
+ }
+ }
+
+ private static String toString(Collection collection) {
+ return collection.stream().sorted()
+ .collect(Collectors.joining(","));
+ }
+
private String getSaveOpts() {
StringBuilder sb = new StringBuilder();
sb.append('#').append(new Date()).append("\n");
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java
index c8688ec118d..4535f9cfe7e 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -46,6 +46,7 @@ import java.util.Map.Entry;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.Set;
+import java.util.stream.Collectors;
import java.util.stream.Stream;
import jdk.tools.jlink.internal.plugins.ExcludeJmodSectionPlugin;
@@ -101,8 +102,15 @@ public final class TaskHelper {
final boolean hidden;
final String name;
final String shortname;
+ final boolean terminalOption;
- public Option(boolean hasArg, Processing processing, boolean hidden, String name, String shortname) {
+ public Option(boolean hasArg,
+ Processing processing,
+ boolean hidden,
+ String name,
+ String shortname,
+ boolean isTerminal)
+ {
if (!name.startsWith("--")) {
throw new RuntimeException("option name missing --, " + name);
}
@@ -115,24 +123,33 @@ public final class TaskHelper {
this.hidden = hidden;
this.name = name;
this.shortname = shortname;
+ this.terminalOption = isTerminal;
+ }
+
+ public Option(boolean hasArg, Processing processing, String name, String shortname, boolean isTerminal) {
+ this(hasArg, processing, false, name, shortname, isTerminal);
}
public Option(boolean hasArg, Processing processing, String name, String shortname) {
- this(hasArg, processing, false, name, shortname);
+ this(hasArg, processing, false, name, shortname, false);
}
public Option(boolean hasArg, Processing processing, boolean hidden, String name) {
- this(hasArg, processing, hidden, name, "");
+ this(hasArg, processing, hidden, name, "", false);
}
public Option(boolean hasArg, Processing processing, String name) {
- this(hasArg, processing, false, name, "");
+ this(hasArg, processing, false, name, "", false);
}
public boolean isHidden() {
return hidden;
}
+ public boolean isTerminal() {
+ return terminalOption;
+ }
+
public boolean matches(String opt) {
return opt.equals(name) ||
opt.equals(shortname) ||
@@ -179,12 +196,12 @@ public final class TaskHelper {
private static class PluginOption extends Option {
public PluginOption(boolean hasArg,
Processing processing, boolean hidden, String name, String shortname) {
- super(hasArg, processing, hidden, name, shortname);
+ super(hasArg, processing, hidden, name, shortname, false);
}
public PluginOption(boolean hasArg,
Processing processing, boolean hidden, String name) {
- super(hasArg, processing, hidden, name, "");
+ super(hasArg, processing, hidden, name, "", false);
}
public String resourcePrefix() {
@@ -498,21 +515,13 @@ public final class TaskHelper {
return null;
}
- // used by jimage. Return unhandled arguments like "create", "describe".
+ /**
+ * Handles all options. This method stops processing the argument
+ * at the first non-option argument i.e. not starts with `-`, or
+ * at the first terminal option and returns the remaining arguments,
+ * if any.
+ */
public List handleOptions(T task, String[] args) throws BadArgs {
- return handleOptions(task, args, true);
- }
-
- // used by jlink. No unhandled arguments like "create", "describe".
- void handleOptionsNoUnhandled(T task, String[] args) throws BadArgs {
- handleOptions(task, args, false);
- }
-
- // shared code that handles options for both jlink and jimage. jimage uses arguments like
- // "create", "describe" etc. as "task names". Those arguments are unhandled here and returned
- // as "unhandled arguments list". jlink does not want such arguments. "collectUnhandled" flag
- // tells whether to allow for unhandled arguments or not.
- private List handleOptions(T task, String[] args, boolean collectUnhandled) throws BadArgs {
// findbugs warning, copy instead of keeping a reference.
command = Arrays.copyOf(args, args.length);
@@ -521,7 +530,6 @@ public final class TaskHelper {
// Unit tests can call Task multiple time in same JVM.
pluginOptions = new PluginsHelper(null);
- List rest = collectUnhandled? new ArrayList<>() : null;
// process options
for (int i = 0; i < args.length; i++) {
if (args[i].startsWith("-")) {
@@ -531,7 +539,6 @@ public final class TaskHelper {
if (option == null) {
pluginOption = pluginOptions.getOption(name);
if (pluginOption == null) {
-
throw new BadArgs("err.unknown.option", name).
showUsage(true);
}
@@ -556,20 +563,23 @@ public final class TaskHelper {
pluginOption.process(pluginOptions, name, param);
} else {
option.process(task, name, param);
+ if (option.isTerminal()) {
+ return ++i < args.length
+ ? Stream.of(Arrays.copyOfRange(args, i, args.length))
+ .collect(Collectors.toList())
+ : Collections.emptyList();
+
+ }
}
if (opt.ignoreRest()) {
i = args.length;
}
} else {
- if (collectUnhandled) {
- rest.add(args[i]);
- } else {
- throw new BadArgs("err.orphan.argument", args[i]).
- showUsage(true);
- }
+ return Stream.of(Arrays.copyOfRange(args, i, args.length))
+ .collect(Collectors.toList());
}
}
- return rest;
+ return Collections.emptyList();
}
private Option getOption(String name) {
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java
index dd0889d3786..3632ccb16c0 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/packager/AppRuntimeImageBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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
@@ -34,6 +34,7 @@ import jdk.tools.jlink.plugin.Plugin;
import java.io.File;
import java.io.IOException;
import java.lang.module.ModuleFinder;
+import java.nio.ByteOrder;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
@@ -93,9 +94,12 @@ public final class AppRuntimeImageBuilder {
public void build() throws IOException {
// jlink main arguments
- Jlink.JlinkConfiguration jlinkConfig = new Jlink.JlinkConfiguration(
- new File("").toPath(), // Unused
- modulePath, addModules, limitModules);
+ Jlink.JlinkConfiguration jlinkConfig =
+ new Jlink.JlinkConfiguration(new File("").toPath(), // Unused
+ modulePath,
+ addModules,
+ limitModules,
+ ByteOrder.nativeOrder());
// plugin configuration
List plugins = new ArrayList();
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties
index 7a63cc38344..4f7558e2e04 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2017, 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,15 +24,12 @@
#
main.usage.summary=\
-Usage: {0} --module-path --add-modules --output\n\
-\ use --help for a list of possible options
+Usage: {0} --module-path --add-modules [,...]\n\
+\Use --help for a list of possible options
main.usage=\
-Usage: {0} --module-path --add-modules --output\n\
-\ Possible options include:
-
-error.prefix=Error:
-warn.prefix=Warning:
+Usage: {0} --module-path --add-modules [,...]\n\
+\Possible options include:
main.opt.help=\
\ -h, --help Print this help message
@@ -54,9 +51,18 @@ main.opt.output=\
\ --output Location of output path
main.opt.launcher=\
-\ --launcher = Launcher command name for the module\n\
-\ --launcher =/\n\
-\ Launcher command name for the module and the main class
+\ --launcher =[/]\n\
+\ Add a launcher command of the given\n\
+\ name for the module and the main class\n\
+\ if specified
+
+main.opt.bind-services=\
+\ --bind-services Do full service binding
+
+main.opt.suggest-providers=\
+\ --suggest-providers [,...] Suggest providers of services used by\n\
+\ the modules that would be linked, or\n\
+\ of the given service types
main.command.files=\
\ @ Read options from file
@@ -75,6 +81,9 @@ main.opt.ignore-signing-information=\
\ signed modular JARs are not copied to\n\
\ the runtime image.
+main.opt.verbose=\
+\ -v, --verbose Enable verbose tracing
+
main.msg.bug=\
An exception has occurred in jlink. \
Please file a bug at the Java Bug Database (http://bugreport.java.com/bugreport/) \
@@ -95,6 +104,9 @@ main.extended.help.footer=\
\n\
+error.prefix=Error:
+warn.prefix=Warning:
+
err.unknown.byte.order:unknown byte order {0}
err.launcher.main.class.empty:launcher main class name cannot be empty: {0}
err.launcher.module.name.empty:launcher module name cannot be empty: {0}
@@ -111,12 +123,12 @@ err.file.error=cannot access file: {0}
err.dir.exists={0} already exists
err.badpattern=bad pattern {0}
err.unknown.option=unknown option: {0}
-err.orphan.argument=orphan argument: {0}
err.missing.arg=no value given for {0}
err.internal.error=internal error: {0} {1} {2}
err.invalid.arg.for.option=invalid argument for option: {0}
err.option.after.class=option must be specified before classes: {0}
err.option.unsupported={0} not supported: {1}
+err.orphan.arguments=invalid argument: {0}
err.config.defaults=property {0} is missing from configuration
err.config.defaults.value=wrong value in defaults property: {0}
err.bom.generation=bom file generation failed: {0}
@@ -126,3 +138,7 @@ err.signing=signed modular JAR {0} is currently not supported,\
warn.signing=WARNING: signed modular JAR {0} is currently not supported
warn.invalid.arg=invalid classname or pathname not exist: {0}
warn.split.package=package {0} defined in {1} {2}
+warn.unused.services=Services specified in --suggest-providers not used: {0}
+no.suggested.providers=--bind-services option is specified. No additional providers suggested.
+suggested.providers.header=Suggested providers
+providers.header=Providers
diff --git a/jdk/test/tools/jlink/IntegrationTest.java b/jdk/test/tools/jlink/IntegrationTest.java
index c3059051986..de2c1189c66 100644
--- a/jdk/test/tools/jlink/IntegrationTest.java
+++ b/jdk/test/tools/jlink/IntegrationTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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 @@ import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.UncheckedIOException;
+import java.nio.ByteOrder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -135,11 +136,6 @@ public class IntegrationTest {
}
System.out.println(jl);
- JlinkConfiguration config
- = new JlinkConfiguration(null, null, null, null);
-
- System.out.println(config);
-
Plugin p = Jlink.newPlugin("toto", Collections.emptyMap(), null);
if (p != null) {
throw new Exception("Plugin should be null");
@@ -163,7 +159,7 @@ public class IntegrationTest {
Set limits = new HashSet<>();
limits.add("java.management");
JlinkConfiguration config = new Jlink.JlinkConfiguration(output,
- modulePaths, mods, limits, null);
+ modulePaths, mods, limits, ByteOrder.nativeOrder());
List lst = new ArrayList<>();
diff --git a/jdk/test/tools/jlink/JLinkTest.java b/jdk/test/tools/jlink/JLinkTest.java
index 4690bb12180..a964a694a8d 100644
--- a/jdk/test/tools/jlink/JLinkTest.java
+++ b/jdk/test/tools/jlink/JLinkTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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
@@ -274,7 +274,7 @@ public class JLinkTest {
String[] userOptions = {"--compress", "2", "foo" };
String moduleName = "orphanarg1";
helper.generateDefaultJModule(moduleName, "composite2");
- helper.generateDefaultImage(userOptions, moduleName).assertFailure("Error: orphan argument: foo");
+ helper.generateDefaultImage(userOptions, moduleName).assertFailure("Error: invalid argument: foo");
}
// orphan argument - JDK-8166810
@@ -282,7 +282,7 @@ public class JLinkTest {
String[] userOptions = {"--output", "foo", "bar" };
String moduleName = "orphanarg2";
helper.generateDefaultJModule(moduleName, "composite2");
- helper.generateDefaultImage(userOptions, moduleName).assertFailure("Error: orphan argument: bar");
+ helper.generateDefaultImage(userOptions, moduleName).assertFailure("Error: invalid argument: bar");
}
// basic check for --help - JDK-8173717
diff --git a/jdk/test/tools/jlink/bindservices/BindServices.java b/jdk/test/tools/jlink/bindservices/BindServices.java
new file mode 100644
index 00000000000..1c57d211a0f
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/BindServices.java
@@ -0,0 +1,200 @@
+/*
+ * Copyright (c) 2017, 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.PrintWriter;
+import java.io.StringWriter;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.spi.ToolProvider;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static jdk.testlibrary.Asserts.assertTrue;
+import static jdk.testlibrary.ProcessTools.*;
+
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ * @test
+ * @bug 8174826
+ * @library /lib/testlibrary
+ * @modules jdk.compiler jdk.jlink
+ * @build BindServices CompilerUtils jdk.testlibrary.ProcessTools
+ * @run testng BindServices
+ */
+
+public class BindServices {
+ private static final String JAVA_HOME = System.getProperty("java.home");
+ private static final String TEST_SRC = System.getProperty("test.src");
+
+ private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
+ private static final Path MODS_DIR = Paths.get("mods");
+
+ private static final String MODULE_PATH =
+ Paths.get(JAVA_HOME, "jmods").toString() +
+ File.pathSeparator + MODS_DIR.toString();
+
+ // the names of the modules in this test
+ private static String[] modules = new String[] {"m1", "m2", "m3"};
+
+
+ private static boolean hasJmods() {
+ if (!Files.exists(Paths.get(JAVA_HOME, "jmods"))) {
+ System.err.println("Test skipped. NO jmods directory");
+ return false;
+ }
+ return true;
+ }
+
+ /*
+ * Compiles all modules used by the test
+ */
+ @BeforeTest
+ public void compileAll() throws Throwable {
+ if (!hasJmods()) return;
+
+ for (String mn : modules) {
+ Path msrc = SRC_DIR.resolve(mn);
+ assertTrue(CompilerUtils.compile(msrc, MODS_DIR,
+ "--module-source-path", SRC_DIR.toString()));
+ }
+ }
+
+ @Test
+ public void noServiceBinding() throws Throwable {
+ if (!hasJmods()) return;
+
+ Path dir = Paths.get("noServiceBinding");
+
+ // no service binding and does not link m2,m3 providers.
+ JLink.run("--output", dir.toString(),
+ "--module-path", MODULE_PATH,
+ "--add-modules", "m1").output();
+
+ testImage(dir, "m1");
+ }
+
+ @Test
+ public void fullServiceBinding() throws Throwable {
+ if (!hasJmods()) return;
+
+ Path dir = Paths.get("fullServiceBinding");
+
+ // full service binding
+ // m2 is a provider used by m1. During service binding, when m2 is
+ // resolved, m2 uses p2.T that causes m3 to be linked as it is a
+ // provider to p2.T
+ JLink.run("--output", dir.toString(),
+ "--module-path", MODULE_PATH,
+ "--add-modules", "m1",
+ "--bind-services",
+ "--limit-modules", "m1,m2,m3,java.base");
+
+ testImage(dir, "m1", "m2", "m3");
+ }
+
+ @Test
+ public void testVerbose() throws Throwable {
+ if (!hasJmods()) return;
+
+ Path dir = Paths.get("verbose");
+
+ List output =
+ JLink.run("--output", dir.toString(),
+ "--module-path", MODULE_PATH,
+ "--add-modules", "m1",
+ "--bind-services",
+ "--verbose",
+ "--limit-modules", "m1,m2,m3,java.base").output();
+
+ List expected = List.of(
+ "module m1 (" + MODS_DIR.resolve("m1").toUri().toString() + ")",
+ "module m2 (" + MODS_DIR.resolve("m2").toUri().toString() + ")",
+ "module m3 (" + MODS_DIR.resolve("m3").toUri().toString() + ")",
+ "module m1 provides p1.S, used by m1",
+ "module m2 provides p1.S, used by m1",
+ "module m2 provides p2.T, used by m2",
+ "module m3 provides p2.T, used by m2"
+ );
+
+ assertTrue(output.containsAll(expected));
+
+ testImage(dir, "m1", "m2", "m3");
+ }
+
+ /*
+ * Tests the given ${java.home} to only contain the specified modules
+ */
+ private void testImage(Path javaHome, String... modules) throws Throwable {
+ Path java = javaHome.resolve("bin").resolve("java");
+ String[] cmd = Stream.concat(
+ Stream.of(java.toString(), "-m", "m1/p1.Main"),
+ Stream.of(modules)).toArray(String[]::new);
+
+ assertTrue(executeProcess(cmd).outputTo(System.out)
+ .errorTo(System.out)
+ .getExitValue() == 0);
+ }
+
+ static class JLink {
+ static final ToolProvider JLINK_TOOL = ToolProvider.findFirst("jlink")
+ .orElseThrow(() ->
+ new RuntimeException("jlink tool not found")
+ );
+
+ static JLink run(String... options) {
+ JLink jlink = new JLink();
+ assertTrue(jlink.execute(options) == 0);
+ return jlink;
+ }
+
+ final List output = new ArrayList<>();
+ private int execute(String... options) {
+ System.out.println("jlink " +
+ Stream.of(options).collect(Collectors.joining(" ")));
+
+ StringWriter writer = new StringWriter();
+ PrintWriter pw = new PrintWriter(writer);
+ int rc = JLINK_TOOL.run(pw, pw, options);
+ System.out.println(writer.toString());
+ Stream.of(writer.toString().split("\\v"))
+ .map(String::trim)
+ .forEach(output::add);
+ return rc;
+ }
+
+ boolean contains(String s) {
+ return output.contains(s);
+ }
+
+ List output() {
+ return output;
+ }
+ }
+}
diff --git a/jdk/test/tools/jlink/bindservices/SuggestProviders.java b/jdk/test/tools/jlink/bindservices/SuggestProviders.java
new file mode 100644
index 00000000000..a1adf274925
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/SuggestProviders.java
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2017, 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.PrintWriter;
+import java.io.StringWriter;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.spi.ToolProvider;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static jdk.testlibrary.Asserts.assertTrue;
+
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ * @test
+ * @bug 8174826
+ * @library /lib/testlibrary
+ * @modules jdk.charsets jdk.compiler jdk.jlink
+ * @build SuggestProviders CompilerUtils
+ * @run testng SuggestProviders
+ */
+
+public class SuggestProviders {
+ private static final String JAVA_HOME = System.getProperty("java.home");
+ private static final String TEST_SRC = System.getProperty("test.src");
+
+ private static final Path SRC_DIR = Paths.get(TEST_SRC, "src");
+ private static final Path MODS_DIR = Paths.get("mods");
+
+ private static final String MODULE_PATH =
+ Paths.get(JAVA_HOME, "jmods").toString() +
+ File.pathSeparator + MODS_DIR.toString();
+
+ // the names of the modules in this test
+ private static String[] modules = new String[] {"m1", "m2", "m3"};
+
+
+ private static boolean hasJmods() {
+ if (!Files.exists(Paths.get(JAVA_HOME, "jmods"))) {
+ System.err.println("Test skipped. NO jmods directory");
+ return false;
+ }
+ return true;
+ }
+
+ /*
+ * Compiles all modules used by the test
+ */
+ @BeforeTest
+ public void compileAll() throws Throwable {
+ if (!hasJmods()) return;
+
+ for (String mn : modules) {
+ Path msrc = SRC_DIR.resolve(mn);
+ assertTrue(CompilerUtils.compile(msrc, MODS_DIR,
+ "--module-source-path", SRC_DIR.toString()));
+ }
+ }
+
+ @Test
+ public void suggestProviders() throws Throwable {
+ if (!hasJmods()) return;
+
+ List output = JLink.run("--module-path", MODULE_PATH,
+ "--add-modules", "m1",
+ "--suggest-providers").output();
+ // check a subset of services used by java.base
+ List expected = List.of(
+ "uses java.lang.System$LoggerFinder",
+ "uses java.net.ContentHandlerFactory",
+ "uses java.net.spi.URLStreamHandlerProvider",
+ "uses java.nio.channels.spi.AsynchronousChannelProvider",
+ "uses java.nio.channels.spi.SelectorProvider",
+ "uses java.nio.charset.spi.CharsetProvider",
+ "uses java.nio.file.spi.FileSystemProvider",
+ "uses java.nio.file.spi.FileTypeDetector",
+ "uses java.security.Provider",
+ "uses java.util.spi.ToolProvider",
+ "uses p1.S",
+ "module jdk.charsets provides java.nio.charset.spi.CharsetProvider, used by java.base",
+ "module jdk.compiler provides java.util.spi.ToolProvider, used by java.base",
+ "module jdk.jlink provides java.util.spi.ToolProvider, used by java.base",
+ "module m1 provides p1.S, used by m1",
+ "module m2 provides p1.S, used by m1"
+ );
+
+ assertTrue(output.containsAll(expected));
+ }
+
+ @Test
+ public void providersForServices() throws Throwable {
+ if (!hasJmods()) return;
+
+ List output =
+ JLink.run("--module-path", MODULE_PATH,
+ "--add-modules", "m1",
+ "--suggest-providers",
+ "java.nio.charset.spi.CharsetProvider,p1.S,p2.T").output();
+
+ System.out.println(output);
+ List expected = List.of(
+ "module jdk.charsets provides java.nio.charset.spi.CharsetProvider, used by java.base",
+ "module m1 provides p1.S, used by m1",
+ "module m2 provides p1.S, used by m1",
+ "module m2 provides p2.T, used by m2",
+ "module m3 provides p2.T, used by m2"
+ );
+
+ assertTrue(output.containsAll(expected));
+ }
+
+ @Test
+ public void unusedService() throws Throwable {
+ if (!hasJmods()) return;
+
+ List output =
+ JLink.run("--module-path", MODULE_PATH,
+ "--add-modules", "m1",
+ "--suggest-providers",
+ "nonExistentType").output();
+
+ System.out.println(output);
+ List expected = List.of(
+ "Services specified in --suggest-providers not used: nonExistentType"
+ );
+
+ assertTrue(output.containsAll(expected));
+ }
+
+ @Test
+ public void noSuggestProviders() throws Throwable {
+ if (!hasJmods()) return;
+
+ List output =
+ JLink.run("--module-path", MODULE_PATH,
+ "--add-modules", "m1",
+ "--bind-services",
+ "--limit-modules", "m1,m2,m3,java.base",
+ "--suggest-providers").output();
+
+ String expected = "--bind-services option is specified. No additional providers suggested.";
+ assertTrue(output.contains(expected));
+
+ }
+
+ static class JLink {
+ static final ToolProvider JLINK_TOOL = ToolProvider.findFirst("jlink")
+ .orElseThrow(() ->
+ new RuntimeException("jlink tool not found")
+ );
+
+ static JLink run(String... options) {
+ JLink jlink = new JLink();
+ assertTrue(jlink.execute(options) == 0);
+ return jlink;
+ }
+
+ final List output = new ArrayList<>();
+ private int execute(String... options) {
+ System.out.println("jlink " +
+ Stream.of(options).collect(Collectors.joining(" ")));
+
+ StringWriter writer = new StringWriter();
+ PrintWriter pw = new PrintWriter(writer);
+ int rc = JLINK_TOOL.run(pw, pw, options);
+ System.out.println(writer.toString());
+ Stream.of(writer.toString().split("\\v"))
+ .map(String::trim)
+ .forEach(output::add);
+ return rc;
+ }
+
+ boolean contains(String s) {
+ return output.contains(s);
+ }
+
+ List output() {
+ return output;
+ }
+ }
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m1/module-info.java b/jdk/test/tools/jlink/bindservices/src/m1/module-info.java
new file mode 100644
index 00000000000..59ebbe89663
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m1/module-info.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+module m1 {
+ exports p1;
+ uses p1.S;
+ provides p1.S with p1.Impl;
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m1/p1/Impl.java b/jdk/test/tools/jlink/bindservices/src/m1/p1/Impl.java
new file mode 100644
index 00000000000..b03f4e521e4
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m1/p1/Impl.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+package p1;
+
+public class Impl implements S {
+ public String name() {
+ return this.getClass().getName();
+ }
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m1/p1/Main.java b/jdk/test/tools/jlink/bindservices/src/m1/p1/Main.java
new file mode 100644
index 00000000000..d3a07ed6601
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m1/p1/Main.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+package p1;
+
+import java.lang.module.ModuleFinder;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * This tests if JAVA_HOME is linked only with the specified modules.
+ */
+public class Main {
+ public static void main(String... args) {
+ Set modules = ModuleFinder.ofSystem().findAll().stream()
+ .map(mref -> mref.descriptor().name())
+ .filter(mn -> !mn.equals("java.base"))
+ .collect(Collectors.toSet());
+
+ Set notLinked = Stream.of(args).filter(mn -> !modules.contains(mn))
+ .collect(Collectors.toSet());
+ if (!notLinked.isEmpty()) {
+ throw new RuntimeException("Expected modules not linked in the image: "
+ + notLinked);
+ }
+ Stream.of(args).forEach(modules::remove);
+
+ if (!modules.isEmpty()) {
+ throw new RuntimeException("Unexpected modules linked in the image: "
+ + modules);
+ }
+ }
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m1/p1/S.java b/jdk/test/tools/jlink/bindservices/src/m1/p1/S.java
new file mode 100644
index 00000000000..5b43138d068
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m1/p1/S.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+package p1;
+
+public interface S {
+ String name();
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m2/module-info.java b/jdk/test/tools/jlink/bindservices/src/m2/module-info.java
new file mode 100644
index 00000000000..c32e334d229
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m2/module-info.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+module m2 {
+ requires m1;
+ exports p2;
+ uses p2.T;
+ provides p1.S with p2.Impl;
+ provides p2.T with p2.Impl;
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m2/p2/Impl.java b/jdk/test/tools/jlink/bindservices/src/m2/p2/Impl.java
new file mode 100644
index 00000000000..d790e9ee467
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m2/p2/Impl.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+package p2;
+
+public class Impl implements p1.S, T {
+ public String name() {
+ return this.getClass().getName();
+ }
+
+ public void run() {
+ }
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m2/p2/T.java b/jdk/test/tools/jlink/bindservices/src/m2/p2/T.java
new file mode 100644
index 00000000000..dea30505b32
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m2/p2/T.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+package p2;
+
+public interface T {
+ void run();
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m3/module-info.java b/jdk/test/tools/jlink/bindservices/src/m3/module-info.java
new file mode 100644
index 00000000000..e48769209ff
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m3/module-info.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+module m3 {
+ requires m2;
+ provides p2.T with p3.Impl;
+}
diff --git a/jdk/test/tools/jlink/bindservices/src/m3/p3/Impl.java b/jdk/test/tools/jlink/bindservices/src/m3/p3/Impl.java
new file mode 100644
index 00000000000..4d328cdd71c
--- /dev/null
+++ b/jdk/test/tools/jlink/bindservices/src/m3/p3/Impl.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+package p3;
+
+public class Impl implements p2.T {
+ public void run() {
+ }
+}
From c6c3ed52eb2fcf4581b2ae5ce378d5050a3419a7 Mon Sep 17 00:00:00 2001
From: Joe Darcy
Date: Mon, 27 Mar 2017 18:38:58 -0700
Subject: [PATCH 05/40] 8177678: Overstatement of universality of
Era.getDisplayName() implementation
Reviewed-by: naoto
---
.../share/classes/java/time/chrono/Era.java | 6 +++---
.../classes/java/time/chrono/JapaneseEra.java | 17 ++++-------------
2 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/jdk/src/java.base/share/classes/java/time/chrono/Era.java b/jdk/src/java.base/share/classes/java/time/chrono/Era.java
index f8945fa0aec..5cf0968597c 100644
--- a/jdk/src/java.base/share/classes/java/time/chrono/Era.java
+++ b/jdk/src/java.base/share/classes/java/time/chrono/Era.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, 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
@@ -310,8 +310,8 @@ public interface Era extends TemporalAccessor, TemporalAdjuster {
* The parameters control the style of the returned text and the locale.
*
* If no textual mapping is found then the {@link #getValue() numeric value} is returned.
- *
- * This default implementation is suitable for all implementations.
+ *
+ * @apiNote This default implementation is suitable for most implementations.
*
* @param style the style of the text required, not null
* @param locale the locale to use, not null
diff --git a/jdk/src/java.base/share/classes/java/time/chrono/JapaneseEra.java b/jdk/src/java.base/share/classes/java/time/chrono/JapaneseEra.java
index 7ae62944025..e6fadc902ae 100644
--- a/jdk/src/java.base/share/classes/java/time/chrono/JapaneseEra.java
+++ b/jdk/src/java.base/share/classes/java/time/chrono/JapaneseEra.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, 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
@@ -240,19 +240,10 @@ public final class JapaneseEra
}
/**
- * Gets the textual representation of this era.
- *
- * This returns the textual name used to identify the era,
- * suitable for presentation to the user.
- * The parameters control the style of the returned text and the locale.
- *
- * If no textual mapping is found then the {@link #getValue() numeric value}
- * is returned.
+ * {@inheritDoc}
*
- * @param style the style of the text required, not null
- * @param locale the locale to use, not null
- * @return the text value of the era, not null
- * @since 9
+ * @param style {@inheritDoc}
+ * @param locale {@inheritDoc}
*/
@Override
public String getDisplayName(TextStyle style, Locale locale) {
From 31374e10a35119118791b91275ff2b46cc96074f Mon Sep 17 00:00:00 2001
From: Hamlin Li
Date: Mon, 27 Mar 2017 18:52:47 -0700
Subject: [PATCH 06/40] 8176865: overridden api has a wrong since value in
java.base module
Reviewed-by: alanb
---
jdk/src/java.base/share/classes/java/lang/String.java | 2 --
.../share/classes/java/lang/reflect/Constructor.java | 1 -
.../java.base/share/classes/java/nio/MappedByteBuffer.java | 7 -------
.../share/classes/java/nio/X-Buffer.java.template | 7 -------
.../share/classes/java/security/SecureRandom.java | 2 --
.../share/classes/java/security/SecureRandomSpi.java | 2 --
6 files changed, 21 deletions(-)
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 9bcc69963c7..3dd2b9833a9 100644
--- a/jdk/src/java.base/share/classes/java/lang/String.java
+++ b/jdk/src/java.base/share/classes/java/lang/String.java
@@ -2672,7 +2672,6 @@ public final class String
* point is passed through uninterpreted.
*
* @return an IntStream of char values from this sequence
- * @since 9
*/
@Override
public IntStream chars() {
@@ -2692,7 +2691,6 @@ public final class String
* {@code int} values which are then passed to the stream.
*
* @return an IntStream of Unicode code points from this sequence
- * @since 9
*/
@Override
public IntStream codePoints() {
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java b/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java
index d60ae0eeacd..ecc3fd1f462 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java
@@ -174,7 +174,6 @@ public final class Constructor extends Executable {
* @throws SecurityException if the request is denied by the security manager
* or this is a constructor for {@code java.lang.Class}
*
- * @since 9
* @spec JPMS
*/
@Override
diff --git a/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java b/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java
index 838cc40a09a..07aa7c6f5b9 100644
--- a/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java
+++ b/jdk/src/java.base/share/classes/java/nio/MappedByteBuffer.java
@@ -213,7 +213,6 @@ public abstract class MappedByteBuffer
/**
* {@inheritDoc}
- * @since 9
*/
@Override
public final MappedByteBuffer position(int newPosition) {
@@ -223,7 +222,6 @@ public abstract class MappedByteBuffer
/**
* {@inheritDoc}
- * @since 9
*/
@Override
public final MappedByteBuffer limit(int newLimit) {
@@ -233,7 +231,6 @@ public abstract class MappedByteBuffer
/**
* {@inheritDoc}
- * @since 9
*/
@Override
public final MappedByteBuffer mark() {
@@ -243,7 +240,6 @@ public abstract class MappedByteBuffer
/**
* {@inheritDoc}
- * @since 9
*/
@Override
public final MappedByteBuffer reset() {
@@ -253,7 +249,6 @@ public abstract class MappedByteBuffer
/**
* {@inheritDoc}
- * @since 9
*/
@Override
public final MappedByteBuffer clear() {
@@ -263,7 +258,6 @@ public abstract class MappedByteBuffer
/**
* {@inheritDoc}
- * @since 9
*/
@Override
public final MappedByteBuffer flip() {
@@ -273,7 +267,6 @@ public abstract class MappedByteBuffer
/**
* {@inheritDoc}
- * @since 9
*/
@Override
public final MappedByteBuffer rewind() {
diff --git a/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template b/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template
index 1292ca458c6..4453130953d 100644
--- a/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template
+++ b/jdk/src/java.base/share/classes/java/nio/X-Buffer.java.template
@@ -1069,7 +1069,6 @@ public abstract class $Type$Buffer
/**
* {@inheritDoc}
- * @since 9
*/
@Override
public
@@ -1083,7 +1082,6 @@ public abstract class $Type$Buffer
/**
* {@inheritDoc}
- * @since 9
*/
@Override
public
@@ -1097,7 +1095,6 @@ public abstract class $Type$Buffer
/**
* {@inheritDoc}
- * @since 9
*/
@Override
public
@@ -1111,7 +1108,6 @@ public abstract class $Type$Buffer
/**
* {@inheritDoc}
- * @since 9
*/
@Override
public
@@ -1125,7 +1121,6 @@ public abstract class $Type$Buffer
/**
* {@inheritDoc}
- * @since 9
*/
@Override
public
@@ -1139,7 +1134,6 @@ public abstract class $Type$Buffer
/**
* {@inheritDoc}
- * @since 9
*/
@Override
public
@@ -1153,7 +1147,6 @@ public abstract class $Type$Buffer
/**
* {@inheritDoc}
- * @since 9
*/
@Override
public
diff --git a/jdk/src/java.base/share/classes/java/security/SecureRandom.java b/jdk/src/java.base/share/classes/java/security/SecureRandom.java
index 0fe361044b8..4f9f1b3a460 100644
--- a/jdk/src/java.base/share/classes/java/security/SecureRandom.java
+++ b/jdk/src/java.base/share/classes/java/security/SecureRandom.java
@@ -651,8 +651,6 @@ public class SecureRandom extends java.util.Random {
* {@code SecureRandom}.
*
* @return the string representation
- *
- * @since 9
*/
@Override
public String toString() {
diff --git a/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java b/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java
index 65a0ce0164d..fefbe576a02 100644
--- a/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java
+++ b/jdk/src/java.base/share/classes/java/security/SecureRandomSpi.java
@@ -211,8 +211,6 @@ public abstract class SecureRandomSpi implements java.io.Serializable {
* {@code SecureRandom}.
*
* @return the string representation
- *
- * @since 9
*/
@Override
public String toString() {
From ec2626b88e558447f510ffb99aa5a4dcd4bbb41a Mon Sep 17 00:00:00 2001
From: Brian Burkhalter
Date: Tue, 28 Mar 2017 09:02:59 -0700
Subject: [PATCH 07/40] 8177559: Enable
java/nio/channels/Selector/OutOfBand.java for macOS >= 10.10.5
Enable test for macOS 10.10.5 and newer and remove from problem list
Reviewed-by: alanb, amlu
---
jdk/test/ProblemList.txt | 2 --
jdk/test/java/nio/channels/Selector/OutOfBand.java | 5 ++++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt
index d83f5106868..f16f7af5f86 100644
--- a/jdk/test/ProblemList.txt
+++ b/jdk/test/ProblemList.txt
@@ -180,8 +180,6 @@ java/nio/channels/Selector/Wakeup.java 6963118 windows-
java/nio/channels/DatagramChannel/ChangingAddress.java 7141822 macosx-all
-java/nio/channels/Selector/OutOfBand.java 7132677 macosx-all
-
java/nio/file/WatchService/Basic.java 7158947 solaris-all Solaris 11
java/nio/file/WatchService/MayFlies.java 7158947 solaris-all Solaris 11
java/nio/file/WatchService/LotsOfEvents.java 7158947 solaris-all Solaris 11
diff --git a/jdk/test/java/nio/channels/Selector/OutOfBand.java b/jdk/test/java/nio/channels/Selector/OutOfBand.java
index 78322fafb92..e2d76b75b9f 100644
--- a/jdk/test/java/nio/channels/Selector/OutOfBand.java
+++ b/jdk/test/java/nio/channels/Selector/OutOfBand.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2017, 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,6 +23,9 @@
/* @test
* @bug 6213702
+ * @requires (os.family != "mac") | (os.version == "10.10.5")
+ * | (os.simpleVersion != "10.8" & os.simpleVersion != "10.9"
+ * & os.simpleVersion != "10.10")
* @summary OOB data causes a SocketChannel, with OOBINLINE disabled, to be
* selected
*/
From 2f4a0a94eb500191729d3619d9d55c49f69bb587 Mon Sep 17 00:00:00 2001
From: Joe Darcy
Date: Tue, 28 Mar 2017 17:33:48 -0700
Subject: [PATCH 08/40] 8177722: Improve grouping of jdk/internal/math tests
Reviewed-by: smarks
---
jdk/test/TEST.groups | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/jdk/test/TEST.groups b/jdk/test/TEST.groups
index cff9658f00b..ed7f022ac7e 100644
--- a/jdk/test/TEST.groups
+++ b/jdk/test/TEST.groups
@@ -73,6 +73,7 @@ jdk_lang = \
jdk/internal/misc \
jdk/internal/ref \
jdk/internal/jimage \
+ jdk/internal/math \
jdk/modules \
vm
@@ -141,8 +142,7 @@ jdk_stream = \
java/util/stream
jdk_math = \
- java/math \
- jdk/internal/math
+ java/math
jdk_io = \
java/io
From 4fa7bde21bf869f596333d78013e5495cc2c6bf8 Mon Sep 17 00:00:00 2001
From: Daniel Fuchs
Date: Wed, 29 Mar 2017 13:16:12 +0100
Subject: [PATCH 09/40] 8177136: Caller sensitive method System::getLogger
should specify what happens if there is no caller on the stack
IllegalCallerException (instead of undocumented NPE) is thrown if there is no caller on the stack. The specification is clarified in this respect.
Reviewed-by: alanb, mchung, dholmes, bchristi
---
.../share/classes/java/lang/System.java | 28 ++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/jdk/src/java.base/share/classes/java/lang/System.java b/jdk/src/java.base/share/classes/java/lang/System.java
index 2982591e875..661c0f5a34c 100644
--- a/jdk/src/java.base/share/classes/java/lang/System.java
+++ b/jdk/src/java.base/share/classes/java/lang/System.java
@@ -1568,6 +1568,14 @@ public final class System {
* obtained by calling {@link LoggerFinder#getLogger(java.lang.String,
* java.lang.reflect.Module) LoggerFinder.getLogger(name, module)}, where
* {@code module} is the caller's module.
+ * In cases where {@code System.getLogger} is called from a context where
+ * there is no caller frame on the stack (e.g when called directly
+ * from a JNI attached thread), {@code IllegalCallerException} is thrown.
+ * To obtain a logger in such a context, use an auxiliary class that will
+ * implicitly be identified as the caller, or use the system {@link
+ * LoggerFinder#getLoggerFinder() LoggerFinder} to obtain a logger instead.
+ * Note that doing the latter may eagerly initialize the underlying
+ * logging system.
*
* @apiNote
* This method may defer calling the {@link
@@ -1580,6 +1588,8 @@ public final class System {
* @return an instance of {@link Logger} that can be used by the calling
* class.
* @throws NullPointerException if {@code name} is {@code null}.
+ * @throws IllegalCallerException if there is no Java caller frame on the
+ * stack.
*
* @since 9
*/
@@ -1587,6 +1597,9 @@ public final class System {
public static Logger getLogger(String name) {
Objects.requireNonNull(name);
final Class> caller = Reflection.getCallerClass();
+ if (caller == null) {
+ throw new IllegalCallerException("no caller frame");
+ }
return LazyLoggers.getLogger(name, caller.getModule());
}
@@ -1600,8 +1613,16 @@ public final class System {
* The returned logger will perform message localization as specified
* by {@link LoggerFinder#getLocalizedLogger(java.lang.String,
* java.util.ResourceBundle, java.lang.reflect.Module)
- * LoggerFinder.getLocalizedLogger(name, bundle, module}, where
+ * LoggerFinder.getLocalizedLogger(name, bundle, module)}, where
* {@code module} is the caller's module.
+ * In cases where {@code System.getLogger} is called from a context where
+ * there is no caller frame on the stack (e.g when called directly
+ * from a JNI attached thread), {@code IllegalCallerException} is thrown.
+ * To obtain a logger in such a context, use an auxiliary class that
+ * will implicitly be identified as the caller, or use the system {@link
+ * LoggerFinder#getLoggerFinder() LoggerFinder} to obtain a logger instead.
+ * Note that doing the latter may eagerly initialize the underlying
+ * logging system.
*
* @apiNote
* This method is intended to be used after the system is fully initialized.
@@ -1620,6 +1641,8 @@ public final class System {
* resource bundle for message localization.
* @throws NullPointerException if {@code name} is {@code null} or
* {@code bundle} is {@code null}.
+ * @throws IllegalCallerException if there is no Java caller frame on the
+ * stack.
*
* @since 9
*/
@@ -1628,6 +1651,9 @@ public final class System {
final ResourceBundle rb = Objects.requireNonNull(bundle);
Objects.requireNonNull(name);
final Class> caller = Reflection.getCallerClass();
+ if (caller == null) {
+ throw new IllegalCallerException("no caller frame");
+ }
final SecurityManager sm = System.getSecurityManager();
// We don't use LazyLoggers if a resource bundle is specified.
// Bootstrap sensitive classes in the JDK do not use resource bundles
From 6d568376c95b205d5f9ca41e9edc78566f6e002f Mon Sep 17 00:00:00 2001
From: Mandy Chung
Date: Wed, 29 Mar 2017 09:40:41 -0700
Subject: [PATCH 10/40] 8173303: Add module-subgraph images to main platform
documentation
Co-authored-by: Jonathan Gibbons
Reviewed-by: alanb, chegar, erikj, ihse, lancea
---
jdk/make/GenerateModuleSummary.gmk | 4 +-
jdk/make/ModuleTools.gmk | 11 +-
.../classes/build/tools/jigsaw/GenGraphs.java | 185 ++++++++++++++----
.../tools/jigsaw/javadoc-graphs.properties | 2 +
.../build/tools/taglet/ModuleGraph.java | 96 +++++++++
.../java.base/share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 3 +-
.../share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 1 +
.../java.prefs/share/classes/module-info.java | 1 +
.../java.rmi/share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 1 +
.../java.se.ee/share/classes/module-info.java | 1 +
.../java.se/share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 1 +
.../java.sql/share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 3 +-
.../jdk.attach/share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 7 +
.../share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 1 +
.../windows/classes/module-info.java | 1 +
.../solaris/classes/module-info.java | 1 +
.../share/classes/module-info.java | 6 +
.../share/classes/module-info.java | 7 +
.../jdk.jcmd/share/classes/module-info.java | 7 +
.../share/classes/module-info.java | 7 +
.../jdk.jdi/share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 1 +
.../jdk.jlink/share/classes/module-info.java | 6 +
.../share/classes/module-info.java | 6 +
.../jdk.jstatd/share/classes/module-info.java | 8 +-
.../share/classes/module-info.java | 6 +
.../share/classes/module-info.java | 6 +
.../share/classes/module-info.java | 6 +
.../share/classes/module-info.java | 6 +
.../share/classes/module-info.java | 6 +
.../jdk.net/share/classes/module-info.java | 6 +
.../jdk.sctp/share/classes/module-info.java | 6 +
.../share/classes/module-info.java | 1 +
.../share/classes/module-info.java | 1 +
.../jdk.zipfs/share/classes/module-info.java | 6 +
50 files changed, 388 insertions(+), 45 deletions(-)
create mode 100644 jdk/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
create mode 100644 jdk/make/src/classes/build/tools/taglet/ModuleGraph.java
diff --git a/jdk/make/GenerateModuleSummary.gmk b/jdk/make/GenerateModuleSummary.gmk
index 9f52ed37a74..b96e9ded8ca 100644
--- a/jdk/make/GenerateModuleSummary.gmk
+++ b/jdk/make/GenerateModuleSummary.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 2017, 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,7 +31,7 @@ include MakeBase.gmk
include ModuleTools.gmk
GENGRAPHS_DIR := $(IMAGES_OUTPUTDIR)/gengraphs
-SPEC_DOTFILES_DIR := $(IMAGES_OUTPUTDIR)/spec-dotfiles
+SPEC_DOTFILES_DIR := $(GENGRAPHS_DIR)/spec-dotfiles
TOOLS_MODULE_SRCDIR := $(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw
$(GENGRAPHS_DIR)/jdk.dot: $(BUILD_JIGSAW_TOOLS)
diff --git a/jdk/make/ModuleTools.gmk b/jdk/make/ModuleTools.gmk
index 45bfbae630e..c48a1b6ec3d 100644
--- a/jdk/make/ModuleTools.gmk
+++ b/jdk/make/ModuleTools.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2017, 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,8 +23,9 @@
# questions.
#
-include $(SPEC)
-include MakeBase.gmk
+ifndef _MODULE_TOOLS_GMK
+_MODULE_TOOLS_GMK := 1
+
include JavaCompilation.gmk
TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes
@@ -32,7 +33,7 @@ TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes
# To avoid reevaluating the compilation setup for the tools each time this file
# is included, the actual compilation is handled by CompileModuleTools.gmk. The
# following trick is used to be able to declare a dependency on the built tools.
-BUILD_TOOLS_JDK := $(call SetupJavaCompilationCompileTarget, \
+BUILD_JIGSAW_TOOLS := $(call SetupJavaCompilationCompileTarget, \
BUILD_JIGSAW_TOOLS, $(TOOLS_CLASSES_DIR))
TOOL_GENGRAPHS := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \
@@ -47,3 +48,5 @@ TOOL_ADD_PACKAGES_ATTRIBUTE := $(BUILD_JAVA) $(JAVA_FLAGS_SMALL) \
-cp $(TOOLS_CLASSES_DIR) \
--add-exports java.base/jdk.internal.module=ALL-UNNAMED \
build.tools.jigsaw.AddPackagesAttribute
+
+endif # _MODULE_TOOLS_GMK
diff --git a/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java b/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java
index 902185eef3a..8301929ebd1 100644
--- a/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java
+++ b/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java
@@ -26,7 +26,6 @@
package build.tools.jigsaw;
import com.sun.tools.jdeps.ModuleDotGraph;
-import com.sun.tools.jdeps.ModuleDotGraph.DotGraphBuilder;
import java.io.IOException;
import java.lang.module.Configuration;
@@ -36,10 +35,15 @@ import java.lang.module.ModuleReference;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.List;
import java.util.Map;
+import java.util.Properties;
import java.util.Set;
+import java.util.function.Function;
+import java.util.stream.Collectors;
/**
* Generate the DOT file for a module graph for each module in the JDK
@@ -50,13 +54,19 @@ public class GenGraphs {
public static void main(String[] args) throws Exception {
Path dir = null;
boolean spec = false;
+ Properties props = null;
for (int i=0; i < args.length; i++) {
String arg = args[i];
if (arg.equals("--spec")) {
spec = true;
+ } else if (arg.equals("--dot-attributes")) {
+ if (i++ == args.length) {
+ throw new IllegalArgumentException("Missing argument: --dot-attributes option");
+ }
+ props = new Properties();
+ props.load(Files.newInputStream(Paths.get(args[i])));
} else if (arg.equals("--output")) {
- i++;
- dir = i < args.length ? Paths.get(args[i]) : null;
+ dir = ++i < args.length ? Paths.get(args[i]) : null;
} else if (arg.startsWith("-")) {
throw new IllegalArgumentException("Invalid option: " + arg);
}
@@ -67,11 +77,14 @@ public class GenGraphs {
System.exit(1);
}
- // setup and configure the dot graph attributes
- initDotGraphAttributes();
Files.createDirectories(dir);
-
- GenGraphs genGraphs = new GenGraphs(dir, spec);
+ ModuleGraphAttributes attributes;
+ if (props != null) {
+ attributes = new ModuleGraphAttributes(props);
+ } else {
+ attributes = new ModuleGraphAttributes();
+ }
+ GenGraphs genGraphs = new GenGraphs(dir, spec, attributes);
// print dot file for each module
Map configurations = new HashMap<>();
@@ -99,49 +112,149 @@ public class GenGraphs {
genGraphs.genDotFiles(configurations);
}
- static void initDotGraphAttributes() {
- int h = 1000;
- DotGraphBuilder.weight("java.se", "java.sql.rowset", h * 10);
- DotGraphBuilder.weight("java.sql.rowset", "java.sql", h * 10);
- DotGraphBuilder.weight("java.sql", "java.xml", h * 10);
- DotGraphBuilder.weight("java.xml", "java.base", h * 10);
+ /**
+ * Custom dot file attributes.
+ */
+ static class ModuleGraphAttributes implements ModuleDotGraph.Attributes {
+ static Map DEFAULT_ATTRIBUTES = Map.of(
+ "ranksep", "0.6",
+ "fontsize", "12",
+ "fontcolor", BLACK,
+ "fontname", "DejaVuSans",
+ "arrowsize", "1",
+ "arrowwidth", "2",
+ "arrowcolor", DARK_GRAY,
+ // custom
+ "requiresMandatedColor", LIGHT_GRAY,
+ "javaSubgraphColor", ORANGE,
+ "jdkSubgraphColor", BLUE
+ );
- DotGraphBuilder.sameRankNodes(Set.of("java.logging", "java.scripting", "java.xml"));
- DotGraphBuilder.sameRankNodes(Set.of("java.sql"));
- DotGraphBuilder.sameRankNodes(Set.of("java.compiler", "java.instrument"));
- DotGraphBuilder.sameRankNodes(Set.of("java.desktop", "java.management"));
- DotGraphBuilder.sameRankNodes(Set.of("java.corba", "java.xml.ws"));
- DotGraphBuilder.sameRankNodes(Set.of("java.xml.bind", "java.xml.ws.annotation"));
- DotGraphBuilder.setRankSep(0.7);
- DotGraphBuilder.setFontSize(12);
- DotGraphBuilder.setArrowSize(1);
- DotGraphBuilder.setArrowWidth(2);
+ final Map weights = new HashMap<>();
+ final List> ranks = new ArrayList<>();
+ final Map attrs;
+ ModuleGraphAttributes(Map attrs) {
+ int h = 1000;
+ weight("java.se", "java.sql.rowset", h * 10);
+ weight("java.sql.rowset", "java.sql", h * 10);
+ weight("java.sql", "java.xml", h * 10);
+ weight("java.xml", "java.base", h * 10);
+
+ ranks.add(Set.of("java.logging", "java.scripting", "java.xml"));
+ ranks.add(Set.of("java.sql"));
+ ranks.add(Set.of("java.compiler", "java.instrument"));
+ ranks.add(Set.of("java.desktop", "java.management"));
+ ranks.add(Set.of("java.corba", "java.xml.ws"));
+ ranks.add(Set.of("java.xml.bind", "java.xml.ws.annotation"));
+
+ this.attrs = attrs;
+ }
+
+ ModuleGraphAttributes() {
+ this(DEFAULT_ATTRIBUTES);
+ }
+ ModuleGraphAttributes(Properties props) {
+ this(toAttributes(props));
+ }
+
+ @Override
+ public double rankSep() {
+ return Double.valueOf(attrs.get("ranksep"));
+ }
+
+ @Override
+ public int fontSize() {
+ return Integer.valueOf(attrs.get("fontsize"));
+ }
+
+ @Override
+ public String fontName() {
+ return attrs.get("fontname");
+ }
+
+ @Override
+ public String fontColor() {
+ return attrs.get("fontcolor");
+ }
+
+ @Override
+ public int arrowSize() {
+ return Integer.valueOf(attrs.get("arrowsize"));
+ }
+
+ @Override
+ public int arrowWidth() {
+ return Integer.valueOf(attrs.get("arrowwidth"));
+ }
+
+ @Override
+ public String arrowColor() {
+ return attrs.get("arrowcolor");
+ }
+
+ @Override
+ public List> ranks() {
+ return ranks;
+ }
+
+ @Override
+ public String requiresMandatedColor() {
+ return attrs.get("requiresMandatedColor");
+ }
+
+ @Override
+ public String javaSubgraphColor() {
+ return attrs.get("javaSubgraphColor");
+ }
+
+ @Override
+ public String jdkSubgraphColor() {
+ return attrs.get("jdkSubgraphColor");
+ }
+
+ @Override
+ public int weightOf(String s, String t) {
+ int w = weights.getOrDefault(s + ":" + t, 1);
+ if (w != 1)
+ return w;
+ if (s.startsWith("java.") && t.startsWith("java."))
+ return 10;
+ return 1;
+ }
+
+ public void weight(String s, String t, int w) {
+ weights.put(s + ":" + t, w);
+ }
+
+ static Map toAttributes(Properties props) {
+ return DEFAULT_ATTRIBUTES.keySet().stream()
+ .collect(Collectors.toMap(Function.identity(),
+ k -> props.getProperty(k, DEFAULT_ATTRIBUTES.get(k))));
+ }
}
private final Path dir;
private final boolean spec;
- GenGraphs(Path dir, boolean spec) {
+ private final ModuleGraphAttributes attributes;
+ GenGraphs(Path dir, boolean spec, ModuleGraphAttributes attributes) {
this.dir = dir;
this.spec = spec;
+ this.attributes = attributes;
}
void genDotFiles(Map configurations) throws IOException {
ModuleDotGraph dotGraph = new ModuleDotGraph(configurations, spec);
- dotGraph.genDotFiles(dir);
+ dotGraph.genDotFiles(dir, attributes);
}
+ /**
+ * Returns true for any name if generating graph for non-spec;
+ * otherwise, returns true except "jdk" and name with "jdk.internal." prefix
+ */
boolean accept(String name, ModuleDescriptor descriptor) {
- if (!spec) return true;
-
- if (name.equals("jdk"))
- return false;
-
- if (name.equals("java.se") || name.equals("java.se.ee"))
+ if (!spec)
return true;
- // only the module that has exported API
- return descriptor.exports().stream()
- .filter(e -> !e.isQualified())
- .findAny().isPresent();
+ return !name.equals("jdk") && !name.startsWith("jdk.internal.");
}
-}
\ No newline at end of file
+}
diff --git a/jdk/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties b/jdk/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
new file mode 100644
index 00000000000..75348c3f7be
--- /dev/null
+++ b/jdk/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
@@ -0,0 +1,2 @@
+arrowcolor=#999999
+requiresMandatedColor=#999999
diff --git a/jdk/make/src/classes/build/tools/taglet/ModuleGraph.java b/jdk/make/src/classes/build/tools/taglet/ModuleGraph.java
new file mode 100644
index 00000000000..6983eaa64d2
--- /dev/null
+++ b/jdk/make/src/classes/build/tools/taglet/ModuleGraph.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+package build.tools.taglet;
+
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Set;
+import javax.lang.model.element.Element;
+import com.sun.source.doctree.DocTree;
+import jdk.javadoc.doclet.Taglet;
+import static jdk.javadoc.doclet.Taglet.Location.*;
+
+/**
+ * A block tag to optionally insert a reference to a module graph.
+ */
+public class ModuleGraph implements Taglet {
+ private static final boolean enableModuleGraph =
+ Boolean.getBoolean("enableModuleGraph");
+
+ /** Returns the set of locations in which a taglet may be used. */
+ @Override
+ public Set getAllowedLocations() {
+ return EnumSet.of(MODULE);
+ }
+
+ @Override
+ public boolean isInlineTag() {
+ return false;
+ }
+
+ @Override
+ public String getName() {
+ return "moduleGraph";
+ }
+
+ @Override
+ public String toString(List extends DocTree> tags, Element element) {
+ if (!enableModuleGraph) {
+ return "";
+ }
+
+ String moduleName = element.getSimpleName().toString();
+ String imageFile = moduleName + "-graph.png";
+ int thumbnailHeight = -1;
+ String hoverImage = "";
+ if (!moduleName.equals("java.base")) {
+ thumbnailHeight = 100; // also appears in the stylesheet
+ hoverImage = ""
+ + getImage(moduleName, imageFile, -1, true)
+ + "";
+ }
+ return "
";
+ }
+
+ private static final String VERTICAL_ALIGN = "vertical-align:top";
+ private static final String BORDER = "border: solid lightgray 1px;";
+
+ private String getImage(String moduleName, String file, int height, boolean useBorder) {
+ return String.format("",
+ useBorder ? BORDER + " " + VERTICAL_ALIGN : VERTICAL_ALIGN,
+ moduleName,
+ file,
+ (height <= 0 ? "" : " height=\"" + height + "\""));
+ }
+}
diff --git a/jdk/src/java.base/share/classes/module-info.java b/jdk/src/java.base/share/classes/module-info.java
index 60b1512cbca..1c3f76927aa 100644
--- a/jdk/src/java.base/share/classes/module-info.java
+++ b/jdk/src/java.base/share/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* Defines the foundational APIs of the Java SE Platform.
*
+ * @moduleGraph
* @since 9
*/
module java.base {
diff --git a/jdk/src/java.datatransfer/share/classes/module-info.java b/jdk/src/java.datatransfer/share/classes/module-info.java
index 35b7571fb92..41fbc8d7b0c 100644
--- a/jdk/src/java.datatransfer/share/classes/module-info.java
+++ b/jdk/src/java.datatransfer/share/classes/module-info.java
@@ -24,8 +24,9 @@
*/
/**
- * Defines an API for transferring data between and within applications.
+ * Defines the API for transferring data between and within applications.
*
+ * @moduleGraph
* @since 9
*/
module java.datatransfer {
diff --git a/jdk/src/java.desktop/share/classes/module-info.java b/jdk/src/java.desktop/share/classes/module-info.java
index 841618d8216..29d24e68df3 100644
--- a/jdk/src/java.desktop/share/classes/module-info.java
+++ b/jdk/src/java.desktop/share/classes/module-info.java
@@ -27,6 +27,7 @@
* Defines the AWT and Swing user interface toolkits, plus APIs for
* accessibility, audio, imaging, printing, and JavaBeans.
*
+ * @moduleGraph
* @since 9
*/
module java.desktop {
diff --git a/jdk/src/java.instrument/share/classes/module-info.java b/jdk/src/java.instrument/share/classes/module-info.java
index 4a7f2199e1d..c0a38104c13 100644
--- a/jdk/src/java.instrument/share/classes/module-info.java
+++ b/jdk/src/java.instrument/share/classes/module-info.java
@@ -27,6 +27,7 @@
* Defines services that allow agents to
* instrument programs running on the JVM.
*
+ * @moduleGraph
* @since 9
*/
module java.instrument {
diff --git a/jdk/src/java.logging/share/classes/module-info.java b/jdk/src/java.logging/share/classes/module-info.java
index a8120deeedb..2ddf82f4599 100644
--- a/jdk/src/java.logging/share/classes/module-info.java
+++ b/jdk/src/java.logging/share/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* Defines the Java Logging API.
*
+ * @moduleGraph
* @since 9
*/
module java.logging {
diff --git a/jdk/src/java.management.rmi/share/classes/module-info.java b/jdk/src/java.management.rmi/share/classes/module-info.java
index fca14d540a8..ac6eabc83e3 100644
--- a/jdk/src/java.management.rmi/share/classes/module-info.java
+++ b/jdk/src/java.management.rmi/share/classes/module-info.java
@@ -46,6 +46,7 @@
* and load the appropriate {@code JMXConnectorServerProvider} service
* implementation for the given protocol.
*
+ * @moduleGraph
* @since 9
*/
module java.management.rmi {
diff --git a/jdk/src/java.management/share/classes/module-info.java b/jdk/src/java.management/share/classes/module-info.java
index fd8ec495098..c407821e505 100644
--- a/jdk/src/java.management/share/classes/module-info.java
+++ b/jdk/src/java.management/share/classes/module-info.java
@@ -29,6 +29,7 @@
* The JMX API consists of interfaces for monitoring and management of the
* JVM and other components in the Java runtime.
*
+ * @moduleGraph
* @since 9
*/
module java.management {
diff --git a/jdk/src/java.naming/share/classes/module-info.java b/jdk/src/java.naming/share/classes/module-info.java
index bd1332a5f7b..f8ec57900f0 100644
--- a/jdk/src/java.naming/share/classes/module-info.java
+++ b/jdk/src/java.naming/share/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* Defines the Java Naming and Directory Interface (JNDI) API.
*
+ * @moduleGraph
* @since 9
*/
module java.naming {
diff --git a/jdk/src/java.prefs/share/classes/module-info.java b/jdk/src/java.prefs/share/classes/module-info.java
index 15c47ad206b..b20d962967c 100644
--- a/jdk/src/java.prefs/share/classes/module-info.java
+++ b/jdk/src/java.prefs/share/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* Defines the Preferences API.
*
+ * @moduleGraph
* @since 9
*/
module java.prefs {
diff --git a/jdk/src/java.rmi/share/classes/module-info.java b/jdk/src/java.rmi/share/classes/module-info.java
index b10be8aee8e..6509952de9a 100644
--- a/jdk/src/java.rmi/share/classes/module-info.java
+++ b/jdk/src/java.rmi/share/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* Defines the Remote Method Invocation (RMI) API.
*
+ * @moduleGraph
* @since 9
*/
module java.rmi {
diff --git a/jdk/src/java.scripting/share/classes/module-info.java b/jdk/src/java.scripting/share/classes/module-info.java
index 0ee7a489b1f..42854afc437 100644
--- a/jdk/src/java.scripting/share/classes/module-info.java
+++ b/jdk/src/java.scripting/share/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* Defines the Scripting API.
*
+ * @moduleGraph
* @since 9
*/
module java.scripting {
diff --git a/jdk/src/java.se.ee/share/classes/module-info.java b/jdk/src/java.se.ee/share/classes/module-info.java
index 0156b7abe68..c12f8048963 100644
--- a/jdk/src/java.se.ee/share/classes/module-info.java
+++ b/jdk/src/java.se.ee/share/classes/module-info.java
@@ -29,6 +29,7 @@
* This module requires {@code java.se} and supplements it with modules
* that define CORBA and Java EE APIs. These modules are upgradeable.
*
+ * @moduleGraph
* @since 9
*/
@SuppressWarnings("deprecation")
diff --git a/jdk/src/java.se/share/classes/module-info.java b/jdk/src/java.se/share/classes/module-info.java
index 4d0d87869f3..33b99b1c13c 100644
--- a/jdk/src/java.se/share/classes/module-info.java
+++ b/jdk/src/java.se/share/classes/module-info.java
@@ -29,6 +29,7 @@
* The modules defining CORBA and Java EE APIs are not required by
* this module, but they are required by {@code java.se.ee}.
*
+ * @moduleGraph
* @since 9
*/
module java.se {
diff --git a/jdk/src/java.security.jgss/share/classes/module-info.java b/jdk/src/java.security.jgss/share/classes/module-info.java
index 4bb35fd807d..e73920ec79b 100644
--- a/jdk/src/java.security.jgss/share/classes/module-info.java
+++ b/jdk/src/java.security.jgss/share/classes/module-info.java
@@ -28,6 +28,7 @@
*
* This module also contains GSS-API mechanisms including Kerberos v5 and SPNEGO.
*
+ * @moduleGraph
* @since 9
*/
module java.security.jgss {
diff --git a/jdk/src/java.security.sasl/share/classes/module-info.java b/jdk/src/java.security.sasl/share/classes/module-info.java
index 0f4e1fd9f1f..162f844960e 100644
--- a/jdk/src/java.security.sasl/share/classes/module-info.java
+++ b/jdk/src/java.security.sasl/share/classes/module-info.java
@@ -30,6 +30,7 @@
* This module also contains SASL mechanisms including DIGEST-MD5,
* CRAM-MD5, and NTLM.
*
+ * @moduleGraph
* @since 9
*/
module java.security.sasl {
diff --git a/jdk/src/java.smartcardio/share/classes/module-info.java b/jdk/src/java.smartcardio/share/classes/module-info.java
index 1b3f717e374..ece968cc733 100644
--- a/jdk/src/java.smartcardio/share/classes/module-info.java
+++ b/jdk/src/java.smartcardio/share/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* Defines the Java Smart Card I/O API.
*
+ * @moduleGraph
* @since 9
*/
module java.smartcardio {
diff --git a/jdk/src/java.sql.rowset/share/classes/module-info.java b/jdk/src/java.sql.rowset/share/classes/module-info.java
index 5ba5fc96ecd..02413903f9c 100644
--- a/jdk/src/java.sql.rowset/share/classes/module-info.java
+++ b/jdk/src/java.sql.rowset/share/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* Defines the JDBC RowSet API.
*
+ * @moduleGraph
* @since 9
*/
module java.sql.rowset {
diff --git a/jdk/src/java.sql/share/classes/module-info.java b/jdk/src/java.sql/share/classes/module-info.java
index 9f3c08106c1..1e232ec122e 100644
--- a/jdk/src/java.sql/share/classes/module-info.java
+++ b/jdk/src/java.sql/share/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* Defines the JDBC API.
*
+ * @moduleGraph
* @since 9
*/
module java.sql {
diff --git a/jdk/src/java.transaction/share/classes/module-info.java b/jdk/src/java.transaction/share/classes/module-info.java
index 4b4d76a265a..1a3a1926248 100644
--- a/jdk/src/java.transaction/share/classes/module-info.java
+++ b/jdk/src/java.transaction/share/classes/module-info.java
@@ -29,6 +29,7 @@
* The subset consists of RMI exception types which are mapped to CORBA system
* exceptions by the 'Java Language to IDL Mapping Specification'.
*
+ * @moduleGraph
* @since 9
*/
@Deprecated(since="9", forRemoval=true)
diff --git a/jdk/src/java.xml.crypto/share/classes/module-info.java b/jdk/src/java.xml.crypto/share/classes/module-info.java
index ad2f50e9570..4e7db6b7579 100644
--- a/jdk/src/java.xml.crypto/share/classes/module-info.java
+++ b/jdk/src/java.xml.crypto/share/classes/module-info.java
@@ -24,8 +24,9 @@
*/
/**
- * Defines an API for XML cryptography.
+ * Defines the API for XML cryptography.
*
+ * @moduleGraph
* @since 9
*/
module java.xml.crypto {
diff --git a/jdk/src/jdk.attach/share/classes/module-info.java b/jdk/src/jdk.attach/share/classes/module-info.java
index c23210ab3e8..29f0cd67a7f 100644
--- a/jdk/src/jdk.attach/share/classes/module-info.java
+++ b/jdk/src/jdk.attach/share/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* Defines the attach API.
*
+ * @moduleGraph
* @since 9
*/
module jdk.attach {
diff --git a/jdk/src/jdk.charsets/share/classes/module-info.java b/jdk/src/jdk.charsets/share/classes/module-info.java
index 6e8cfc36441..8d40e575d30 100644
--- a/jdk/src/jdk.charsets/share/classes/module-info.java
+++ b/jdk/src/jdk.charsets/share/classes/module-info.java
@@ -23,6 +23,13 @@
* questions.
*/
+/**
+ * {@link java.nio.charset.Charset Charset} provider for the charsets that
+ * are not in {@code java.base} (mostly double byte and IBM charsets).
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.charsets {
provides java.nio.charset.spi.CharsetProvider
with sun.nio.cs.ext.ExtendedCharsets;
diff --git a/jdk/src/jdk.crypto.cryptoki/share/classes/module-info.java b/jdk/src/jdk.crypto.cryptoki/share/classes/module-info.java
index 487df00c299..82c2cde442e 100644
--- a/jdk/src/jdk.crypto.cryptoki/share/classes/module-info.java
+++ b/jdk/src/jdk.crypto.cryptoki/share/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* The SunPKCS11 security provider.
*
+ * @moduleGraph
* @since 9
*/
module jdk.crypto.cryptoki {
diff --git a/jdk/src/jdk.crypto.ec/share/classes/module-info.java b/jdk/src/jdk.crypto.ec/share/classes/module-info.java
index 74601fa8faf..54f22b68609 100644
--- a/jdk/src/jdk.crypto.ec/share/classes/module-info.java
+++ b/jdk/src/jdk.crypto.ec/share/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* The SunEC security provider.
*
+ * @moduleGraph
* @since 9
*/
module jdk.crypto.ec {
diff --git a/jdk/src/jdk.crypto.mscapi/windows/classes/module-info.java b/jdk/src/jdk.crypto.mscapi/windows/classes/module-info.java
index 20222f45122..0121f613e5e 100644
--- a/jdk/src/jdk.crypto.mscapi/windows/classes/module-info.java
+++ b/jdk/src/jdk.crypto.mscapi/windows/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* The SunMSCAPI security provider.
*
+ * @moduleGraph
* @since 9
*/
module jdk.crypto.mscapi {
diff --git a/jdk/src/jdk.crypto.ucrypto/solaris/classes/module-info.java b/jdk/src/jdk.crypto.ucrypto/solaris/classes/module-info.java
index 21d8a6686a2..3d96987b3c5 100644
--- a/jdk/src/jdk.crypto.ucrypto/solaris/classes/module-info.java
+++ b/jdk/src/jdk.crypto.ucrypto/solaris/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* The OracleUCrypto security provider.
*
+ * @moduleGraph
* @since 9
*/
module jdk.crypto.ucrypto {
diff --git a/jdk/src/jdk.httpserver/share/classes/module-info.java b/jdk/src/jdk.httpserver/share/classes/module-info.java
index b01a3870d79..e6c7173e8db 100644
--- a/jdk/src/jdk.httpserver/share/classes/module-info.java
+++ b/jdk/src/jdk.httpserver/share/classes/module-info.java
@@ -23,6 +23,12 @@
* questions.
*/
+/**
+ * Defines the JDK-specific API for HTTP server.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.httpserver {
exports com.sun.net.httpserver;
diff --git a/jdk/src/jdk.jartool/share/classes/module-info.java b/jdk/src/jdk.jartool/share/classes/module-info.java
index 536ca81b684..d852ee780d3 100644
--- a/jdk/src/jdk.jartool/share/classes/module-info.java
+++ b/jdk/src/jdk.jartool/share/classes/module-info.java
@@ -23,6 +23,13 @@
* questions.
*/
+/**
+ * Defines tools for manipulating Java Archive (JAR) files,
+ * including the jar and jarsigner tools.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.jartool {
exports com.sun.jarsigner;
exports jdk.security.jarsigner;
diff --git a/jdk/src/jdk.jcmd/share/classes/module-info.java b/jdk/src/jdk.jcmd/share/classes/module-info.java
index 5edf30cec80..4cda0283f1b 100644
--- a/jdk/src/jdk.jcmd/share/classes/module-info.java
+++ b/jdk/src/jdk.jcmd/share/classes/module-info.java
@@ -23,6 +23,13 @@
* questions.
*/
+/**
+ * Defines tools for diagnostics and troubleshooting a JVM,
+ * including the jcmd, jps, jstat and other diagnostics tools.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.jcmd {
requires jdk.attach;
requires jdk.internal.jvmstat;
diff --git a/jdk/src/jdk.jconsole/share/classes/module-info.java b/jdk/src/jdk.jconsole/share/classes/module-info.java
index 327af1e1066..7e1841a9bea 100644
--- a/jdk/src/jdk.jconsole/share/classes/module-info.java
+++ b/jdk/src/jdk.jconsole/share/classes/module-info.java
@@ -23,6 +23,13 @@
* questions.
*/
+/**
+ * Defines the JMX graphical tool, jconsole, for monitoring and managing
+ * a running application.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.jconsole {
requires transitive java.desktop;
requires transitive java.management;
diff --git a/jdk/src/jdk.jdi/share/classes/module-info.java b/jdk/src/jdk.jdi/share/classes/module-info.java
index e2cb439d8c0..e0ea5a5e416 100644
--- a/jdk/src/jdk.jdi/share/classes/module-info.java
+++ b/jdk/src/jdk.jdi/share/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* Defines the Java Debugger Interface.
*
+ * @moduleGraph
* @since 9
*/
module jdk.jdi {
diff --git a/jdk/src/jdk.jdwp.agent/share/classes/module-info.java b/jdk/src/jdk.jdwp.agent/share/classes/module-info.java
index b78275fab92..82d4c86056a 100644
--- a/jdk/src/jdk.jdwp.agent/share/classes/module-info.java
+++ b/jdk/src/jdk.jdwp.agent/share/classes/module-info.java
@@ -26,6 +26,7 @@
/**
* Java Debug Wire Protocol.
*
+ * @moduleGraph
* @since 9
*/
module jdk.jdwp.agent {
diff --git a/jdk/src/jdk.jlink/share/classes/module-info.java b/jdk/src/jdk.jlink/share/classes/module-info.java
index 00140adb802..510b4ac0bb1 100644
--- a/jdk/src/jdk.jlink/share/classes/module-info.java
+++ b/jdk/src/jdk.jlink/share/classes/module-info.java
@@ -23,6 +23,12 @@
* questions.
*/
+/**
+ * Defines the Java linker tool, jlink.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.jlink {
requires jdk.internal.opt;
requires jdk.jdeps;
diff --git a/jdk/src/jdk.jsobject/share/classes/module-info.java b/jdk/src/jdk.jsobject/share/classes/module-info.java
index b8f6a2db16b..ac69396a3e5 100644
--- a/jdk/src/jdk.jsobject/share/classes/module-info.java
+++ b/jdk/src/jdk.jsobject/share/classes/module-info.java
@@ -23,6 +23,12 @@
* questions.
*/
+/**
+ * Defines the API for the JavaScript Object.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.jsobject {
requires java.desktop;
exports netscape.javascript;
diff --git a/jdk/src/jdk.jstatd/share/classes/module-info.java b/jdk/src/jdk.jstatd/share/classes/module-info.java
index 67f3ec0770f..b3e3195c262 100644
--- a/jdk/src/jdk.jstatd/share/classes/module-info.java
+++ b/jdk/src/jdk.jstatd/share/classes/module-info.java
@@ -23,6 +23,13 @@
* questions.
*/
+/**
+ * Defines the tool for starting a daemon for the jstat tool to monitor
+ * JVM statistics remotely.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.jstatd {
requires java.rmi;
requires jdk.internal.jvmstat;
@@ -32,4 +39,3 @@ module jdk.jstatd {
provides sun.jvmstat.monitor.MonitoredHostService with sun.jvmstat.perfdata.monitor.protocol.rmi.MonitoredHostRmiService;
}
-
diff --git a/jdk/src/jdk.localedata/share/classes/module-info.java b/jdk/src/jdk.localedata/share/classes/module-info.java
index 324e14b928f..ac27dc329c5 100644
--- a/jdk/src/jdk.localedata/share/classes/module-info.java
+++ b/jdk/src/jdk.localedata/share/classes/module-info.java
@@ -23,6 +23,12 @@
* questions.
*/
+/**
+ * Locale data provider for locales other than {@linkplain java.util.Locale#US US locale}.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.localedata {
provides sun.util.locale.provider.LocaleDataMetaInfo with
sun.util.resources.cldr.provider.CLDRLocaleDataMetaInfo,
diff --git a/jdk/src/jdk.management.agent/share/classes/module-info.java b/jdk/src/jdk.management.agent/share/classes/module-info.java
index 0afeaf0ccd6..81bccdb0e2b 100644
--- a/jdk/src/jdk.management.agent/share/classes/module-info.java
+++ b/jdk/src/jdk.management.agent/share/classes/module-info.java
@@ -23,6 +23,12 @@
* questions.
*/
+/**
+ * Define the JMX management agent.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.management.agent {
requires java.management;
requires java.management.rmi;
diff --git a/jdk/src/jdk.management/share/classes/module-info.java b/jdk/src/jdk.management/share/classes/module-info.java
index 327d31ebda8..bea31ddcadb 100644
--- a/jdk/src/jdk.management/share/classes/module-info.java
+++ b/jdk/src/jdk.management/share/classes/module-info.java
@@ -23,6 +23,12 @@
* questions.
*/
+/**
+ * Defines the JDK-specific Management Interfaces for JVM.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.management {
requires transitive java.management;
diff --git a/jdk/src/jdk.naming.dns/share/classes/module-info.java b/jdk/src/jdk.naming.dns/share/classes/module-info.java
index abe26ec2644..71d3725440a 100644
--- a/jdk/src/jdk.naming.dns/share/classes/module-info.java
+++ b/jdk/src/jdk.naming.dns/share/classes/module-info.java
@@ -23,6 +23,12 @@
* questions.
*/
+/**
+ * DNS Java Naming provider.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.naming.dns {
requires java.naming;
diff --git a/jdk/src/jdk.naming.rmi/share/classes/module-info.java b/jdk/src/jdk.naming.rmi/share/classes/module-info.java
index debe6409103..bba4557c935 100644
--- a/jdk/src/jdk.naming.rmi/share/classes/module-info.java
+++ b/jdk/src/jdk.naming.rmi/share/classes/module-info.java
@@ -23,6 +23,12 @@
* questions.
*/
+/**
+ * RMI Java Naming provider.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.naming.rmi {
requires java.naming;
requires java.rmi;
diff --git a/jdk/src/jdk.net/share/classes/module-info.java b/jdk/src/jdk.net/share/classes/module-info.java
index 95fb57915a8..e5ed160d74b 100644
--- a/jdk/src/jdk.net/share/classes/module-info.java
+++ b/jdk/src/jdk.net/share/classes/module-info.java
@@ -23,6 +23,12 @@
* questions.
*/
+/**
+ * Defines the JDK-specific Networking API.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.net {
exports jdk.net;
}
diff --git a/jdk/src/jdk.sctp/share/classes/module-info.java b/jdk/src/jdk.sctp/share/classes/module-info.java
index c52ceb5c8c2..f150ed25fc6 100644
--- a/jdk/src/jdk.sctp/share/classes/module-info.java
+++ b/jdk/src/jdk.sctp/share/classes/module-info.java
@@ -23,6 +23,12 @@
* questions.
*/
+/**
+ * Defines the JDK-specific API for SCTP.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.sctp {
exports com.sun.nio.sctp;
}
diff --git a/jdk/src/jdk.security.auth/share/classes/module-info.java b/jdk/src/jdk.security.auth/share/classes/module-info.java
index 1f6eea6537b..59e9f996aaf 100644
--- a/jdk/src/jdk.security.auth/share/classes/module-info.java
+++ b/jdk/src/jdk.security.auth/share/classes/module-info.java
@@ -27,6 +27,7 @@
* Contains the implementation of the javax.security.auth.* interfaces and
* various authentication modules.
*
+ * @moduleGraph
* @since 9
*/
module jdk.security.auth {
diff --git a/jdk/src/jdk.security.jgss/share/classes/module-info.java b/jdk/src/jdk.security.jgss/share/classes/module-info.java
index f43fdd49296..3e4d520d0a4 100644
--- a/jdk/src/jdk.security.jgss/share/classes/module-info.java
+++ b/jdk/src/jdk.security.jgss/share/classes/module-info.java
@@ -27,6 +27,7 @@
* Defines Java extensions to the GSS-API and an implementation of the SASL
* GSSAPI mechanism.
*
+ * @moduleGraph
* @since 9
*/
module jdk.security.jgss {
diff --git a/jdk/src/jdk.zipfs/share/classes/module-info.java b/jdk/src/jdk.zipfs/share/classes/module-info.java
index 5b7275e0ccb..bcd281f459a 100644
--- a/jdk/src/jdk.zipfs/share/classes/module-info.java
+++ b/jdk/src/jdk.zipfs/share/classes/module-info.java
@@ -23,6 +23,12 @@
* questions.
*/
+/**
+ * Zip file system provider.
+ *
+ * @moduleGraph
+ * @since 9
+ */
module jdk.zipfs {
provides java.nio.file.spi.FileSystemProvider with jdk.nio.zipfs.ZipFileSystemProvider;
}
From a2173b8f39e7c5611a0366646c7a8072f0ed611f Mon Sep 17 00:00:00 2001
From: Kumar Srinivasan
Date: Wed, 29 Mar 2017 10:50:45 -0700
Subject: [PATCH 11/40] 8174148: Typo in
java.util.jar.Pack200.Unpacker.properties() method documentation 8173871:
Typos in Jar Packer/Unpacker PROGRESS field documentation
Reviewed-by: bpb, darcy
---
.../share/classes/java/util/jar/Pack200.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/jdk/src/java.base/share/classes/java/util/jar/Pack200.java b/jdk/src/java.base/share/classes/java/util/jar/Pack200.java
index 01df2638039..c8862a8da7a 100644
--- a/jdk/src/java.base/share/classes/java/util/jar/Pack200.java
+++ b/jdk/src/java.base/share/classes/java/util/jar/Pack200.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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
@@ -452,13 +452,13 @@ public abstract class Pack200 {
String CODE_ATTRIBUTE_PFX = "pack.code.attribute.";
/**
- * The unpacker's progress as a percentage, as periodically
- * updated by the unpacker.
+ * The packer's progress as a percentage, as periodically
+ * updated by the packer.
* Values of 0 - 100 are normal, and -1 indicates a stall.
* Progress can be monitored by polling the value of this
* property.
*
- * At a minimum, the unpacker must set progress to 0
+ * At a minimum, the packer must set progress to 0
* at the beginning of a packing operation, and to 100
* at the end.
*/
@@ -623,7 +623,7 @@ public abstract class Pack200 {
* property.
*
* At a minimum, the unpacker must set progress to 0
- * at the beginning of a packing operation, and to 100
+ * at the beginning of an unpacking operation, and to 100
* at the end.
*/
String PROGRESS = "unpack.progress";
@@ -631,7 +631,7 @@ public abstract class Pack200 {
/**
* Get the set of this engine's properties. This set is
* a "live view", so that changing its
- * contents immediately affects the Packer engine, and
+ * contents immediately affects the Unpacker engine, and
* changes from the engine (such as progress indications)
* are immediately visible in the map.
*
From 837ceec9a5832dcddd6bcb3725d7a4b37df77b3b Mon Sep 17 00:00:00 2001
From: Weijun Wang
Date: Thu, 30 Mar 2017 07:29:58 +0800
Subject: [PATCH 12/40] 8177569: keytool should not warn if signature algorithm
used in cacerts is weak
Reviewed-by: mullan
---
.../sun/security/tools/keytool/Main.java | 57 +++++++++++++------
.../sun/security/tools/keytool/WeakAlg.java | 57 +++++++++++++++++--
2 files changed, 94 insertions(+), 20 deletions(-)
diff --git a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java
index c71df1a2cbe..53ea9706207 100644
--- a/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java
+++ b/jdk/src/java.base/share/classes/sun/security/tools/keytool/Main.java
@@ -1025,6 +1025,13 @@ public final class Main {
cf = CertificateFactory.getInstance("X509");
}
+ // -trustcacerts can only be specified on -importcert.
+ // Reset it so that warnings on CA cert will remain for
+ // -printcert, etc.
+ if (command != IMPORTCERT) {
+ trustcacerts = false;
+ }
+
if (trustcacerts) {
caks = KeyStoreUtil.getCacertsKeyStore();
}
@@ -1758,9 +1765,8 @@ public final class Main {
if (keyPass == null) {
keyPass = promptForKeyPass(alias, null, storePass);
}
- keyStore.setKeyEntry(alias, privKey, keyPass, chain);
-
checkWeak(rb.getString("the.generated.certificate"), chain[0]);
+ keyStore.setKeyEntry(alias, privKey, keyPass, chain);
}
/**
@@ -2118,6 +2124,10 @@ public final class Main {
}
try {
+ Certificate c = srckeystore.getCertificate(alias);
+ if (c != null) {
+ checkWeak("<" + newAlias + ">", c);
+ }
keyStore.setEntry(newAlias, entry, pp);
// Place the check so that only successful imports are blocked.
// For example, we don't block a failed SecretEntry import.
@@ -2127,10 +2137,6 @@ public final class Main {
"The.destination.pkcs12.keystore.has.different.storepass.and.keypass.Please.retry.with.destkeypass.specified."));
}
}
- Certificate c = srckeystore.getCertificate(alias);
- if (c != null) {
- checkWeak("<" + newAlias + ">", c);
- }
return 1;
} catch (KeyStoreException kse) {
Object[] source2 = {alias, kse.toString()};
@@ -2814,8 +2820,8 @@ public final class Main {
}
if (noprompt) {
- keyStore.setCertificateEntry(alias, cert);
checkWeak(rb.getString("the.input"), cert);
+ keyStore.setCertificateEntry(alias, cert);
return true;
}
@@ -3049,6 +3055,11 @@ public final class Main {
MessageFormat form = new MessageFormat
(rb.getString(".PATTERN.printX509Cert.with.weak"));
PublicKey pkey = cert.getPublicKey();
+ String sigName = cert.getSigAlgName();
+ // No need to warn about sigalg of a trust anchor
+ if (!isTrustedCert(cert)) {
+ sigName = withWeak(sigName);
+ }
Object[] source = {cert.getSubjectDN().toString(),
cert.getIssuerDN().toString(),
cert.getSerialNumber().toString(16),
@@ -3056,7 +3067,7 @@ public final class Main {
cert.getNotAfter().toString(),
getCertFingerPrint("SHA-1", cert),
getCertFingerPrint("SHA-256", cert),
- withWeak(cert.getSigAlgName()),
+ sigName,
withWeak(pkey),
cert.getVersion()
};
@@ -3111,7 +3122,7 @@ public final class Main {
* or null otherwise. A label is added.
*/
private static Pair
- getTrustedSigner(Certificate cert, KeyStore ks) throws Exception {
+ getSigner(Certificate cert, KeyStore ks) throws Exception {
if (ks.getCertificateAlias(cert) != null) {
return new Pair<>("", cert);
}
@@ -3467,9 +3478,9 @@ public final class Main {
// do we trust the cert at the top?
Certificate topCert = replyCerts[replyCerts.length-1];
boolean fromKeyStore = true;
- Pair root = getTrustedSigner(topCert, keyStore);
+ Pair root = getSigner(topCert, keyStore);
if (root == null && trustcacerts && caks != null) {
- root = getTrustedSigner(topCert, caks);
+ root = getSigner(topCert, caks);
fromKeyStore = false;
}
if (root == null) {
@@ -4301,9 +4312,19 @@ public final class Main {
return result;
}
+ private boolean isTrustedCert(Certificate cert) throws KeyStoreException {
+ if (caks != null && caks.getCertificateAlias(cert) != null) {
+ return true;
+ } else {
+ String inKS = keyStore.getCertificateAlias(cert);
+ return inKS != null && keyStore.isCertificateEntry(inKS);
+ }
+ }
+
private void checkWeak(String label, String sigAlg, Key key) {
- if (!DISABLED_CHECK.permits(SIG_PRIMITIVE_SET, sigAlg, null)) {
+ if (sigAlg != null && !DISABLED_CHECK.permits(
+ SIG_PRIMITIVE_SET, sigAlg, null)) {
weakWarnings.add(String.format(
rb.getString("whose.sigalg.risk"), label, sigAlg));
}
@@ -4316,7 +4337,8 @@ public final class Main {
}
}
- private void checkWeak(String label, Certificate[] certs) {
+ private void checkWeak(String label, Certificate[] certs)
+ throws KeyStoreException {
for (int i = 0; i < certs.length; i++) {
Certificate cert = certs[i];
if (cert instanceof X509Certificate) {
@@ -4325,15 +4347,18 @@ public final class Main {
if (certs.length > 1) {
fullLabel = oneInMany(label, i, certs.length);
}
- checkWeak(fullLabel, xc.getSigAlgName(), xc.getPublicKey());
+ checkWeak(fullLabel, xc);
}
}
}
- private void checkWeak(String label, Certificate cert) {
+ private void checkWeak(String label, Certificate cert)
+ throws KeyStoreException {
if (cert instanceof X509Certificate) {
X509Certificate xc = (X509Certificate)cert;
- checkWeak(label, xc.getSigAlgName(), xc.getPublicKey());
+ // No need to check the sigalg of a trust anchor
+ String sigAlg = isTrustedCert(cert) ? null : xc.getSigAlgName();
+ checkWeak(label, sigAlg, xc.getPublicKey());
}
}
diff --git a/jdk/test/sun/security/tools/keytool/WeakAlg.java b/jdk/test/sun/security/tools/keytool/WeakAlg.java
index 95603ba45ea..bb7ae777371 100644
--- a/jdk/test/sun/security/tools/keytool/WeakAlg.java
+++ b/jdk/test/sun/security/tools/keytool/WeakAlg.java
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8171319
+ * @bug 8171319 8177569
* @summary keytool should print out warnings when reading or generating
* cert/cert req using weak algorithms
* @library /test/lib
@@ -78,7 +78,8 @@ public class WeakAlg {
.shouldMatch(".*512-bit RSA key.*risk")
.shouldContain("512-bit RSA key (weak)");
- // Multiple warnings for multiple cert in -printcert or -list or -exportcert
+ // Multiple warnings for multiple cert in -printcert
+ // or -list or -exportcert
// -certreq, -printcertreq, -gencert
checkCertReq("a", "", null);
@@ -184,7 +185,7 @@ public class WeakAlg {
.shouldMatch("The input.*MD5withRSA.*risk")
.shouldNotContain("[no]");
- // cert is self-signed cacerts
+ // JDK-8177569: no warning for sigalg of trusted cert
String weakSigAlgCA = null;
KeyStore ks = KeyStoreUtil.getCacertsKeyStore();
if (ks != null) {
@@ -208,12 +209,40 @@ public class WeakAlg {
}
}
if (weakSigAlgCA != null) {
+ // The following 2 commands still have a warning on why not using
+ // the -cacerts option directly.
+ kt("-list -keystore " + KeyStoreUtil.getCacerts())
+ .shouldNotContain("risk");
+ kt("-list -v -keystore " + KeyStoreUtil.getCacerts())
+ .shouldNotContain("risk");
+
+ // -printcert will always show warnings
+ kt("-printcert -file ca.cert")
+ .shouldContain("name: " + weakSigAlgCA + " (weak)")
+ .shouldContain("Warning")
+ .shouldMatch("The certificate.*" + weakSigAlgCA + ".*risk");
+ kt("-printcert -file ca.cert -trustcacerts") // -trustcacerts useless
+ .shouldContain("name: " + weakSigAlgCA + " (weak)")
+ .shouldContain("Warning")
+ .shouldMatch("The certificate.*" + weakSigAlgCA + ".*risk");
+
+ // Importing with -trustcacerts ignore CA cert's sig alg
kt("-delete -alias d");
kt("-importcert -alias d -trustcacerts -file ca.cert", "no")
.shouldContain("Certificate already exists in system-wide CA")
+ .shouldNotContain("risk")
+ .shouldContain("Do you still want to add it to your own keystore?");
+ kt("-importcert -alias d -trustcacerts -file ca.cert -noprompt")
+ .shouldNotContain("risk")
+ .shouldNotContain("[no]");
+
+ // but not without -trustcacerts
+ kt("-delete -alias d");
+ kt("-importcert -alias d -file ca.cert", "no")
+ .shouldContain("name: " + weakSigAlgCA + " (weak)")
.shouldContain("Warning")
.shouldMatch("The input.*" + weakSigAlgCA + ".*risk")
- .shouldContain("Do you still want to add it to your own keystore?");
+ .shouldContain("Trust this certificate?");
kt("-importcert -alias d -file ca.cert -noprompt")
.shouldContain("Warning")
.shouldMatch("The input.*" + weakSigAlgCA + ".*risk")
@@ -265,6 +294,26 @@ public class WeakAlg {
// install reply
+ reStore();
+ certreq("c", "");
+ gencert("a-c", "");
+ kt("-importcert -alias c -file a-c.cert")
+ .shouldContain("Warning")
+ .shouldMatch("Issuer .*MD5withRSA.*risk");
+
+ // JDK-8177569: no warning for sigalg of trusted cert
+ reStore();
+ // Change a into a TrustedCertEntry
+ kt("-exportcert -alias a -file a.cert");
+ kt("-delete -alias a");
+ kt("-importcert -alias a -file a.cert -noprompt");
+ kt("-list -alias a -v")
+ .shouldNotContain("weak")
+ .shouldNotContain("Warning");
+ // This time a is trusted and no warning on its weak sig alg
+ kt("-importcert -alias c -file a-c.cert")
+ .shouldNotContain("Warning");
+
reStore();
gencert("a-b", "");
From a1c69dba88eb6ba0c788c446fcc1f10e3a96c7b7 Mon Sep 17 00:00:00 2001
From: Lana Steuck
Date: Wed, 29 Mar 2017 23:33:06 +0000
Subject: [PATCH 13/40] Added tag jdk-9+163 for changeset b5c4e28a7521
---
jdk/.hgtags | 1 +
1 file changed, 1 insertion(+)
diff --git a/jdk/.hgtags b/jdk/.hgtags
index 81e51863746..de92f56c630 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -405,3 +405,4 @@ c476ca73750698fa5654e101af699ee45db38e2a jdk-9+158
cac788454598b95d8b0153c021a7fae3cd7e6fda jdk-9+160
09b92d3067a38ee07bc14efa336b14790c93f7e7 jdk-9+161
f6bf027e88e9a4dd19f721001a7af00157af42c4 jdk-9+162
+50171f8c47961710cbf87aead6f03fa431d8d240 jdk-9+163
From c3e64cb01c446d3ff75e09c5f9122f71d21f82f9 Mon Sep 17 00:00:00 2001
From: Stuart Marks
Date: Thu, 30 Mar 2017 11:26:31 -0700
Subject: [PATCH 14/40] 8155052: add notes and links to j.u.Observer/Observable
deprecation comments
Reviewed-by: chegar
---
jdk/src/java.base/share/classes/java/util/Observable.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/jdk/src/java.base/share/classes/java/util/Observable.java b/jdk/src/java.base/share/classes/java/util/Observable.java
index b19830bb64e..d71bf5d5d4c 100644
--- a/jdk/src/java.base/share/classes/java/util/Observable.java
+++ b/jdk/src/java.base/share/classes/java/util/Observable.java
@@ -69,6 +69,8 @@ package java.util;
* {@link java.beans} package. For reliable and ordered
* messaging among threads, consider using one of the concurrent data
* structures in the {@link java.util.concurrent} package.
+ * For reactive streams style programming, see the
+ * {@link java.util.concurrent.Flow} API.
*/
@Deprecated(since="9")
public class Observable {
From 4935556d43f6ba8fdf26fb7400828bebfc8f172b Mon Sep 17 00:00:00 2001
From: Xueming Shen
Date: Fri, 31 Mar 2017 11:33:23 -0700
Subject: [PATCH 15/40] 8177910: Update zlib copyright note in
idk/src/java.base/share/legal/zlib.md
Reviewed-by: mchung, rriggs
---
jdk/src/java.base/share/legal/zlib.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/jdk/src/java.base/share/legal/zlib.md b/jdk/src/java.base/share/legal/zlib.md
index bbf40f9814b..69198f1ef4f 100644
--- a/jdk/src/java.base/share/legal/zlib.md
+++ b/jdk/src/java.base/share/legal/zlib.md
@@ -1,9 +1,9 @@
-## zlib v1.2.8
+## zlib v1.2.11
### zlib License
Because it is inherently unsafe. Stopping a thread causes it to
+unlock all the monitors that it has locked. (The monitors are
+unlocked as the ThreadDeath exception propagates up
+the stack.) If any of the objects previously protected by these
+monitors were in an inconsistent state, other threads may now view
+these objects in an inconsistent state. Such objects are said to be
+damaged. When threads operate on damaged objects, arbitrary
+behavior can result. This behavior may be subtle and difficult to
+detect, or it may be pronounced. Unlike other unchecked exceptions,
+ThreadDeath kills threads silently; thus, the user has
+no warning that his program may be corrupted. The corruption can
+manifest itself at any time after the actual damage occurs, even
+hours or days in the future.
+
+
Couldn't I just catch the ThreadDeath exception
+and fix the damaged object?
+
In theory, perhaps, but it would vastly complicate the
+task of writing correct multithreaded code. The task would be
+nearly insurmountable for two reasons:
+
+
A thread can throw a ThreadDeath exception
+almost anywhere. All synchronized methods and blocks would
+have to be studied in great detail, with this in mind.
+
A thread can throw a second ThreadDeath exception
+while cleaning up from the first (in the catch or
+finally clause). Cleanup would have to be repeated till
+it succeeded. The code to ensure this would be quite complex.
+
+In sum, it just isn't practical.
+
+
What about Thread.stop(Throwable)?
+
In addition to all of the problems noted above, this method may
+be used to generate exceptions that its target thread is unprepared
+to handle (including checked exceptions that the thread could not
+possibly throw, were it not for this method). For example, the
+following method is behaviorally identical to Java's
+throw operation, but circumvents the compiler's
+attempts to guarantee that the calling method has declared all of
+the checked exceptions that it may throw:
Most uses of stop should be replaced by code that
+simply modifies some variable to indicate that the target thread
+should stop running. The target thread should check this variable
+regularly, and return from its run method in an orderly fashion if
+the variable indicates that it is to stop running. To ensure prompt
+communication of the stop-request, the variable must be
+volatile (or access to the variable must be
+synchronized).
+
For example, suppose your applet contains the following
+start, stop and run
+methods:
How do I stop a thread that waits for long periods (e.g., for
+input)?
+
That's what the Thread.interrupt method is for. The
+same "state based" signaling mechanism shown above can be used, but
+the state change (blinker = null, in the previous
+example) can be followed by a call to
+Thread.interrupt, to interrupt the wait:
+For this technique to work, it's critical that any method that
+catches an interrupt exception and is not prepared to deal with it
+immediately reasserts the exception. We say reasserts
+rather than rethrows, because it is not always possible to
+rethrow the exception. If the method that catches the
+InterruptedException is not declared to throw this
+(checked) exception, then it should "reinterrupt itself" with the
+following incantation:
+
+ Thread.currentThread().interrupt();
+
+This ensures that the Thread will reraise the
+InterruptedException as soon as it is able.
+
+
What if a thread doesn't respond to
+Thread.interrupt?
+
In some cases, you can use application specific tricks. For
+example, if a thread is waiting on a known socket, you can close
+the socket to cause the thread to return immediately.
+Unfortunately, there really isn't any technique that works in
+general. It should be noted that in all situations where a
+waiting thread doesn't respond to Thread.interrupt, it
+wouldn't respond to Thread.stop either. Such
+cases include deliberate denial-of-service attacks, and I/O
+operations for which thread.stop and thread.interrupt do not work
+properly.
+
+
Why are Thread.suspend and
+Thread.resume deprecated?
+
Thread.suspend is inherently deadlock-prone. If the
+target thread holds a lock on the monitor protecting a critical
+system resource when it is suspended, no thread can access this
+resource until the target thread is resumed. If the thread that
+would resume the target thread attempts to lock this monitor prior
+to calling resume, deadlock results. Such deadlocks
+typically manifest themselves as "frozen" processes.
+
+
What should I use instead of Thread.suspend and
+Thread.resume?
+
As with Thread.stop, the prudent approach is to
+have the "target thread" poll a variable indicating the desired
+state of the thread (active or suspended). When the desired state
+is suspended, the thread waits using Object.wait. When
+the thread is resumed, the target thread is notified using
+Object.notify.
+
For example, suppose your applet contains the following
+mousePressed event handler, which toggles the state of a thread
+called blinker:
+The wait method throws the
+InterruptedException, so it must be inside a try
+... catch clause. It's fine to put it in the same clause as
+the sleep. The check should follow (rather than
+precede) the sleep so the window is immediately
+repainted when the thread is "resumed." The resulting
+run method follows:
+
+Note that the notify in the mousePressed
+method and the wait in the run method are
+inside synchronized blocks. This is required by the
+language, and ensures that wait and
+notify are properly serialized. In practical terms,
+this eliminates race conditions that could cause the "suspended"
+thread to miss a notify and remain suspended
+indefinitely.
+
While the cost of synchronization in Java is decreasing as the
+platform matures, it will never be free. A simple trick can be used
+to remove the synchronization that we've added to each iteration of
+the "run loop." The synchronized block that was added is replaced
+by a slightly more complex piece of code that enters a synchronized
+block only if the thread has actually been suspended:
+
+ if (threadSuspended) {
+ synchronized(this) {
+ while (threadSuspended)
+ wait();
+ }
+ }
+
+
In the absence of explicit synchronization,
+threadSuspended must be made volatile to ensure
+prompt communication of the suspend-request.
Can I combine the two techniques to produce a thread that may
+be safely "stopped" or "suspended"?
+Yes, it's reasonably straightforward. The one subtlety is that the
+target thread may already be suspended at the time that another
+thread tries to stop it. If the stop method merely sets
+the state variable (blinker) to null, the target thread
+will remain suspended (waiting on the monitor), rather than exiting
+gracefully as it should. If the applet is restarted, multiple
+threads could end up waiting on the monitor at the same time,
+resulting in erratic behavior.
+
To rectify this situation, the stop method must ensure
+that the target thread resumes immediately if it is suspended. Once
+the target thread resumes, it must recognize immediately that it
+has been stopped, and exit gracefully. Here's how the resulting
+run and stop methods look:
+If the stop method calls Thread.interrupt, as
+described above, it needn't call notify as well, but it
+still must be synchronized. This ensures that the target thread
+won't miss an interrupt due to a race condition.
+
+
What about Thread.destroy?
+Thread.destroy was never implemented and has been
+deprecated. If it were implemented, it would be deadlock-prone in
+the manner of Thread.suspend. (In fact, it is roughly
+equivalent to Thread.suspend without the possibility
+of a subsequent Thread.resume.)
+
+
Why is Runtime.runFinalizersOnExit
+deprecated?
+Because it is inherently unsafe. It may result in finalizers being
+called on live objects while other threads are concurrently
+manipulating those objects, resulting in erratic behavior or
+deadlock. While this problem could be prevented if the class whose
+objects are being finalized were coded to "defend against" this
+call, most programmers do not defend against it. They assume
+that an object is dead at the time that its finalizer is called.
+
Further, the call is not "thread-safe" in the sense that it sets
+a VM-global flag. This forces every class with a finalizer
+to defend against the finalization of live objects!
+
+
+
From c8873016c3d2822fc4f726f92d294c763ffdfc15 Mon Sep 17 00:00:00 2001
From: Daniel Fuchs
Date: Thu, 6 Apr 2017 14:38:15 +0100
Subject: [PATCH 29/40] 8178139: Minor typo in API documentation of
java.util.logging.Logger
Reviewed-by: lancea
---
.../java.logging/share/classes/java/util/logging/Logger.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/jdk/src/java.logging/share/classes/java/util/logging/Logger.java b/jdk/src/java.logging/share/classes/java/util/logging/Logger.java
index 1cfd6f98659..d99b13907e5 100644
--- a/jdk/src/java.logging/share/classes/java/util/logging/Logger.java
+++ b/jdk/src/java.logging/share/classes/java/util/logging/Logger.java
@@ -664,7 +664,7 @@ public class Logger {
* a new logger is created.
*
* If a new logger is created its log level will be configured
- * based on the LogManager configuration and it will configured
+ * based on the LogManager configuration and it will be configured
* to also send logging output to its parent's Handlers. It will
* be registered in the LogManager global namespace.
*
@@ -726,7 +726,7 @@ public class Logger {
*
*
* If a new logger is created its log level will be configured
- * based on the LogManager and it will configured to also send logging
+ * based on the LogManager and it will be configured to also send logging
* output to its parent's Handlers. It will be registered in
* the LogManager global namespace.
*
diff --git a/jdk/src/java.base/share/classes/java/lang/Class.java b/jdk/src/java.base/share/classes/java/lang/Class.java
index 14026931c97..733c76a2a2c 100644
--- a/jdk/src/java.base/share/classes/java/lang/Class.java
+++ b/jdk/src/java.base/share/classes/java/lang/Class.java
@@ -43,7 +43,6 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
import java.lang.reflect.Proxy;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
@@ -2561,21 +2560,16 @@ public final class Class implements java.io.Serializable,
public InputStream getResourceAsStream(String name) {
name = resolveName(name);
- Module module = getModule();
- if (module.isNamed()) {
- if (Resources.canEncapsulate(name)) {
- Module caller = Reflection.getCallerClass().getModule();
- if (caller != module) {
- Set packages = module.getDescriptor().packages();
- String pn = Resources.toPackageName(name);
- if (packages.contains(pn) && !module.isOpen(pn, caller)) {
- // resource is in package not open to caller
- return null;
- }
- }
+ Module thisModule = getModule();
+ if (thisModule.isNamed()) {
+ // check if resource can be located by caller
+ if (Resources.canEncapsulate(name)
+ && !isOpenToCaller(name, Reflection.getCallerClass())) {
+ return null;
}
- String mn = module.getName();
+ // resource not encapsulated or in package open to caller
+ String mn = thisModule.getName();
ClassLoader cl = getClassLoader0();
try {
@@ -2663,20 +2657,16 @@ public final class Class implements java.io.Serializable,
public URL getResource(String name) {
name = resolveName(name);
- Module module = getModule();
- if (module.isNamed()) {
- if (Resources.canEncapsulate(name)) {
- Module caller = Reflection.getCallerClass().getModule();
- if (caller != module) {
- Set packages = module.getDescriptor().packages();
- String pn = Resources.toPackageName(name);
- if (packages.contains(pn) && !module.isOpen(pn, caller)) {
- // resource is in package not open to caller
- return null;
- }
- }
+ Module thisModule = getModule();
+ if (thisModule.isNamed()) {
+ // check if resource can be located by caller
+ if (Resources.canEncapsulate(name)
+ && !isOpenToCaller(name, Reflection.getCallerClass())) {
+ return null;
}
- String mn = getModule().getName();
+
+ // resource not encapsulated or in package open to caller
+ String mn = thisModule.getName();
ClassLoader cl = getClassLoader0();
try {
if (cl == null) {
@@ -2698,10 +2688,36 @@ public final class Class implements java.io.Serializable,
}
}
+ /**
+ * Returns true if a resource with the given name can be located by the
+ * given caller. All resources in a module can be located by code in
+ * the module. For other callers, then the package needs to be open to
+ * the caller.
+ */
+ private boolean isOpenToCaller(String name, Class> caller) {
+ // assert getModule().isNamed();
+ Module thisModule = getModule();
+ Module callerModule = (caller != null) ? caller.getModule() : null;
+ if (callerModule != thisModule) {
+ String pn = Resources.toPackageName(name);
+ if (thisModule.getDescriptor().packages().contains(pn)) {
+ if (callerModule == null && !thisModule.isOpen(pn)) {
+ // no caller, package not open
+ return false;
+ }
+ if (!thisModule.isOpen(pn, callerModule)) {
+ // package not open to caller
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+
/** protection domain returned when the internal domain is null */
private static java.security.ProtectionDomain allPermDomain;
-
/**
* Returns the {@code ProtectionDomain} of this class. If there is a
* security manager installed, this method first calls the security
diff --git a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java
index a6817746cdc..f9d8ae36934 100644
--- a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java
+++ b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java
@@ -31,7 +31,6 @@ import java.io.UncheckedIOException;
import java.io.File;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
-import java.lang.reflect.Module;
import java.net.URL;
import java.security.AccessController;
import java.security.AccessControlContext;
@@ -352,9 +351,7 @@ public abstract class ClassLoader {
private ClassLoader(Void unused, String name, ClassLoader parent) {
this.name = name;
this.parent = parent;
- this.unnamedModule
- = SharedSecrets.getJavaLangReflectModuleAccess()
- .defineUnnamedModule(this);
+ this.unnamedModule = new Module(this);
if (ParallelLoaders.isRegistered(this.getClass())) {
parallelLockMap = new ConcurrentHashMap<>();
package2certs = new ConcurrentHashMap<>();
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/LayerInstantiationException.java b/jdk/src/java.base/share/classes/java/lang/LayerInstantiationException.java
similarity index 93%
rename from jdk/src/java.base/share/classes/java/lang/reflect/LayerInstantiationException.java
rename to jdk/src/java.base/share/classes/java/lang/LayerInstantiationException.java
index fbd0de0ac85..4c64fe071a8 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/LayerInstantiationException.java
+++ b/jdk/src/java.base/share/classes/java/lang/LayerInstantiationException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, 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,13 +23,12 @@
* questions.
*/
-package java.lang.reflect;
+package java.lang;
/**
- * Thrown when creating a Layer fails.
- *
- * @see Layer
+ * Thrown when creating a {@linkplain ModuleLayer module layer} fails.
*
+ * @see ModuleLayer
* @since 9
* @spec JPMS
*/
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Module.java b/jdk/src/java.base/share/classes/java/lang/Module.java
similarity index 89%
rename from jdk/src/java.base/share/classes/java/lang/reflect/Module.java
rename to jdk/src/java.base/share/classes/java/lang/Module.java
index 23fddfaa557..26337d86beb 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Module.java
+++ b/jdk/src/java.base/share/classes/java/lang/Module.java
@@ -23,7 +23,7 @@
* questions.
*/
-package java.lang.reflect;
+package java.lang;
import java.io.IOException;
import java.io.InputStream;
@@ -35,6 +35,7 @@ import java.lang.module.ModuleDescriptor.Exports;
import java.lang.module.ModuleDescriptor.Opens;
import java.lang.module.ModuleDescriptor.Version;
import java.lang.module.ResolvedModule;
+import java.lang.reflect.AnnotatedElement;
import java.net.URI;
import java.net.URL;
import java.security.AccessController;
@@ -49,12 +50,12 @@ import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
+import java.util.stream.Collectors;
import java.util.stream.Stream;
import jdk.internal.loader.BuiltinClassLoader;
import jdk.internal.loader.BootLoader;
import jdk.internal.misc.JavaLangAccess;
-import jdk.internal.misc.JavaLangReflectModuleAccess;
import jdk.internal.misc.SharedSecrets;
import jdk.internal.module.ServicesCatalog;
import jdk.internal.module.Resources;
@@ -73,7 +74,7 @@ import sun.security.util.SecurityConstants;
*
*
Named modules have a {@link #getName() name} and are constructed by the
* Java Virtual Machine when a graph of modules is defined to the Java virtual
- * machine to create a module {@link Layer Layer}.
+ * machine to create a {@linkplain ModuleLayer module layer}.
*
*
An unnamed module does not have a name. There is an unnamed module for
* each {@link ClassLoader ClassLoader}, obtained by invoking its {@link
@@ -92,13 +93,13 @@ import sun.security.util.SecurityConstants;
*
* @since 9
* @spec JPMS
- * @see java.lang.Class#getModule
+ * @see Class#getModule()
*/
public final class Module implements AnnotatedElement {
// the layer that contains this module, can be null
- private final Layer layer;
+ private final ModuleLayer layer;
// module name and loader, these fields are read by VM
private final String name;
@@ -113,10 +114,10 @@ public final class Module implements AnnotatedElement {
* VM but will not read any other modules, will not have any exports setup
* and will not be registered in the service catalog.
*/
- private Module(Layer layer,
- ClassLoader loader,
- ModuleDescriptor descriptor,
- URI uri)
+ Module(ModuleLayer layer,
+ ClassLoader loader,
+ ModuleDescriptor descriptor,
+ URI uri)
{
this.layer = layer;
this.name = descriptor.name();
@@ -139,7 +140,7 @@ public final class Module implements AnnotatedElement {
*
* @see ClassLoader#getUnnamedModule
*/
- private Module(ClassLoader loader) {
+ Module(ClassLoader loader) {
this.layer = null;
this.name = null;
this.loader = loader;
@@ -217,29 +218,28 @@ public final class Module implements AnnotatedElement {
* Returns the layer that contains this module or {@code null} if this
* module is not in a layer.
*
- * A module {@code Layer} contains named modules and therefore this
- * method always returns {@code null} when invoked on an unnamed module.
+ * A module layer contains named modules and therefore this method always
+ * returns {@code null} when invoked on an unnamed module.
*
- *
Dynamic modules are named
- * modules that are generated at runtime. A dynamic module may or may
- * not be in a module Layer.
+ *
Dynamic modules are
+ * named modules that are generated at runtime. A dynamic module may or may
+ * not be in a module layer.
*
- * @return The layer that contains this module
+ * @return The module layer that contains this module
*
- * @see Proxy
+ * @see java.lang.reflect.Proxy
*/
- public Layer getLayer() {
+ public ModuleLayer getLayer() {
if (isNamed()) {
- Layer layer = this.layer;
+ ModuleLayer layer = this.layer;
if (layer != null)
return layer;
- // special-case java.base as it is created before the boot Layer
+ // special-case java.base as it is created before the boot layer
if (loader == null && name.equals("java.base")) {
- return SharedSecrets.getJavaLangAccess().getBootLayer();
+ return ModuleLayer.boot();
}
}
-
return null;
}
@@ -338,7 +338,7 @@ public final class Module implements AnnotatedElement {
public Module addReads(Module other) {
Objects.requireNonNull(other);
if (this.isNamed()) {
- Module caller = Reflection.getCallerClass().getModule();
+ Module caller = getCallerModule(Reflection.getCallerClass());
if (caller != this) {
throw new IllegalCallerException(caller + " != " + this);
}
@@ -350,12 +350,21 @@ public final class Module implements AnnotatedElement {
/**
* Updates this module to read another module.
*
- * @apiNote This method is for Proxy use and white-box testing.
+ * @apiNote Used by the --add-reads command line option.
*/
void implAddReads(Module other) {
implAddReads(other, true);
}
+ /**
+ * Updates this module to read all unnamed modules.
+ *
+ * @apiNote Used by the --add-reads command line option.
+ */
+ void implAddReadsAllUnnamed() {
+ implAddReads(Module.ALL_UNNAMED_MODULE, true);
+ }
+
/**
* Updates this module to read another module without notifying the VM.
*
@@ -371,6 +380,7 @@ public final class Module implements AnnotatedElement {
* If {@code syncVM} is {@code true} then the VM is notified.
*/
private void implAddReads(Module other, boolean syncVM) {
+ Objects.requireNonNull(other);
if (!canRead(other)) {
// update VM first, just in case it fails
if (syncVM) {
@@ -659,7 +669,7 @@ public final class Module implements AnnotatedElement {
Objects.requireNonNull(other);
if (isNamed()) {
- Module caller = Reflection.getCallerClass().getModule();
+ Module caller = getCallerModule(Reflection.getCallerClass());
if (caller != this) {
throw new IllegalCallerException(caller + " != " + this);
}
@@ -706,8 +716,8 @@ public final class Module implements AnnotatedElement {
Objects.requireNonNull(other);
if (isNamed()) {
- Module caller = Reflection.getCallerClass().getModule();
- if (caller != this && !isOpen(pn, caller))
+ Module caller = getCallerModule(Reflection.getCallerClass());
+ if (caller != this && (caller == null || !isOpen(pn, caller)))
throw new IllegalCallerException(pn + " is not open to " + caller);
implAddExportsOrOpens(pn, other, /*open*/true, /*syncVM*/true);
}
@@ -717,36 +727,80 @@ public final class Module implements AnnotatedElement {
/**
- * Updates the exports so that package {@code pn} is exported to module
- * {@code other} but without notifying the VM.
+ * Updates this module to export a package unconditionally.
*
- * @apiNote This method is for VM white-box testing.
+ * @apiNote This method is for JDK tests only.
*/
- void implAddExportsNoSync(String pn, Module other) {
- if (other == null)
- other = EVERYONE_MODULE;
- implAddExportsOrOpens(pn.replace('/', '.'), other, false, false);
+ void implAddExports(String pn) {
+ implAddExportsOrOpens(pn, Module.EVERYONE_MODULE, false, true);
}
/**
- * Updates the exports so that package {@code pn} is exported to module
- * {@code other}.
+ * Updates this module to export a package to another module.
*
- * @apiNote This method is for white-box testing.
+ * @apiNote Used by Instrumentation::redefineModule and --add-exports
*/
void implAddExports(String pn, Module other) {
implAddExportsOrOpens(pn, other, false, true);
}
/**
- * Updates the module to open package {@code pn} to module {@code other}.
+ * Updates this module to export a package to all unnamed modules.
*
- * @apiNote This method is for white-box tests and jtreg
+ * @apiNote Used by the --add-exports command line option.
+ */
+ void implAddExportsToAllUnnamed(String pn) {
+ implAddExportsOrOpens(pn, Module.ALL_UNNAMED_MODULE, false, true);
+ }
+
+ /**
+ * Updates this export to export a package unconditionally without
+ * notifying the VM.
+ *
+ * @apiNote This method is for VM white-box testing.
+ */
+ void implAddExportsNoSync(String pn) {
+ implAddExportsOrOpens(pn.replace('/', '.'), Module.EVERYONE_MODULE, false, false);
+ }
+
+ /**
+ * Updates a module to export a package to another module without
+ * notifying the VM.
+ *
+ * @apiNote This method is for VM white-box testing.
+ */
+ void implAddExportsNoSync(String pn, Module other) {
+ implAddExportsOrOpens(pn.replace('/', '.'), other, false, false);
+ }
+
+ /**
+ * Updates this module to open a package unconditionally.
+ *
+ * @apiNote This method is for JDK tests only.
+ */
+ void implAddOpens(String pn) {
+ implAddExportsOrOpens(pn, Module.EVERYONE_MODULE, true, true);
+ }
+
+ /**
+ * Updates this module to open a package to another module.
+ *
+ * @apiNote Used by Instrumentation::redefineModule and --add-opens
*/
void implAddOpens(String pn, Module other) {
implAddExportsOrOpens(pn, other, true, true);
}
+ /**
+ * Updates this module to export a package to all unnamed modules.
+ *
+ * @apiNote Used by the --add-opens command line option.
+ */
+ void implAddOpensToAllUnnamed(String pn) {
+ implAddExportsOrOpens(pn, Module.ALL_UNNAMED_MODULE, true, true);
+ }
+
+
/**
* Updates a module to export or open a module to another module.
*
@@ -831,7 +885,7 @@ public final class Module implements AnnotatedElement {
Objects.requireNonNull(service);
if (isNamed() && !descriptor.isAutomatic()) {
- Module caller = Reflection.getCallerClass().getModule();
+ Module caller = getCallerModule(Reflection.getCallerClass());
if (caller != this) {
throw new IllegalCallerException(caller + " != " + this);
}
@@ -899,33 +953,28 @@ public final class Module implements AnnotatedElement {
/**
- * Returns an array of the package names of the packages in this module.
+ * Returns the set of package names for the packages in this module.
*
- *
For named modules, the returned array contains an element for each
+ *
For named modules, the returned set contains an element for each
* package in the module.
*
*
For unnamed modules, this method is the equivalent to invoking the
* {@link ClassLoader#getDefinedPackages() getDefinedPackages} method of
- * this module's class loader and returning the array of package names.
+ * this module's class loader and returning the set of package names.
*
- *
A package name appears at most once in the returned array.
- *
- * @apiNote This method returns an array rather than a {@code Set} for
- * consistency with other {@code java.lang.reflect} types.
- *
- * @return an array of the package names of the packages in this module
+ * @return the set of the package names of the packages in this module
*/
- public String[] getPackages() {
+ public Set getPackages() {
if (isNamed()) {
Set packages = descriptor.packages();
Map extraPackages = this.extraPackages;
if (extraPackages == null) {
- return packages.toArray(new String[0]);
+ return packages;
} else {
return Stream.concat(packages.stream(),
extraPackages.keySet().stream())
- .toArray(String[]::new);
+ .collect(Collectors.toSet());
}
} else {
@@ -936,7 +985,7 @@ public final class Module implements AnnotatedElement {
} else {
packages = SharedSecrets.getJavaLangAccess().packages(loader);
}
- return packages.map(Package::getName).toArray(String[]::new);
+ return packages.map(Package::getName).collect(Collectors.toSet());
}
}
@@ -1013,12 +1062,12 @@ public final class Module implements AnnotatedElement {
*/
static Map defineModules(Configuration cf,
Function clf,
- Layer layer)
+ ModuleLayer layer)
{
Map nameToModule = new HashMap<>();
Map moduleToLoader = new HashMap<>();
- boolean isBootLayer = (Layer.boot() == null);
+ boolean isBootLayer = (ModuleLayer.boot() == null);
Set loaders = new HashSet<>();
// map each module to a class loader
@@ -1074,7 +1123,7 @@ public final class Module implements AnnotatedElement {
assert m2 != null;
} else {
// parent layer
- for (Layer parent: layer.parents()) {
+ for (ModuleLayer parent: layer.parents()) {
m2 = findModule(parent, other);
if (m2 != null)
break;
@@ -1133,7 +1182,8 @@ public final class Module implements AnnotatedElement {
* Find the runtime Module corresponding to the given ResolvedModule
* in the given parent layer (or its parents).
*/
- private static Module findModule(Layer parent, ResolvedModule resolvedModule) {
+ private static Module findModule(ModuleLayer parent,
+ ResolvedModule resolvedModule) {
Configuration cf = resolvedModule.configuration();
String dn = resolvedModule.name();
return parent.layers()
@@ -1156,7 +1206,7 @@ public final class Module implements AnnotatedElement {
private static void initExportsAndOpens(Module m,
Map nameToSource,
Map nameToModule,
- List parents) {
+ List parents) {
// The VM doesn't special case open or automatic modules so need to
// export all packages
ModuleDescriptor descriptor = m.getDescriptor();
@@ -1246,12 +1296,12 @@ public final class Module implements AnnotatedElement {
private static Module findModule(String target,
Map nameToSource,
Map nameToModule,
- List parents) {
+ List parents) {
Module m = nameToSource.get(target);
if (m == null) {
m = nameToModule.get(target);
if (m == null) {
- for (Layer parent : parents) {
+ for (ModuleLayer parent : parents) {
m = parent.findModule(target).orElse(null);
if (m != null) break;
}
@@ -1445,14 +1495,18 @@ public final class Module implements AnnotatedElement {
}
if (isNamed() && Resources.canEncapsulate(name)) {
- Module caller = Reflection.getCallerClass().getModule();
+ Module caller = getCallerModule(Reflection.getCallerClass());
if (caller != this && caller != Object.class.getModule()) {
- // ignore packages added for proxies via addPackage
- Set packages = getDescriptor().packages();
String pn = Resources.toPackageName(name);
- if (packages.contains(pn) && !isOpen(pn, caller)) {
- // resource is in package not open to caller
- return null;
+ if (getPackages().contains(pn)) {
+ if (caller == null && !isOpen(pn)) {
+ // no caller, package not open
+ return null;
+ }
+ if (!isOpen(pn, caller)) {
+ // package not open to caller
+ return null;
+ }
}
}
}
@@ -1497,6 +1551,14 @@ public final class Module implements AnnotatedElement {
}
}
+ /**
+ * Returns the module that a given caller class is a member of. Returns
+ * {@code null} if the caller is {@code null}.
+ */
+ private Module getCallerModule(Class> caller) {
+ return (caller != null) ? caller.getModule() : null;
+ }
+
// -- native methods --
@@ -1521,71 +1583,4 @@ public final class Module implements AnnotatedElement {
// JVM_AddModulePackage
private static native void addPackage0(Module m, String pn);
-
- /**
- * Register shared secret to provide access to package-private methods
- */
- static {
- SharedSecrets.setJavaLangReflectModuleAccess(
- new JavaLangReflectModuleAccess() {
- @Override
- public Module defineUnnamedModule(ClassLoader loader) {
- return new Module(loader);
- }
- @Override
- public Module defineModule(ClassLoader loader,
- ModuleDescriptor descriptor,
- URI uri) {
- return new Module(null, loader, descriptor, uri);
- }
- @Override
- public void addReads(Module m1, Module m2) {
- m1.implAddReads(m2, true);
- }
- @Override
- public void addReadsAllUnnamed(Module m) {
- m.implAddReads(Module.ALL_UNNAMED_MODULE);
- }
- @Override
- public void addExports(Module m, String pn) {
- m.implAddExportsOrOpens(pn, Module.EVERYONE_MODULE, false, true);
- }
- @Override
- public void addExports(Module m, String pn, Module other) {
- m.implAddExportsOrOpens(pn, other, false, true);
- }
- @Override
- public void addExportsToAllUnnamed(Module m, String pn) {
- m.implAddExportsOrOpens(pn, Module.ALL_UNNAMED_MODULE, false, true);
- }
- @Override
- public void addOpens(Module m, String pn) {
- m.implAddExportsOrOpens(pn, Module.EVERYONE_MODULE, true, true);
- }
- @Override
- public void addOpens(Module m, String pn, Module other) {
- m.implAddExportsOrOpens(pn, other, true, true);
- }
- @Override
- public void addOpensToAllUnnamed(Module m, String pn) {
- m.implAddExportsOrOpens(pn, Module.ALL_UNNAMED_MODULE, true, true);
- }
- @Override
- public void addUses(Module m, Class> service) {
- m.implAddUses(service);
- }
- @Override
- public ServicesCatalog getServicesCatalog(Layer layer) {
- return layer.getServicesCatalog();
- }
- @Override
- public Stream layers(Layer layer) {
- return layer.layers();
- }
- @Override
- public Stream layers(ClassLoader loader) {
- return Layer.layers(loader);
- }
- });
- }
}
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Layer.java b/jdk/src/java.base/share/classes/java/lang/ModuleLayer.java
similarity index 88%
rename from jdk/src/java.base/share/classes/java/lang/reflect/Layer.java
rename to jdk/src/java.base/share/classes/java/lang/ModuleLayer.java
index bd0036d7de3..549662ff9c0 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Layer.java
+++ b/jdk/src/java.base/share/classes/java/lang/ModuleLayer.java
@@ -23,7 +23,7 @@
* questions.
*/
-package java.lang.reflect;
+package java.lang;
import java.lang.module.Configuration;
import java.lang.module.ModuleDescriptor;
@@ -47,8 +47,6 @@ import java.util.stream.Stream;
import jdk.internal.loader.ClassLoaderValue;
import jdk.internal.loader.Loader;
import jdk.internal.loader.LoaderPool;
-import jdk.internal.misc.SharedSecrets;
-import jdk.internal.module.Modules;
import jdk.internal.module.ServicesCatalog;
import sun.security.util.SecurityConstants;
@@ -70,15 +68,16 @@ import sun.security.util.SecurityConstants;
*
*
The {@link #defineModulesWithOneLoader defineModulesWithOneLoader} and
* {@link #defineModulesWithManyLoaders defineModulesWithManyLoaders} methods
- * provide convenient ways to create a {@code Layer} where all modules are
+ * provide convenient ways to create a module layer where all modules are
* mapped to a single class loader or where each module is mapped to its own
* class loader. The {@link #defineModules defineModules} method is for more
* advanced cases where modules are mapped to custom class loaders by means of
* a function specified to the method. Each of these methods has an instance
* and static variant. The instance methods create a layer with the receiver
* as the parent layer. The static methods are for more advanced cases where
- * there can be more than one parent layer or where a {@link Layer.Controller
- * Controller} is needed to control modules in the layer.
+ * there can be more than one parent layer or where a {@link
+ * ModuleLayer.Controller Controller} is needed to control modules in the layer
+ *
*
*
A Java virtual machine has at least one non-empty layer, the {@link
* #boot() boot} layer, that is created when the Java virtual machine is
@@ -131,13 +130,13 @@ import sun.security.util.SecurityConstants;
*
@@ -147,27 +146,27 @@ import sun.security.util.SecurityConstants;
* @see Module#getLayer()
*/
-public final class Layer {
+public final class ModuleLayer {
- // the empty Layer
- private static final Layer EMPTY_LAYER
- = new Layer(Configuration.empty(), List.of(), null);
+ // the empty layer
+ private static final ModuleLayer EMPTY_LAYER
+ = new ModuleLayer(Configuration.empty(), List.of(), null);
- // the configuration from which this Layer was created
+ // the configuration from which this ;ayer was created
private final Configuration cf;
// parent layers, empty in the case of the empty layer
- private final List parents;
+ private final List parents;
// maps module name to jlr.Module
private final Map nameToModule;
/**
- * Creates a new Layer from the modules in the given configuration.
+ * Creates a new module layer from the modules in the given configuration.
*/
- private Layer(Configuration cf,
- List parents,
- Function clf)
+ private ModuleLayer(Configuration cf,
+ List parents,
+ Function clf)
{
this.cf = cf;
this.parents = parents; // no need to do defensive copy
@@ -182,9 +181,9 @@ public final class Layer {
}
/**
- * Controls a layer. The static methods defined by {@link Layer} to create
- * module layers return a {@code Controller} that can be used to control
- * modules in the layer.
+ * Controls a module layer. The static methods defined by {@link ModuleLayer}
+ * to create module layers return a {@code Controller} that can be used to
+ * control modules in the layer.
*
*
Unless otherwise specified, passing a {@code null} argument to a
* method in this class causes a {@link NullPointerException
@@ -197,18 +196,18 @@ public final class Layer {
* @spec JPMS
*/
public static final class Controller {
- private final Layer layer;
+ private final ModuleLayer layer;
- Controller(Layer layer) {
+ Controller(ModuleLayer layer) {
this.layer = layer;
}
/**
* Returns the layer that this object controls.
*
- * @return the layer
+ * @return the module layer
*/
- public Layer layer() {
+ public ModuleLayer layer() {
return layer;
}
@@ -235,14 +234,13 @@ public final class Layer {
* @return This controller
*
* @throws IllegalArgumentException
- * If {@code source} is not in the layer
+ * If {@code source} is not in the module layer
*
* @see Module#addReads
*/
public Controller addReads(Module source, Module target) {
ensureInLayer(source);
- Objects.requireNonNull(target);
- Modules.addReads(source, target);
+ source.implAddReads(target);
return this;
}
@@ -261,23 +259,21 @@ public final class Layer {
* @return This controller
*
* @throws IllegalArgumentException
- * If {@code source} is not in the layer or the package is not
- * in the source module
+ * If {@code source} is not in the module layer or the package
+ * is not in the source module
*
* @see Module#addOpens
*/
public Controller addOpens(Module source, String pn, Module target) {
ensureInLayer(source);
- Objects.requireNonNull(pn);
- Objects.requireNonNull(target);
- Modules.addOpens(source, pn, target);
+ source.implAddOpens(pn, target);
return this;
}
}
/**
- * Creates a new layer, with this layer as its parent, by defining the
+ * Creates a new module layer, with this layer as its parent, by defining the
* modules in the given {@code Configuration} to the Java virtual machine.
* This method creates one class loader and defines all modules to that
* class loader. The {@link ClassLoader#getParent() parent} of each class
@@ -288,7 +284,7 @@ public final class Layer {
* parent. In other words, if this layer is {@code thisLayer} then this
* method is equivalent to invoking:
*
*
* @param cf
@@ -312,14 +308,14 @@ public final class Layer {
*
* @see #findLoader
*/
- public Layer defineModulesWithOneLoader(Configuration cf,
- ClassLoader parentLoader) {
+ public ModuleLayer defineModulesWithOneLoader(Configuration cf,
+ ClassLoader parentLoader) {
return defineModulesWithOneLoader(cf, List.of(this), parentLoader).layer();
}
/**
- * Creates a new layer, with this layer as its parent, by defining the
+ * Creates a new module layer, with this layer as its parent, by defining the
* modules in the given {@code Configuration} to the Java virtual machine.
* Each module is defined to its own {@link ClassLoader} created by this
* method. The {@link ClassLoader#getParent() parent} of each class loader
@@ -330,7 +326,7 @@ public final class Layer {
* parent. In other words, if this layer is {@code thisLayer} then this
* method is equivalent to invoking:
*
*
* @param cf
@@ -354,14 +350,14 @@ public final class Layer {
*
* @see #findLoader
*/
- public Layer defineModulesWithManyLoaders(Configuration cf,
- ClassLoader parentLoader) {
+ public ModuleLayer defineModulesWithManyLoaders(Configuration cf,
+ ClassLoader parentLoader) {
return defineModulesWithManyLoaders(cf, List.of(this), parentLoader).layer();
}
/**
- * Creates a new layer, with this layer as its parent, by defining the
+ * Creates a new module layer, with this layer as its parent, by defining the
* modules in the given {@code Configuration} to the Java virtual machine.
* Each module is mapped, by name, to its class loader by means of the
* given function. This method works exactly as specified by the static
@@ -370,7 +366,7 @@ public final class Layer {
* this layer is {@code thisLayer} then this method is equivalent to
* invoking:
*
*
* @param cf
@@ -390,13 +386,13 @@ public final class Layer {
* If {@code RuntimePermission("getClassLoader")} is denied by
* the security manager
*/
- public Layer defineModules(Configuration cf,
- Function clf) {
+ public ModuleLayer defineModules(Configuration cf,
+ Function clf) {
return defineModules(cf, List.of(this), clf).layer();
}
/**
- * Creates a new layer by defining the modules in the given {@code
+ * Creates a new module layer by defining the modules in the given {@code
* Configuration} to the Java virtual machine. This method creates one
* class loader and defines all modules to that class loader.
*
@@ -458,10 +454,10 @@ public final class Layer {
* @see #findLoader
*/
public static Controller defineModulesWithOneLoader(Configuration cf,
- List parentLayers,
+ List parentLayers,
ClassLoader parentLoader)
{
- List parents = new ArrayList<>(parentLayers);
+ List parents = new ArrayList<>(parentLayers);
checkConfiguration(cf, parents);
checkCreateClassLoaderPermission();
@@ -470,7 +466,7 @@ public final class Layer {
try {
Loader loader = new Loader(cf.modules(), parentLoader);
loader.initRemotePackageMap(cf, parents);
- Layer layer = new Layer(cf, parents, mn -> loader);
+ ModuleLayer layer = new ModuleLayer(cf, parents, mn -> loader);
return new Controller(layer);
} catch (IllegalArgumentException | IllegalStateException e) {
throw new LayerInstantiationException(e.getMessage());
@@ -478,7 +474,7 @@ public final class Layer {
}
/**
- * Creates a new layer by defining the modules in the given {@code
+ * Creates a new module layer by defining the modules in the given {@code
* Configuration} to the Java virtual machine. Each module is defined to
* its own {@link ClassLoader} created by this method. The {@link
* ClassLoader#getParent() parent} of each class loader is the given parent
@@ -528,10 +524,10 @@ public final class Layer {
* @see #findLoader
*/
public static Controller defineModulesWithManyLoaders(Configuration cf,
- List parentLayers,
+ List parentLayers,
ClassLoader parentLoader)
{
- List parents = new ArrayList<>(parentLayers);
+ List parents = new ArrayList<>(parentLayers);
checkConfiguration(cf, parents);
checkCreateClassLoaderPermission();
@@ -539,7 +535,7 @@ public final class Layer {
LoaderPool pool = new LoaderPool(cf, parents, parentLoader);
try {
- Layer layer = new Layer(cf, parents, pool::loaderFor);
+ ModuleLayer layer = new ModuleLayer(cf, parents, pool::loaderFor);
return new Controller(layer);
} catch (IllegalArgumentException | IllegalStateException e) {
throw new LayerInstantiationException(e.getMessage());
@@ -547,7 +543,7 @@ public final class Layer {
}
/**
- * Creates a new layer by defining the modules in the given {@code
+ * Creates a new module layer by defining the modules in the given {@code
* Configuration} to the Java virtual machine. The given function maps each
* module in the configuration, by name, to a class loader. Creating the
* layer informs the Java virtual machine about the classes that may be
@@ -562,7 +558,7 @@ public final class Layer {
* ready to load from these modules before there are any attempts to load
* classes or resources.
*
- *
Creating a {@code Layer} can fail for the following reasons:
+ *
Creating a layer can fail for the following reasons:
*
*
*
@@ -589,7 +585,7 @@ public final class Layer {
* or runtime exception then it is propagated to the caller of this method.
*
*
- * @apiNote It is implementation specific as to whether creating a Layer
+ * @apiNote It is implementation specific as to whether creating a layer
* with this method is an atomic operation or not. Consequentially it is
* possible for this method to fail with some modules, but not all, defined
* to the Java virtual machine.
@@ -613,10 +609,10 @@ public final class Layer {
* the security manager
*/
public static Controller defineModules(Configuration cf,
- List parentLayers,
+ List parentLayers,
Function clf)
{
- List parents = new ArrayList<>(parentLayers);
+ List parents = new ArrayList<>(parentLayers);
checkConfiguration(cf, parents);
Objects.requireNonNull(clf);
@@ -628,7 +624,7 @@ public final class Layer {
}
try {
- Layer layer = new Layer(cf, parents, clf);
+ ModuleLayer layer = new ModuleLayer(cf, parents, clf);
return new Controller(layer);
} catch (IllegalArgumentException | IllegalStateException e) {
throw new LayerInstantiationException(e.getMessage());
@@ -641,7 +637,7 @@ public final class Layer {
* the parent layers.
*/
private static void checkConfiguration(Configuration cf,
- List parentLayers)
+ List parentLayers)
{
Objects.requireNonNull(cf);
@@ -650,7 +646,7 @@ public final class Layer {
throw new IllegalArgumentException("wrong number of parents");
int index = 0;
- for (Layer parent : parentLayers) {
+ for (ModuleLayer parent : parentLayers) {
if (parent.configuration() != parentConfigurations.get(index)) {
throw new IllegalArgumentException(
"Parent of configuration != configuration of this Layer");
@@ -727,7 +723,7 @@ public final class Layer {
*
* @return The list of this layer's parents
*/
- public List parents() {
+ public List parents() {
return parents;
}
@@ -739,24 +735,24 @@ public final class Layer {
* @implNote For now, the assumption is that the number of elements will
* be very low and so this method does not use a specialized spliterator.
*/
- Stream layers() {
- List allLayers = this.allLayers;
+ Stream layers() {
+ List allLayers = this.allLayers;
if (allLayers != null)
return allLayers.stream();
allLayers = new ArrayList<>();
- Set visited = new HashSet<>();
- Deque stack = new ArrayDeque<>();
+ Set visited = new HashSet<>();
+ Deque stack = new ArrayDeque<>();
visited.add(this);
stack.push(this);
while (!stack.isEmpty()) {
- Layer layer = stack.pop();
+ ModuleLayer layer = stack.pop();
allLayers.add(layer);
// push in reverse order
for (int i = layer.parents.size() - 1; i >= 0; i--) {
- Layer parent = layer.parents.get(i);
+ ModuleLayer parent = layer.parents.get(i);
if (!visited.contains(parent)) {
visited.add(parent);
stack.push(parent);
@@ -768,7 +764,7 @@ public final class Layer {
return allLayers.stream();
}
- private volatile List allLayers;
+ private volatile List allLayers;
/**
* Returns the set of the modules in this layer.
@@ -856,9 +852,9 @@ public final class Layer {
}
/**
- * Returns a string describing this layer.
+ * Returns a string describing this module layer.
*
- * @return A possibly empty string describing this layer
+ * @return A possibly empty string describing this module layer
*/
@Override
public String toString() {
@@ -873,7 +869,7 @@ public final class Layer {
*
* @return The empty layer
*/
- public static Layer empty() {
+ public static ModuleLayer empty() {
return EMPTY_LAYER;
}
@@ -887,11 +883,10 @@ public final class Layer {
*
* @return The boot layer
*/
- public static Layer boot() {
- return SharedSecrets.getJavaLangAccess().getBootLayer();
+ public static ModuleLayer boot() {
+ return System.bootLayer;
}
-
/**
* Returns the ServicesCatalog for this Layer, creating it if not
* already created.
@@ -922,10 +917,10 @@ public final class Layer {
*/
void bindToLoader(ClassLoader loader) {
// CLV.computeIfAbsent(loader, (cl, clv) -> new CopyOnWriteArrayList<>())
- List list = CLV.get(loader);
+ List list = CLV.get(loader);
if (list == null) {
list = new CopyOnWriteArrayList<>();
- List previous = CLV.putIfAbsent(loader, list);
+ List previous = CLV.putIfAbsent(loader, list);
if (previous != null) list = previous;
}
list.add(this);
@@ -935,8 +930,8 @@ public final class Layer {
* Returns a stream of the layers that have at least one module defined to
* the given class loader.
*/
- static Stream layers(ClassLoader loader) {
- List list = CLV.get(loader);
+ static Stream layers(ClassLoader loader) {
+ List list = CLV.get(loader);
if (list != null) {
return list.stream();
} else {
@@ -945,5 +940,5 @@ public final class Layer {
}
// the list of layers with modules defined to a class loader
- private static final ClassLoaderValue> CLV = new ClassLoaderValue<>();
+ private static final ClassLoaderValue> CLV = new ClassLoaderValue<>();
}
diff --git a/jdk/src/java.base/share/classes/java/lang/NamedPackage.java b/jdk/src/java.base/share/classes/java/lang/NamedPackage.java
index 5d86cc7fd9c..6234b949e65 100644
--- a/jdk/src/java.base/share/classes/java/lang/NamedPackage.java
+++ b/jdk/src/java.base/share/classes/java/lang/NamedPackage.java
@@ -26,7 +26,6 @@ package java.lang;
import java.lang.module.Configuration;
import java.lang.module.ModuleReference;
-import java.lang.reflect.Module;
import java.net.URI;
/**
diff --git a/jdk/src/java.base/share/classes/java/lang/Package.java b/jdk/src/java.base/share/classes/java/lang/Package.java
index 0dcc5e1c12c..25bf4a751fd 100644
--- a/jdk/src/java.base/share/classes/java/lang/Package.java
+++ b/jdk/src/java.base/share/classes/java/lang/Package.java
@@ -27,7 +27,6 @@ package java.lang;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Module;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
diff --git a/jdk/src/java.base/share/classes/java/lang/SecurityManager.java b/jdk/src/java.base/share/classes/java/lang/SecurityManager.java
index 084d4661700..098e8626525 100644
--- a/jdk/src/java.base/share/classes/java/lang/SecurityManager.java
+++ b/jdk/src/java.base/share/classes/java/lang/SecurityManager.java
@@ -29,9 +29,7 @@ import java.lang.RuntimePermission;
import java.lang.module.ModuleDescriptor;
import java.lang.module.ModuleDescriptor.Exports;
import java.lang.module.ModuleDescriptor.Opens;
-import java.lang.reflect.Layer;
import java.lang.reflect.Member;
-import java.lang.reflect.Module;
import java.io.FileDescriptor;
import java.io.File;
import java.io.FilePermission;
@@ -1441,7 +1439,7 @@ class SecurityManager {
static {
// Get the modules in the boot layer
- Stream bootLayerModules = Layer.boot().modules().stream();
+ Stream bootLayerModules = ModuleLayer.boot().modules().stream();
// Filter out the modules loaded by the boot or platform loader
PrivilegedAction> pa = () ->
diff --git a/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java b/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java
index 79b4c7299f6..b96fb363559 100644
--- a/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java
+++ b/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java
@@ -33,8 +33,6 @@ import jdk.internal.module.ModuleReferenceImpl;
import java.lang.module.ModuleDescriptor.Version;
import java.lang.module.ModuleReference;
import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.util.HashSet;
import java.util.Objects;
import java.util.Optional;
@@ -191,7 +189,7 @@ public final class StackTraceElement implements java.io.Serializable {
* if the module name is not available.
* @since 9
* @spec JPMS
- * @see java.lang.reflect.Module#getName()
+ * @see Module#getName()
*/
public String getModuleName() {
return moduleName;
@@ -480,7 +478,7 @@ public final class StackTraceElement implements java.io.Serializable {
if (!VM.isModuleSystemInited())
return true;
- return Layer.boot() == m.getLayer() && HashedModules.contains(m);
+ return ModuleLayer.boot() == m.getLayer() && HashedModules.contains(m);
}
/*
@@ -492,7 +490,7 @@ public final class StackTraceElement implements java.io.Serializable {
static Set hashedModules() {
- Optional resolvedModule = Layer.boot()
+ Optional resolvedModule = ModuleLayer.boot()
.configuration()
.findModule("java.base");
assert resolvedModule.isPresent();
diff --git a/jdk/src/java.base/share/classes/java/lang/System.java b/jdk/src/java.base/share/classes/java/lang/System.java
index 661c0f5a34c..a749255158d 100644
--- a/jdk/src/java.base/share/classes/java/lang/System.java
+++ b/jdk/src/java.base/share/classes/java/lang/System.java
@@ -35,33 +35,32 @@ import java.io.InputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.lang.annotation.Annotation;
+import java.lang.module.ModuleDescriptor;
import java.lang.reflect.Constructor;
import java.lang.reflect.Executable;
-import java.lang.reflect.Layer;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
+import java.net.URI;
import java.net.URL;
import java.security.AccessControlContext;
import java.security.ProtectionDomain;
-import java.util.Properties;
-import java.util.PropertyPermission;
-import java.util.Map;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.nio.channels.Channel;
import java.nio.channels.spi.SelectorProvider;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Properties;
+import java.util.PropertyPermission;
+import java.util.ResourceBundle;
+import java.util.function.Supplier;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Stream;
-import java.util.Objects;
-import java.util.ResourceBundle;
-import java.util.function.Supplier;
-import sun.nio.ch.Interruptible;
+import jdk.internal.module.ModuleBootstrap;
+import jdk.internal.module.ServicesCatalog;
import jdk.internal.reflect.CallerSensitive;
import jdk.internal.reflect.Reflection;
-import sun.security.util.SecurityConstants;
-import sun.reflect.annotation.AnnotationType;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.JavaLangAccess;;
import jdk.internal.misc.SharedSecrets;;
@@ -69,8 +68,9 @@ import jdk.internal.misc.VM;
import jdk.internal.logger.LoggerFinderLoader;
import jdk.internal.logger.LazyLoggers;
import jdk.internal.logger.LocalizedLoggerWrapper;
-
-import jdk.internal.module.ModuleBootstrap;
+import sun.reflect.annotation.AnnotationType;
+import sun.nio.ch.Interruptible;
+import sun.security.util.SecurityConstants;
/**
* The System class contains several useful class fields
@@ -1160,7 +1160,7 @@ public final class System {
* @param msg the string message (or a key in the message catalog, if
* this logger is a {@link
* LoggerFinder#getLocalizedLogger(java.lang.String,
- * java.util.ResourceBundle, java.lang.reflect.Module) localized logger});
+ * java.util.ResourceBundle, java.lang.Module) localized logger});
* can be {@code null}.
*
* @throws NullPointerException if {@code level} is {@code null}.
@@ -1228,7 +1228,7 @@ public final class System {
* @param msg the string message (or a key in the message catalog, if
* this logger is a {@link
* LoggerFinder#getLocalizedLogger(java.lang.String,
- * java.util.ResourceBundle, java.lang.reflect.Module) localized logger});
+ * java.util.ResourceBundle, java.lang.Module) localized logger});
* can be {@code null}.
* @param thrown a {@code Throwable} associated with the log message;
* can be {@code null}.
@@ -1277,7 +1277,7 @@ public final class System {
* java.text.MessageFormat} format, (or a key in the message
* catalog, if this logger is a {@link
* LoggerFinder#getLocalizedLogger(java.lang.String,
- * java.util.ResourceBundle, java.lang.reflect.Module) localized logger});
+ * java.util.ResourceBundle, java.lang.Module) localized logger});
* can be {@code null}.
* @param params an optional list of parameters to the message (may be
* none).
@@ -1482,7 +1482,7 @@ public final class System {
* message localization.
*
* @implSpec By default, this method calls {@link
- * #getLogger(java.lang.String, java.lang.reflect.Module)
+ * #getLogger(java.lang.String, java.lang.Module)
* this.getLogger(name, module)} to obtain a logger, then wraps that
* logger in a {@link Logger} instance where all methods that do not
* take a {@link ResourceBundle} as parameter are redirected to one
@@ -1566,7 +1566,7 @@ public final class System {
* @implSpec
* Instances returned by this method route messages to loggers
* obtained by calling {@link LoggerFinder#getLogger(java.lang.String,
- * java.lang.reflect.Module) LoggerFinder.getLogger(name, module)}, where
+ * java.lang.Module) LoggerFinder.getLogger(name, module)}, where
* {@code module} is the caller's module.
* In cases where {@code System.getLogger} is called from a context where
* there is no caller frame on the stack (e.g when called directly
@@ -1579,7 +1579,7 @@ public final class System {
*
* @apiNote
* This method may defer calling the {@link
- * LoggerFinder#getLogger(java.lang.String, java.lang.reflect.Module)
+ * LoggerFinder#getLogger(java.lang.String, java.lang.Module)
* LoggerFinder.getLogger} method to create an actual logger supplied by
* the logging backend, for instance, to allow loggers to be obtained during
* the system initialization time.
@@ -1612,7 +1612,7 @@ public final class System {
* @implSpec
* The returned logger will perform message localization as specified
* by {@link LoggerFinder#getLocalizedLogger(java.lang.String,
- * java.util.ResourceBundle, java.lang.reflect.Module)
+ * java.util.ResourceBundle, java.lang.Module)
* LoggerFinder.getLocalizedLogger(name, bundle, module)}, where
* {@code module} is the caller's module.
* In cases where {@code System.getLogger} is called from a context where
@@ -1977,7 +1977,7 @@ public final class System {
}
// @see #initPhase2()
- private static Layer bootLayer;
+ static ModuleLayer bootLayer;
/*
* Invoked by VM. Phase 2 module system initialization.
@@ -2100,9 +2100,6 @@ public final class System {
public void invokeFinalize(Object o) throws Throwable {
o.finalize();
}
- public Layer getBootLayer() {
- return bootLayer;
- }
public ConcurrentHashMap, ?> createOrGetClassLoaderValueMap(ClassLoader cl) {
return cl.createOrGetClassLoaderValueMap();
}
@@ -2127,6 +2124,44 @@ public final class System {
public void invalidatePackageAccessCache() {
SecurityManager.invalidatePackageAccessCache();
}
+ public Module defineModule(ClassLoader loader,
+ ModuleDescriptor descriptor,
+ URI uri) {
+ return new Module(null, loader, descriptor, uri);
+ }
+ public Module defineUnnamedModule(ClassLoader loader) {
+ return new Module(loader);
+ }
+ public void addReads(Module m1, Module m2) {
+ m1.implAddReads(m2);
+ }
+ public void addReadsAllUnnamed(Module m) {
+ m.implAddReadsAllUnnamed();
+ }
+ public void addExports(Module m, String pn, Module other) {
+ m.implAddExports(pn, other);
+ }
+ public void addExportsToAllUnnamed(Module m, String pn) {
+ m.implAddExportsToAllUnnamed(pn);
+ }
+ public void addOpens(Module m, String pn, Module other) {
+ m.implAddOpens(pn, other);
+ }
+ public void addOpensToAllUnnamed(Module m, String pn) {
+ m.implAddOpensToAllUnnamed(pn);
+ }
+ public void addUses(Module m, Class> service) {
+ m.implAddUses(service);
+ }
+ public ServicesCatalog getServicesCatalog(ModuleLayer layer) {
+ return layer.getServicesCatalog();
+ }
+ public Stream layers(ModuleLayer layer) {
+ return layer.layers();
+ }
+ public Stream layers(ClassLoader loader) {
+ return ModuleLayer.layers(loader);
+ }
});
}
}
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/WeakPairMap.java b/jdk/src/java.base/share/classes/java/lang/WeakPairMap.java
similarity index 99%
rename from jdk/src/java.base/share/classes/java/lang/reflect/WeakPairMap.java
rename to jdk/src/java.base/share/classes/java/lang/WeakPairMap.java
index 39a623a4704..1e4e12767b3 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/WeakPairMap.java
+++ b/jdk/src/java.base/share/classes/java/lang/WeakPairMap.java
@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-package java.lang.reflect;
+package java.lang;
import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java b/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java
index 97efa4f1066..92ab77cedf4 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java
@@ -33,7 +33,6 @@ import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
index 8f7059ec47e..afd8d9b2819 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
@@ -43,7 +43,6 @@ import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
import java.lang.reflect.ReflectPermission;
import java.nio.ByteOrder;
import java.security.AccessController;
@@ -668,11 +667,11 @@ public class MethodHandles {
* The value is {@code 0x20}, which does not correspond meaningfully to
* any particular {@linkplain java.lang.reflect.Modifier modifier bit}.
* A {@code Lookup} with this lookup mode assumes {@linkplain
- * java.lang.reflect.Module#canRead(java.lang.reflect.Module) readability}.
+ * java.lang.Module#canRead(java.lang.Module) readability}.
* In conjunction with the {@code PUBLIC} modifier bit, a {@code Lookup}
* with this lookup mode can access all public members of public types
* of all modules where the type is in a package that is {@link
- * java.lang.reflect.Module#isExported(String) exported unconditionally}.
+ * java.lang.Module#isExported(String) exported unconditionally}.
* @since 9
* @spec JPMS
* @see #publicLookup()
diff --git a/jdk/src/java.base/share/classes/java/lang/module/Configuration.java b/jdk/src/java.base/share/classes/java/lang/module/Configuration.java
index dfd5fe87b7e..d5fc16c1ef6 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/Configuration.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/Configuration.java
@@ -64,11 +64,11 @@ import java.util.stream.Stream;
* with the receiver as the parent configuration. The static methods are for
* more advanced cases where there can be more than one parent configuration.
*
- *
Each {@link java.lang.reflect.Layer layer} of modules in the Java virtual
+ *
Each {@link java.lang.ModuleLayer layer} of modules in the Java virtual
* machine is created from a configuration. The configuration for the {@link
- * java.lang.reflect.Layer#boot() boot} layer is obtained by invoking {@code
- * Layer.boot().configuration()}. The configuration for the boot layer will
- * often be the parent when creating new configurations.
+ * java.lang.ModuleLayer#boot() boot} layer is obtained by invoking {@code
+ * ModuleLayer.boot().configuration()}. The configuration for the boot layer
+ * will often be the parent when creating new configurations.
*
*
A module descriptor describes a named module and defines methods to
* obtain each of its components. The module descriptor for a named module
* in the Java virtual machine is obtained by invoking the {@link
- * java.lang.reflect.Module Module}'s {@link java.lang.reflect.Module#getDescriptor
+ * java.lang.Module Module}'s {@link java.lang.Module#getDescriptor
* getDescriptor} method. Module descriptors can also be created using the
* {@link ModuleDescriptor.Builder} class or by reading the binary form of a
* module declaration ({@code module-info.class}) using the {@link
@@ -85,7 +85,7 @@ import jdk.internal.module.ModuleInfo;
*
{@code ModuleDescriptor} objects are immutable and safe for use by
* multiple concurrent threads.
*
- * @see java.lang.reflect.Module
+ * @see java.lang.Module
* @since 9
* @spec JPMS
*/
@@ -2110,7 +2110,9 @@ public class ModuleDescriptor
/**
* Sets the module main class. The package for the main class is added
- * to the module if not already added.
+ * to the module if not already added. In other words, this method is
+ * equivalent to first invoking this builder's {@link #packages(Set)
+ * packages} method to add the package name of the main class.
*
* @param mc
* The module main class
@@ -2134,8 +2136,8 @@ public class ModuleDescriptor
throw new IllegalArgumentException(mc + ": unnamed package");
}
}
- mainClass = mc;
packages.add(pn);
+ mainClass = mc;
return this;
}
diff --git a/jdk/src/java.base/share/classes/java/lang/module/ModuleFinder.java b/jdk/src/java.base/share/classes/java/lang/module/ModuleFinder.java
index 97c74f64209..0be9d8d9eff 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/ModuleFinder.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleFinder.java
@@ -228,14 +228,14 @@ public interface ModuleFinder {
* directory is treated as an exploded module rather than a directory of
* modules.
*
- *
The module finder returned by this method supports modules that are
- * packaged as JAR files. A JAR file with a {@code module-info.class} in
- * the top-level directory of the JAR file (or overridden by a versioned
- * entry in a {@link java.util.jar.JarFile#isMultiRelease() multi-release}
- * JAR file) is a modular JAR and is an explicit module.
- * A JAR file that does not have a {@code module-info.class} in the
- * top-level directory is created as an automatic module. The components
- * for the automatic module are derived as follows:
+ *
The module finder returned by this method
+ * supports modules packaged as JAR files. A JAR file with a {@code
+ * module-info.class} in its top-level directory, or in a versioned entry
+ * in a {@linkplain java.util.jar.JarFile#isMultiRelease() multi-release}
+ * JAR file, is a modular JAR file and thus defines an explicit
+ * module. A JAR file that does not have a {@code module-info.class} in its
+ * top-level directory defines an automatic module, as follows:
+ *
*
*
*
@@ -254,16 +254,16 @@ public interface ModuleFinder {
* ModuleDescriptor.Version} and ignored if it cannot be parsed as
* a {@code Version}.
*
- *
For the module name, then any trailing digits and dots
- * are removed, all non-alphanumeric characters ({@code [^A-Za-z0-9]})
- * are replaced with a dot ({@code "."}), all repeating dots are
- * replaced with one dot, and all leading and trailing dots are
- * removed.
+ *
All non-alphanumeric characters ({@code [^A-Za-z0-9]})
+ * in the module name are replaced with a dot ({@code "."}), all
+ * repeating dots are replaced with one dot, and all leading and
+ * trailing dots are removed.
*
*
As an example, a JAR file named {@code foo-bar.jar} will
* derive a module name {@code foo.bar} and no version. A JAR file
- * named {@code foo-1.2.3-SNAPSHOT.jar} will derive a module name
- * {@code foo} and {@code 1.2.3-SNAPSHOT} as the version.
+ * named {@code foo-bar-1.2.3-SNAPSHOT.jar} will derive a module
+ * name {@code foo.bar} and {@code 1.2.3-SNAPSHOT} as the version.
+ *
*
*
As with automatic modules, the contents of a packaged or exploded
* module may need to be scanned in order to determine the packages
- * in the module. If a {@code .class} file (other than {@code
+ * in the module. Whether {@linkplain java.nio.file.Files#isHidden(Path)
+ * hidden files} are ignored or not is implementation specific and therefore
+ * not specified. If a {@code .class} file (other than {@code
* module-info.class}) is found in the top-level directory then it is
* assumed to be a class in the unnamed package and so {@code FindException}
* is thrown.
diff --git a/jdk/src/java.base/share/classes/java/lang/module/Resolver.java b/jdk/src/java.base/share/classes/java/lang/module/Resolver.java
index b585ac63165..6adf93f8317 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/Resolver.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/Resolver.java
@@ -28,7 +28,6 @@ package java.lang.module;
import java.io.PrintStream;
import java.lang.module.ModuleDescriptor.Provides;
import java.lang.module.ModuleDescriptor.Requires.Modifier;
-import java.lang.reflect.Layer;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
@@ -67,6 +66,9 @@ final class Resolver {
// maps module name to module reference
private final Map nameToReference = new HashMap<>();
+ // true if all automatic modules have been found
+ private boolean haveAllAutomaticModules;
+
// module constraints on target platform
private String osName;
private String osArch;
@@ -171,6 +173,21 @@ final class Resolver {
ModuleDescriptor descriptor = q.poll();
assert nameToReference.containsKey(descriptor.name());
+ // if the module is an automatic module then all automatic
+ // modules need to be resolved
+ if (descriptor.isAutomatic() && !haveAllAutomaticModules) {
+ addFoundAutomaticModules().forEach(mref -> {
+ ModuleDescriptor other = mref.descriptor();
+ q.offer(other);
+ if (isTracing()) {
+ trace("Automatic module %s located, required by %s",
+ other.name(), descriptor.name());
+ mref.location().ifPresent(uri -> trace(" (%s)", uri));
+ }
+ });
+ haveAllAutomaticModules = true;
+ }
+
// process dependences
for (ModuleDescriptor.Requires requires : descriptor.requires()) {
@@ -199,10 +216,15 @@ final class Resolver {
if (!nameToReference.containsKey(dn)) {
addFoundModule(mref);
q.offer(mref.descriptor());
- resolved.add(mref.descriptor());
if (isTracing()) {
- trace("Module %s located, required by %s",
+ String prefix;
+ if (mref.descriptor().isAutomatic()) {
+ prefix = "Automatic module";
+ } else {
+ prefix = "Module";
+ }
+ trace(prefix + " %s located, required by %s",
dn, descriptor.name());
mref.location().ifPresent(uri -> trace(" (%s)", uri));
}
@@ -250,7 +272,7 @@ final class Resolver {
// the initial set of modules that may use services
Set initialConsumers;
- if (Layer.boot() == null) {
+ if (ModuleLayer.boot() == null) {
initialConsumers = new HashSet<>();
} else {
initialConsumers = parents.stream()
@@ -301,6 +323,21 @@ final class Resolver {
return this;
}
+ /**
+ * Add all automatic modules that have not already been found to the
+ * nameToReference map.
+ */
+ private Set addFoundAutomaticModules() {
+ Set result = new HashSet<>();
+ findAll().forEach(mref -> {
+ String mn = mref.descriptor().name();
+ if (mref.descriptor().isAutomatic() && !nameToReference.containsKey(mn)) {
+ addFoundModule(mref);
+ result.add(mref);
+ }
+ });
+ return result;
+ }
/**
* Add the module to the nameToReference map. Also check any constraints on
@@ -534,7 +571,7 @@ final class Resolver {
// need "requires transitive" from the modules in parent configurations
// as there may be selected modules that have a dependency on modules in
// the parent configuration.
- if (Layer.boot() == null) {
+ if (ModuleLayer.boot() == null) {
g2 = new HashMap<>(capacity);
} else {
g2 = parents.stream()
diff --git a/jdk/src/java.base/share/classes/java/lang/module/package-info.java b/jdk/src/java.base/share/classes/java/lang/module/package-info.java
index 1d830079cab..b531f13748c 100644
--- a/jdk/src/java.base/share/classes/java/lang/module/package-info.java
+++ b/jdk/src/java.base/share/classes/java/lang/module/package-info.java
@@ -70,7 +70,7 @@
* }
*
*
If module {@code m1} is resolved with the configuration for the {@link
- * java.lang.reflect.Layer#boot() boot} layer as the parent then the resulting
+ * java.lang.ModuleLayer#boot() boot} layer as the parent then the resulting
* configuration contains two modules ({@code m1}, {@code m2}). The edges in
* its readability graph are:
*
{@code
@@ -92,10 +92,10 @@
*
*
{@link java.lang.module.ModuleDescriptor#isAutomatic() Automatic} modules
* receive special treatment during resolution. Each automatic module is resolved
- * so that it reads all other modules in the configuration and all parent
- * configurations. Each automatic module is also resolved as if it
- * "{@code requires transitive}" all other automatic modules in the configuration
- * (and all automatic modules in parent configurations).
+ * as if it "{@code requires transitive}" all observable automatic modules and
+ * all automatic modules in the parent configurations. Each automatic module is
+ * resolved so that it reads all other modules in the resulting configuration and
+ * all modules in parent configurations.
*
*
*
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java b/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java
index b4b4a07c807..c47caad95a5 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java
@@ -227,11 +227,11 @@ import static java.lang.module.ModuleDescriptor.Modifier.SYNTHETIC;
* {@code Proxy.newProxyInstance} method should be used instead.
*
*
- * A dynamic module can read the modules of all of the superinterfaces of a proxy class
- * and the modules of the types referenced by all public method signatures
+ * A dynamic module can read the modules of all of the superinterfaces of a proxy
+ * class and the modules of the types referenced by all public method signatures
* of a proxy class. If a superinterface or a referenced type, say {@code T},
- * is in a non-exported package, the {@linkplain java.lang.reflect.Module module}
- * of {@code T} is updated to export the package of {@code T} to the dynamic module.
+ * is in a non-exported package, the {@linkplain Module module} of {@code T} is
+ * updated to export the package of {@code T} to the dynamic module.
*
*
Methods Duplicated in Multiple Proxy Interfaces
*
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/package-info.java b/jdk/src/java.base/share/classes/java/lang/reflect/package-info.java
index 97800b1ce13..e771f31cea1 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/package-info.java
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, 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,11 +25,10 @@
/**
* Provides classes and interfaces for obtaining reflective information about
- * modules, classes and objects. Reflection allows programmatic access to
- * information about modules and to the fields, methods and constructors of
- * loaded classes, and the use of reflected fields, methods, and constructors
- * to operate on their underlying counterparts, within encapsulation and
- * security restrictions.
+ * classes and objects. Reflection allows programmatic access to information
+ * about the fields, methods and constructors of loaded classes, and the use
+ * of reflected fields, methods, and constructors to operate on their underlying
+ * counterparts, within encapsulation and security restrictions.
*
*
The {@code load} methods locate providers using a class loader or module
- * {@link Layer layer}. When locating providers using a class loader then
+ * {@link ModuleLayer layer}. When locating providers using a class loader then
* providers in both named and unnamed modules may be located. When locating
* providers using a module layer then only providers in named modules in
* the layer (or parent layers) are located.
@@ -168,11 +165,11 @@ import jdk.internal.reflect.Reflection;
*
When locating providers using a class loader then any providers in named
* modules defined to the class loader, or any class loader that is reachable
* via parent delegation, are located. Additionally, providers in module layers
- * other than the {@link Layer#boot() boot} layer, where the module layer
+ * other than the {@link ModuleLayer#boot() boot} layer, where the module layer
* contains modules defined to the class loader, or any class loader reachable
* via parent delegation, are also located. For example, suppose there is a
* module layer where each module is defined to its own class loader (see {@link
- * Layer#defineModulesWithManyLoaders defineModulesWithManyLoaders}). If the
+ * ModuleLayer#defineModulesWithManyLoaders defineModulesWithManyLoaders}). If the
* {@code load} method is invoked to locate providers using any of these class
* loaders for this layer then it will locate all of the providers in that
* layer, irrespective of their defining class loader.
@@ -198,7 +195,7 @@ import jdk.internal.reflect.Reflection;
* will locate providers in modules defined to the class loader, then its
* parent class loader, its parent parent, and so on to the bootstrap class
* loader. If a {@code ClassLoader}, or any class loader in the parent
- * delegation chain, defines modules in a custom module {@link Layer} then
+ * delegation chain, defines modules in a custom module {@link ModuleLayer} then
* all providers in that layer are located, irrespective of their class
* loader. The ordering of modules defined to the same class loader, or the
* ordering of modules in a layer, is not defined.
@@ -216,11 +213,11 @@ import jdk.internal.reflect.Reflection;
* method finds the service configuration files.
*
*
- *
Service loaders created to locate providers in a module {@link Layer}
- * will first locate providers in the layer, before locating providers in
- * parent layers. Traversal of parent layers is depth-first with each layer
- * visited at most once. For example, suppose L0 is the boot layer, L1 and
- * L2 are custom layers with L0 as their parent. Now suppose that L3 is
+ *
Service loaders created to locate providers in a {@linkplain ModuleLayer
+ * module layer} will first locate providers in the layer, before locating
+ * providers in parent layers. Traversal of parent layers is depth-first with
+ * each layer visited at most once. For example, suppose L0 is the boot layer,
+ * L1 and L2 are custom layers with L0 as their parent. Now suppose that L3 is
* created with L1 and L2 as the parents (in that order). Using a service
* loader to locate providers with L3 as the content will locate providers
* in the following order: L3, L1, L0, L2. The ordering of modules in a layer
@@ -352,12 +349,12 @@ public final class ServiceLoader
// The class of the service type
private final String serviceName;
- // The module Layer used to locate providers; null when locating
+ // The module layer used to locate providers; null when locating
// providers using a class loader
- private final Layer layer;
+ private final ModuleLayer layer;
// The class loader used to locate, load, and instantiate providers;
- // null when locating provider using a module Layer
+ // null when locating provider using a module layer
private final ClassLoader loader;
// The access control context taken when the ServiceLoader is created
@@ -376,10 +373,8 @@ public final class ServiceLoader
private int reloadCount;
private static JavaLangAccess LANG_ACCESS;
- private static JavaLangReflectModuleAccess JLRM_ACCESS;
static {
LANG_ACCESS = SharedSecrets.getJavaLangAccess();
- JLRM_ACCESS = SharedSecrets.getJavaLangReflectModuleAccess();
}
/**
@@ -425,13 +420,13 @@ public final class ServiceLoader
/**
* Initializes a new instance of this class for locating service providers
- * in a module Layer.
+ * in a module layer.
*
* @throws ServiceConfigurationError
* If {@code svc} is not accessible to {@code caller} or the caller
* module does not use the service type.
*/
- private ServiceLoader(Class> caller, Layer layer, Class svc) {
+ private ServiceLoader(Class> caller, ModuleLayer layer, Class svc) {
Objects.requireNonNull(caller);
Objects.requireNonNull(layer);
Objects.requireNonNull(svc);
@@ -512,12 +507,15 @@ public final class ServiceLoader
/**
* Checks that the given service type is accessible to types in the given
- * module, and check that the module declare that it uses the service type. ??
+ * module, and check that the module declares that it uses the service type.
*/
private static void checkCaller(Class> caller, Class> svc) {
- Module callerModule = caller.getModule();
+ if (caller == null) {
+ fail(svc, "no caller to check if it declares `uses`");
+ }
// Check access to the service type
+ Module callerModule = caller.getModule();
int mods = svc.getModifiers();
if (!Reflection.verifyMemberAccess(caller, svc, null, mods)) {
fail(svc, "service type not accessible to " + callerModule);
@@ -826,13 +824,13 @@ public final class ServiceLoader
/**
* Implements lazy service provider lookup of service providers that
- * are provided by modules in a module Layer (or parent layers)
+ * are provided by modules in a module layer (or parent layers)
*/
private final class LayerLookupIterator
implements Iterator>
{
- Deque stack = new ArrayDeque<>();
- Set visited = new HashSet<>();
+ Deque stack = new ArrayDeque<>();
+ Set visited = new HashSet<>();
Iterator iterator;
ServiceProvider next; // next provider to load
@@ -841,8 +839,8 @@ public final class ServiceLoader
stack.push(layer);
}
- private Iterator providers(Layer layer) {
- ServicesCatalog catalog = JLRM_ACCESS.getServicesCatalog(layer);
+ private Iterator providers(ModuleLayer layer) {
+ ServicesCatalog catalog = LANG_ACCESS.getServicesCatalog(layer);
return catalog.findServices(serviceName).iterator();
}
@@ -864,10 +862,10 @@ public final class ServiceLoader
if (stack.isEmpty())
return false;
- Layer layer = stack.pop();
- List parents = layer.parents();
+ ModuleLayer layer = stack.pop();
+ List parents = layer.parents();
for (int i = parents.size() - 1; i >= 0; i--) {
- Layer parent = parents.get(i);
+ ModuleLayer parent = parents.get(i);
if (!visited.contains(parent)) {
visited.add(parent);
stack.push(parent);
@@ -915,8 +913,8 @@ public final class ServiceLoader
* Returns iterator to iterate over the implementations of {@code
* service} in the given layer.
*/
- private List providers(Layer layer) {
- ServicesCatalog catalog = JLRM_ACCESS.getServicesCatalog(layer);
+ private List providers(ModuleLayer layer) {
+ ServicesCatalog catalog = LANG_ACCESS.getServicesCatalog(layer);
return catalog.findServices(serviceName);
}
@@ -946,10 +944,10 @@ public final class ServiceLoader
return providers.iterator();
} else {
List allProviders = new ArrayList<>(providers);
- Layer bootLayer = Layer.boot();
- Iterator iterator = JLRM_ACCESS.layers(loader).iterator();
+ ModuleLayer bootLayer = ModuleLayer.boot();
+ Iterator iterator = LANG_ACCESS.layers(loader).iterator();
while (iterator.hasNext()) {
- Layer layer = iterator.next();
+ ModuleLayer layer = iterator.next();
if (layer != bootLayer) {
allProviders.addAll(providers(layer));
}
@@ -1535,7 +1533,7 @@ public final class ServiceLoader
/**
* Creates a new service loader for the given service type that loads
- * service providers from modules in the given {@code Layer} and its
+ * service providers from modules in the given {@code ModuleLayer} and its
* ancestors.
*
* @apiNote Unlike the other load methods defined here, the service type
@@ -1545,7 +1543,7 @@ public final class ServiceLoader
* @param the class of the service type
*
* @param layer
- * The module Layer
+ * The module layer
*
* @param service
* The interface or abstract class representing the service
@@ -1561,7 +1559,7 @@ public final class ServiceLoader
* @spec JPMS
*/
@CallerSensitive
- public static ServiceLoader load(Layer layer, Class service) {
+ public static ServiceLoader load(ModuleLayer layer, Class service) {
return new ServiceLoader<>(Reflection.getCallerClass(), layer, service);
}
diff --git a/jdk/src/java.base/share/classes/java/util/spi/AbstractResourceBundleProvider.java b/jdk/src/java.base/share/classes/java/util/spi/AbstractResourceBundleProvider.java
index b0cba4f4915..4a3ef27e13a 100644
--- a/jdk/src/java.base/share/classes/java/util/spi/AbstractResourceBundleProvider.java
+++ b/jdk/src/java.base/share/classes/java/util/spi/AbstractResourceBundleProvider.java
@@ -31,7 +31,6 @@ import jdk.internal.misc.SharedSecrets;
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
-import java.lang.reflect.Module;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Locale;
diff --git a/jdk/src/java.base/share/classes/javax/crypto/JceSecurityManager.java b/jdk/src/java.base/share/classes/javax/crypto/JceSecurityManager.java
index 60a1c9d3aa2..16b7903cd8e 100644
--- a/jdk/src/java.base/share/classes/javax/crypto/JceSecurityManager.java
+++ b/jdk/src/java.base/share/classes/javax/crypto/JceSecurityManager.java
@@ -25,7 +25,6 @@
package javax.crypto;
-import java.lang.reflect.Module;
import java.security.*;
import java.net.*;
import java.util.*;
diff --git a/jdk/src/java.base/share/classes/jdk/internal/loader/BootLoader.java b/jdk/src/java.base/share/classes/jdk/internal/loader/BootLoader.java
index 72148adb5bd..07b5173e726 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/loader/BootLoader.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/loader/BootLoader.java
@@ -27,8 +27,6 @@ package jdk.internal.loader;
import java.io.IOException;
import java.io.InputStream;
import java.lang.module.ModuleReference;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
@@ -62,8 +60,7 @@ public class BootLoader {
private static final String JAVA_HOME = System.getProperty("java.home");
static {
- UNNAMED_MODULE
- = SharedSecrets.getJavaLangReflectModuleAccess().defineUnnamedModule(null);
+ UNNAMED_MODULE = SharedSecrets.getJavaLangAccess().defineUnnamedModule(null);
setBootLoaderUnnamedModule0(UNNAMED_MODULE);
}
@@ -255,7 +252,7 @@ public class BootLoader {
if (mn != null) {
// named module from runtime image or exploded module
- Optional om = Layer.boot().findModule(mn);
+ Optional om = ModuleLayer.boot().findModule(mn);
if (!om.isPresent())
throw new InternalError(mn + " not in boot layer");
return om.get();
diff --git a/jdk/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java b/jdk/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java
index 64492508dc0..972902651fe 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java
@@ -27,7 +27,6 @@ package jdk.internal.loader;
import java.io.File;
import java.io.IOException;
-import java.lang.reflect.Module;
import java.net.URL;
import java.nio.file.InvalidPathException;
import java.nio.file.Paths;
diff --git a/jdk/src/java.base/share/classes/jdk/internal/loader/Loader.java b/jdk/src/java.base/share/classes/jdk/internal/loader/Loader.java
index ca90e80a1ea..0eb249de0d9 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/loader/Loader.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/loader/Loader.java
@@ -33,7 +33,6 @@ import java.lang.module.ModuleDescriptor;
import java.lang.module.ModuleReader;
import java.lang.module.ModuleReference;
import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
@@ -80,8 +79,8 @@ import jdk.internal.module.Resources;
* loader. This allows automatic modules (for example) to link to types in the
* unnamed module of the parent class loader.
*
- * @see Layer#defineModulesWithOneLoader
- * @see Layer#defineModulesWithManyLoaders
+ * @see ModuleModuleLayer#defineModulesWithOneLoader
+ * @see ModuleModuleLayer#defineModulesWithManyLoaders
*/
public final class Loader extends SecureClassLoader {
@@ -207,10 +206,10 @@ public final class Loader extends SecureClassLoader {
* @param cf the Configuration containing at least modules to be defined to
* this class loader
*
- * @param parentLayers the parent Layers
+ * @param parentModuleLayers the parent ModuleLayers
*/
public Loader initRemotePackageMap(Configuration cf,
- List parentLayers)
+ List parentModuleLayers)
{
for (String name : nameToModule.keySet()) {
ResolvedModule resolvedModule = cf.findModule(name).get();
@@ -236,8 +235,8 @@ public final class Loader extends SecureClassLoader {
} else {
// find the layer for the target module
- Layer layer = parentLayers.stream()
- .map(parent -> findLayer(parent, other.configuration()))
+ ModuleLayer layer = parentModuleLayers.stream()
+ .map(parent -> findModuleLayer(parent, other.configuration()))
.flatMap(Optional::stream)
.findAny()
.orElseThrow(() ->
@@ -286,8 +285,8 @@ public final class Loader extends SecureClassLoader {
* Find the layer corresponding to the given configuration in the tree
* of layers rooted at the given parent.
*/
- private Optional findLayer(Layer parent, Configuration cf) {
- return SharedSecrets.getJavaLangReflectModuleAccess().layers(parent)
+ private Optional findModuleLayer(ModuleLayer parent, Configuration cf) {
+ return SharedSecrets.getJavaLangAccess().layers(parent)
.filter(l -> l.configuration() == cf)
.findAny();
}
diff --git a/jdk/src/java.base/share/classes/jdk/internal/loader/LoaderPool.java b/jdk/src/java.base/share/classes/jdk/internal/loader/LoaderPool.java
index 14b088c14a9..a16f2447947 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/loader/LoaderPool.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/loader/LoaderPool.java
@@ -27,7 +27,6 @@ package jdk.internal.loader;
import java.lang.module.Configuration;
import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -36,7 +35,7 @@ import java.util.stream.Stream;
/**
* A pool of class loaders.
*
- * @see Layer#defineModulesWithManyLoaders
+ * @see ModuleLayer#defineModulesWithManyLoaders
*/
public final class LoaderPool {
@@ -51,7 +50,7 @@ public final class LoaderPool {
* created with the given parent class loader as its parent.
*/
public LoaderPool(Configuration cf,
- List parentLayers,
+ List parentLayers,
ClassLoader parentLoader)
{
Map loaders = new HashMap<>();
diff --git a/jdk/src/java.base/share/classes/jdk/internal/logger/DefaultLoggerFinder.java b/jdk/src/java.base/share/classes/jdk/internal/logger/DefaultLoggerFinder.java
index 18ccc33442e..5ffd8fd7af4 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/logger/DefaultLoggerFinder.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/logger/DefaultLoggerFinder.java
@@ -34,7 +34,6 @@ import java.util.Objects;
import java.lang.System.LoggerFinder;
import java.lang.System.Logger;
import java.lang.ref.ReferenceQueue;
-import java.lang.reflect.Module;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Collection;
diff --git a/jdk/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java b/jdk/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java
index 6c65426ca8e..c266caac684 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java
@@ -31,7 +31,6 @@ import java.util.function.BiFunction;
import java.lang.System.LoggerFinder;
import java.lang.System.Logger;
import java.lang.ref.WeakReference;
-import java.lang.reflect.Module;
import java.util.Objects;
import jdk.internal.misc.VM;
import sun.util.logging.PlatformLogger;
@@ -402,10 +401,10 @@ public final class LazyLoggers {
* @param module The module on behalf of which the logger is created.
* If the module is not loaded from the Boot ClassLoader,
* the LoggerFinder is accessed and the logger returned
- * by {@link LoggerFinder#getLogger(java.lang.String, java.lang.reflect.Module)}
+ * by {@link LoggerFinder#getLogger(java.lang.String, java.lang.Module)}
* is returned to the caller directly.
* Otherwise, the logger returned by
- * {@link #getLazyLogger(java.lang.String, java.lang.reflect.Module)}
+ * {@link #getLazyLogger(java.lang.String, java.lang.Module)}
* is returned to the caller.
*
* @return a (possibly lazy) Logger instance.
diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java
index 5d5e27d3e2b..ece20d827a4 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, 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,10 +27,10 @@ package jdk.internal.misc;
import java.io.IOException;
import java.lang.annotation.Annotation;
+import java.lang.module.ModuleDescriptor;
import java.lang.reflect.Executable;
-import java.lang.reflect.Layer;
import java.lang.reflect.Method;
-import java.lang.reflect.Module;
+import java.net.URI;
import java.net.URL;
import java.security.AccessControlContext;
import java.security.ProtectionDomain;
@@ -38,6 +38,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Stream;
+import jdk.internal.module.ServicesCatalog;
import jdk.internal.reflect.ConstantPool;
import sun.reflect.annotation.AnnotationType;
import sun.nio.ch.Interruptible;
@@ -139,11 +140,6 @@ public interface JavaLangAccess {
*/
void invokeFinalize(Object o) throws Throwable;
- /**
- * Returns the boot Layer
- */
- Layer getBootLayer();
-
/**
* Returns the ConcurrentHashMap used as a storage for ClassLoaderValue(s)
* associated with the given class loader, creating it if it doesn't already exist.
@@ -185,4 +181,74 @@ public interface JavaLangAccess {
* Invalidate package access cache
*/
void invalidatePackageAccessCache();
+
+ /**
+ * Defines a new module to the Java virtual machine. The module
+ * is defined to the given class loader.
+ *
+ * The URI is for information purposes only, it can be {@code null}.
+ */
+ Module defineModule(ClassLoader loader, ModuleDescriptor descriptor, URI uri);
+
+ /**
+ * Defines the unnamed module for the given class loader.
+ */
+ Module defineUnnamedModule(ClassLoader loader);
+
+ /**
+ * Updates the readability so that module m1 reads m2. The new read edge
+ * does not result in a strong reference to m2 (m2 can be GC'ed).
+ *
+ * This method is the same as m1.addReads(m2) but without a permission check.
+ */
+ void addReads(Module m1, Module m2);
+
+ /**
+ * Updates module m to read all unnamed modules.
+ */
+ void addReadsAllUnnamed(Module m);
+
+ /**
+ * Updates module m1 to export a package to module m2. The export does
+ * not result in a strong reference to m2 (m2 can be GC'ed).
+ */
+ void addExports(Module m1, String pkg, Module m2);
+
+ /**
+ * Updates a module m to export a package to all unnamed modules.
+ */
+ void addExportsToAllUnnamed(Module m, String pkg);
+
+ /**
+ * Updates module m1 to open a package to module m2. Opening the
+ * package does not result in a strong reference to m2 (m2 can be GC'ed).
+ */
+ void addOpens(Module m1, String pkg, Module m2);
+
+ /**
+ * Updates a module m to open a package to all unnamed modules.
+ */
+ void addOpensToAllUnnamed(Module m, String pkg);
+
+ /**
+ * Updates a module m to use a service.
+ */
+ void addUses(Module m, Class> service);
+
+ /**
+ * Returns the ServicesCatalog for the given Layer.
+ */
+ ServicesCatalog getServicesCatalog(ModuleLayer layer);
+
+ /**
+ * Returns an ordered stream of layers. The first element is is the
+ * given layer, the remaining elements are its parents, in DFS order.
+ */
+ Stream layers(ModuleLayer layer);
+
+ /**
+ * Returns a stream of the layers that have modules defined to the
+ * given class loader.
+ */
+ Stream layers(ClassLoader loader);
}
diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangReflectModuleAccess.java b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangReflectModuleAccess.java
deleted file mode 100644
index c8a2039d3ce..00000000000
--- a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangReflectModuleAccess.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2014, 2016, 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.
- */
-
-package jdk.internal.misc;
-
-import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
-import java.net.URI;
-import java.util.stream.Stream;
-
-import jdk.internal.module.ServicesCatalog;
-
-/**
- * Provides access to non-public methods in java.lang.reflect.Module
- */
-
-public interface JavaLangReflectModuleAccess {
-
- /**
- * Defines the unnamed module for the given class loader.
- */
- Module defineUnnamedModule(ClassLoader loader);
-
- /**
- * Defines a new module to the Java virtual machine. The module
- * is defined to the given class loader.
- *
- * The URI is for information purposes only, it can be {@code null}.
- */
- Module defineModule(ClassLoader loader, ModuleDescriptor descriptor, URI uri);
-
- /**
- * Updates the readability so that module m1 reads m2. The new read edge
- * does not result in a strong reference to m2 (m2 can be GC'ed).
- *
- * This method is the same as m1.addReads(m2) but without a permission check.
- */
- void addReads(Module m1, Module m2);
-
- /**
- * Updates module m to read all unnamed modules.
- */
- void addReadsAllUnnamed(Module m);
-
- /**
- * Update module m to export a package to all modules.
- */
- void addExports(Module m, String pn);
-
- /**
- * Updates module m1 to export a package to module m2. The export does
- * not result in a strong reference to m2 (m2 can be GC'ed).
- */
- void addExports(Module m1, String pkg, Module m2);
-
- /**
- * Updates a module m to export a package to all unnamed modules.
- */
- void addExportsToAllUnnamed(Module m, String pkg);
-
- /**
- * Updates a module m to open a package to all modules.
- */
- void addOpens(Module m, String pkg);
-
- /**
- * Updates module m1 to open a package to module m2. Opening the
- * package does not result in a strong reference to m2 (m2 can be GC'ed).
- */
- void addOpens(Module m1, String pkg, Module m2);
-
- /**
- * Updates a module m to open a package to all unnamed modules.
- */
- void addOpensToAllUnnamed(Module m, String pkg);
-
- /**
- * Updates a module m to use a service.
- */
- void addUses(Module m, Class> service);
-
- /**
- * Returns the ServicesCatalog for the given Layer.
- */
- ServicesCatalog getServicesCatalog(Layer layer);
-
- /**
- * Returns an ordered stream of layers. The first element is is the
- * given layer, the remaining elements are its parents, in DFS order.
- */
- Stream layers(Layer layer);
-
- /**
- * Returns a stream of the layers that have modules defined to the
- * given class loader.
- */
- Stream layers(ClassLoader loader);
-}
\ No newline at end of file
diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaUtilResourceBundleAccess.java b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaUtilResourceBundleAccess.java
index b137c3d48c4..c0eb99d7dbf 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaUtilResourceBundleAccess.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaUtilResourceBundleAccess.java
@@ -25,7 +25,6 @@
package jdk.internal.misc;
-import java.lang.reflect.Module;
import java.util.Locale;
import java.util.ResourceBundle;
diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java b/jdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java
index 321a4ca1fb2..cd54d422c21 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java
@@ -50,7 +50,6 @@ public class SharedSecrets {
private static JavaUtilJarAccess javaUtilJarAccess;
private static JavaLangAccess javaLangAccess;
private static JavaLangModuleAccess javaLangModuleAccess;
- private static JavaLangReflectModuleAccess javaLangReflectModuleAccess;
private static JavaLangInvokeAccess javaLangInvokeAccess;
private static JavaLangRefAccess javaLangRefAccess;
private static JavaIOAccess javaIOAccess;
@@ -119,16 +118,6 @@ public class SharedSecrets {
return javaLangModuleAccess;
}
- public static void setJavaLangReflectModuleAccess(JavaLangReflectModuleAccess jlrma) {
- javaLangReflectModuleAccess = jlrma;
- }
-
- public static JavaLangReflectModuleAccess getJavaLangReflectModuleAccess() {
- if (javaLangReflectModuleAccess == null)
- unsafe.ensureClassInitialized(java.lang.reflect.Module.class);
- return javaLangReflectModuleAccess;
- }
-
public static void setJavaLangRefAccess(JavaLangRefAccess jlra) {
javaLangRefAccess = jlra;
}
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/IllegalAccessLogger.java b/jdk/src/java.base/share/classes/jdk/internal/module/IllegalAccessLogger.java
index a502cd0c762..3914ce923fc 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/IllegalAccessLogger.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/IllegalAccessLogger.java
@@ -27,7 +27,6 @@ package jdk.internal.module;
import java.io.PrintStream;
import java.lang.invoke.MethodHandles;
-import java.lang.reflect.Module;
import java.net.URL;
import java.security.AccessController;
import java.security.CodeSource;
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java
index 98f5cf0db2e..061b2294158 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java
@@ -32,9 +32,6 @@ import java.lang.module.ModuleDescriptor;
import java.lang.module.ModuleFinder;
import java.lang.module.ModuleReference;
import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
-import java.lang.reflect.LayerInstantiationException;
-import java.lang.reflect.Module;
import java.net.URI;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -61,7 +58,7 @@ import jdk.internal.perf.PerfCounter;
* resolving a set of module names specified via the launcher (or equivalent)
* -m and --add-modules options. The modules are located on a module path that
* is constructed from the upgrade module path, system modules, and application
- * module path. The Configuration is instantiated as the boot Layer with each
+ * module path. The Configuration is instantiated as the boot layer with each
* module in the the configuration defined to one of the built-in class loaders.
*/
@@ -106,11 +103,11 @@ public final class ModuleBootstrap {
}
/**
- * Initialize the module system, returning the boot Layer.
+ * Initialize the module system, returning the boot layer.
*
* @see java.lang.System#initPhase2()
*/
- public static Layer boot() {
+ public static ModuleLayer boot() {
long t0 = System.nanoTime();
@@ -237,7 +234,6 @@ public final class ModuleBootstrap {
ModuleFinder f = finder; // observable modules
systemModules.findAll()
.stream()
- .filter(mref -> !ModuleResolution.doNotResolveByDefault(mref))
.map(ModuleReference::descriptor)
.map(ModuleDescriptor::name)
.filter(mn -> f.find(mn).isPresent()) // observable
@@ -321,8 +317,7 @@ public final class ModuleBootstrap {
if (SystemModules.hasSplitPackages() || needPostResolutionChecks) {
Map packageToModule = new HashMap<>();
for (ResolvedModule resolvedModule : cf.modules()) {
- ModuleDescriptor descriptor =
- resolvedModule.reference().descriptor();
+ ModuleDescriptor descriptor = resolvedModule.reference().descriptor();
String name = descriptor.name();
for (String p : descriptor.packages()) {
String other = packageToModule.putIfAbsent(p, name);
@@ -338,7 +333,7 @@ public final class ModuleBootstrap {
long t4 = System.nanoTime();
// define modules to VM/runtime
- Layer bootLayer = Layer.empty().defineModules(cf, clf);
+ ModuleLayer bootLayer = ModuleLayer.empty().defineModules(cf, clf);
PerfCounters.layerCreateTime.addElapsedTimeFrom(t4);
@@ -476,7 +471,7 @@ public final class ModuleBootstrap {
* Process the --add-reads options to add any additional read edges that
* are specified on the command-line.
*/
- private static void addExtraReads(Layer bootLayer) {
+ private static void addExtraReads(ModuleLayer bootLayer) {
// decode the command line options
Map> map = decode("jdk.module.addreads.");
@@ -514,7 +509,7 @@ public final class ModuleBootstrap {
* Process the --add-exports and --add-opens options to export/open
* additional packages specified on the command-line.
*/
- private static void addExtraExportsAndOpens(Layer bootLayer) {
+ private static void addExtraExportsAndOpens(ModuleLayer bootLayer) {
// --add-exports
String prefix = "jdk.module.addexports.";
Map> extraExports = decode(prefix);
@@ -548,7 +543,7 @@ public final class ModuleBootstrap {
}
}
- private static void addExtraExportsOrOpens(Layer bootLayer,
+ private static void addExtraExportsOrOpens(ModuleLayer bootLayer,
Map> map,
boolean opens)
{
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java
index 5321d2a36d3..3f5827bfc54 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModulePatcher.java
@@ -135,8 +135,9 @@ public final class ModulePatcher {
Path top = file;
Files.find(top, Integer.MAX_VALUE,
((path, attrs) -> attrs.isRegularFile()))
- .filter(path -> !isAutomatic
+ .filter(path -> (!isAutomatic
|| path.toString().endsWith(".class"))
+ && !isHidden(path))
.map(path -> toPackageName(top, path))
.filter(Checks::isPackageName)
.forEach(packages::add);
@@ -177,11 +178,13 @@ public final class ModulePatcher {
ModuleTarget target = null;
ModuleHashes recordedHashes = null;
+ ModuleHashes.HashSupplier hasher = null;
ModuleResolution mres = null;
if (mref instanceof ModuleReferenceImpl) {
ModuleReferenceImpl impl = (ModuleReferenceImpl)mref;
target = impl.moduleTarget();
recordedHashes = impl.recordedHashes();
+ hasher = impl.hasher();
mres = impl.moduleResolution();
}
@@ -191,7 +194,7 @@ public final class ModulePatcher {
this,
target,
recordedHashes,
- null,
+ hasher,
mres);
}
@@ -556,7 +559,7 @@ public final class ModulePatcher {
/**
- * Derives a package name from a file path to a .class file.
+ * Derives a package name from the file path of an entry in an exploded patch
*/
private static String toPackageName(Path top, Path file) {
Path entry = top.relativize(file);
@@ -568,6 +571,17 @@ public final class ModulePatcher {
}
}
+ /**
+ * Returns true if the given file exists and is a hidden file
+ */
+ private boolean isHidden(Path file) {
+ try {
+ return Files.isHidden(file);
+ } catch (IOException ioe) {
+ return false;
+ }
+ }
+
/**
* Derives a package name from the name of an entry in a JAR file.
*/
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ModulePath.java b/jdk/src/java.base/share/classes/jdk/internal/module/ModulePath.java
index 89e81d178f7..75a76b0858f 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ModulePath.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ModulePath.java
@@ -547,7 +547,6 @@ public class ModulePath implements ModuleFinder {
*/
private static class Patterns {
static final Pattern DASH_VERSION = Pattern.compile("-(\\d+(\\.|$))");
- static final Pattern TRAILING_VERSION = Pattern.compile("(\\.|\\d)*$");
static final Pattern NON_ALPHANUM = Pattern.compile("[^A-Za-z0-9]");
static final Pattern REPEATING_DOTS = Pattern.compile("(\\.)(\\1)+");
static final Pattern LEADING_DOTS = Pattern.compile("^\\.");
@@ -558,9 +557,6 @@ public class ModulePath implements ModuleFinder {
* Clean up candidate module name derived from a JAR file name.
*/
private static String cleanModuleName(String mn) {
- // drop trailing version from name
- mn = Patterns.TRAILING_VERSION.matcher(mn).replaceAll("");
-
// replace non-alphanumeric
mn = Patterns.NON_ALPHANUM.matcher(mn).replaceAll(".");
@@ -630,7 +626,7 @@ public class ModulePath implements ModuleFinder {
private Set explodedPackages(Path dir) {
try {
return Files.find(dir, Integer.MAX_VALUE,
- ((path, attrs) -> attrs.isRegularFile()))
+ ((path, attrs) -> attrs.isRegularFile() && !isHidden(path)))
.map(path -> dir.relativize(path))
.map(this::toPackageName)
.flatMap(Optional::stream)
@@ -726,6 +722,17 @@ public class ModulePath implements ModuleFinder {
}
}
+ /**
+ * Returns true if the given file exists and is a hidden file
+ */
+ private boolean isHidden(Path file) {
+ try {
+ return Files.isHidden(file);
+ } catch (IOException ioe) {
+ return false;
+ }
+ }
+
private static final PerfCounter scanTime
= PerfCounter.newPerfCounter("jdk.module.finder.modulepath.scanTime");
private static final PerfCounter moduleCount
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/Modules.java b/jdk/src/java.base/share/classes/jdk/internal/module/Modules.java
index 696aa64b3a5..62288625b76 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/Modules.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/Modules.java
@@ -26,15 +26,13 @@
package jdk.internal.module;
import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.net.URI;
import java.security.AccessController;
import java.security.PrivilegedAction;
import jdk.internal.loader.BootLoader;
import jdk.internal.loader.ClassLoaders;
-import jdk.internal.misc.JavaLangReflectModuleAccess;
+import jdk.internal.misc.JavaLangAccess;
import jdk.internal.misc.SharedSecrets;
/**
@@ -51,8 +49,7 @@ import jdk.internal.misc.SharedSecrets;
public class Modules {
private Modules() { }
- private static final JavaLangReflectModuleAccess JLRMA
- = SharedSecrets.getJavaLangReflectModuleAccess();
+ private static final JavaLangAccess JLA = SharedSecrets.getJavaLangAccess();
/**
* Creates a new Module. The module has the given ModuleDescriptor and
@@ -67,7 +64,7 @@ public class Modules {
ModuleDescriptor descriptor,
URI uri)
{
- return JLRMA.defineModule(loader, descriptor, uri);
+ return JLA.defineModule(loader, descriptor, uri);
}
/**
@@ -75,23 +72,14 @@ public class Modules {
* Same as m1.addReads(m2) but without a caller check.
*/
public static void addReads(Module m1, Module m2) {
- JLRMA.addReads(m1, m2);
+ JLA.addReads(m1, m2);
}
/**
* Update module m to read all unnamed modules.
*/
public static void addReadsAllUnnamed(Module m) {
- JLRMA.addReadsAllUnnamed(m);
- }
-
- /**
- * Update module m to export a package to all modules.
- *
- * This method is for intended for use by tests only.
- */
- public static void addExports(Module m, String pn) {
- JLRMA.addExports(m, pn);
+ JLA.addReadsAllUnnamed(m);
}
/**
@@ -99,23 +87,14 @@ public class Modules {
* Same as m1.addExports(pn, m2) but without a caller check
*/
public static void addExports(Module m1, String pn, Module m2) {
- JLRMA.addExports(m1, pn, m2);
+ JLA.addExports(m1, pn, m2);
}
/**
* Updates module m to export a package to all unnamed modules.
*/
public static void addExportsToAllUnnamed(Module m, String pn) {
- JLRMA.addExportsToAllUnnamed(m, pn);
- }
-
- /**
- * Update module m to open a package to all modules.
- *
- * This method is for intended for use by tests only.
- */
- public static void addOpens(Module m, String pn) {
- JLRMA.addOpens(m, pn);
+ JLA.addExportsToAllUnnamed(m, pn);
}
/**
@@ -123,14 +102,14 @@ public class Modules {
* Same as m1.addOpens(pn, m2) but without a caller check.
*/
public static void addOpens(Module m1, String pn, Module m2) {
- JLRMA.addOpens(m1, pn, m2);
+ JLA.addOpens(m1, pn, m2);
}
/**
* Updates module m to open a package to all unnamed modules.
*/
public static void addOpensToAllUnnamed(Module m, String pn) {
- JLRMA.addOpensToAllUnnamed(m, pn);
+ JLA.addOpensToAllUnnamed(m, pn);
}
/**
@@ -138,16 +117,16 @@ public class Modules {
* Same as m2.addUses(service) but without a caller check.
*/
public static void addUses(Module m, Class> service) {
- JLRMA.addUses(m, service);
+ JLA.addUses(m, service);
}
/**
* Updates module m to provide a service
*/
public static void addProvides(Module m, Class> service, Class> impl) {
- Layer layer = m.getLayer();
+ ModuleLayer layer = m.getLayer();
- if (layer == null || layer == Layer.boot()) {
+ if (layer == null || layer == ModuleLayer.boot()) {
// update ClassLoader catalog
PrivilegedAction pa = m::getClassLoader;
ClassLoader loader = AccessController.doPrivileged(pa);
@@ -162,9 +141,7 @@ public class Modules {
if (layer != null) {
// update Layer catalog
- SharedSecrets.getJavaLangReflectModuleAccess()
- .getServicesCatalog(layer)
- .addProvider(m, service, impl);
+ JLA.getServicesCatalog(layer).addProvider(m, service, impl);
}
}
diff --git a/jdk/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java b/jdk/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java
index d4425aadbb8..f0d7126adc8 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java
@@ -25,7 +25,6 @@
package jdk.internal.module;
-import java.lang.reflect.Module;
import java.lang.module.ModuleDescriptor;
import java.lang.module.ModuleDescriptor.Provides;
import java.util.ArrayList;
diff --git a/jdk/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java b/jdk/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java
index c3633ff8aab..d0e2a98995a 100644
--- a/jdk/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java
+++ b/jdk/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java
@@ -27,7 +27,6 @@ package sun.invoke.util;
import java.lang.reflect.Modifier;
import static java.lang.reflect.Modifier.*;
-import java.lang.reflect.Module;
import java.util.Objects;
import jdk.internal.reflect.Reflection;
diff --git a/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java b/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java
index c86075a260b..d6cc3661d00 100644
--- a/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java
+++ b/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java
@@ -50,10 +50,8 @@ import java.lang.module.ModuleDescriptor.Requires;
import java.lang.module.ModuleDescriptor.Exports;
import java.lang.module.ModuleDescriptor.Opens;
import java.lang.module.ModuleDescriptor.Provides;
-import java.lang.reflect.Layer;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URI;
@@ -467,7 +465,7 @@ public final class LauncherHelper {
String mn = s[0];
String pn = s[1];
- Layer.boot().findModule(mn).ifPresent(m -> {
+ ModuleLayer.boot().findModule(mn).ifPresent(m -> {
if (m.getDescriptor().packages().contains(pn)) {
if (open) {
Modules.addOpensToAllUnnamed(m, pn);
@@ -564,7 +562,7 @@ public final class LauncherHelper {
}
// main module is in the boot layer
- Layer layer = Layer.boot();
+ ModuleLayer layer = ModuleLayer.boot();
Optional om = layer.findModule(mainModule);
if (!om.isPresent()) {
// should not happen
@@ -854,7 +852,7 @@ public final class LauncherHelper {
private static void setFXLaunchParameters(String what, int mode) {
// find the module with the FX launcher
- Optional om = Layer.boot().findModule(JAVAFX_GRAPHICS_MODULE_NAME);
+ Optional om = ModuleLayer.boot().findModule(JAVAFX_GRAPHICS_MODULE_NAME);
if (!om.isPresent()) {
abort(null, "java.launcher.cls.error5");
}
@@ -938,8 +936,7 @@ public final class LauncherHelper {
* Called by the launcher to list the observable modules.
* If called without any sub-options then the output is a simple list of
* the modules. If called with sub-options then the sub-options are the
- * names of the modules to list (-listmods:java.base,java.desktop for
- * example).
+ * names of the modules to list (e.g. --list-modules java.base,java.desktop)
*/
static void listModules(boolean printToStderr, String optionFlag)
throws IOException, ClassNotFoundException
@@ -947,89 +944,97 @@ public final class LauncherHelper {
initOutput(printToStderr);
ModuleFinder finder = jdk.internal.module.ModuleBootstrap.finder();
-
int colon = optionFlag.indexOf('=');
if (colon == -1) {
finder.findAll().stream()
- .sorted(Comparator.comparing(ModuleReference::descriptor))
- .forEach(md -> {
- ostream.println(midAndLocation(md.descriptor(),
- md.location()));
- });
+ .sorted(Comparator.comparing(ModuleReference::descriptor))
+ .forEach(mref -> describeModule(finder, mref, false));
} else {
String[] names = optionFlag.substring(colon+1).split(",");
for (String name: names) {
ModuleReference mref = finder.find(name).orElse(null);
if (mref == null) {
- System.err.format("%s not observable!%n", name);
+ System.err.format("%s not found%n", name);
continue;
}
-
- ModuleDescriptor md = mref.descriptor();
- if (md.isOpen())
- ostream.print("open ");
- if (md.isAutomatic())
- ostream.print("automatic ");
- if (md.modifiers().contains(ModuleDescriptor.Modifier.SYNTHETIC))
- ostream.print("synthetic ");
- if (md.modifiers().contains(ModuleDescriptor.Modifier.MANDATED))
- ostream.print("mandated ");
- ostream.println("module " + midAndLocation(md, mref.location()));
-
- // unqualified exports (sorted by package)
- Set exports = new TreeSet<>(Comparator.comparing(Exports::source));
- md.exports().stream().filter(e -> !e.isQualified()).forEach(exports::add);
- for (Exports e : exports) {
- String modsAndSource = Stream.concat(toStringStream(e.modifiers()),
- Stream.of(e.source()))
- .collect(Collectors.joining(" "));
- ostream.format(" exports %s%n", modsAndSource);
- }
-
- for (Requires d : md.requires()) {
- ostream.format(" requires %s%n", d);
- }
- for (String s : md.uses()) {
- ostream.format(" uses %s%n", s);
- }
-
- for (Provides ps : md.provides()) {
- ostream.format(" provides %s with %s%n", ps.service(),
- ps.providers().stream().collect(Collectors.joining(", ")));
- }
-
- // qualified exports
- for (Exports e : md.exports()) {
- if (e.isQualified()) {
- String modsAndSource = Stream.concat(toStringStream(e.modifiers()),
- Stream.of(e.source()))
- .collect(Collectors.joining(" "));
- ostream.format(" exports %s", modsAndSource);
- formatCommaList(ostream, " to", e.targets());
- }
- }
-
- // open packages
- for (Opens obj: md.opens()) {
- String modsAndSource = Stream.concat(toStringStream(obj.modifiers()),
- Stream.of(obj.source()))
- .collect(Collectors.joining(" "));
- ostream.format(" opens %s", modsAndSource);
- if (obj.isQualified())
- formatCommaList(ostream, " to", obj.targets());
- else
- ostream.println();
- }
-
- // non-exported/non-open packages
- Set concealed = new TreeSet<>(md.packages());
- md.exports().stream().map(Exports::source).forEach(concealed::remove);
- md.opens().stream().map(Opens::source).forEach(concealed::remove);
- concealed.forEach(p -> ostream.format(" contains %s%n", p));
+ describeModule(finder, mref, true);
}
}
}
+ /**
+ * Describes the given module.
+ */
+ static void describeModule(ModuleFinder finder,
+ ModuleReference mref,
+ boolean verbose)
+ {
+ ModuleDescriptor md = mref.descriptor();
+ ostream.print("module " + midAndLocation(md, mref.location()));
+ if (md.isAutomatic())
+ ostream.print(" automatic");
+ ostream.println();
+
+ if (!verbose)
+ return;
+
+ // unqualified exports (sorted by package)
+ Set exports = new TreeSet<>(Comparator.comparing(Exports::source));
+ md.exports().stream().filter(e -> !e.isQualified()).forEach(exports::add);
+ for (Exports e : exports) {
+ String modsAndSource = Stream.concat(toStringStream(e.modifiers()),
+ Stream.of(e.source()))
+ .collect(Collectors.joining(" "));
+ ostream.format(" exports %s%n", modsAndSource);
+ }
+
+ for (Requires d : md.requires()) {
+ ostream.format(" requires %s", d);
+ String suffix = finder.find(d.name())
+ .map(ModuleReference::descriptor)
+ .map(any -> any.isAutomatic() ? " automatic" : "")
+ .orElse(" not found");
+ ostream.println(suffix);
+ }
+ for (String s : md.uses()) {
+ ostream.format(" uses %s%n", s);
+ }
+
+ for (Provides ps : md.provides()) {
+ ostream.format(" provides %s with %s%n", ps.service(),
+ ps.providers().stream().collect(Collectors.joining(", ")));
+ }
+
+ // qualified exports
+ for (Exports e : md.exports()) {
+ if (e.isQualified()) {
+ String modsAndSource = Stream.concat(toStringStream(e.modifiers()),
+ Stream.of(e.source()))
+ .collect(Collectors.joining(" "));
+ ostream.format(" exports %s", modsAndSource);
+ formatCommaList(ostream, " to", e.targets());
+ }
+ }
+
+ // open packages
+ for (Opens obj: md.opens()) {
+ String modsAndSource = Stream.concat(toStringStream(obj.modifiers()),
+ Stream.of(obj.source()))
+ .collect(Collectors.joining(" "));
+ ostream.format(" opens %s", modsAndSource);
+ if (obj.isQualified())
+ formatCommaList(ostream, " to", obj.targets());
+ else
+ ostream.println();
+ }
+
+ // non-exported/non-open packages
+ Set concealed = new TreeSet<>(md.packages());
+ md.exports().stream().map(Exports::source).forEach(concealed::remove);
+ md.opens().stream().map(Opens::source).forEach(concealed::remove);
+ concealed.forEach(p -> ostream.format(" contains %s%n", p));
+ }
+
static String toString(Set s) {
return toStringStream(s).collect(Collectors.joining(" "));
}
diff --git a/jdk/src/java.base/share/classes/sun/reflect/misc/MethodUtil.java b/jdk/src/java.base/share/classes/sun/reflect/misc/MethodUtil.java
index d3d34da4967..8cb5ca08fcb 100644
--- a/jdk/src/java.base/share/classes/sun/reflect/misc/MethodUtil.java
+++ b/jdk/src/java.base/share/classes/sun/reflect/misc/MethodUtil.java
@@ -25,7 +25,6 @@
package sun.reflect.misc;
-import java.lang.reflect.Module;
import java.io.EOFException;
import java.security.AllPermission;
import java.security.AccessController;
diff --git a/jdk/src/java.base/share/native/libjava/Module.c b/jdk/src/java.base/share/native/libjava/Module.c
index 083671da206..f396b8dfc49 100644
--- a/jdk/src/java.base/share/native/libjava/Module.c
+++ b/jdk/src/java.base/share/native/libjava/Module.c
@@ -29,12 +29,12 @@
#include "jni_util.h"
#include "jvm.h"
-#include "java_lang_reflect_Module.h"
+#include "java_lang_Module.h"
/*
* Gets the UTF-8 chars for the string and translates '.' to '/'. Does no
* further validation, assumption being that both calling code in
- * java.lang.reflect.Module and VM will do deeper validation.
+ * java.lang.Module and VM will do deeper validation.
*/
static char*
GetInternalPackageName(JNIEnv *env, jstring pkg, char* buf, jsize buf_size)
@@ -68,7 +68,7 @@ GetInternalPackageName(JNIEnv *env, jstring pkg, char* buf, jsize buf_size)
}
JNIEXPORT void JNICALL
-Java_java_lang_reflect_Module_defineModule0(JNIEnv *env, jclass cls, jobject module,
+Java_java_lang_Module_defineModule0(JNIEnv *env, jclass cls, jobject module,
jboolean is_open, jstring version,
jstring location, jobjectArray packages)
{
@@ -109,14 +109,14 @@ Java_java_lang_reflect_Module_defineModule0(JNIEnv *env, jclass cls, jobject mod
}
JNIEXPORT void JNICALL
-Java_java_lang_reflect_Module_addReads0(JNIEnv *env, jclass cls, jobject from, jobject to)
+Java_java_lang_Module_addReads0(JNIEnv *env, jclass cls, jobject from, jobject to)
{
JVM_AddReadsModule(env, from, to);
}
JNIEXPORT void JNICALL
-Java_java_lang_reflect_Module_addExports0(JNIEnv *env, jclass cls, jobject from,
- jstring pkg, jobject to)
+Java_java_lang_Module_addExports0(JNIEnv *env, jclass cls, jobject from,
+ jstring pkg, jobject to)
{
char buf[128];
char* pkg_name;
@@ -136,8 +136,8 @@ Java_java_lang_reflect_Module_addExports0(JNIEnv *env, jclass cls, jobject from,
}
JNIEXPORT void JNICALL
-Java_java_lang_reflect_Module_addExportsToAll0(JNIEnv *env, jclass cls, jobject from,
- jstring pkg)
+Java_java_lang_Module_addExportsToAll0(JNIEnv *env, jclass cls, jobject from,
+ jstring pkg)
{
char buf[128];
char* pkg_name;
@@ -157,8 +157,8 @@ Java_java_lang_reflect_Module_addExportsToAll0(JNIEnv *env, jclass cls, jobject
}
JNIEXPORT void JNICALL
-Java_java_lang_reflect_Module_addExportsToAllUnnamed0(JNIEnv *env, jclass cls,
- jobject from, jstring pkg)
+Java_java_lang_Module_addExportsToAllUnnamed0(JNIEnv *env, jclass cls,
+ jobject from, jstring pkg)
{
char buf[128];
char* pkg_name;
@@ -178,7 +178,7 @@ Java_java_lang_reflect_Module_addExportsToAllUnnamed0(JNIEnv *env, jclass cls,
}
JNIEXPORT void JNICALL
-Java_java_lang_reflect_Module_addPackage0(JNIEnv *env, jclass cls, jobject m, jstring pkg)
+Java_java_lang_Module_addPackage0(JNIEnv *env, jclass cls, jobject m, jstring pkg)
{
char buf[128];
char* pkg_name;
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadata.java b/jdk/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadata.java
index c9ac7374a00..08f31278c28 100644
--- a/jdk/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadata.java
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadata.java
@@ -28,7 +28,6 @@ package javax.imageio.metadata;
import org.w3c.dom.Node;
import java.lang.reflect.Method;
-import java.lang.reflect.Module;
import java.security.AccessController;
import java.security.PrivilegedAction;
diff --git a/jdk/src/java.desktop/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java b/jdk/src/java.desktop/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java
index e5961b90e4a..dc2f2322100 100644
--- a/jdk/src/java.desktop/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java
+++ b/jdk/src/java.desktop/share/classes/javax/imageio/spi/ImageReaderWriterSpi.java
@@ -28,7 +28,6 @@ package javax.imageio.spi;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
-import java.lang.reflect.Module;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Arrays;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/PlainView.java b/jdk/src/java.desktop/share/classes/javax/swing/text/PlainView.java
index 4430b4e1c89..d3a0a35b932 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/PlainView.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/PlainView.java
@@ -31,7 +31,6 @@ import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Objects;
import javax.swing.event.*;
-import java.lang.reflect.Module;
import java.lang.ref.SoftReference;
import java.util.HashMap;
diff --git a/jdk/src/java.instrument/share/classes/java/lang/instrument/ClassFileTransformer.java b/jdk/src/java.instrument/share/classes/java/lang/instrument/ClassFileTransformer.java
index e0e0309468e..896f30904de 100644
--- a/jdk/src/java.instrument/share/classes/java/lang/instrument/ClassFileTransformer.java
+++ b/jdk/src/java.instrument/share/classes/java/lang/instrument/ClassFileTransformer.java
@@ -25,7 +25,6 @@
package java.lang.instrument;
-import java.lang.reflect.Module;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.ProtectionDomain;
diff --git a/jdk/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java b/jdk/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java
index bc4170d3af2..65d1569d0a0 100644
--- a/jdk/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java
+++ b/jdk/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java
@@ -25,7 +25,6 @@
package java.lang.instrument;
-import java.lang.reflect.Module;
import java.security.ProtectionDomain;
import java.util.List;
import java.util.Map;
@@ -346,7 +345,7 @@ public interface Instrumentation {
/**
- * Determines whether a class is modifiable by
+ * Tests whether a class is modifiable by
* {@linkplain #retransformClasses retransformation}
* or {@linkplain #redefineClasses redefinition}.
* If a class is modifiable then this method returns true.
@@ -711,8 +710,11 @@ public interface Instrumentation {
* {@code extraProvides} map contains a service provider type that
* is not a member of the module or an implementation of the service;
* or {@code extraProvides} maps a key to an empty list
+ * @throws UnmodifiableModuleException if the module cannot be modified
* @throws NullPointerException if any of the arguments are {@code null} or
* any of the Sets or Maps contains a {@code null} key or value
+ *
+ * @see #isModifiableModule(Module)
* @since 9
* @spec JPMS
*/
@@ -722,4 +724,19 @@ public interface Instrumentation {
Map> extraOpens,
Set> extraUses,
Map, List>> extraProvides);
+
+ /**
+ * Tests whether a module can be modified with {@link #redefineModule
+ * redefineModule}. If a module is modifiable then this method returns
+ * {@code true}. If a module is not modifiable then this method returns
+ * {@code false}.
+ *
+ * @param module the module to test if it can be modified
+ * @return {@code true} if the module is modifiable, otherwise {@code false}
+ * @throws NullPointerException if the module is {@code null}
+ *
+ * @since 9
+ * @spec JPMS
+ */
+ boolean isModifiableModule(Module module);
}
diff --git a/jdk/src/java.instrument/share/classes/java/lang/instrument/UnmodifiableModuleException.java b/jdk/src/java.instrument/share/classes/java/lang/instrument/UnmodifiableModuleException.java
new file mode 100644
index 00000000000..be037b21cf6
--- /dev/null
+++ b/jdk/src/java.instrument/share/classes/java/lang/instrument/UnmodifiableModuleException.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+package java.lang.instrument;
+
+/**
+ * Thrown to indicate that a module cannot be modified.
+ *
+ * @see Instrumentation#redefineModule
+ * @since 9
+ * @spec JPMS
+ */
+
+public class UnmodifiableModuleException extends RuntimeException {
+ private static final long serialVersionUID = 6912511912351080644L;
+
+ /**
+ * Constructs an {@code UnmodifiableModuleException} with no
+ * detail message.
+ */
+ public UnmodifiableModuleException() {
+ super();
+ }
+
+ /**
+ * Constructs an {@code UnmodifiableModuleException} with the
+ * specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public UnmodifiableModuleException(String msg) {
+ super(msg);
+ }
+}
diff --git a/jdk/src/java.instrument/share/classes/sun/instrument/InstrumentationImpl.java b/jdk/src/java.instrument/share/classes/sun/instrument/InstrumentationImpl.java
index b2c2a24e50d..f31a007443e 100644
--- a/jdk/src/java.instrument/share/classes/sun/instrument/InstrumentationImpl.java
+++ b/jdk/src/java.instrument/share/classes/sun/instrument/InstrumentationImpl.java
@@ -23,11 +23,10 @@
* questions.
*/
-
package sun.instrument;
+import java.lang.instrument.UnmodifiableModuleException;
import java.lang.reflect.Method;
-import java.lang.reflect.Module;
import java.lang.reflect.AccessibleObject;
import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.ClassDefinition;
@@ -132,6 +131,13 @@ public class InstrumentationImpl implements Instrumentation {
return isModifiableClass0(mNativeAgent, theClass);
}
+ public boolean isModifiableModule(Module module) {
+ if (module == null) {
+ throw new NullPointerException("'module' is null");
+ }
+ return true;
+ }
+
public boolean
isRetransformClassesSupported() {
// ask lazily since there is some overhead
@@ -243,6 +249,9 @@ public class InstrumentationImpl implements Instrumentation {
if (!module.isNamed())
return;
+ if (!isModifiableModule(module))
+ throw new UnmodifiableModuleException(module.getName());
+
// copy and check reads
extraReads = new HashSet<>(extraReads);
if (extraReads.contains(null))
@@ -312,7 +321,7 @@ public class InstrumentationImpl implements Instrumentation {
return Collections.emptyMap();
Map> result = new HashMap<>();
- Set packages = Set.of(module.getPackages());
+ Set packages = module.getPackages();
for (Map.Entry> e : map.entrySet()) {
String pkg = e.getKey();
if (pkg == null)
diff --git a/jdk/src/java.instrument/share/classes/sun/instrument/TransformerManager.java b/jdk/src/java.instrument/share/classes/sun/instrument/TransformerManager.java
index dcac4b7ad8f..29665440f9f 100644
--- a/jdk/src/java.instrument/share/classes/sun/instrument/TransformerManager.java
+++ b/jdk/src/java.instrument/share/classes/sun/instrument/TransformerManager.java
@@ -25,10 +25,8 @@
package sun.instrument;
-
import java.lang.instrument.Instrumentation;
import java.lang.instrument.ClassFileTransformer;
-import java.lang.reflect.Module;
import java.security.ProtectionDomain;
/*
diff --git a/jdk/src/java.instrument/share/native/libinstrument/JPLISAgent.h b/jdk/src/java.instrument/share/native/libinstrument/JPLISAgent.h
index 008b2fabc6a..08d61636839 100644
--- a/jdk/src/java.instrument/share/native/libinstrument/JPLISAgent.h
+++ b/jdk/src/java.instrument/share/native/libinstrument/JPLISAgent.h
@@ -66,7 +66,7 @@ typedef struct _JPLISEnvironment JPLISEnvironment;
#define JPLIS_INSTRUMENTIMPL_AGENTMAININVOKER_METHODSIGNATURE "(Ljava/lang/String;Ljava/lang/String;)V"
#define JPLIS_INSTRUMENTIMPL_TRANSFORM_METHODNAME "transform"
#define JPLIS_INSTRUMENTIMPL_TRANSFORM_METHODSIGNATURE \
- "(Ljava/lang/reflect/Module;Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/Class;Ljava/security/ProtectionDomain;[BZ)[B"
+ "(Ljava/lang/Module;Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/Class;Ljava/security/ProtectionDomain;[BZ)[B"
/*
diff --git a/jdk/src/java.logging/share/classes/java/util/logging/Level.java b/jdk/src/java.logging/share/classes/java/util/logging/Level.java
index 526161bafa9..2af2c6d83d6 100644
--- a/jdk/src/java.logging/share/classes/java/util/logging/Level.java
+++ b/jdk/src/java.logging/share/classes/java/util/logging/Level.java
@@ -24,10 +24,10 @@
*/
package java.util.logging;
+
import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
-import java.lang.reflect.Module;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
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 cb03b2af40e..bb408fd919b 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
@@ -23,7 +23,6 @@
* questions.
*/
-
package java.util.logging;
import java.io.*;
@@ -43,7 +42,6 @@ import java.util.stream.Stream;
import jdk.internal.misc.JavaAWTAccess;
import jdk.internal.misc.SharedSecrets;
import sun.util.logging.internal.LoggingProviderImpl;
-import java.lang.reflect.Module;
import static jdk.internal.logger.DefaultLoggerFinder.isSystem;
/**
diff --git a/jdk/src/java.logging/share/classes/java/util/logging/Logger.java b/jdk/src/java.logging/share/classes/java/util/logging/Logger.java
index 1cfd6f98659..70ff7b2d94e 100644
--- a/jdk/src/java.logging/share/classes/java/util/logging/Logger.java
+++ b/jdk/src/java.logging/share/classes/java/util/logging/Logger.java
@@ -23,11 +23,9 @@
* questions.
*/
-
package java.util.logging;
import java.lang.ref.WeakReference;
-import java.lang.reflect.Module;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
diff --git a/jdk/src/java.logging/share/classes/sun/util/logging/internal/LoggingProviderImpl.java b/jdk/src/java.logging/share/classes/sun/util/logging/internal/LoggingProviderImpl.java
index 1ccf2cf7c92..432228a88d0 100644
--- a/jdk/src/java.logging/share/classes/sun/util/logging/internal/LoggingProviderImpl.java
+++ b/jdk/src/java.logging/share/classes/sun/util/logging/internal/LoggingProviderImpl.java
@@ -32,7 +32,6 @@ import java.util.ResourceBundle;
import java.util.function.Supplier;
import java.lang.System.LoggerFinder;
import java.lang.System.Logger;
-import java.lang.reflect.Module;
import java.util.Objects;
import java.util.logging.LogManager;
import jdk.internal.logger.DefaultLoggerFinder;
diff --git a/jdk/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnector.java b/jdk/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnector.java
index 7c5cd32811f..16eeff47d4b 100644
--- a/jdk/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnector.java
+++ b/jdk/src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnector.java
@@ -43,7 +43,6 @@ import java.lang.ref.WeakReference;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Module;
import java.lang.reflect.Proxy;
import java.net.MalformedURLException;
import java.rmi.MarshalledObject;
diff --git a/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java b/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java
index 580829c834c..5b0b6ac7695 100644
--- a/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java
+++ b/jdk/src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java
@@ -28,7 +28,6 @@ package javax.management.remote;
import com.sun.jmx.mbeanserver.Util;
import java.io.IOException;
import java.io.UncheckedIOException;
-import java.lang.reflect.Module;
import java.net.MalformedURLException;
import java.util.Collections;
import java.util.HashMap;
diff --git a/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java b/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java
index 4eb5742b2ba..5336177ba50 100644
--- a/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java
+++ b/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java
@@ -45,7 +45,6 @@ import jdk.internal.misc.SharedSecrets;
import java.util.ArrayList;
import java.util.List;
-import java.lang.reflect.Module;
import java.lang.reflect.UndeclaredThrowableException;
import java.security.PrivilegedAction;
import java.util.Collections;
@@ -181,8 +180,7 @@ public class ManagementFactoryHelper {
return AccessController.doPrivileged(new PrivilegedAction<>() {
@Override
public Class> run() {
- Optional logging = java.lang.reflect.Layer.boot()
- .findModule("java.logging");
+ Optional logging = ModuleLayer.boot().findModule("java.logging");
if (logging.isPresent()) {
return Class.forName(logging.get(), className);
}
diff --git a/jdk/src/java.naming/share/classes/com/sun/naming/internal/VersionHelper.java b/jdk/src/java.naming/share/classes/com/sun/naming/internal/VersionHelper.java
index c29a88dc40c..43dbc075138 100644
--- a/jdk/src/java.naming/share/classes/com/sun/naming/internal/VersionHelper.java
+++ b/jdk/src/java.naming/share/classes/com/sun/naming/internal/VersionHelper.java
@@ -176,7 +176,7 @@ public final class VersionHelper {
InputStream getResourceAsStream(Class> c, String name) {
PrivilegedAction act = () -> {
try {
- java.lang.reflect.Module m = c.getModule();
+ Module m = c.getModule();
return c.getModule().getResourceAsStream(resolveName(c,name));
} catch (IOException x) {
return null;
diff --git a/jdk/src/java.rmi/share/classes/java/rmi/activation/ActivationInstantiator.java b/jdk/src/java.rmi/share/classes/java/rmi/activation/ActivationInstantiator.java
index 4e100fb9abb..2cd4733fb25 100644
--- a/jdk/src/java.rmi/share/classes/java/rmi/activation/ActivationInstantiator.java
+++ b/jdk/src/java.rmi/share/classes/java/rmi/activation/ActivationInstantiator.java
@@ -67,11 +67,11 @@ public interface ActivationInstantiator extends Remote {
*
*
The class to be activated and the special activation constructor are both public,
* and the class resides in a package that is
- * {@linkplain java.lang.reflect.Module#isExported(String,java.lang.reflect.Module) exported}
+ * {@linkplain Module#isExported(String,Module) exported}
* to at least the {@code java.rmi} module; or
*
*
The class to be activated resides in a package that is
- * {@linkplain java.lang.reflect.Module#isOpen(String,java.lang.reflect.Module) open}
+ * {@linkplain Module#isOpen(String,Module) open}
* to at least the {@code java.rmi} module.
*
Each remote interface must either be public and reside in a package that is
- * {@linkplain java.lang.reflect.Module#isExported(String,java.lang.reflect.Module) exported}
+ * {@linkplain Module#isExported(String,Module) exported}
* to at least the {@code java.rmi} module, or it must reside in a package that is
- * {@linkplain java.lang.reflect.Module#isOpen(String,java.lang.reflect.Module) open}
+ * {@linkplain Module#isOpen(String,Module) open}
* to at least the {@code java.rmi} module.
*
*
The proxy's invocation handler is a {@link
diff --git a/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java b/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java
index c630598f199..0b752ca8bc0 100644
--- a/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java
+++ b/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java
@@ -1022,7 +1022,7 @@ final class P11KeyStore extends KeyStoreSpi {
("trusted certificates may only be set by " +
"token initialization application"));
}
- Module module = token.provider.nssModule;
+ Secmod.Module module = token.provider.nssModule;
if ((module.type != ModuleType.KEYSTORE) && (module.type != ModuleType.FIPS)) {
// XXX allow TRUSTANCHOR module
throw new KeyStoreException("Trusted certificates can only be "
diff --git a/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java b/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java
index a9b6de30d82..9e3ffe773e7 100644
--- a/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java
+++ b/jdk/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/SunPKCS11.java
@@ -77,7 +77,7 @@ public final class SunPKCS11 extends AuthProvider {
final boolean removable;
- final Module nssModule;
+ final Secmod.Module nssModule;
final boolean nssUseSecmodTrust;
@@ -148,7 +148,7 @@ public final class SunPKCS11 extends AuthProvider {
boolean useSecmod = config.getNssUseSecmod();
boolean nssUseSecmodTrust = config.getNssUseSecmodTrust();
- Module nssModule = null;
+ Secmod.Module nssModule = null;
//
// Initialization via Secmod. The way this works is as follows:
@@ -217,7 +217,7 @@ public final class SunPKCS11 extends AuthProvider {
// XXX which exception to throw
throw new ProviderException("Could not initialize NSS", e);
}
- List modules = secmod.getModules();
+ List modules = secmod.getModules();
if (config.getShowInfo()) {
System.out.println("NSS modules: " + modules);
}
@@ -258,7 +258,7 @@ public final class SunPKCS11 extends AuthProvider {
("Invalid external module: " + moduleName);
}
int k = 0;
- for (Module module : modules) {
+ for (Secmod.Module module : modules) {
if (module.getType() == ModuleType.EXTERNAL) {
if (++k == moduleIndex) {
nssModule = module;
diff --git a/jdk/src/jdk.jcmd/share/classes/sun/tools/common/ProcessArgumentMatcher.java b/jdk/src/jdk.jcmd/share/classes/sun/tools/common/ProcessArgumentMatcher.java
index 7e1da1c8d92..d8e44d385ab 100644
--- a/jdk/src/jdk.jcmd/share/classes/sun/tools/common/ProcessArgumentMatcher.java
+++ b/jdk/src/jdk.jcmd/share/classes/sun/tools/common/ProcessArgumentMatcher.java
@@ -25,7 +25,6 @@
package sun.tools.common;
-import java.lang.reflect.Module;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collection;
diff --git a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/ModuleReferenceImpl.c b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/ModuleReferenceImpl.c
index 047796421a7..88df2d9603d 100644
--- a/jdk/src/jdk.jdwp.agent/share/native/libjdwp/ModuleReferenceImpl.c
+++ b/jdk/src/jdk.jdwp.agent/share/native/libjdwp/ModuleReferenceImpl.c
@@ -29,8 +29,8 @@
#include "ModuleReferenceImpl.h"
-static jclass jlrM(JNIEnv *env) {
- return findClass(env, "Ljava/lang/reflect/Module;");
+static jclass jlM(JNIEnv *env) {
+ return findClass(env, "Ljava/lang/Module;");
}
static jboolean
@@ -43,7 +43,7 @@ getName(PacketInputStream *in, PacketOutputStream *out)
jobject module;
if (method == NULL) {
- method = getMethod(env, jlrM(env), "getName", "()Ljava/lang/String;");
+ method = getMethod(env, jlM(env), "getName", "()Ljava/lang/String;");
}
module = inStream_readModuleRef(getEnv(), in);
if (inStream_error(in)) {
@@ -71,7 +71,7 @@ getClassLoader(PacketInputStream *in, PacketOutputStream *out)
jobject module;
if (method == NULL) {
- method = getMethod(env, jlrM(env), "getClassLoader", "()Ljava/lang/ClassLoader;");
+ method = getMethod(env, jlM(env), "getClassLoader", "()Ljava/lang/ClassLoader;");
}
module = inStream_readModuleRef(env, in);
if (inStream_error(in)) {
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java
index 5ab1bfca53a..5a0d3f223d9 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java
@@ -26,7 +26,6 @@ package jdk.tools.jlink.internal;
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
import java.nio.ByteOrder;
import java.nio.file.Path;
import java.util.ArrayList;
@@ -55,10 +54,10 @@ public final class Jlink {
* @return A new plugin or null if plugin is unknown.
*/
public static Plugin newPlugin(String name,
- Map configuration, Layer pluginsLayer) {
+ Map configuration, ModuleLayer pluginsLayer) {
Objects.requireNonNull(name);
Objects.requireNonNull(configuration);
- pluginsLayer = pluginsLayer == null ? Layer.boot() : pluginsLayer;
+ pluginsLayer = pluginsLayer == null ? ModuleLayer.boot() : pluginsLayer;
return PluginRepository.newPlugin(configuration, name, pluginsLayer);
}
@@ -330,7 +329,7 @@ public final class Jlink {
private PluginsConfiguration addAutoEnabledPlugins(PluginsConfiguration pluginsConfig) {
List plugins = new ArrayList<>(pluginsConfig.getPlugins());
- List bootPlugins = PluginRepository.getPlugins(Layer.boot());
+ List bootPlugins = PluginRepository.getPlugins(ModuleLayer.boot());
for (Plugin bp : bootPlugins) {
if (Utils.isAutoEnabled(bp)) {
try {
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginRepository.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginRepository.java
index 1d39c2cbfeb..b12bf00df96 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginRepository.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/PluginRepository.java
@@ -24,7 +24,6 @@
*/
package jdk.tools.jlink.internal;
-import java.lang.reflect.Layer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -56,7 +55,7 @@ public final class PluginRepository {
* @return A provider or null if not found.
*/
public static Plugin getPlugin(String name,
- Layer pluginsLayer) {
+ ModuleLayer pluginsLayer) {
return getPlugin(Plugin.class, name, pluginsLayer);
}
@@ -69,7 +68,7 @@ public final class PluginRepository {
* @return A plugin or null if no plugin found.
*/
public static Plugin newPlugin(Map config, String name,
- Layer pluginsLayer) {
+ ModuleLayer pluginsLayer) {
Objects.requireNonNull(name);
Objects.requireNonNull(pluginsLayer);
Plugin plugin = getPlugin(name, pluginsLayer);
@@ -107,12 +106,12 @@ public final class PluginRepository {
registeredPlugins.remove(name);
}
- public static List getPlugins(Layer pluginsLayer) {
+ public static List getPlugins(ModuleLayer pluginsLayer) {
return getPlugins(Plugin.class, pluginsLayer);
}
private static T getPlugin(Class clazz, String name,
- Layer pluginsLayer) {
+ ModuleLayer pluginsLayer) {
Objects.requireNonNull(name);
Objects.requireNonNull(pluginsLayer);
@SuppressWarnings("unchecked")
@@ -136,7 +135,7 @@ public final class PluginRepository {
* @param pluginsLayer
* @return The list of plugins.
*/
- private static List getPlugins(Class clazz, Layer pluginsLayer) {
+ private static List getPlugins(Class clazz, ModuleLayer pluginsLayer) {
Objects.requireNonNull(pluginsLayer);
List factories = new ArrayList<>();
try {
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java
index 4535f9cfe7e..f5a312de8aa 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java
@@ -29,7 +29,6 @@ import java.io.IOException;
import java.io.PrintWriter;
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -211,7 +210,7 @@ public final class TaskHelper {
private final class PluginsHelper {
- private Layer pluginsLayer = Layer.boot();
+ private ModuleLayer pluginsLayer = ModuleLayer.boot();
private final List plugins;
private String lastSorter;
private boolean listPlugins;
@@ -655,7 +654,7 @@ public final class TaskHelper {
return defaults;
}
- public Layer getPluginsLayer() {
+ public ModuleLayer getPluginsLayer() {
return pluginOptions.pluginsLayer;
}
}
@@ -725,18 +724,18 @@ public final class TaskHelper {
return System.getProperty("java.version");
}
- static Layer createPluginsLayer(List paths) {
+ static ModuleLayer createPluginsLayer(List paths) {
Path[] dirs = paths.toArray(new Path[0]);
ModuleFinder finder = ModulePath.of(Runtime.version(), true, dirs);
- Configuration bootConfiguration = Layer.boot().configuration();
+ Configuration bootConfiguration = ModuleLayer.boot().configuration();
try {
Configuration cf = bootConfiguration
.resolveAndBind(ModuleFinder.of(),
finder,
Collections.emptySet());
ClassLoader scl = ClassLoader.getSystemClassLoader();
- return Layer.boot().defineModulesWithOneLoader(cf, scl);
+ return ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
} catch (Exception ex) {
// Malformed plugin modules (e.g.: same package in multiple modules).
throw new PluginException("Invalid modules in the plugins path: " + ex);
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Utils.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Utils.java
index ef8fb392086..fd0dc135263 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Utils.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Utils.java
@@ -24,7 +24,6 @@
*/
package jdk.tools.jlink.internal;
-import java.lang.reflect.Module;
import java.net.URI;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
diff --git a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ReleaseInfoPlugin.java b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ReleaseInfoPlugin.java
index e778733cd06..bcdb1e90a0c 100644
--- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ReleaseInfoPlugin.java
+++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ReleaseInfoPlugin.java
@@ -27,6 +27,7 @@ package jdk.tools.jlink.internal.plugins;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
+import java.io.PrintWriter;
import java.io.UncheckedIOException;
import java.lang.module.ModuleDescriptor;
import java.util.EnumSet;
@@ -43,8 +44,6 @@ import jdk.tools.jlink.plugin.ResourcePool;
import jdk.tools.jlink.plugin.ResourcePoolBuilder;
import jdk.tools.jlink.plugin.ResourcePoolEntry;
import jdk.tools.jlink.plugin.ResourcePoolModule;
-import jdk.tools.jlink.plugin.Plugin.Category;
-import jdk.tools.jlink.plugin.Plugin.State;
import jdk.tools.jlink.plugin.Plugin;
/**
@@ -101,9 +100,9 @@ public final class ReleaseInfoPlugin implements Plugin {
// --release-info add:build_type=fastdebug,source=openjdk,java_version=9
// and put whatever value that was passed in command line.
- config.keySet().stream().
- filter(s -> !NAME.equals(s)).
- forEach(s -> release.put(s, config.get(s)));
+ config.keySet().stream()
+ .filter(s -> !NAME.equals(s))
+ .forEach(s -> release.put(s, config.get(s)));
}
break;
@@ -148,8 +147,8 @@ public final class ReleaseInfoPlugin implements Plugin {
// put topological sorted module names separated by space
release.put("MODULES", new ModuleSorter(in.moduleView())
- .sorted().map(ResourcePoolModule::name)
- .collect(Collectors.joining(" ", "\"", "\"")));
+ .sorted().map(ResourcePoolModule::name)
+ .collect(Collectors.joining(" ", "\"", "\"")));
// create a TOP level ResourcePoolEntry for "release" file.
out.add(ResourcePoolEntry.create("/java.base/release",
@@ -160,11 +159,11 @@ public final class ReleaseInfoPlugin implements Plugin {
// Parse version string and return a string that includes only version part
// leaving "pre", "build" information. See also: java.lang.Runtime.Version.
private static String parseVersion(String str) {
- return Runtime.Version.parse(str).
- version().
- stream().
- map(Object::toString).
- collect(Collectors.joining("."));
+ return Runtime.Version.parse(str)
+ .version()
+ .stream()
+ .map(Object::toString)
+ .collect(Collectors.joining("."));
}
private static String quote(String str) {
@@ -172,14 +171,12 @@ public final class ReleaseInfoPlugin implements Plugin {
}
private byte[] releaseFileContent() {
- Properties props = new Properties();
- props.putAll(release);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
- try {
- props.store(baos, "");
- return baos.toByteArray();
- } catch (IOException ex) {
- throw new UncheckedIOException(ex);
+ try (PrintWriter pw = new PrintWriter(baos)) {
+ release.entrySet().stream()
+ .sorted(Map.Entry.comparingByKey())
+ .forEach(e -> pw.format("%s=%s%n", e.getKey(), e.getValue()));
}
+ return baos.toByteArray();
}
}
diff --git a/jdk/test/TEST.ROOT b/jdk/test/TEST.ROOT
index e822c4f2aae..f79fb4e6e5d 100644
--- a/jdk/test/TEST.ROOT
+++ b/jdk/test/TEST.ROOT
@@ -26,8 +26,8 @@ groups=TEST.groups [closed/TEST.groups]
# Allow querying of various System properties in @requires clauses
requires.properties=sun.arch.data.model java.runtime.name
-# Tests using jtreg 4.2 b05 features
-requiredVersion=4.2 b05
+# Tests using jtreg 4.2 b07 features
+requiredVersion=4.2 b07
# Path to libraries in the topmost test directory. This is needed so @library
# does not need ../../ notation to reach them
diff --git a/jdk/test/java/awt/TrayIcon/SystemTrayIconHelper.java b/jdk/test/java/awt/TrayIcon/SystemTrayIconHelper.java
index 1fcf2813950..e8529a3b396 100644
--- a/jdk/test/java/awt/TrayIcon/SystemTrayIconHelper.java
+++ b/jdk/test/java/awt/TrayIcon/SystemTrayIconHelper.java
@@ -81,7 +81,7 @@ public class SystemTrayIconHelper {
try {
// sun.lwawt.macosx.CTrayIcon
Field f_peer = getField( java.awt.TrayIcon.class, "peer");
- Method m_addExports = Class.forName("java.awt.Helper").getDeclaredMethod("addExports", String.class, java.lang.reflect.Module.class);
+ Method m_addExports = Class.forName("java.awt.Helper").getDeclaredMethod("addExports", String.class, java.lang.Module.class);
m_addExports.invoke(null, "sun.lwawt.macosx", robot.getClass().getModule());
@@ -105,7 +105,7 @@ public class SystemTrayIconHelper {
} else {
try {
// sun.awt.X11.XTrayIconPeer
- Method m_addExports = Class.forName("java.awt.Helper").getDeclaredMethod("addExports", String.class, java.lang.reflect.Module.class);
+ Method m_addExports = Class.forName("java.awt.Helper").getDeclaredMethod("addExports", String.class, java.lang.Module.class);
m_addExports.invoke(null, "sun.awt.X11", robot.getClass().getModule());
Field f_peer = getField(java.awt.TrayIcon.class, "peer");
diff --git a/jdk/test/java/awt/patchlib/java.desktop/java/awt/Helper.java b/jdk/test/java/awt/patchlib/java.desktop/java/awt/Helper.java
index 6d8dbc4b227..d599833cb70 100644
--- a/jdk/test/java/awt/patchlib/java.desktop/java/awt/Helper.java
+++ b/jdk/test/java/awt/patchlib/java.desktop/java/awt/Helper.java
@@ -22,7 +22,6 @@
*/
package java.awt;
-import java.lang.reflect.Module;
public class Helper {
private Helper() { }
public static void addExports(String pn, Module target) {
diff --git a/jdk/test/java/awt/regtesthelpers/Util.java b/jdk/test/java/awt/regtesthelpers/Util.java
index 62feee23489..dde65574460 100644
--- a/jdk/test/java/awt/regtesthelpers/Util.java
+++ b/jdk/test/java/awt/regtesthelpers/Util.java
@@ -445,7 +445,7 @@ public final class Util {
try {
final Class _clazz = clazz;
- Method m_addExports = Class.forName("java.awt.Helper").getDeclaredMethod("addExports", String.class, java.lang.reflect.Module.class);
+ Method m_addExports = Class.forName("java.awt.Helper").getDeclaredMethod("addExports", String.class, java.lang.Module.class);
// No MToolkit anymore: nothing to do about it.
// We may be called from non-X11 system, and this permission cannot be delegated to a test.
m_addExports.invoke(null, "sun.awt.X11", Util.class.getModule());
diff --git a/jdk/test/java/lang/Class/GetModuleTest.java b/jdk/test/java/lang/Class/GetModuleTest.java
index f0d7477c074..4059a216c02 100644
--- a/jdk/test/java/lang/Class/GetModuleTest.java
+++ b/jdk/test/java/lang/Class/GetModuleTest.java
@@ -31,7 +31,6 @@
*/
import java.awt.Component;
-import java.lang.reflect.Module;
import jdk.internal.org.objectweb.asm.ClassWriter;
import static jdk.internal.org.objectweb.asm.Opcodes.*;
diff --git a/jdk/test/java/lang/Class/forName/modules/TestLayer.java b/jdk/test/java/lang/Class/forName/modules/TestLayer.java
index ff9a772ceeb..45460d19d32 100644
--- a/jdk/test/java/lang/Class/forName/modules/TestLayer.java
+++ b/jdk/test/java/lang/Class/forName/modules/TestLayer.java
@@ -23,9 +23,7 @@
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
import java.lang.reflect.Method;
-import java.lang.reflect.Module;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Path;
@@ -45,13 +43,13 @@ public class TestLayer {
ModuleFinder finder = ModuleFinder.of(MODS_DIR);
- Configuration parent = Layer.boot().configuration();
+ Configuration parent = ModuleLayer.boot().configuration();
Configuration cf = parent.resolveAndBind(ModuleFinder.of(),
finder,
modules);
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer = Layer.boot().defineModulesWithManyLoaders(cf, scl);
+ ModuleLayer layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, scl);
Module m1 = layer.findModule("m1").get();
Module m2 = layer.findModule("m2").get();
diff --git a/jdk/test/java/lang/Class/forName/modules/TestMain.java b/jdk/test/java/lang/Class/forName/modules/TestMain.java
index 0da5136622c..aa821a1d08d 100644
--- a/jdk/test/java/lang/Class/forName/modules/TestMain.java
+++ b/jdk/test/java/lang/Class/forName/modules/TestMain.java
@@ -21,13 +21,11 @@
* questions.
*/
-import java.lang.reflect.Layer;
import java.lang.reflect.Method;
-import java.lang.reflect.Module;
public class TestMain {
public static void main(String[] args) throws Exception {
- Layer boot = Layer.boot();
+ ModuleLayer boot = ModuleLayer.boot();
Module m1 = boot.findModule("m1").get();
Module m2 = boot.findModule("m2").get();
diff --git a/jdk/test/java/lang/Class/forName/modules/src/m2/p2/test/Main.java b/jdk/test/java/lang/Class/forName/modules/src/m2/p2/test/Main.java
index 56cec626fa0..8febc9515a9 100644
--- a/jdk/test/java/lang/Class/forName/modules/src/m2/p2/test/Main.java
+++ b/jdk/test/java/lang/Class/forName/modules/src/m2/p2/test/Main.java
@@ -23,12 +23,9 @@
package p2.test;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
-
public class Main {
public static void main(String... args) throws Exception {
- Layer boot = Layer.boot();
+ ModuleLayer boot = ModuleLayer.boot();
Module m1 = boot.findModule("m1").get();
Module m2 = Main.class.getModule();
diff --git a/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoAccess.java b/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoAccess.java
index 25e8779ab48..92002a613e1 100644
--- a/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoAccess.java
+++ b/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoAccess.java
@@ -26,8 +26,6 @@ package p3;
import java.io.FilePermission;
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.AccessControlException;
@@ -47,7 +45,7 @@ public class NoAccess {
ModuleFinder finder = ModuleFinder.of(Paths.get("mods1"), Paths.get("mods2"));
- Layer bootLayer = Layer.boot();
+ ModuleLayer bootLayer = ModuleLayer.boot();
Configuration parent = bootLayer.configuration();
Configuration cf = parent.resolveAndBind(finder,
@@ -55,7 +53,7 @@ public class NoAccess {
Set.of("m1", "m2"));
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer = bootLayer.defineModulesWithManyLoaders(cf, scl);
+ ModuleLayer layer = bootLayer.defineModulesWithManyLoaders(cf, scl);
if (sm != null) {
System.setSecurityManager(sm);
diff --git a/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoGetClassLoaderAccess.java b/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoGetClassLoaderAccess.java
index 1c2ee70fcbc..aeed218ee5d 100644
--- a/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoGetClassLoaderAccess.java
+++ b/jdk/test/java/lang/Class/forName/modules/src/m3/p3/NoGetClassLoaderAccess.java
@@ -23,8 +23,6 @@
package p3;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.security.AccessControlException;
import java.security.Permission;
@@ -37,7 +35,7 @@ public class NoGetClassLoaderAccess {
private static final Permission GET_CLASSLOADER_PERMISSION = new RuntimePermission("getClassLoader");
public static void main(String[] args) throws Exception {
- Layer boot = Layer.boot();
+ ModuleLayer boot = ModuleLayer.boot();
System.setSecurityManager(new SecurityManager());
Module m1 = boot.findModule("m1").get();
diff --git a/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java b/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java
index 5ea706de1ee..35e6ede16db 100644
--- a/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java
+++ b/jdk/test/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java
@@ -26,10 +26,8 @@ import java.io.IOException;
import java.io.UncheckedIOException;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Field;
-import java.lang.reflect.Module;
import java.lang.reflect.Modifier;
import java.lang.reflect.InaccessibleObjectException;
-import java.lang.reflect.Layer;
import java.lang.reflect.ReflectPermission;
import java.net.URI;
import java.nio.file.FileSystem;
@@ -269,7 +267,7 @@ public class FieldSetAccessibleTest {
try {
return Files.walk(root)
.filter(p -> p.getNameCount() > 2)
- .filter(p -> Layer.boot().findModule(p.getName(1).toString()).isPresent())
+ .filter(p -> ModuleLayer.boot().findModule(p.getName(1).toString()).isPresent())
.map(p -> p.subpath(2, p.getNameCount()))
.map(p -> p.toString())
.filter(s -> s.endsWith(".class") && !s.endsWith("module-info.class"))
diff --git a/jdk/test/java/lang/Class/getResource/Main.java b/jdk/test/java/lang/Class/getResource/Main.java
index 96d4e68ac15..efd50262be2 100644
--- a/jdk/test/java/lang/Class/getResource/Main.java
+++ b/jdk/test/java/lang/Class/getResource/Main.java
@@ -23,7 +23,6 @@
import java.lang.module.Configuration;
import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
@@ -256,7 +255,7 @@ public class Main {
* Returns the directory for the given module (by name).
*/
static Path directoryFor(String name) {
- Configuration cf = Layer.boot().configuration();
+ Configuration cf = ModuleLayer.boot().configuration();
ResolvedModule resolvedModule = cf.findModule(name).orElse(null);
if (resolvedModule == null)
throw new RuntimeException("not found: " + name);
diff --git a/jdk/test/java/lang/ClassLoader/getResource/automaticmodules/Main.java b/jdk/test/java/lang/ClassLoader/getResource/automaticmodules/Main.java
index afde3d56bf5..8141e9977bc 100644
--- a/jdk/test/java/lang/ClassLoader/getResource/automaticmodules/Main.java
+++ b/jdk/test/java/lang/ClassLoader/getResource/automaticmodules/Main.java
@@ -26,7 +26,6 @@ import java.io.InputStream;
import java.lang.module.ModuleReader;
import java.lang.module.ModuleReference;
import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
import java.net.URL;
import java.util.Enumeration;
@@ -74,7 +73,7 @@ public class Main {
public static void main(String[] args) throws Exception {
String mn = args[0];
- ModuleReference mref = Layer.boot()
+ ModuleReference mref = ModuleLayer.boot()
.configuration()
.findModule(mn)
.map(ResolvedModule::reference)
diff --git a/jdk/test/java/lang/ClassLoader/getResource/modules/Main.java b/jdk/test/java/lang/ClassLoader/getResource/modules/Main.java
index e816f31fc8b..405132067db 100644
--- a/jdk/test/java/lang/ClassLoader/getResource/modules/Main.java
+++ b/jdk/test/java/lang/ClassLoader/getResource/modules/Main.java
@@ -24,7 +24,6 @@
import java.io.InputStream;
import java.lang.module.Configuration;
import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
@@ -309,7 +308,7 @@ public class Main {
* Returns the directory for the given module (by name).
*/
static Path directoryFor(String mn) {
- Configuration cf = Layer.boot().configuration();
+ Configuration cf = ModuleLayer.boot().configuration();
ResolvedModule resolvedModule = cf.findModule(mn).orElse(null);
if (resolvedModule == null)
throw new RuntimeException("not found: " + mn);
diff --git a/jdk/test/java/lang/reflect/Layer/BasicLayerTest.java b/jdk/test/java/lang/ModuleLayer/BasicLayerTest.java
similarity index 85%
rename from jdk/test/java/lang/reflect/Layer/BasicLayerTest.java
rename to jdk/test/java/lang/ModuleLayer/BasicLayerTest.java
index 9478cac7861..eb5eeb8a256 100644
--- a/jdk/test/java/lang/reflect/Layer/BasicLayerTest.java
+++ b/jdk/test/java/lang/ModuleLayer/BasicLayerTest.java
@@ -28,16 +28,13 @@
* @build BasicLayerTest ModuleUtils
* @compile layertest/Test.java
* @run testng BasicLayerTest
- * @summary Basic tests for java.lang.reflect.Layer
+ * @summary Basic tests for java.lang.ModuleLayer
*/
import java.lang.module.Configuration;
import java.lang.module.ModuleDescriptor;
import java.lang.module.ModuleDescriptor.Requires;
import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
-import java.lang.reflect.LayerInstantiationException;
-import java.lang.reflect.Module;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
@@ -63,10 +60,10 @@ public class BasicLayerTest {
}
/**
- * Exercise Layer.empty()
+ * Exercise ModuleLayer.empty()
*/
public void testEmpty() {
- Layer emptyLayer = Layer.empty();
+ ModuleLayer emptyLayer = ModuleLayer.empty();
assertTrue(emptyLayer.parents().isEmpty());
@@ -84,10 +81,10 @@ public class BasicLayerTest {
/**
- * Exercise Layer.boot()
+ * Exercise ModuleLayer.boot()
*/
public void testBoot() {
- Layer bootLayer = Layer.boot();
+ ModuleLayer bootLayer = ModuleLayer.boot();
// configuration
Configuration cf = bootLayer.configuration();
@@ -114,12 +111,12 @@ public class BasicLayerTest {
// parents
assertTrue(bootLayer.parents().size() == 1);
- assertTrue(bootLayer.parents().get(0) == Layer.empty());
+ assertTrue(bootLayer.parents().get(0) == ModuleLayer.empty());
}
/**
- * Exercise Layer defineModules, created with empty layer as parent
+ * Exercise defineModules, created with empty layer as parent
*/
public void testLayerOnEmpty() {
ModuleDescriptor descriptor1 = newBuilder("m1")
@@ -148,7 +145,7 @@ public class BasicLayerTest {
map.put("m2", loader2);
map.put("m3", loader3);
- Layer layer = Layer.empty().defineModules(cf, map::get);
+ ModuleLayer layer = ModuleLayer.empty().defineModules(cf, map::get);
// configuration
assertTrue(layer.configuration() == cf);
@@ -193,12 +190,12 @@ public class BasicLayerTest {
// parents
assertTrue(layer.parents().size() == 1);
- assertTrue(layer.parents().get(0) == Layer.empty());
+ assertTrue(layer.parents().get(0) == ModuleLayer.empty());
}
/**
- * Exercise Layer defineModules, created with boot layer as parent
+ * Exercise defineModules, created with boot layer as parent
*/
public void testLayerOnBoot() {
ModuleDescriptor descriptor1 = newBuilder("m1")
@@ -214,12 +211,12 @@ public class BasicLayerTest {
ModuleFinder finder
= ModuleUtils.finderOf(descriptor1, descriptor2);
- Configuration parent = Layer.boot().configuration();
+ Configuration parent = ModuleLayer.boot().configuration();
Configuration cf = resolve(parent, finder, "m1");
ClassLoader loader = new ClassLoader() { };
- Layer layer = Layer.boot().defineModules(cf, mn -> loader);
+ ModuleLayer layer = ModuleLayer.boot().defineModules(cf, mn -> loader);
// configuration
assertTrue(layer.configuration() == cf);
@@ -255,12 +252,12 @@ public class BasicLayerTest {
// parents
assertTrue(layer.parents().size() == 1);
- assertTrue(layer.parents().get(0) == Layer.boot());
+ assertTrue(layer.parents().get(0) == ModuleLayer.boot());
}
/**
- * Exercise Layer defineModules with a configuration of two modules that
+ * Exercise defineModules with a configuration of two modules that
* have the same module-private package.
*/
public void testPackageContainedInSelfAndOther() {
@@ -280,19 +277,19 @@ public class BasicLayerTest {
assertTrue(cf.modules().size() == 2);
// one loader per module, should be okay
- Layer.empty().defineModules(cf, mn -> new ClassLoader() { });
+ ModuleLayer.empty().defineModules(cf, mn -> new ClassLoader() { });
// same class loader
try {
ClassLoader loader = new ClassLoader() { };
- Layer.empty().defineModules(cf, mn -> loader);
+ ModuleLayer.empty().defineModules(cf, mn -> loader);
assertTrue(false);
} catch (LayerInstantiationException expected) { }
}
/**
- * Exercise Layer defineModules with a configuration that is a partitioned
+ * Exercise defineModules with a configuration that is a partitioned
* graph. The same package is exported in both partitions.
*/
public void testSameExportInPartitionedGraph() {
@@ -323,7 +320,7 @@ public class BasicLayerTest {
assertTrue(cf.modules().size() == 4);
// one loader per module
- Layer.empty().defineModules(cf, mn -> new ClassLoader() { });
+ ModuleLayer.empty().defineModules(cf, mn -> new ClassLoader() { });
// m1 & m2 in one loader, m3 & m4 in another loader
ClassLoader loader1 = new ClassLoader() { };
@@ -333,19 +330,19 @@ public class BasicLayerTest {
map.put("m2", loader1);
map.put("m3", loader2);
map.put("m4", loader2);
- Layer.empty().defineModules(cf, map::get);
+ ModuleLayer.empty().defineModules(cf, map::get);
// same loader
try {
ClassLoader loader = new ClassLoader() { };
- Layer.empty().defineModules(cf, mn -> loader);
+ ModuleLayer.empty().defineModules(cf, mn -> loader);
assertTrue(false);
} catch (LayerInstantiationException expected) { }
}
/**
- * Exercise Layer defineModules with a configuration with a module that
+ * Exercise defineModules with a configuration with a module that
* contains a package that is the same name as a non-exported package in
* a parent layer.
*/
@@ -362,12 +359,12 @@ public class BasicLayerTest {
ModuleFinder finder = ModuleUtils.finderOf(descriptor);
- Configuration parent = Layer.boot().configuration();
+ Configuration parent = ModuleLayer.boot().configuration();
Configuration cf = parent.resolve(finder, ModuleFinder.of(), Set.of("m1"));
assertTrue(cf.modules().size() == 1);
ClassLoader loader = new ClassLoader() { };
- Layer layer = Layer.boot().defineModules(cf, mn -> loader);
+ ModuleLayer layer = ModuleLayer.boot().defineModules(cf, mn -> loader);
assertTrue(layer.modules().size() == 1);
}
@@ -395,7 +392,7 @@ public class BasicLayerTest {
Configuration cf1 = resolve(finder1, "m2");
ClassLoader cl1 = new ClassLoader() { };
- Layer layer1 = Layer.empty().defineModules(cf1, mn -> cl1);
+ ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
// cf2: m3, m3 requires m2
@@ -409,10 +406,10 @@ public class BasicLayerTest {
Configuration cf2 = resolve(cf1, finder2, "m3");
ClassLoader cl2 = new ClassLoader() { };
- Layer layer2 = layer1.defineModules(cf2, mn -> cl2);
+ ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
assertTrue(layer1.parents().size() == 1);
- assertTrue(layer1.parents().get(0) == Layer.empty());
+ assertTrue(layer1.parents().get(0) == ModuleLayer.empty());
assertTrue(layer2.parents().size() == 1);
assertTrue(layer2.parents().get(0) == layer1);
@@ -461,7 +458,7 @@ public class BasicLayerTest {
Configuration cf1 = resolve(finder1, "m1");
ClassLoader cl1 = new ClassLoader() { };
- Layer layer1 = Layer.empty().defineModules(cf1, mn -> cl1);
+ ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
// cf2: m2, m3: m2 requires transitive m1, m3 requires m2
@@ -479,10 +476,10 @@ public class BasicLayerTest {
Configuration cf2 = resolve(cf1, finder2, "m3");
ClassLoader cl2 = new ClassLoader() { };
- Layer layer2 = layer1.defineModules(cf2, mn -> cl2);
+ ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
assertTrue(layer1.parents().size() == 1);
- assertTrue(layer1.parents().get(0) == Layer.empty());
+ assertTrue(layer1.parents().get(0) == ModuleLayer.empty());
assertTrue(layer2.parents().size() == 1);
assertTrue(layer2.parents().get(0) == layer1);
@@ -528,7 +525,7 @@ public class BasicLayerTest {
Configuration cf1 = resolve(finder1, "m1");
ClassLoader cl1 = new ClassLoader() { };
- Layer layer1 = Layer.empty().defineModules(cf1, mn -> cl1);
+ ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
// cf2: m2 requires transitive m1
@@ -542,7 +539,7 @@ public class BasicLayerTest {
Configuration cf2 = resolve(cf1, finder2, "m2");
ClassLoader cl2 = new ClassLoader() { };
- Layer layer2 = layer1.defineModules(cf2, mn -> cl2);
+ ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
// cf3: m3 requires m2
@@ -556,10 +553,10 @@ public class BasicLayerTest {
Configuration cf3 = resolve(cf2, finder3, "m3");
ClassLoader cl3 = new ClassLoader() { };
- Layer layer3 = layer2.defineModules(cf3, mn -> cl3);
+ ModuleLayer layer3 = layer2.defineModules(cf3, mn -> cl3);
assertTrue(layer1.parents().size() == 1);
- assertTrue(layer1.parents().get(0) == Layer.empty());
+ assertTrue(layer1.parents().get(0) == ModuleLayer.empty());
assertTrue(layer2.parents().size() == 1);
assertTrue(layer2.parents().get(0) == layer1);
@@ -612,7 +609,7 @@ public class BasicLayerTest {
Configuration cf1 = resolve(finder1, "m2");
ClassLoader cl1 = new ClassLoader() { };
- Layer layer1 = Layer.empty().defineModules(cf1, mn -> cl1);
+ ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
// cf2: m3 requires transitive m2, m4 requires m3
@@ -631,10 +628,10 @@ public class BasicLayerTest {
Configuration cf2 = resolve(cf1, finder2, "m3", "m4");
ClassLoader cl2 = new ClassLoader() { };
- Layer layer2 = layer1.defineModules(cf2, mn -> cl2);
+ ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
assertTrue(layer1.parents().size() == 1);
- assertTrue(layer1.parents().get(0) == Layer.empty());
+ assertTrue(layer1.parents().get(0) == ModuleLayer.empty());
assertTrue(layer2.parents().size() == 1);
assertTrue(layer2.parents().get(0) == layer1);
@@ -691,7 +688,7 @@ public class BasicLayerTest {
Configuration cf = resolve(finder1, "m1", "m2");
ClassLoader cl = new ClassLoader() { };
- Layer layer = Layer.empty().defineModules(cf, mn -> cl);
+ ModuleLayer layer = ModuleLayer.empty().defineModules(cf, mn -> cl);
assertTrue(layer.modules().size() == 2);
Module m1 = layer.findModule("m1").get();
@@ -724,7 +721,7 @@ public class BasicLayerTest {
Configuration cf = resolve(finder1, "m2");
ClassLoader cl = new ClassLoader() { };
- Layer layer = Layer.empty().defineModules(cf, mn -> cl);
+ ModuleLayer layer = ModuleLayer.empty().defineModules(cf, mn -> cl);
assertTrue(layer.modules().size() == 2);
Module m1 = layer.findModule("m1").get();
@@ -750,7 +747,7 @@ public class BasicLayerTest {
ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
Configuration cf1 = resolve(finder1, "m1");
ClassLoader cl1 = new ClassLoader() { };
- Layer layer1 = Layer.empty().defineModules(cf1, mn -> cl1);
+ ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
assertTrue(layer1.modules().size() == 1);
// create layer2 with m2
@@ -760,7 +757,7 @@ public class BasicLayerTest {
ModuleFinder finder2 = ModuleUtils.finderOf(descriptor2);
Configuration cf2 = resolve(cf1, finder2, "m2");
ClassLoader cl2 = new ClassLoader() { };
- Layer layer2 = layer1.defineModules(cf2, mn -> cl2);
+ ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
assertTrue(layer2.modules().size() == 1);
Module m1 = layer1.findModule("m1").get();
@@ -786,7 +783,7 @@ public class BasicLayerTest {
ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
Configuration cf1 = resolve(finder1, "m1");
ClassLoader cl1 = new ClassLoader() { };
- Layer layer1 = Layer.empty().defineModules(cf1, mn -> cl1);
+ ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
assertTrue(layer1.modules().size() == 1);
// create layer2 with m2
@@ -797,7 +794,7 @@ public class BasicLayerTest {
ModuleFinder finder2 = ModuleUtils.finderOf(descriptor2);
Configuration cf2 = resolve(cf1, finder2, "m2");
ClassLoader cl2 = new ClassLoader() { };
- Layer layer2 = layer1.defineModules(cf2, mn -> cl2);
+ ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
assertTrue(layer2.modules().size() == 1);
Module m1 = layer1.findModule("m1").get();
@@ -822,7 +819,7 @@ public class BasicLayerTest {
ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
Configuration cf1 = resolve(finder1, "m1");
ClassLoader cl1 = new ClassLoader() { };
- Layer layer1 = Layer.empty().defineModules(cf1, mn -> cl1);
+ ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
assertTrue(layer1.modules().size() == 1);
// create layer2 with m1 and m2
@@ -830,7 +827,7 @@ public class BasicLayerTest {
ModuleFinder finder2 = ModuleUtils.finderOf(descriptor1, descriptor2);
Configuration cf2 = resolve(cf1, finder2, "m1", "m2");
ClassLoader cl2 = new ClassLoader() { };
- Layer layer2 = layer1.defineModules(cf2, mn -> cl2);
+ ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
assertTrue(layer2.modules().size() == 2);
Module m1_v1 = layer1.findModule("m1").get();
@@ -860,7 +857,7 @@ public class BasicLayerTest {
ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
Configuration cf1 = resolve(finder1, "m2");
ClassLoader loader1 = new ClassLoader() { };
- Layer layer1 = Layer.empty().defineModules(cf1, mn -> loader1);
+ ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> loader1);
assertTrue(layer1.modules().size() == 2);
// create layer2 with m1 and m3
@@ -871,7 +868,7 @@ public class BasicLayerTest {
ModuleFinder finder2 = ModuleUtils.finderOf(descriptor1, descriptor3);
Configuration cf2 = resolve(cf1, finder2, "m1", "m3");
ClassLoader loader2 = new ClassLoader() { };
- Layer layer2 = layer1.defineModules(cf2, mn -> loader2);
+ ModuleLayer layer2 = layer1.defineModules(cf2, mn -> loader2);
assertTrue(layer2.modules().size() == 2);
Module m1_v1 = layer1.findModule("m1").get();
@@ -902,7 +899,7 @@ public class BasicLayerTest {
ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
Configuration cf1 = resolve(finder1, "m1");
ClassLoader cl1 = new ClassLoader() { };
- Layer layer1 = Layer.empty().defineModules(cf1, mn -> cl1);
+ ModuleLayer layer1 = ModuleLayer.empty().defineModules(cf1, mn -> cl1);
assertTrue(layer1.modules().size() == 1);
// create layer2 with m2
@@ -912,7 +909,7 @@ public class BasicLayerTest {
ModuleFinder finder2 = ModuleUtils.finderOf(descriptor2);
Configuration cf2 = resolve(cf1, finder2, "m2");
ClassLoader cl2 = new ClassLoader() { };
- Layer layer2 = layer1.defineModules(cf2, mn -> cl2);
+ ModuleLayer layer2 = layer1.defineModules(cf2, mn -> cl2);
assertTrue(layer2.modules().size() == 1);
Module m1 = layer1.findModule("m1").get();
@@ -924,9 +921,9 @@ public class BasicLayerTest {
}
/**
- * Attempt to use Layer defineModules to create a layer with a module
- * defined to a class loader that already has a module of the same name
- * defined to the class loader.
+ * Attempt to use defineModules to create a layer with a module defined
+ * to a class loader that already has a module of the same name defined
+ * to the class loader.
*/
@Test(expectedExceptions = { LayerInstantiationException.class })
public void testModuleAlreadyDefinedToLoader() {
@@ -937,24 +934,24 @@ public class BasicLayerTest {
ModuleFinder finder = ModuleUtils.finderOf(md);
- Configuration parent = Layer.boot().configuration();
+ Configuration parent = ModuleLayer.boot().configuration();
Configuration cf = parent.resolve(finder, ModuleFinder.of(), Set.of("m"));
ClassLoader loader = new ClassLoader() { };
- Layer.boot().defineModules(cf, mn -> loader);
+ ModuleLayer.boot().defineModules(cf, mn -> loader);
// should throw LayerInstantiationException as m1 already defined to loader
- Layer.boot().defineModules(cf, mn -> loader);
+ ModuleLayer.boot().defineModules(cf, mn -> loader);
}
/**
- * Attempt to use Layer defineModules to create a Layer with a module
- * containing package {@code p} where the class loader already has a module
- * defined to it containing package {@code p}.
+ * Attempt to use defineModules to create a layer with a module containing
+ * package {@code p} where the class loader already has a module defined
+ * to it containing package {@code p}.
*/
@Test(expectedExceptions = { LayerInstantiationException.class })
public void testPackageAlreadyInNamedModule() {
@@ -975,24 +972,24 @@ public class BasicLayerTest {
// define m1 containing package p to class loader
- Configuration parent = Layer.boot().configuration();
+ Configuration parent = ModuleLayer.boot().configuration();
Configuration cf1 = parent.resolve(finder, ModuleFinder.of(), Set.of("m1"));
- Layer layer1 = Layer.boot().defineModules(cf1, mn -> loader);
+ ModuleLayer layer1 = ModuleLayer.boot().defineModules(cf1, mn -> loader);
// attempt to define m2 containing package p to class loader
Configuration cf2 = parent.resolve(finder, ModuleFinder.of(), Set.of("m2"));
// should throw exception because p already in m1
- Layer layer2 = Layer.boot().defineModules(cf2, mn -> loader);
+ ModuleLayer layer2 = ModuleLayer.boot().defineModules(cf2, mn -> loader);
}
/**
- * Attempt to use Layer defineModules to create a Layer with a module
+ * Attempt to use defineModules to create a layer with a module
* containing a package in which a type is already loaded by the class
* loader.
*/
@@ -1009,15 +1006,15 @@ public class BasicLayerTest {
ModuleFinder finder = ModuleUtils.finderOf(md);
- Configuration parent = Layer.boot().configuration();
+ Configuration parent = ModuleLayer.boot().configuration();
Configuration cf = parent.resolve(finder, ModuleFinder.of(), Set.of("m"));
- Layer.boot().defineModules(cf, mn -> c.getClassLoader());
+ ModuleLayer.boot().defineModules(cf, mn -> c.getClassLoader());
}
/**
- * Attempt to create a Layer with a module named "java.base".
+ * Attempt to create a layer with a module named "java.base".
*/
public void testLayerWithJavaBase() {
ModuleDescriptor descriptor = newBuilder("java.base")
@@ -1026,7 +1023,7 @@ public class BasicLayerTest {
ModuleFinder finder = ModuleUtils.finderOf(descriptor);
- Configuration cf = Layer.boot()
+ Configuration cf = ModuleLayer.boot()
.configuration()
.resolve(finder, ModuleFinder.of(), Set.of("java.base"));
assertTrue(cf.modules().size() == 1);
@@ -1034,17 +1031,17 @@ public class BasicLayerTest {
ClassLoader scl = ClassLoader.getSystemClassLoader();
try {
- Layer.boot().defineModules(cf, mn -> new ClassLoader() { });
+ ModuleLayer.boot().defineModules(cf, mn -> new ClassLoader() { });
assertTrue(false);
} catch (LayerInstantiationException e) { }
try {
- Layer.boot().defineModulesWithOneLoader(cf, scl);
+ ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
assertTrue(false);
} catch (LayerInstantiationException e) { }
try {
- Layer.boot().defineModulesWithManyLoaders(cf, scl);
+ ModuleLayer.boot().defineModulesWithManyLoaders(cf, scl);
assertTrue(false);
} catch (LayerInstantiationException e) { }
}
@@ -1056,7 +1053,7 @@ public class BasicLayerTest {
}
/**
- * Attempt to create a Layer with a module containing a "java" package.
+ * Attempt to create a layer with a module containing a "java" package.
* This should only be allowed when the module is defined to the platform
* class loader.
*/
@@ -1065,7 +1062,7 @@ public class BasicLayerTest {
ModuleDescriptor descriptor = newBuilder(mn).packages(Set.of(pn)).build();
ModuleFinder finder = ModuleUtils.finderOf(descriptor);
- Configuration cf = Layer.boot()
+ Configuration cf = ModuleLayer.boot()
.configuration()
.resolve(finder, ModuleFinder.of(), Set.of(mn));
assertTrue(cf.modules().size() == 1);
@@ -1074,33 +1071,33 @@ public class BasicLayerTest {
ClassLoader scl = ClassLoader.getSystemClassLoader();
try {
- Layer.boot().defineModules(cf, _mn -> new ClassLoader() { });
+ ModuleLayer.boot().defineModules(cf, _mn -> new ClassLoader() { });
assertTrue(false);
} catch (LayerInstantiationException e) { }
try {
- Layer.boot().defineModulesWithOneLoader(cf, scl);
+ ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
assertTrue(false);
} catch (LayerInstantiationException e) { }
try {
- Layer.boot().defineModulesWithManyLoaders(cf, scl);
+ ModuleLayer.boot().defineModulesWithManyLoaders(cf, scl);
assertTrue(false);
} catch (LayerInstantiationException e) { }
// create layer with module defined to platform class loader
- Layer layer = Layer.boot().defineModules(cf, _mn -> pcl);
+ ModuleLayer layer = ModuleLayer.boot().defineModules(cf, _mn -> pcl);
Optional om = layer.findModule(mn);
assertTrue(om.isPresent());
Module foo = om.get();
assertTrue(foo.getClassLoader() == pcl);
- assertTrue(foo.getPackages().length == 1);
- assertTrue(foo.getPackages()[0].equals(pn));
+ assertTrue(foo.getPackages().size() == 1);
+ assertTrue(foo.getPackages().iterator().next().equals(pn));
}
/**
- * Attempt to create a Layer with a module defined to the boot loader
+ * Attempt to create a layer with a module defined to the boot loader
*/
@Test(expectedExceptions = { LayerInstantiationException.class })
public void testLayerWithBootLoader() {
@@ -1109,50 +1106,47 @@ public class BasicLayerTest {
ModuleFinder finder = ModuleUtils.finderOf(descriptor);
- Configuration cf = Layer.boot()
+ Configuration cf = ModuleLayer.boot()
.configuration()
.resolve(finder, ModuleFinder.of(), Set.of("m1"));
assertTrue(cf.modules().size() == 1);
- Layer.boot().defineModules(cf, mn -> null );
+ ModuleLayer.boot().defineModules(cf, mn -> null );
}
/**
- * Parent of configuration != configuration of parent Layer
+ * Parent of configuration != configuration of parent layer
*/
@Test(expectedExceptions = { IllegalArgumentException.class })
public void testIncorrectParent1() {
-
ModuleDescriptor descriptor1 = newBuilder("m1")
.requires("java.base")
.build();
ModuleFinder finder = ModuleUtils.finderOf(descriptor1);
- Configuration parent = Layer.boot().configuration();
+ Configuration parent = ModuleLayer.boot().configuration();
Configuration cf = parent.resolve(finder, ModuleFinder.of(), Set.of("m1"));
ClassLoader loader = new ClassLoader() { };
- Layer.empty().defineModules(cf, mn -> loader);
+ ModuleLayer.empty().defineModules(cf, mn -> loader);
}
/**
- * Parent of configuration != configuration of parent Layer
+ * Parent of configuration != configuration of parent layer
*/
@Test(expectedExceptions = { IllegalArgumentException.class })
public void testIncorrectParent2() {
-
- ModuleDescriptor descriptor1 = newBuilder("m1")
- .build();
+ ModuleDescriptor descriptor1 = newBuilder("m1").build();
ModuleFinder finder = ModuleUtils.finderOf(descriptor1);
Configuration cf = resolve(finder, "m1");
ClassLoader loader = new ClassLoader() { };
- Layer.boot().defineModules(cf, mn -> loader);
+ ModuleLayer.boot().defineModules(cf, mn -> loader);
}
@@ -1161,35 +1155,35 @@ public class BasicLayerTest {
@Test(expectedExceptions = { NullPointerException.class })
public void testCreateWithNull1() {
ClassLoader loader = new ClassLoader() { };
- Layer.empty().defineModules(null, mn -> loader);
+ ModuleLayer.empty().defineModules(null, mn -> loader);
}
@Test(expectedExceptions = { NullPointerException.class })
public void testCreateWithNull2() {
- Configuration cf = resolve(Layer.boot().configuration(), ModuleFinder.of());
- Layer.boot().defineModules(cf, null);
+ Configuration cf = resolve(ModuleLayer.boot().configuration(), ModuleFinder.of());
+ ModuleLayer.boot().defineModules(cf, null);
}
@Test(expectedExceptions = { NullPointerException.class })
public void testCreateWithNull3() {
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer.empty().defineModulesWithOneLoader(null, scl);
+ ModuleLayer.empty().defineModulesWithOneLoader(null, scl);
}
@Test(expectedExceptions = { NullPointerException.class })
public void testCreateWithNull4() {
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer.empty().defineModulesWithManyLoaders(null, scl);
+ ModuleLayer.empty().defineModulesWithManyLoaders(null, scl);
}
@Test(expectedExceptions = { NullPointerException.class })
public void testFindModuleWithNull() {
- Layer.boot().findModule(null);
+ ModuleLayer.boot().findModule(null);
}
@Test(expectedExceptions = { NullPointerException.class })
public void testFindLoaderWithNull() {
- Layer.boot().findLoader(null);
+ ModuleLayer.boot().findLoader(null);
}
@@ -1198,7 +1192,7 @@ public class BasicLayerTest {
@Test(expectedExceptions = { UnsupportedOperationException.class })
public void testImmutableSet() {
Module base = Object.class.getModule();
- Layer.boot().modules().add(base);
+ ModuleLayer.boot().modules().add(base);
}
diff --git a/jdk/test/java/lang/reflect/Layer/LayerAndLoadersTest.java b/jdk/test/java/lang/ModuleLayer/LayerAndLoadersTest.java
similarity index 88%
rename from jdk/test/java/lang/reflect/Layer/LayerAndLoadersTest.java
rename to jdk/test/java/lang/ModuleLayer/LayerAndLoadersTest.java
index ac6c035c297..a67555a47b1 100644
--- a/jdk/test/java/lang/reflect/Layer/LayerAndLoadersTest.java
+++ b/jdk/test/java/lang/ModuleLayer/LayerAndLoadersTest.java
@@ -27,7 +27,7 @@
* @modules jdk.compiler
* @build LayerAndLoadersTest CompilerUtils ModuleUtils
* @run testng LayerAndLoadersTest
- * @summary Tests for java.lang.reflect.Layer@createWithXXX methods
+ * @summary Tests for java.lang.ModuleLayer@defineModulesWithXXX methods
*/
import java.io.IOException;
@@ -36,10 +36,7 @@ import java.lang.module.Configuration;
import java.lang.module.ModuleDescriptor;
import java.lang.module.ModuleFinder;
import java.lang.module.ModuleReference;
-import java.lang.reflect.Layer;
-import java.lang.reflect.LayerInstantiationException;
import java.lang.reflect.Method;
-import java.lang.reflect.Module;
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -74,7 +71,7 @@ public class LayerAndLoadersTest {
/**
- * Basic test of Layer defineModulesWithOneLoader
+ * Basic test of ModuleLayer.defineModulesWithOneLoader
*
* Test scenario:
* m1 requires m2 and m3
@@ -85,7 +82,7 @@ public class LayerAndLoadersTest {
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer = Layer.boot().defineModulesWithOneLoader(cf, scl);
+ ModuleLayer layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
checkLayer(layer, "m1", "m2", "m3");
@@ -103,7 +100,7 @@ public class LayerAndLoadersTest {
/**
- * Basic test of Layer defineModulesWithManyLoaders
+ * Basic test of ModuleLayer.defineModulesWithManyLoaders
*
* Test scenario:
* m1 requires m2 and m3
@@ -114,7 +111,7 @@ public class LayerAndLoadersTest {
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer = Layer.boot().defineModulesWithManyLoaders(cf, scl);
+ ModuleLayer layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, scl);
checkLayer(layer, "m1", "m2", "m3");
@@ -135,8 +132,8 @@ public class LayerAndLoadersTest {
/**
- * Basic test of Layer defineModulesWithOneLoader where one of the modules
- * is a service provider module.
+ * Basic test of ModuleLayer.defineModulesWithOneLoader where one of the
+ * modules is a service provider module.
*
* Test scenario:
* m1 requires m2 and m3
@@ -149,7 +146,7 @@ public class LayerAndLoadersTest {
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer = Layer.boot().defineModulesWithOneLoader(cf, scl);
+ ModuleLayer layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
checkLayer(layer, "m1", "m2", "m3", "m4");
@@ -176,7 +173,7 @@ public class LayerAndLoadersTest {
/**
- * Basic test of Layer defineModulesWithManyLoaders where one of the
+ * Basic test of ModuleLayer.defineModulesWithManyLoaders where one of the
* modules is a service provider module.
*
* Test scenario:
@@ -190,7 +187,7 @@ public class LayerAndLoadersTest {
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer = Layer.boot().defineModulesWithManyLoaders(cf, scl);
+ ModuleLayer layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, scl);
checkLayer(layer, "m1", "m2", "m3", "m4");
@@ -239,19 +236,19 @@ public class LayerAndLoadersTest {
String cn = this.getClass().getName();
// one loader
- Layer layer = Layer.boot().defineModulesWithOneLoader(cf, parent);
+ ModuleLayer layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, parent);
testLoad(layer, cn);
// one loader with boot loader as parent
- layer = Layer.boot().defineModulesWithOneLoader(cf, null);
+ layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, null);
testLoadFail(layer, cn);
// many loaders
- layer = Layer.boot().defineModulesWithManyLoaders(cf, parent);
+ layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, parent);
testLoad(layer, cn);
// many loader with boot loader as parent
- layer = Layer.boot().defineModulesWithManyLoaders(cf, null);
+ layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, null);
testLoadFail(layer, cn);
}
@@ -274,25 +271,25 @@ public class LayerAndLoadersTest {
ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
- Configuration cf = Layer.boot()
+ Configuration cf = ModuleLayer.boot()
.configuration()
.resolve(finder, ModuleFinder.of(), Set.of("m1", "m2"));
// cannot define both module m1 and m2 to the same class loader
try {
- Layer.boot().defineModulesWithOneLoader(cf, null);
+ ModuleLayer.boot().defineModulesWithOneLoader(cf, null);
assertTrue(false);
} catch (LayerInstantiationException expected) { }
// should be okay to have one module per class loader
- Layer layer = Layer.boot().defineModulesWithManyLoaders(cf, null);
+ ModuleLayer layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, null);
checkLayer(layer, "m1", "m2");
}
/**
- * Test Layer defineModulesWithXXX with split delegation.
+ * Test ModuleLayer.defineModulesWithXXX with split delegation.
*
* Test scenario:
* layer1: m1 exports p, m2 exports p
@@ -308,11 +305,11 @@ public class LayerAndLoadersTest {
ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
- Configuration cf1 = Layer.boot()
+ Configuration cf1 = ModuleLayer.boot()
.configuration()
.resolve(finder1, ModuleFinder.of(), Set.of("m1", "m2"));
- Layer layer1 = Layer.boot().defineModulesWithManyLoaders(cf1, null);
+ ModuleLayer layer1 = ModuleLayer.boot().defineModulesWithManyLoaders(cf1, null);
checkLayer(layer1, "m1", "m2");
ModuleDescriptor descriptor3
@@ -333,14 +330,14 @@ public class LayerAndLoadersTest {
} catch (LayerInstantiationException expected) { }
// no split delegation when modules have their own class loader
- Layer layer2 = layer1.defineModulesWithManyLoaders(cf2, null);
+ ModuleLayer layer2 = layer1.defineModulesWithManyLoaders(cf2, null);
checkLayer(layer2, "m3", "m4");
}
/**
- * Test Layer defineModulesWithXXX when the modules that override same
+ * Test ModuleLayer.defineModulesWithXXX when the modules that override same
* named modules in the parent layer.
*
* Test scenario:
@@ -351,14 +348,14 @@ public class LayerAndLoadersTest {
Configuration cf1 = resolve("m1");
- Layer layer1 = Layer.boot().defineModulesWithOneLoader(cf1, null);
+ ModuleLayer layer1 = ModuleLayer.boot().defineModulesWithOneLoader(cf1, null);
checkLayer(layer1, "m1", "m2", "m3");
ModuleFinder finder = ModuleFinder.of(MODS_DIR);
Configuration cf2 = cf1.resolve(finder, ModuleFinder.of(),
Set.of("m1"));
- Layer layer2 = layer1.defineModulesWithOneLoader(cf2, null);
+ ModuleLayer layer2 = layer1.defineModulesWithOneLoader(cf2, null);
checkLayer(layer2, "m1", "m2", "m3");
invoke(layer1, "m1", "p.Main");
@@ -400,14 +397,14 @@ public class LayerAndLoadersTest {
Configuration cf1 = resolve("m1");
- Layer layer1 = Layer.boot().defineModulesWithManyLoaders(cf1, null);
+ ModuleLayer layer1 = ModuleLayer.boot().defineModulesWithManyLoaders(cf1, null);
checkLayer(layer1, "m1", "m2", "m3");
ModuleFinder finder = ModuleFinder.of(MODS_DIR);
Configuration cf2 = cf1.resolve(finder, ModuleFinder.of(),
Set.of("m1"));
- Layer layer2 = layer1.defineModulesWithManyLoaders(cf2, null);
+ ModuleLayer layer2 = layer1.defineModulesWithManyLoaders(cf2, null);
checkLayer(layer2, "m1", "m2", "m3");
invoke(layer1, "m1", "p.Main");
@@ -484,7 +481,7 @@ public class LayerAndLoadersTest {
/**
- * Test Layer defineModulesWithXXX when the modules that override same
+ * Test ModuleLayer.defineModulesWithXXX when the modules that override same
* named modules in the parent layer.
*
* layer1: m1, m2, m3 => same loader
@@ -494,7 +491,7 @@ public class LayerAndLoadersTest {
Configuration cf1 = resolve("m1");
- Layer layer1 = Layer.boot().defineModulesWithOneLoader(cf1, null);
+ ModuleLayer layer1 = ModuleLayer.boot().defineModulesWithOneLoader(cf1, null);
checkLayer(layer1, "m1", "m2", "m3");
ModuleFinder finder = finderFor("m1", "m3");
@@ -502,7 +499,7 @@ public class LayerAndLoadersTest {
Configuration cf2 = cf1.resolve(finder, ModuleFinder.of(),
Set.of("m1"));
- Layer layer2 = layer1.defineModulesWithOneLoader(cf2, null);
+ ModuleLayer layer2 = layer1.defineModulesWithOneLoader(cf2, null);
checkLayer(layer2, "m1", "m3");
invoke(layer1, "m1", "p.Main");
@@ -531,7 +528,7 @@ public class LayerAndLoadersTest {
Configuration cf1 = resolve("m1");
- Layer layer1 = Layer.boot().defineModulesWithManyLoaders(cf1, null);
+ ModuleLayer layer1 = ModuleLayer.boot().defineModulesWithManyLoaders(cf1, null);
checkLayer(layer1, "m1", "m2", "m3");
ModuleFinder finder = finderFor("m1", "m3");
@@ -539,7 +536,7 @@ public class LayerAndLoadersTest {
Configuration cf2 = cf1.resolve(finder, ModuleFinder.of(),
Set.of("m1"));
- Layer layer2 = layer1.defineModulesWithManyLoaders(cf2, null);
+ ModuleLayer layer2 = layer1.defineModulesWithManyLoaders(cf2, null);
checkLayer(layer2, "m1", "m3");
invoke(layer1, "m1", "p.Main");
@@ -579,7 +576,7 @@ public class LayerAndLoadersTest {
public void testResourcesOneLoader() throws Exception {
Configuration cf = resolve("m1");
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer = Layer.boot().defineModulesWithOneLoader(cf, scl);
+ ModuleLayer layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
ClassLoader loader = layer.findLoader("m1");
testResourceLoading(loader, "p/Main.class");
}
@@ -591,7 +588,7 @@ public class LayerAndLoadersTest {
public void testResourcesManyLoaders() throws Exception {
Configuration cf = resolve("m1");
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer = Layer.boot().defineModulesWithManyLoaders(cf, scl);
+ ModuleLayer layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, scl);
ClassLoader loader = layer.findLoader("m1");
testResourceLoading(loader, "p/Main.class");
}
@@ -623,7 +620,7 @@ public class LayerAndLoadersTest {
*/
private static Configuration resolve(String... roots) {
ModuleFinder finder = ModuleFinder.of(MODS_DIR);
- return Layer.boot()
+ return ModuleLayer.boot()
.configuration()
.resolve(finder, ModuleFinder.of(), Set.of(roots));
}
@@ -634,7 +631,7 @@ public class LayerAndLoadersTest {
*/
private static Configuration resolveAndBind(String... roots) {
ModuleFinder finder = ModuleFinder.of(MODS_DIR);
- return Layer.boot()
+ return ModuleLayer.boot()
.configuration()
.resolveAndBind(finder, ModuleFinder.of(), Set.of(roots));
}
@@ -644,7 +641,7 @@ public class LayerAndLoadersTest {
* Invokes the static void main(String[]) method on the given class
* in the given module.
*/
- private static void invoke(Layer layer, String mn, String mc) throws Exception {
+ private static void invoke(ModuleLayer layer, String mn, String mc) throws Exception {
ClassLoader loader = layer.findLoader(mn);
Class> c = loader.loadClass(mc);
Method mainMethod = c.getMethod("main", String[].class);
@@ -656,7 +653,7 @@ public class LayerAndLoadersTest {
* Checks that the given layer contains exactly the expected modules
* (by name).
*/
- private void checkLayer(Layer layer, String ... expected) {
+ private void checkLayer(ModuleLayer layer, String ... expected) {
Set names = layer.modules().stream()
.map(Module::getName)
.collect(Collectors.toSet());
@@ -671,7 +668,7 @@ public class LayerAndLoadersTest {
* Test that a class can be loaded via the class loader of all modules
* in the given layer.
*/
- static void testLoad(Layer layer, String cn) throws Exception {
+ static void testLoad(ModuleLayer layer, String cn) throws Exception {
for (Module m : layer.modules()) {
ClassLoader l = m.getClassLoader();
l.loadClass(cn);
@@ -683,7 +680,7 @@ public class LayerAndLoadersTest {
* Test that a class cannot be loaded via any of the class loaders of
* the modules in the given layer.
*/
- static void testLoadFail(Layer layer, String cn) throws Exception {
+ static void testLoadFail(ModuleLayer layer, String cn) throws Exception {
for (Module m : layer.modules()) {
ClassLoader l = m.getClassLoader();
try {
diff --git a/jdk/test/java/lang/reflect/Layer/LayerControllerTest.java b/jdk/test/java/lang/ModuleLayer/LayerControllerTest.java
similarity index 88%
rename from jdk/test/java/lang/reflect/Layer/LayerControllerTest.java
rename to jdk/test/java/lang/ModuleLayer/LayerControllerTest.java
index 4e4a0dbd5bd..28246cf9b66 100644
--- a/jdk/test/java/lang/reflect/Layer/LayerControllerTest.java
+++ b/jdk/test/java/lang/ModuleLayer/LayerControllerTest.java
@@ -26,14 +26,12 @@
* @library /lib/testlibrary
* @build LayerControllerTest ModuleUtils
* @run testng LayerControllerTest
- * @summary Basic tests for java.lang.reflect.Layer.Controller
+ * @summary Basic tests for java.lang.ModuleLayer.Controller
*/
import java.lang.module.Configuration;
import java.lang.module.ModuleDescriptor;
import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.util.List;
import java.util.Set;
@@ -48,7 +46,7 @@ public class LayerControllerTest {
* Module m1 contains p1, reads java.base, does not export/open any package
* Module m2 contains p2, reads java.base, does not export/open any package
*/
- private Layer.Controller createTestLayer() {
+ private ModuleLayer.Controller createTestLayer() {
ModuleDescriptor descriptor1
= ModuleDescriptor.newModule("m1")
.packages(Set.of("p1"))
@@ -62,17 +60,17 @@ public class LayerControllerTest {
.build();
ModuleFinder finder = ModuleUtils.finderOf(descriptor1, descriptor2);
- Layer bootLayer = Layer.boot();
+ ModuleLayer bootLayer = ModuleLayer.boot();
Configuration cf = bootLayer.configuration()
.resolve(finder, ModuleFinder.of(), Set.of("m1", "m2"));
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer.Controller controller
- = Layer.defineModulesWithOneLoader(cf, List.of(bootLayer), scl);
+ ModuleLayer.Controller controller
+ = ModuleLayer.defineModulesWithOneLoader(cf, List.of(bootLayer), scl);
- Layer layer = controller.layer();
+ ModuleLayer layer = controller.layer();
assertTrue(layer.modules().size() == 2);
assertTrue(layer.findModule("m1").isPresent());
@@ -82,12 +80,12 @@ public class LayerControllerTest {
}
/**
- * Basic test of Layer.Controller to update modules m1 and m2 to read and
+ * Basic test of Controller to update modules m1 and m2 to read and
* open packages to each other.
*/
public void testBasic() {
- Layer.Controller controller = createTestLayer();
- Layer layer = controller.layer();
+ ModuleLayer.Controller controller = createTestLayer();
+ ModuleLayer layer = controller.layer();
Module m1 = layer.findModule("m1").orElseThrow(RuntimeException::new);
Module m2 = layer.findModule("m2").orElseThrow(RuntimeException::new);
@@ -132,8 +130,8 @@ public class LayerControllerTest {
* Test invalid argument handling
*/
public void testBadArguments() {
- Layer.Controller controller = createTestLayer();
- Layer layer = controller.layer();
+ ModuleLayer.Controller controller = createTestLayer();
+ ModuleLayer layer = controller.layer();
Module m1 = layer.findModule("m1").orElseThrow(RuntimeException::new);
Module m2 = layer.findModule("m2").orElseThrow(RuntimeException::new);
Module base = Object.class.getModule();
@@ -161,8 +159,8 @@ public class LayerControllerTest {
* Test null handling
*/
public void testNulls() {
- Layer.Controller controller = createTestLayer();
- Layer layer = controller.layer();
+ ModuleLayer.Controller controller = createTestLayer();
+ ModuleLayer layer = controller.layer();
Module m1 = layer.findModule("m1").orElseThrow(RuntimeException::new);
Module m2 = layer.findModule("m2").orElseThrow(RuntimeException::new);
assertTrue(m1 != null);
diff --git a/jdk/test/java/lang/reflect/Layer/layertest/Test.java b/jdk/test/java/lang/ModuleLayer/layertest/Test.java
similarity index 95%
rename from jdk/test/java/lang/reflect/Layer/layertest/Test.java
rename to jdk/test/java/lang/ModuleLayer/layertest/Test.java
index f5c76ccbde5..5eac638e992 100644
--- a/jdk/test/java/lang/reflect/Layer/layertest/Test.java
+++ b/jdk/test/java/lang/ModuleLayer/layertest/Test.java
@@ -22,7 +22,7 @@
*/
/**
- * Supporting class for tests of java.lang.reflect.Layer.
+ * Supporting class for tests of java.lang.ModuleLayer.
*/
package layertest;
diff --git a/jdk/test/java/lang/reflect/Layer/src/m1/module-info.java b/jdk/test/java/lang/ModuleLayer/src/m1/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m1/module-info.java
rename to jdk/test/java/lang/ModuleLayer/src/m1/module-info.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m1/p/Main.java b/jdk/test/java/lang/ModuleLayer/src/m1/p/Main.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m1/p/Main.java
rename to jdk/test/java/lang/ModuleLayer/src/m1/p/Main.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m1/p/Service.java b/jdk/test/java/lang/ModuleLayer/src/m1/p/Service.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m1/p/Service.java
rename to jdk/test/java/lang/ModuleLayer/src/m1/p/Service.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m2/module-info.java b/jdk/test/java/lang/ModuleLayer/src/m2/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m2/module-info.java
rename to jdk/test/java/lang/ModuleLayer/src/m2/module-info.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m2/q/Hello.java b/jdk/test/java/lang/ModuleLayer/src/m2/q/Hello.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m2/q/Hello.java
rename to jdk/test/java/lang/ModuleLayer/src/m2/q/Hello.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m3/module-info.java b/jdk/test/java/lang/ModuleLayer/src/m3/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m3/module-info.java
rename to jdk/test/java/lang/ModuleLayer/src/m3/module-info.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m3/w/Hello.java b/jdk/test/java/lang/ModuleLayer/src/m3/w/Hello.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m3/w/Hello.java
rename to jdk/test/java/lang/ModuleLayer/src/m3/w/Hello.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m4/impl/ServiceImpl.java b/jdk/test/java/lang/ModuleLayer/src/m4/impl/ServiceImpl.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m4/impl/ServiceImpl.java
rename to jdk/test/java/lang/ModuleLayer/src/m4/impl/ServiceImpl.java
diff --git a/jdk/test/java/lang/reflect/Layer/src/m4/module-info.java b/jdk/test/java/lang/ModuleLayer/src/m4/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Layer/src/m4/module-info.java
rename to jdk/test/java/lang/ModuleLayer/src/m4/module-info.java
diff --git a/jdk/test/java/lang/reflect/Module/AddExportsTest.java b/jdk/test/java/lang/ModuleTests/AddExportsTest.java
similarity index 97%
rename from jdk/test/java/lang/reflect/Module/AddExportsTest.java
rename to jdk/test/java/lang/ModuleTests/AddExportsTest.java
index 3f4453614e8..e1204615e74 100644
--- a/jdk/test/java/lang/reflect/Module/AddExportsTest.java
+++ b/jdk/test/java/lang/ModuleTests/AddExportsTest.java
@@ -30,8 +30,6 @@
* @summary Test Module isExported methods with exports changed by -AddExportsTest
*/
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.util.Optional;
import java.util.stream.Stream;
@@ -55,7 +53,7 @@ public class AddExportsTest {
assertTrue(oaddExports.isPresent());
- Layer bootLayer = Layer.boot();
+ ModuleLayer bootLayer = ModuleLayer.boot();
Module unnamedModule = AddExportsTest.class.getModule();
assertFalse(unnamedModule.isNamed());
diff --git a/jdk/test/java/lang/reflect/Module/AnnotationsTest.java b/jdk/test/java/lang/ModuleTests/AnnotationsTest.java
similarity index 95%
rename from jdk/test/java/lang/reflect/Module/AnnotationsTest.java
rename to jdk/test/java/lang/ModuleTests/AnnotationsTest.java
index d30a0c07779..b4319a7bb11 100644
--- a/jdk/test/java/lang/reflect/Module/AnnotationsTest.java
+++ b/jdk/test/java/lang/ModuleTests/AnnotationsTest.java
@@ -26,8 +26,6 @@ import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -102,7 +100,7 @@ public class AnnotationsTest {
boolean forRemoval,
String since,
Path output) throws IOException {
- Module module = Layer.boot().findModule(name).orElse(null);
+ Module module = ModuleLayer.boot().findModule(name).orElse(null);
assertNotNull(module, name + " not found");
InputStream in = module.getResourceAsStream("module-info.class");
@@ -141,13 +139,13 @@ public class AnnotationsTest {
static Module loadModule(Path dir, String name) throws IOException {
ModuleFinder finder = ModuleFinder.of(dir);
- Layer bootLayer = Layer.boot();
+ ModuleLayer bootLayer = ModuleLayer.boot();
Configuration cf = bootLayer.configuration()
.resolve(finder, ModuleFinder.of(), Set.of(name));
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
+ ModuleLayer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
Module module = layer.findModule(name).orElse(null);
assertNotNull(module, name + " not loaded");
diff --git a/jdk/test/java/lang/reflect/Module/BasicModuleTest.java b/jdk/test/java/lang/ModuleTests/BasicModuleTest.java
similarity index 93%
rename from jdk/test/java/lang/reflect/Module/BasicModuleTest.java
rename to jdk/test/java/lang/ModuleTests/BasicModuleTest.java
index 90fb62b4a2e..b2f5eaa3a14 100644
--- a/jdk/test/java/lang/reflect/Module/BasicModuleTest.java
+++ b/jdk/test/java/lang/ModuleTests/BasicModuleTest.java
@@ -23,8 +23,6 @@
import java.lang.module.ModuleDescriptor.Exports;
import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.nio.file.spi.FileSystemProvider; // service type in java.base
import java.util.function.Predicate;
import java.util.stream.Stream;
@@ -35,7 +33,7 @@ import static org.testng.Assert.*;
/*
* @test
- * @summary Basic test of java.lang.reflect.Module
+ * @summary Basic test of java.lang.Module
* @modules java.desktop java.xml
* @run testng BasicModuleTest
*/
@@ -43,10 +41,10 @@ import static org.testng.Assert.*;
public class BasicModuleTest {
/**
- * Tests that the given module reads all modules in the boot Layer.
+ * Tests that the given module reads all modules in the boot layer.
*/
private void testReadsAllBootModules(Module m) {
- Layer bootLayer = Layer.boot();
+ ModuleLayer bootLayer = ModuleLayer.boot();
bootLayer.configuration()
.modules()
.stream()
@@ -55,13 +53,6 @@ public class BasicModuleTest {
.forEach(target -> assertTrue(m.canRead(target.get())));
}
- /**
- * Returns {@code true} if the array contains the given object.
- */
- private boolean contains(T[] array, T obj) {
- return Stream.of(array).anyMatch(obj::equals);
- }
-
/**
* Returns a {@code Predicate} to test if a package is exported.
*/
@@ -103,7 +94,7 @@ public class BasicModuleTest {
assertTrue(thisModule.isExported("p", baseModule));
// this test is in the unnamed package
- assertTrue(contains(thisModule.getPackages(), ""));
+ assertTrue(thisModule.getPackages().contains(""));
}
@@ -162,13 +153,13 @@ public class BasicModuleTest {
assertTrue(base.getClassLoader() == null);
// getLayer
- assertTrue(base.getLayer() == Layer.boot());
+ assertTrue(base.getLayer() == ModuleLayer.boot());
// toString
assertEquals(base.toString(), "module java.base");
// getPackages
- assertTrue(contains(base.getPackages(), "java.lang"));
+ assertTrue(base.getPackages().contains("java.lang"));
// canRead
assertTrue(base.canRead(base));
@@ -258,14 +249,14 @@ public class BasicModuleTest {
assertTrue(desktop.getClassLoader() == null);
// getLayer
- assertTrue(desktop.getLayer() == Layer.boot());
+ assertTrue(desktop.getLayer() == ModuleLayer.boot());
// toString
assertEquals(desktop.toString(), "module java.desktop");
// getPackages
- assertTrue(contains(desktop.getPackages(), "java.awt"));
- assertTrue(contains(desktop.getPackages(), "sun.awt"));
+ assertTrue(desktop.getPackages().contains("java.awt"));
+ assertTrue(desktop.getPackages().contains("sun.awt"));
// canRead
assertTrue(desktop.canRead(base));
diff --git a/jdk/test/java/lang/reflect/Module/WithSecurityManager.java b/jdk/test/java/lang/ModuleTests/WithSecurityManager.java
similarity index 92%
rename from jdk/test/java/lang/reflect/Module/WithSecurityManager.java
rename to jdk/test/java/lang/ModuleTests/WithSecurityManager.java
index 794ebf00e44..88813c859ac 100644
--- a/jdk/test/java/lang/reflect/Module/WithSecurityManager.java
+++ b/jdk/test/java/lang/ModuleTests/WithSecurityManager.java
@@ -24,7 +24,7 @@
/**
* @test
* @modules jdk.compiler
- * @summary Test java.lang.reflect.Module methods that specify permission checks
+ * @summary Test java.lang.Module methods that specify permission checks
* @run main/othervm -Djava.security.policy=${test.src}/allow.policy WithSecurityManager allow
* @run main/othervm WithSecurityManager deny
*/
@@ -34,14 +34,12 @@ import java.io.InputStream;
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
import java.lang.module.ModuleReference;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.util.Collections;
import java.util.Optional;
import java.util.Set;
/**
- * Test java.lang.reflect.Module methods that specify permission checks.
+ * Test java.lang.Module methods that specify permission checks.
*/
public class WithSecurityManager {
@@ -58,7 +56,7 @@ public class WithSecurityManager {
// another module, in a child layer
Module other = loadModuleInChildLayer(ANOTHER_MODULE);
- assertTrue(other.getLayer() != Layer.boot());
+ assertTrue(other.getLayer() != ModuleLayer.boot());
System.setSecurityManager(new SecurityManager());
@@ -123,11 +121,11 @@ public class WithSecurityManager {
};
// create a child configuration and layer with this module
- Layer bootLayer = Layer.boot();
+ ModuleLayer bootLayer = ModuleLayer.boot();
Configuration cf = bootLayer
.configuration()
.resolve(finder, ModuleFinder.of(), Set.of(ANOTHER_MODULE));
- Layer layer = bootLayer.defineModulesWithOneLoader(cf, null);
+ ModuleLayer layer = bootLayer.defineModulesWithOneLoader(cf, null);
Optional om = layer.findModule(mn);
assertTrue("module " + mn + " not in child layer", om.isPresent());
diff --git a/jdk/test/java/lang/reflect/Module/access/AccessTest.java b/jdk/test/java/lang/ModuleTests/access/AccessTest.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/access/AccessTest.java
rename to jdk/test/java/lang/ModuleTests/access/AccessTest.java
diff --git a/jdk/test/java/lang/reflect/Module/access/src/target/module-info.java b/jdk/test/java/lang/ModuleTests/access/src/target/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/access/src/target/module-info.java
rename to jdk/test/java/lang/ModuleTests/access/src/target/module-info.java
diff --git a/jdk/test/java/lang/reflect/Module/access/src/target/p1/Helper.java b/jdk/test/java/lang/ModuleTests/access/src/target/p1/Helper.java
similarity index 97%
rename from jdk/test/java/lang/reflect/Module/access/src/target/p1/Helper.java
rename to jdk/test/java/lang/ModuleTests/access/src/target/p1/Helper.java
index e0e45e82a06..cbed4fbaec7 100644
--- a/jdk/test/java/lang/reflect/Module/access/src/target/p1/Helper.java
+++ b/jdk/test/java/lang/ModuleTests/access/src/target/p1/Helper.java
@@ -23,8 +23,6 @@
package p1;
-import java.lang.reflect.Module;
-
/**
* Helper class in target module to allow test invoke addExports[Private]
*/
diff --git a/jdk/test/java/lang/reflect/Module/access/src/target/p1/Public.java b/jdk/test/java/lang/ModuleTests/access/src/target/p1/Public.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/access/src/target/p1/Public.java
rename to jdk/test/java/lang/ModuleTests/access/src/target/p1/Public.java
diff --git a/jdk/test/java/lang/reflect/Module/access/src/target/p2/NonPublic.java b/jdk/test/java/lang/ModuleTests/access/src/target/p2/NonPublic.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/access/src/target/p2/NonPublic.java
rename to jdk/test/java/lang/ModuleTests/access/src/target/p2/NonPublic.java
diff --git a/jdk/test/java/lang/reflect/Module/access/src/target/q1/Public.java b/jdk/test/java/lang/ModuleTests/access/src/target/q1/Public.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/access/src/target/q1/Public.java
rename to jdk/test/java/lang/ModuleTests/access/src/target/q1/Public.java
diff --git a/jdk/test/java/lang/reflect/Module/access/src/target/q2/NonPublic.java b/jdk/test/java/lang/ModuleTests/access/src/target/q2/NonPublic.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/access/src/target/q2/NonPublic.java
rename to jdk/test/java/lang/ModuleTests/access/src/target/q2/NonPublic.java
diff --git a/jdk/test/java/lang/reflect/Module/access/src/test/module-info.java b/jdk/test/java/lang/ModuleTests/access/src/test/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/access/src/test/module-info.java
rename to jdk/test/java/lang/ModuleTests/access/src/test/module-info.java
diff --git a/jdk/test/java/lang/reflect/Module/access/src/test/test/Main.java b/jdk/test/java/lang/ModuleTests/access/src/test/test/Main.java
similarity index 99%
rename from jdk/test/java/lang/reflect/Module/access/src/test/test/Main.java
rename to jdk/test/java/lang/ModuleTests/access/src/test/test/Main.java
index c58b8e202dd..dc81f25a563 100644
--- a/jdk/test/java/lang/reflect/Module/access/src/test/test/Main.java
+++ b/jdk/test/java/lang/ModuleTests/access/src/test/test/Main.java
@@ -26,9 +26,7 @@ package test;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
-import java.lang.reflect.Layer;
import java.lang.reflect.Method;
-import java.lang.reflect.Module;
/**
* Test access to public/non-public members of public/non-public classes in
@@ -305,7 +303,7 @@ public class Main {
static Module getTargetModule() {
- return Layer.boot().findModule("target").get();
+ return ModuleLayer.boot().findModule("target").get();
}
static void tryAccessConstructor(Constructor> ctor, boolean shouldSucceed) {
diff --git a/jdk/test/java/lang/reflect/Module/addXXX/Driver.java b/jdk/test/java/lang/ModuleTests/addXXX/Driver.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/addXXX/Driver.java
rename to jdk/test/java/lang/ModuleTests/addXXX/Driver.java
diff --git a/jdk/test/java/lang/reflect/Module/addXXX/m1/module-info.java b/jdk/test/java/lang/ModuleTests/addXXX/m1/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/addXXX/m1/module-info.java
rename to jdk/test/java/lang/ModuleTests/addXXX/m1/module-info.java
diff --git a/jdk/test/java/lang/reflect/Module/addXXX/m1/p1/C.java b/jdk/test/java/lang/ModuleTests/addXXX/m1/p1/C.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/addXXX/m1/p1/C.java
rename to jdk/test/java/lang/ModuleTests/addXXX/m1/p1/C.java
diff --git a/jdk/test/java/lang/reflect/Module/addXXX/m2/module-info.java b/jdk/test/java/lang/ModuleTests/addXXX/m2/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/addXXX/m2/module-info.java
rename to jdk/test/java/lang/ModuleTests/addXXX/m2/module-info.java
diff --git a/jdk/test/java/lang/reflect/Module/addXXX/m2/p2/C.java b/jdk/test/java/lang/ModuleTests/addXXX/m2/p2/C.java
similarity index 97%
rename from jdk/test/java/lang/reflect/Module/addXXX/m2/p2/C.java
rename to jdk/test/java/lang/ModuleTests/addXXX/m2/p2/C.java
index 6a87a2eba87..d3c5f467250 100644
--- a/jdk/test/java/lang/reflect/Module/addXXX/m2/p2/C.java
+++ b/jdk/test/java/lang/ModuleTests/addXXX/m2/p2/C.java
@@ -22,8 +22,6 @@
*/
package p2;
-import java.lang.reflect.Module;
-
public class C {
public static void export(String pn, Module m) {
diff --git a/jdk/test/java/lang/reflect/Module/addXXX/m2/p2/internal/C.java b/jdk/test/java/lang/ModuleTests/addXXX/m2/p2/internal/C.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/addXXX/m2/p2/internal/C.java
rename to jdk/test/java/lang/ModuleTests/addXXX/m2/p2/internal/C.java
diff --git a/jdk/test/java/lang/reflect/Module/addXXX/m3/module-info.java b/jdk/test/java/lang/ModuleTests/addXXX/m3/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/addXXX/m3/module-info.java
rename to jdk/test/java/lang/ModuleTests/addXXX/m3/module-info.java
diff --git a/jdk/test/java/lang/reflect/Module/addXXX/m3/p3/C.java b/jdk/test/java/lang/ModuleTests/addXXX/m3/p3/C.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/addXXX/m3/p3/C.java
rename to jdk/test/java/lang/ModuleTests/addXXX/m3/p3/C.java
diff --git a/jdk/test/java/lang/reflect/Module/addXXX/m4/module-info.java b/jdk/test/java/lang/ModuleTests/addXXX/m4/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/addXXX/m4/module-info.java
rename to jdk/test/java/lang/ModuleTests/addXXX/m4/module-info.java
diff --git a/jdk/test/java/lang/reflect/Module/addXXX/m4/p4/C.java b/jdk/test/java/lang/ModuleTests/addXXX/m4/p4/C.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/addXXX/m4/p4/C.java
rename to jdk/test/java/lang/ModuleTests/addXXX/m4/p4/C.java
diff --git a/jdk/test/java/lang/reflect/Module/addXXX/test/module-info.java b/jdk/test/java/lang/ModuleTests/addXXX/test/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/addXXX/test/module-info.java
rename to jdk/test/java/lang/ModuleTests/addXXX/test/module-info.java
diff --git a/jdk/test/java/lang/reflect/Module/addXXX/test/test/C.java b/jdk/test/java/lang/ModuleTests/addXXX/test/test/C.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/addXXX/test/test/C.java
rename to jdk/test/java/lang/ModuleTests/addXXX/test/test/C.java
diff --git a/jdk/test/java/lang/reflect/Module/addXXX/test/test/Main.java b/jdk/test/java/lang/ModuleTests/addXXX/test/test/Main.java
similarity index 99%
rename from jdk/test/java/lang/reflect/Module/addXXX/test/test/Main.java
rename to jdk/test/java/lang/ModuleTests/addXXX/test/test/Main.java
index 924f0a87de4..9a191a1dcfc 100644
--- a/jdk/test/java/lang/reflect/Module/addXXX/test/test/Main.java
+++ b/jdk/test/java/lang/ModuleTests/addXXX/test/test/Main.java
@@ -27,7 +27,6 @@ import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.Constructor;
-import java.lang.reflect.Module;
import java.util.ServiceConfigurationError;
import java.util.ServiceLoader;
diff --git a/jdk/test/java/lang/reflect/Module/addXXX/test/test/Service.java b/jdk/test/java/lang/ModuleTests/addXXX/test/test/Service.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/addXXX/test/test/Service.java
rename to jdk/test/java/lang/ModuleTests/addXXX/test/test/Service.java
diff --git a/jdk/test/java/lang/reflect/Module/allow.policy b/jdk/test/java/lang/ModuleTests/allow.policy
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/allow.policy
rename to jdk/test/java/lang/ModuleTests/allow.policy
diff --git a/jdk/test/java/lang/reflect/Module/annotation/Basic.java b/jdk/test/java/lang/ModuleTests/annotation/Basic.java
similarity index 98%
rename from jdk/test/java/lang/reflect/Module/annotation/Basic.java
rename to jdk/test/java/lang/ModuleTests/annotation/Basic.java
index 43733782d58..dc17cbb5e4f 100644
--- a/jdk/test/java/lang/reflect/Module/annotation/Basic.java
+++ b/jdk/test/java/lang/ModuleTests/annotation/Basic.java
@@ -29,7 +29,6 @@
* @summary Basic test for annotations on modules
*/
-import java.lang.reflect.Module;
import java.util.Arrays;
import p.annotation.Foo;
diff --git a/jdk/test/java/lang/reflect/Module/annotation/src/m/module-info.java b/jdk/test/java/lang/ModuleTests/annotation/src/m/module-info.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/annotation/src/m/module-info.java
rename to jdk/test/java/lang/ModuleTests/annotation/src/m/module-info.java
diff --git a/jdk/test/java/lang/reflect/Module/annotation/src/m/p/annotation/Bar.java b/jdk/test/java/lang/ModuleTests/annotation/src/m/p/annotation/Bar.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/annotation/src/m/p/annotation/Bar.java
rename to jdk/test/java/lang/ModuleTests/annotation/src/m/p/annotation/Bar.java
diff --git a/jdk/test/java/lang/reflect/Module/annotation/src/m/p/annotation/Baz.java b/jdk/test/java/lang/ModuleTests/annotation/src/m/p/annotation/Baz.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/annotation/src/m/p/annotation/Baz.java
rename to jdk/test/java/lang/ModuleTests/annotation/src/m/p/annotation/Baz.java
diff --git a/jdk/test/java/lang/reflect/Module/annotation/src/m/p/annotation/Foo.java b/jdk/test/java/lang/ModuleTests/annotation/src/m/p/annotation/Foo.java
similarity index 100%
rename from jdk/test/java/lang/reflect/Module/annotation/src/m/p/annotation/Foo.java
rename to jdk/test/java/lang/ModuleTests/annotation/src/m/p/annotation/Foo.java
diff --git a/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java b/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java
index 1df260bc412..8ecf21b964f 100644
--- a/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java
+++ b/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java
@@ -33,7 +33,6 @@
import java.lang.module.ModuleFinder;
import java.lang.module.ModuleReference;
-import java.lang.reflect.Layer;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
@@ -82,7 +81,7 @@ public class CheckPackageAccess {
void test() {
final boolean isModulePresent =
- Layer.boot().findModule(moduleName).isPresent();
+ ModuleLayer.boot().findModule(moduleName).isPresent();
System.out.format("Testing module: %1$s. Module is%2$s present.\n",
moduleName, isModulePresent ? "" : " NOT");
diff --git a/jdk/test/java/lang/SecurityManager/CheckSecurityProvider.java b/jdk/test/java/lang/SecurityManager/CheckSecurityProvider.java
index 6aa14ca9342..7034f114aa3 100644
--- a/jdk/test/java/lang/SecurityManager/CheckSecurityProvider.java
+++ b/jdk/test/java/lang/SecurityManager/CheckSecurityProvider.java
@@ -28,7 +28,6 @@
* @run main/othervm CheckSecurityProvider
*/
-import java.lang.reflect.Layer;
import java.security.Provider;
import java.security.Security;
import java.util.ArrayList;
@@ -45,7 +44,7 @@ import java.util.stream.Stream;
*/
public class CheckSecurityProvider {
public static void main(String[] args) throws Exception {
- Layer layer = Layer.boot();
+ ModuleLayer layer = ModuleLayer.boot();
System.setSecurityManager(new SecurityManager());
diff --git a/jdk/test/java/lang/SecurityManager/modules/Test.java b/jdk/test/java/lang/SecurityManager/modules/Test.java
index 81cf617aa79..db499ff6299 100644
--- a/jdk/test/java/lang/SecurityManager/modules/Test.java
+++ b/jdk/test/java/lang/SecurityManager/modules/Test.java
@@ -21,8 +21,6 @@
* questions.
*/
-import java.lang.reflect.Module;
-
public class Test {
public static void main(String... args) {
SecurityManager sm = System.getSecurityManager();
diff --git a/jdk/test/java/lang/StackTraceElement/PublicConstructor.java b/jdk/test/java/lang/StackTraceElement/PublicConstructor.java
index 254be7825f7..7deb732e4ce 100644
--- a/jdk/test/java/lang/StackTraceElement/PublicConstructor.java
+++ b/jdk/test/java/lang/StackTraceElement/PublicConstructor.java
@@ -29,7 +29,6 @@
*/
import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Module;
public class PublicConstructor {
public static void main(String... args) {
diff --git a/jdk/test/java/lang/StackTraceElement/lib/m1/com/app/Utils.java b/jdk/test/java/lang/StackTraceElement/lib/m1/com/app/Utils.java
index 4c571af6833..ef55672ef65 100644
--- a/jdk/test/java/lang/StackTraceElement/lib/m1/com/app/Utils.java
+++ b/jdk/test/java/lang/StackTraceElement/lib/m1/com/app/Utils.java
@@ -25,7 +25,6 @@ package com.app;
import java.lang.StackWalker.StackFrame;
import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Module;
import java.util.Objects;
public class Utils {
diff --git a/jdk/test/java/lang/System/Logger/custom/CustomLoggerTest.java b/jdk/test/java/lang/System/Logger/custom/CustomLoggerTest.java
index d1653ca5f1e..4e18babd0b0 100644
--- a/jdk/test/java/lang/System/Logger/custom/CustomLoggerTest.java
+++ b/jdk/test/java/lang/System/Logger/custom/CustomLoggerTest.java
@@ -46,7 +46,6 @@ import java.lang.System.LoggerFinder;
import java.lang.System.Logger;
import java.lang.System.Logger.Level;
import java.util.stream.Stream;
-import java.lang.reflect.Module;
import java.security.AllPermission;
/**
diff --git a/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/BaseLoggerFinder.java b/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/BaseLoggerFinder.java
index 3db7cef65f8..ae07c7096a7 100644
--- a/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/BaseLoggerFinder.java
+++ b/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/BaseLoggerFinder.java
@@ -25,7 +25,6 @@ import java.security.AccessController;
import java.security.PrivilegedAction;
import java.lang.System.LoggerFinder;
import java.lang.System.Logger;
-import java.lang.reflect.Module;
public class BaseLoggerFinder extends LoggerFinder implements TestLoggerFinder {
diff --git a/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/TestLoggerFinder.java b/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/TestLoggerFinder.java
index cb86e513f90..5e08f15db4b 100644
--- a/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/TestLoggerFinder.java
+++ b/jdk/test/java/lang/System/LoggerFinder/BaseLoggerFinderTest/TestLoggerFinder.java
@@ -30,7 +30,6 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Supplier;
import java.lang.System.Logger;
-import java.lang.reflect.Module;
/**
* What our test provider needs to implement.
diff --git a/jdk/test/java/lang/System/LoggerFinder/LoggerFinderAPI/LoggerFinderAPI.java b/jdk/test/java/lang/System/LoggerFinder/LoggerFinderAPI/LoggerFinderAPI.java
index ceab7f43be7..3c8944e437a 100644
--- a/jdk/test/java/lang/System/LoggerFinder/LoggerFinderAPI/LoggerFinderAPI.java
+++ b/jdk/test/java/lang/System/LoggerFinder/LoggerFinderAPI/LoggerFinderAPI.java
@@ -28,7 +28,6 @@ import java.io.PrintStream;
import java.lang.System.Logger;
import java.lang.System.Logger.Level;
import java.lang.System.LoggerFinder;
-import java.lang.reflect.Module;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Objects;
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/BaseDefaultLoggerFinderTest/BaseDefaultLoggerFinderTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/BaseDefaultLoggerFinderTest/BaseDefaultLoggerFinderTest.java
index ab80d0f8bc6..ce5e714d95f 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/BaseDefaultLoggerFinderTest/BaseDefaultLoggerFinderTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/BaseDefaultLoggerFinderTest/BaseDefaultLoggerFinderTest.java
@@ -55,7 +55,6 @@ import java.util.function.Function;
import jdk.internal.logger.DefaultLoggerFinder;
import jdk.internal.logger.SimpleConsoleLogger;
import sun.util.logging.PlatformLogger;
-import java.lang.reflect.Module;
/**
* @test
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/BaseLoggerBridgeTest/BaseLoggerBridgeTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/BaseLoggerBridgeTest/BaseLoggerBridgeTest.java
index d28481c305f..98ecc69e3d1 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/BaseLoggerBridgeTest/BaseLoggerBridgeTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/BaseLoggerBridgeTest/BaseLoggerBridgeTest.java
@@ -47,7 +47,6 @@ import java.lang.System.LoggerFinder;
import java.lang.System.Logger;
import java.lang.System.Logger.Level;
import java.util.stream.Stream;
-import java.lang.reflect.Module;
/**
* @test
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/BasePlatformLoggerTest/BasePlatformLoggerTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/BasePlatformLoggerTest/BasePlatformLoggerTest.java
index a9e441f9d7c..af15a51eba3 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/BasePlatformLoggerTest/BasePlatformLoggerTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/BasePlatformLoggerTest/BasePlatformLoggerTest.java
@@ -47,7 +47,6 @@ import java.lang.System.Logger.Level;
import java.security.AccessControlException;
import java.util.stream.Stream;
import sun.util.logging.PlatformLogger;
-import java.lang.reflect.Module;
/**
* @test
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java
index 1b6a5c6e145..19b100960e5 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java
@@ -30,7 +30,6 @@ import java.util.Enumeration;
import java.util.List;
import java.util.ResourceBundle;
import java.util.Set;
-import java.lang.reflect.Module;
import jdk.internal.logger.BootstrapLogger;
import jdk.internal.logger.LazyLoggers;
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java
index f34ab76400b..8bc016b1223 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java
@@ -43,7 +43,6 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import jdk.internal.logger.BootstrapLogger;
import jdk.internal.logger.LazyLoggers;
-import java.lang.reflect.Module;
/*
* @test
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/LoggerBridgeTest/LoggerBridgeTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/LoggerBridgeTest/LoggerBridgeTest.java
index be5ad125518..bd70d541a45 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/LoggerBridgeTest/LoggerBridgeTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/LoggerBridgeTest/LoggerBridgeTest.java
@@ -51,7 +51,6 @@ import java.lang.System.Logger;
import java.lang.System.Logger.Level;
import java.util.stream.Stream;
import sun.util.logging.PlatformLogger;
-import java.lang.reflect.Module;
/**
* @test
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/LoggerFinderLoaderTest/LoggerFinderLoaderTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/LoggerFinderLoaderTest/LoggerFinderLoaderTest.java
index 6343a90312c..192be7f828f 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/LoggerFinderLoaderTest/LoggerFinderLoaderTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/LoggerFinderLoaderTest/LoggerFinderLoaderTest.java
@@ -53,7 +53,6 @@ import java.util.ServiceConfigurationError;
import java.util.ServiceLoader;
import java.util.concurrent.atomic.AtomicReference;
import jdk.internal.logger.SimpleConsoleLogger;
-import java.lang.reflect.Module;
/**
* @test
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest/PlatformLoggerBridgeTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest/PlatformLoggerBridgeTest.java
index 9576e17bed6..c409c22a1a3 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest/PlatformLoggerBridgeTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest/PlatformLoggerBridgeTest.java
@@ -49,7 +49,6 @@ import java.lang.System.Logger;
import java.lang.System.Logger.Level;
import java.util.stream.Stream;
import sun.util.logging.PlatformLogger;
-import java.lang.reflect.Module;
/**
* @test
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/SystemLoggerInPlatformLoader.java b/jdk/test/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/SystemLoggerInPlatformLoader.java
index 25be130d8ec..fe0f9e53e3d 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/SystemLoggerInPlatformLoader.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/SystemLoggerInPlatformLoader/SystemLoggerInPlatformLoader.java
@@ -28,7 +28,6 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Layer;
import java.lang.reflect.Method;
/*
@@ -106,7 +105,7 @@ public class SystemLoggerInPlatformLoader {
}
Class> platformLoggerType = platformLogger.getClass();
System.out.println("platformLogger: " + platformLoggerType);
- boolean simpleConsoleOnly = !Layer.boot().findModule("java.logging").isPresent();
+ boolean simpleConsoleOnly = !ModuleLayer.boot().findModule("java.logging").isPresent();
if (simpleConsoleOnly) {
/* Happens if the test is called with custom JDK without java.logging module
or in case usage commandline option --limit-modules java.base */
diff --git a/jdk/test/java/lang/System/LoggerFinder/internal/backend/LoggerFinderBackendTest.java b/jdk/test/java/lang/System/LoggerFinder/internal/backend/LoggerFinderBackendTest.java
index 6abc3c58e73..d2e20b354da 100644
--- a/jdk/test/java/lang/System/LoggerFinder/internal/backend/LoggerFinderBackendTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/internal/backend/LoggerFinderBackendTest.java
@@ -78,7 +78,6 @@ import java.util.logging.LogManager;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import sun.util.logging.internal.LoggingProviderImpl;
-import java.lang.reflect.Module;
/**
* @author danielfuchs
diff --git a/jdk/test/java/lang/System/LoggerFinder/jdk/DefaultLoggerBridgeTest/DefaultLoggerBridgeTest.java b/jdk/test/java/lang/System/LoggerFinder/jdk/DefaultLoggerBridgeTest/DefaultLoggerBridgeTest.java
index cba6f7b1b44..d2348a2c9dd 100644
--- a/jdk/test/java/lang/System/LoggerFinder/jdk/DefaultLoggerBridgeTest/DefaultLoggerBridgeTest.java
+++ b/jdk/test/java/lang/System/LoggerFinder/jdk/DefaultLoggerBridgeTest/DefaultLoggerBridgeTest.java
@@ -48,7 +48,6 @@ import java.lang.System.LoggerFinder;
import java.lang.System.Logger;
import java.util.stream.Stream;
import sun.util.logging.internal.LoggingProviderImpl;
-import java.lang.reflect.Module;
/**
* @test
diff --git a/jdk/test/java/lang/reflect/WeakPairMap/Driver.java b/jdk/test/java/lang/WeakPairMap/Driver.java
similarity index 91%
rename from jdk/test/java/lang/reflect/WeakPairMap/Driver.java
rename to jdk/test/java/lang/WeakPairMap/Driver.java
index f84956d687e..4009561a8e2 100644
--- a/jdk/test/java/lang/reflect/WeakPairMap/Driver.java
+++ b/jdk/test/java/lang/WeakPairMap/Driver.java
@@ -25,11 +25,11 @@
* @test
* @bug 8888888
* @summary Functional test for WeakPairMap
- * @build java.base/java.lang.reflect.WeakPairMapTest
+ * @build java.base/java.lang.WeakPairMapTest
* @run main Driver
*/
public class Driver {
public static void main(String[] args) {
- java.lang.reflect.WeakPairMapTest.main(args);
+ java.lang.WeakPairMapTest.main(args);
}
}
diff --git a/jdk/test/java/lang/reflect/WeakPairMap/java.base/java/lang/reflect/WeakPairMapTest.java b/jdk/test/java/lang/WeakPairMap/java.base/java/lang/WeakPairMapTest.java
similarity index 99%
rename from jdk/test/java/lang/reflect/WeakPairMap/java.base/java/lang/reflect/WeakPairMapTest.java
rename to jdk/test/java/lang/WeakPairMap/java.base/java/lang/WeakPairMapTest.java
index 3247bb317ac..6267d537f06 100644
--- a/jdk/test/java/lang/reflect/WeakPairMap/java.base/java/lang/reflect/WeakPairMapTest.java
+++ b/jdk/test/java/lang/WeakPairMap/java.base/java/lang/WeakPairMapTest.java
@@ -21,7 +21,7 @@
* questions.
*/
-package java.lang.reflect;
+package java.lang;
import java.lang.ref.Reference;
import java.util.Objects;
diff --git a/jdk/test/java/lang/instrument/ATransformerManagementTestCase.java b/jdk/test/java/lang/instrument/ATransformerManagementTestCase.java
index 5f88d3c9ba5..00f3447ef6a 100644
--- a/jdk/test/java/lang/instrument/ATransformerManagementTestCase.java
+++ b/jdk/test/java/lang/instrument/ATransformerManagementTestCase.java
@@ -24,8 +24,6 @@
import java.io.*;
import java.lang.instrument.*;
-
-import java.lang.reflect.Module;
import java.security.ProtectionDomain;
import java.util.*;
diff --git a/jdk/test/java/lang/instrument/BootstrapClassPathAgent.java b/jdk/test/java/lang/instrument/BootstrapClassPathAgent.java
index 96d02bfa066..6b0c71aef94 100644
--- a/jdk/test/java/lang/instrument/BootstrapClassPathAgent.java
+++ b/jdk/test/java/lang/instrument/BootstrapClassPathAgent.java
@@ -26,7 +26,6 @@ package p;
import java.io.*;
import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.Instrumentation;
-import java.lang.reflect.Module;
import java.security.ProtectionDomain;
public class BootstrapClassPathAgent {
diff --git a/jdk/test/java/lang/instrument/BootstrapClassPathTest.java b/jdk/test/java/lang/instrument/BootstrapClassPathTest.java
index bee8602308e..9f60090506d 100644
--- a/jdk/test/java/lang/instrument/BootstrapClassPathTest.java
+++ b/jdk/test/java/lang/instrument/BootstrapClassPathTest.java
@@ -33,7 +33,6 @@
import java.io.*;
import java.lang.instrument.*;
-import java.lang.reflect.Module;
import java.security.ProtectionDomain;
public class BootstrapClassPathTest {
diff --git a/jdk/test/java/lang/instrument/RedefineClassWithNativeMethodAgent.java b/jdk/test/java/lang/instrument/RedefineClassWithNativeMethodAgent.java
index b1146712f30..704b85b062f 100644
--- a/jdk/test/java/lang/instrument/RedefineClassWithNativeMethodAgent.java
+++ b/jdk/test/java/lang/instrument/RedefineClassWithNativeMethodAgent.java
@@ -24,7 +24,6 @@
import java.io.InputStream;
import java.lang.instrument.ClassDefinition;
import java.lang.instrument.Instrumentation;
-import java.lang.reflect.Module;
import java.util.Timer;
import java.util.TimerTask;
diff --git a/jdk/test/java/lang/instrument/RedefineModuleAgent.java b/jdk/test/java/lang/instrument/RedefineModuleAgent.java
index 8d96db1c205..aa38d6b21c9 100644
--- a/jdk/test/java/lang/instrument/RedefineModuleAgent.java
+++ b/jdk/test/java/lang/instrument/RedefineModuleAgent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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
@@ -22,7 +22,6 @@
*/
import java.lang.instrument.Instrumentation;
-import java.lang.reflect.Module;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -47,4 +46,8 @@ public class RedefineModuleAgent {
Map, List>> extraProvides) {
inst.redefineModule(module, extraReads, extraExports, extraOpens, extraUses, extraProvides);
}
+
+ static boolean isModifiableModule(Module module) {
+ return inst.isModifiableModule(module);
+ }
}
diff --git a/jdk/test/java/lang/instrument/RedefineModuleTest.java b/jdk/test/java/lang/instrument/RedefineModuleTest.java
index b3f79ba4cd1..60ae18f7d09 100644
--- a/jdk/test/java/lang/instrument/RedefineModuleTest.java
+++ b/jdk/test/java/lang/instrument/RedefineModuleTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2017, 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
@@ -34,8 +34,6 @@
import java.lang.TestProvider;
import java.lang.instrument.Instrumentation;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.net.URLStreamHandler;
import java.net.spi.URLStreamHandlerProvider;
import java.nio.file.FileSystems;
@@ -68,6 +66,10 @@ public class RedefineModuleTest {
extraProvides);
}
+ static boolean isModifiableModule(Module module) {
+ return RedefineModuleAgent.isModifiableModule(module);
+ }
+
/**
* Use redefineModule to update java.base to read java.instrument
@@ -138,13 +140,13 @@ public class RedefineModuleTest {
// pre-conditions
assertFalse(baseModule.canUse(service));
assertTrue(collect(ServiceLoader.load(service)).isEmpty());
- assertTrue(collect(ServiceLoader.load(Layer.boot(), service)).isEmpty());
+ assertTrue(collect(ServiceLoader.load(ModuleLayer.boot(), service)).isEmpty());
// update java.base to use TestProvider
redefineModule(baseModule, Set.of(), Map.of(), Map.of(), Set.of(service), Map.of());
assertTrue(baseModule.canUse(service));
assertTrue(collect(ServiceLoader.load(service)).isEmpty());
- assertTrue(collect(ServiceLoader.load(Layer.boot(), service)).isEmpty());
+ assertTrue(collect(ServiceLoader.load(ModuleLayer.boot(), service)).isEmpty());
// update java.base to provide an implementation of TestProvider
Class> type1 = Class.forName("jdk.internal.test.TestProviderImpl1");
@@ -162,7 +164,7 @@ public class RedefineModuleTest {
assertTrue(containsInstanceOf(collect(providers), type1));
// use ServiceLoader to load implementations in the boot layer
- providers = collect(ServiceLoader.load(Layer.boot(), service));
+ providers = collect(ServiceLoader.load(ModuleLayer.boot(), service));
assertTrue(collect(providers).size() == 1);
assertTrue(containsInstanceOf(collect(providers), type1));
@@ -184,7 +186,7 @@ public class RedefineModuleTest {
assertTrue(containsInstanceOf(providers, type2));
// use ServiceLoader to load implementations in the boot layer
- providers = collect(ServiceLoader.load(Layer.boot(), service));
+ providers = collect(ServiceLoader.load(ModuleLayer.boot(), service));
assertTrue(collect(providers).size() == 2);
assertTrue(containsInstanceOf(providers, type1));
assertTrue(containsInstanceOf(providers, type2));
@@ -278,6 +280,19 @@ public class RedefineModuleTest {
redefineModule(baseModule, Set.of(), Map.of(), Map.of(), Set.of(), extraProvides);
}
+ /**
+ * Exercise IsModifiableModule
+ */
+ @Test
+ public void testIsModifiableModule() {
+ ClassLoader pcl = ClassLoader.getPlatformClassLoader();
+ ClassLoader scl = ClassLoader.getSystemClassLoader();
+ assertTrue(isModifiableModule(pcl.getUnnamedModule()));
+ assertTrue(isModifiableModule(scl.getUnnamedModule()));
+ assertTrue(isModifiableModule(RedefineModuleTest.class.getModule()));
+ assertTrue(isModifiableModule(Object.class.getModule()));
+ }
+
/**
* Test redefineClass with null
*/
diff --git a/jdk/test/java/lang/instrument/RetransformAgent.java b/jdk/test/java/lang/instrument/RetransformAgent.java
index cdba17efc6d..698449cac14 100644
--- a/jdk/test/java/lang/instrument/RetransformAgent.java
+++ b/jdk/test/java/lang/instrument/RetransformAgent.java
@@ -34,7 +34,6 @@
*/
import java.lang.instrument.*;
-import java.lang.reflect.Module;
import java.security.ProtectionDomain;
import java.io.*;
import asmlib.*;
diff --git a/jdk/test/java/lang/instrument/SimpleIdentityTransformer.java b/jdk/test/java/lang/instrument/SimpleIdentityTransformer.java
index 78e05fcb41b..f25e679596a 100644
--- a/jdk/test/java/lang/instrument/SimpleIdentityTransformer.java
+++ b/jdk/test/java/lang/instrument/SimpleIdentityTransformer.java
@@ -24,7 +24,6 @@
import java.lang.instrument.Instrumentation;
import java.lang.instrument.ClassFileTransformer;
-import java.lang.reflect.Module;
import java.security.*;
/*
diff --git a/jdk/test/java/lang/invoke/MethodHandles/privateLookupIn/test/p/PrivateLookupInTests.java b/jdk/test/java/lang/invoke/MethodHandles/privateLookupIn/test/p/PrivateLookupInTests.java
index f2391743bd0..869a655d0e3 100644
--- a/jdk/test/java/lang/invoke/MethodHandles/privateLookupIn/test/p/PrivateLookupInTests.java
+++ b/jdk/test/java/lang/invoke/MethodHandles/privateLookupIn/test/p/PrivateLookupInTests.java
@@ -26,7 +26,6 @@ import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodHandles.Lookup;
import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
import static java.lang.invoke.MethodHandles.Lookup.*;
diff --git a/jdk/test/java/lang/invoke/modules/m1/p1/Main.java b/jdk/test/java/lang/invoke/modules/m1/p1/Main.java
index 7a10022d78f..d708d74aa50 100644
--- a/jdk/test/java/lang/invoke/modules/m1/p1/Main.java
+++ b/jdk/test/java/lang/invoke/modules/m1/p1/Main.java
@@ -27,8 +27,6 @@ import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodHandles.Lookup;
import java.lang.invoke.MethodType;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import static java.lang.invoke.MethodHandles.Lookup.*;
@@ -64,14 +62,14 @@ public class Main {
}
// check setup
- Module m1 = Layer.boot().findModule("m1").orElse(null);
+ Module m1 = ModuleLayer.boot().findModule("m1").orElse(null);
assertNotNull(m1);
assertTrue(p1_Type1.getModule() == m1);
assertTrue(p2_Type2.getModule() == m1);
assertTrue(m1.isExported("p1"));
assertFalse(m1.isExported("p2"));
- Module m2 = Layer.boot().findModule("m2").orElse(null);
+ Module m2 = ModuleLayer.boot().findModule("m2").orElse(null);
assertNotNull(m2);
assertTrue(q1_Type1.getModule() == m2);
assertTrue(q2_Type2.getModule() == m2);
diff --git a/jdk/test/java/lang/module/AutomaticModulesTest.java b/jdk/test/java/lang/module/AutomaticModulesTest.java
index 81d68973ffe..4fce2beb558 100644
--- a/jdk/test/java/lang/module/AutomaticModulesTest.java
+++ b/jdk/test/java/lang/module/AutomaticModulesTest.java
@@ -38,8 +38,6 @@ import java.lang.module.ModuleFinder;
import java.lang.module.ModuleReference;
import java.lang.module.ResolutionException;
import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -69,13 +67,8 @@ public class AutomaticModulesTest {
{ "foo.jar", "foo" },
{ "foo4j.jar", "foo4j", },
- { "foo1.jar", "foo" },
- { "foo1.2.jar", "foo" },
- { "foo1.2.3.jar", "foo" },
-
- { "foo10.jar", "foo" },
- { "foo10.20.jar", "foo" },
- { "foo10.20.30.jar", "foo" },
+ { "foo1.jar", "foo1" },
+ { "foo10.jar", "foo10" },
{ "foo-1.jar", "foo/1" },
{ "foo-1.2.jar", "foo/1.2" },
@@ -93,6 +86,9 @@ public class AutomaticModulesTest {
{ "foo-bar-10.jar", "foo.bar/10" },
{ "foo-bar-10.20.jar", "foo.bar/10.20" },
+ { "foo.bar1.jar", "foo.bar1" },
+ { "foo.bar10.jar", "foo.bar10" },
+
{ "foo-1.2-SNAPSHOT.jar", "foo/1.2-SNAPSHOT" },
{ "foo-bar-1.2-SNAPSHOT.jar", "foo.bar/1.2-SNAPSHOT" },
@@ -108,8 +104,12 @@ public class AutomaticModulesTest {
public Object[][] createBadNames() {
return new Object[][]{
- { ".jar", null },
- { "_.jar", null }
+ { ".jar", null },
+ { "_.jar", null },
+
+ { "foo.1.jar", null },
+ { "1foo.jar", null },
+ { "foo.1bar.jar", null },
};
}
@@ -389,7 +389,7 @@ public class AutomaticModulesTest {
ModuleFinder finder = ModuleFinder.of(dir);
- Configuration parent = Layer.boot().configuration();
+ Configuration parent = ModuleLayer.boot().configuration();
Configuration cf = resolve(parent, finder, "m");
ModuleDescriptor descriptor = findDescriptor(cf, "m");
@@ -469,11 +469,11 @@ public class AutomaticModulesTest {
createDummyJarFile(dir.resolve("c.jar"), "q/T.class");
// module finder locates a and the modules in the directory
- ModuleFinder finder
- = ModuleFinder.compose(ModuleUtils.finderOf(descriptor1),
- ModuleFinder.of(dir));
+ ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
+ ModuleFinder finder2 = ModuleFinder.of(dir);
+ ModuleFinder finder = ModuleFinder.compose(finder1, finder2);
- Configuration parent = Layer.boot().configuration();
+ Configuration parent = ModuleLayer.boot().configuration();
Configuration cf = resolve(parent, finder, "a");
assertTrue(cf.modules().size() == 3);
@@ -482,7 +482,7 @@ public class AutomaticModulesTest {
assertTrue(cf.findModule("c").isPresent());
ResolvedModule base = cf.findModule("java.base").get();
- assertTrue(base.configuration() == Layer.boot().configuration());
+ assertTrue(base.configuration() == ModuleLayer.boot().configuration());
ResolvedModule a = cf.findModule("a").get();
ResolvedModule b = cf.findModule("b").get();
ResolvedModule c = cf.findModule("c").get();
@@ -534,11 +534,11 @@ public class AutomaticModulesTest {
createDummyJarFile(dir.resolve("d.jar"), "q/T.class");
// module finder locates a and the modules in the directory
- ModuleFinder finder
- = ModuleFinder.compose(ModuleUtils.finderOf(descriptor1, descriptor2),
- ModuleFinder.of(dir));
+ ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
+ ModuleFinder finder2 = ModuleFinder.of(dir);
+ ModuleFinder finder = ModuleFinder.compose(finder1, finder2);
- Configuration parent = Layer.boot().configuration();
+ Configuration parent = ModuleLayer.boot().configuration();
Configuration cf = resolve(parent, finder, "a", "d");
assertTrue(cf.modules().size() == 4);
@@ -554,7 +554,7 @@ public class AutomaticModulesTest {
// readability
ResolvedModule base = cf.findModule("java.base").get();
- assertTrue(base.configuration() == Layer.boot().configuration());
+ assertTrue(base.configuration() == ModuleLayer.boot().configuration());
ResolvedModule a = cf.findModule("a").get();
ResolvedModule b = cf.findModule("b").get();
ResolvedModule c = cf.findModule("c").get();
@@ -607,11 +607,11 @@ public class AutomaticModulesTest {
createDummyJarFile(dir.resolve("d.jar"), "q/T.class");
// module finder locates a and the modules in the directory
- ModuleFinder finder
- = ModuleFinder.compose(ModuleUtils.finderOf(descriptor1, descriptor2),
- ModuleFinder.of(dir));
+ ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
+ ModuleFinder finder2 = ModuleFinder.of(dir);
+ ModuleFinder finder = ModuleFinder.compose(finder1, finder2);
- Configuration parent = Layer.boot().configuration();
+ Configuration parent = ModuleLayer.boot().configuration();
Configuration cf = resolve(parent, finder, "a", "d");
assertTrue(cf.modules().size() == 4);
@@ -621,7 +621,7 @@ public class AutomaticModulesTest {
assertTrue(cf.findModule("d").isPresent());
ResolvedModule base = cf.findModule("java.base").get();
- assertTrue(base.configuration() == Layer.boot().configuration());
+ assertTrue(base.configuration() == ModuleLayer.boot().configuration());
ResolvedModule a = cf.findModule("a").get();
ResolvedModule b = cf.findModule("b").get();
ResolvedModule c = cf.findModule("c").get();
@@ -660,6 +660,189 @@ public class AutomaticModulesTest {
}
+ /**
+ * Basic test to ensure that no automatic modules are resolved when
+ * an automatic module is not a root or required by other modules.
+ */
+ public void testInConfiguration4() throws IOException {
+ ModuleDescriptor descriptor1
+ = ModuleDescriptor.newModule("m1")
+ .requires("java.base")
+ .build();
+
+ // automatic modules
+ Path dir = Files.createTempDirectory(USER_DIR, "mods");
+ createDummyJarFile(dir.resolve("auto1.jar"), "p1/C.class");
+ createDummyJarFile(dir.resolve("auto2.jar"), "p2/C.class");
+ createDummyJarFile(dir.resolve("auto3.jar"), "p3/C.class");
+
+ // module finder locates m1 and the modules in the directory
+ ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
+ ModuleFinder finder2 = ModuleFinder.of(dir);
+ ModuleFinder finder = ModuleFinder.compose(finder1, finder2);
+
+ Configuration parent = ModuleLayer.boot().configuration();
+ Configuration cf = resolve(parent, finder, "m1");
+
+ // ensure that no automatic module is resolved
+ assertTrue(cf.modules().size() == 1);
+ assertTrue(cf.findModule("m1").isPresent());
+ }
+
+
+ /**
+ * Basic test to ensure that if an automatic module is resolved then
+ * all observable automatic modules are resolved.
+ */
+ public void testInConfiguration5() throws IOException {
+ // m1 requires m2
+ ModuleDescriptor descriptor1
+ = ModuleDescriptor.newModule("m1")
+ .requires("m2").build();
+
+ // m2 requires automatic module
+ ModuleDescriptor descriptor2
+ = ModuleDescriptor.newModule("m2")
+ .requires("auto1")
+ .build();
+
+ // automatic modules
+ Path dir = Files.createTempDirectory(USER_DIR, "mods");
+ createDummyJarFile(dir.resolve("auto1.jar"), "p1/C.class");
+ createDummyJarFile(dir.resolve("auto2.jar"), "p2/C.class");
+ createDummyJarFile(dir.resolve("auto3.jar"), "p3/C.class");
+
+ // module finder locates m1, m2, and the modules in the directory
+ ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1, descriptor2);
+ ModuleFinder finder2 = ModuleFinder.of(dir);
+ ModuleFinder finder = ModuleFinder.compose(finder1, finder2);
+
+ Configuration parent = ModuleLayer.boot().configuration();
+ Configuration cf = resolve(parent, finder, "m1");
+
+ // all automatic modules should be resolved
+ assertTrue(cf.modules().size() == 5);
+ assertTrue(cf.findModule("m1").isPresent());
+ assertTrue(cf.findModule("m2").isPresent());
+ assertTrue(cf.findModule("auto1").isPresent());
+ assertTrue(cf.findModule("auto2").isPresent());
+ assertTrue(cf.findModule("auto3").isPresent());
+
+ ResolvedModule base = parent.findModule("java.base")
+ .orElseThrow(() -> new RuntimeException());
+ ResolvedModule m1 = cf.findModule("m1").get();
+ ResolvedModule m2 = cf.findModule("m2").get();
+ ResolvedModule auto1 = cf.findModule("auto1").get();
+ ResolvedModule auto2 = cf.findModule("auto2").get();
+ ResolvedModule auto3 = cf.findModule("auto3").get();
+
+ // m1 does not read the automatic modules
+ assertTrue(m1.reads().size() == 2);
+ assertTrue(m1.reads().contains(m2));
+ assertTrue(m1.reads().contains(base));
+
+ // m2 should read all the automatic modules
+ assertTrue(m2.reads().size() == 4);
+ assertTrue(m2.reads().contains(auto1));
+ assertTrue(m2.reads().contains(auto2));
+ assertTrue(m2.reads().contains(auto3));
+ assertTrue(m2.reads().contains(base));
+
+ assertTrue(auto1.reads().contains(m1));
+ assertTrue(auto1.reads().contains(m2));
+ assertTrue(auto1.reads().contains(auto2));
+ assertTrue(auto1.reads().contains(auto3));
+ assertTrue(auto1.reads().contains(base));
+
+ assertTrue(auto2.reads().contains(m1));
+ assertTrue(auto2.reads().contains(m2));
+ assertTrue(auto2.reads().contains(auto1));
+ assertTrue(auto2.reads().contains(auto3));
+ assertTrue(auto2.reads().contains(base));
+
+ assertTrue(auto3.reads().contains(m1));
+ assertTrue(auto3.reads().contains(m2));
+ assertTrue(auto3.reads().contains(auto1));
+ assertTrue(auto3.reads().contains(auto2));
+ assertTrue(auto3.reads().contains(base));
+ }
+
+
+ /**
+ * Basic test of automatic modules in a child configuration. All automatic
+ * modules that are found with the before finder should be resolved. The
+ * automatic modules that are found by the after finder and not shadowed
+ * by the before finder, or parent configurations, should also be resolved.
+ */
+ public void testInConfiguration6() throws IOException {
+ // m1 requires auto1
+ ModuleDescriptor descriptor1
+ = ModuleDescriptor.newModule("m1")
+ .requires("auto1")
+ .build();
+
+ Path dir = Files.createTempDirectory(USER_DIR, "mods");
+ createDummyJarFile(dir.resolve("auto1.jar"), "p1/C.class");
+
+ // module finder locates m1 and auto1
+ ModuleFinder finder1 = ModuleUtils.finderOf(descriptor1);
+ ModuleFinder finder2 = ModuleFinder.of(dir);
+ ModuleFinder finder = ModuleFinder.compose(finder1, finder2);
+
+ Configuration parent = ModuleLayer.boot().configuration();
+ Configuration cf1 = resolve(parent, finder, "m1");
+
+ assertTrue(cf1.modules().size() == 2);
+ assertTrue(cf1.findModule("m1").isPresent());
+ assertTrue(cf1.findModule("auto1").isPresent());
+
+ ResolvedModule base = parent.findModule("java.base")
+ .orElseThrow(() -> new RuntimeException());
+ ResolvedModule m1 = cf1.findModule("m1").get();
+ ResolvedModule auto1 = cf1.findModule("auto1").get();
+
+ assertTrue(m1.reads().size() == 2);
+ assertTrue(m1.reads().contains(auto1));
+ assertTrue(m1.reads().contains(base));
+
+ assertTrue(auto1.reads().contains(m1));
+ assertTrue(auto1.reads().contains(base));
+
+
+ // create child configuration - the after finder locates auto1
+
+ dir = Files.createTempDirectory(USER_DIR, "mods");
+ createDummyJarFile(dir.resolve("auto2.jar"), "p2/C.class");
+ ModuleFinder beforeFinder = ModuleFinder.of(dir);
+
+ dir = Files.createTempDirectory(USER_DIR, "mods");
+ createDummyJarFile(dir.resolve("auto1.jar"), "p1/C.class");
+ createDummyJarFile(dir.resolve("auto2.jar"), "p2/C.class");
+ createDummyJarFile(dir.resolve("auto3.jar"), "p3/C.class");
+ ModuleFinder afterFinder = ModuleFinder.of(dir);
+
+ Configuration cf2 = cf1.resolve(beforeFinder, afterFinder, Set.of("auto2"));
+
+ // auto1 should be found in parent and should not be in cf2
+ assertTrue(cf2.modules().size() == 2);
+ assertTrue(cf2.findModule("auto2").isPresent());
+ assertTrue(cf2.findModule("auto3").isPresent());
+
+ ResolvedModule auto2 = cf2.findModule("auto2").get();
+ ResolvedModule auto3 = cf2.findModule("auto3").get();
+
+ assertTrue(auto2.reads().contains(m1));
+ assertTrue(auto2.reads().contains(auto1));
+ assertTrue(auto2.reads().contains(auto3));
+ assertTrue(auto2.reads().contains(base));
+
+ assertTrue(auto3.reads().contains(m1));
+ assertTrue(auto3.reads().contains(auto1));
+ assertTrue(auto3.reads().contains(auto2));
+ assertTrue(auto3.reads().contains(base));
+ }
+
+
/**
* Basic test of a configuration created with automatic modules
* a requires b* and c*
@@ -684,7 +867,7 @@ public class AutomaticModulesTest {
= ModuleFinder.compose(ModuleUtils.finderOf(descriptor),
ModuleFinder.of(dir));
- Configuration parent = Layer.boot().configuration();
+ Configuration parent = ModuleLayer.boot().configuration();
resolve(parent, finder, "a");
}
@@ -711,13 +894,13 @@ public class AutomaticModulesTest {
= ModuleFinder.compose(ModuleUtils.finderOf(descriptor),
ModuleFinder.of(dir));
- Configuration parent = Layer.boot().configuration();
+ Configuration parent = ModuleLayer.boot().configuration();
resolve(parent, finder, "a");
}
/**
- * Basic test of Layer containing automatic modules
+ * Basic test of layer containing automatic modules
*/
public void testInLayer() throws IOException {
ModuleDescriptor descriptor
@@ -736,12 +919,12 @@ public class AutomaticModulesTest {
= ModuleFinder.compose(ModuleUtils.finderOf(descriptor),
ModuleFinder.of(dir));
- Configuration parent = Layer.boot().configuration();
+ Configuration parent = ModuleLayer.boot().configuration();
Configuration cf = resolve(parent, finder, "a");
assertTrue(cf.modules().size() == 3);
// each module gets its own loader
- Layer layer = Layer.boot().defineModules(cf, mn -> new ClassLoader() { });
+ ModuleLayer layer = ModuleLayer.boot().defineModules(cf, mn -> new ClassLoader() { });
// an unnamed module
Module unnamed = (new ClassLoader() { }).getUnnamedModule();
@@ -804,7 +987,7 @@ public class AutomaticModulesTest {
*/
static void testReadAllBootModules(Configuration cf, String mn) {
- Set bootModules = Layer.boot().modules().stream()
+ Set bootModules = ModuleLayer.boot().modules().stream()
.map(Module::getName)
.collect(Collectors.toSet());
@@ -813,10 +996,10 @@ public class AutomaticModulesTest {
}
/**
- * Test that the given Module reads all module in the given Layer
- * and its parent Layers.
+ * Test that the given Module reads all module in the given layer
+ * and its parent layers.
*/
- static void testsReadsAll(Module m, Layer layer) {
+ static void testsReadsAll(Module m, ModuleLayer layer) {
// check that m reads all modules in the layer
layer.configuration().modules().stream()
.map(ResolvedModule::name)
diff --git a/jdk/test/java/lang/module/ConfigurationTest.java b/jdk/test/java/lang/module/ConfigurationTest.java
index d010ca30060..d59612d8638 100644
--- a/jdk/test/java/lang/module/ConfigurationTest.java
+++ b/jdk/test/java/lang/module/ConfigurationTest.java
@@ -40,7 +40,6 @@ import java.lang.module.ModuleDescriptor.Requires;
import java.lang.module.ModuleFinder;
import java.lang.module.ResolutionException;
import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
@@ -1708,7 +1707,7 @@ public class ConfigurationTest {
ModuleFinder finder = ModuleUtils.finderOf(descriptor);
- Configuration bootConfiguration = Layer.boot().configuration();
+ Configuration bootConfiguration = ModuleLayer.boot().configuration();
// m1 contains package java.lang, java.base exports package java.lang to m1
resolve(bootConfiguration, finder, "m1");
@@ -1989,14 +1988,14 @@ public class ConfigurationTest {
@Test(expectedExceptions = { NullPointerException.class })
public void testResolveRequiresWithNull5() {
- Configuration cf = Layer.boot().configuration();
+ Configuration cf = ModuleLayer.boot().configuration();
Configuration.resolve(ModuleFinder.of(), List.of(cf), null, Set.of());
}
@Test(expectedExceptions = { NullPointerException.class })
public void testResolveRequiresWithNull6() {
ModuleFinder empty = ModuleFinder.of();
- Configuration cf = Layer.boot().configuration();
+ Configuration cf = ModuleLayer.boot().configuration();
Configuration.resolve(empty, List.of(cf), empty, null);
}
@@ -2024,14 +2023,14 @@ public class ConfigurationTest {
@Test(expectedExceptions = { NullPointerException.class })
public void testResolveRequiresAndUsesWithNull5() {
- Configuration cf = Layer.boot().configuration();
+ Configuration cf = ModuleLayer.boot().configuration();
Configuration.resolveAndBind(ModuleFinder.of(), List.of(cf), null, Set.of());
}
@Test(expectedExceptions = { NullPointerException.class })
public void testResolveRequiresAndUsesWithNull6() {
ModuleFinder empty = ModuleFinder.of();
- Configuration cf = Layer.boot().configuration();
+ Configuration cf = ModuleLayer.boot().configuration();
Configuration.resolveAndBind(empty, List.of(cf), empty, null);
}
@@ -2044,14 +2043,14 @@ public class ConfigurationTest {
@Test(expectedExceptions = { UnsupportedOperationException.class })
public void testImmutableSet1() {
- Configuration cf = Layer.boot().configuration();
+ Configuration cf = ModuleLayer.boot().configuration();
ResolvedModule base = cf.findModule("java.base").get();
cf.modules().add(base);
}
@Test(expectedExceptions = { UnsupportedOperationException.class })
public void testImmutableSet2() {
- Configuration cf = Layer.boot().configuration();
+ Configuration cf = ModuleLayer.boot().configuration();
ResolvedModule base = cf.findModule("java.base").get();
base.reads().add(base);
}
diff --git a/jdk/test/java/lang/module/ModuleDescriptorTest.java b/jdk/test/java/lang/module/ModuleDescriptorTest.java
index 2bd63497141..f4726a59a2f 100644
--- a/jdk/test/java/lang/module/ModuleDescriptorTest.java
+++ b/jdk/test/java/lang/module/ModuleDescriptorTest.java
@@ -41,7 +41,6 @@ import java.lang.module.ModuleDescriptor.Requires;
import java.lang.module.ModuleDescriptor.Provides;
import java.lang.module.ModuleDescriptor.Requires.Modifier;
import java.lang.module.ModuleDescriptor.Version;
-import java.lang.reflect.Module;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collections;
diff --git a/jdk/test/java/lang/module/ModuleFinderTest.java b/jdk/test/java/lang/module/ModuleFinderTest.java
index 3f87883277e..79feee5694b 100644
--- a/jdk/test/java/lang/module/ModuleFinderTest.java
+++ b/jdk/test/java/lang/module/ModuleFinderTest.java
@@ -528,6 +528,30 @@ public class ModuleFinderTest {
}
+ /**
+ * Test ModuleFinder.of with a directory containing hidden files
+ */
+ public void testOfWithHiddenFiles() throws Exception {
+ Path dir = Files.createTempDirectory(USER_DIR, "mods");
+ createExplodedModule(dir.resolve("m"), "m",
+ "com/.ignore",
+ "com/foo/.ignore",
+ "com/foo/foo.properties");
+
+ ModuleFinder finder = ModuleFinder.of(dir);
+ ModuleReference mref = finder.find("m").orElse(null);
+ assertNotNull(mref);
+
+ Set expectedPackages;
+ if (System.getProperty("os.name").startsWith("Windows")) {
+ expectedPackages = Set.of("com", "com.foo");
+ } else {
+ expectedPackages = Set.of("com.foo");
+ }
+ assertEquals(mref.descriptor().packages(), expectedPackages);
+ }
+
+
/**
* Test ModuleFinder.of with a truncated module-info.class
*/
diff --git a/jdk/test/java/lang/module/ModuleReader/ModuleReaderTest.java b/jdk/test/java/lang/module/ModuleReader/ModuleReaderTest.java
index 6e895354357..773b114f338 100644
--- a/jdk/test/java/lang/module/ModuleReader/ModuleReaderTest.java
+++ b/jdk/test/java/lang/module/ModuleReader/ModuleReaderTest.java
@@ -37,7 +37,6 @@ import java.io.InputStream;
import java.lang.module.ModuleFinder;
import java.lang.module.ModuleReader;
import java.lang.module.ModuleReference;
-import java.lang.reflect.Module;
import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
diff --git a/jdk/test/java/lang/reflect/AccessibleObject/ModuleSetAccessibleTest.java b/jdk/test/java/lang/reflect/AccessibleObject/ModuleSetAccessibleTest.java
index 3e2bf3911c7..a287e6f6807 100644
--- a/jdk/test/java/lang/reflect/AccessibleObject/ModuleSetAccessibleTest.java
+++ b/jdk/test/java/lang/reflect/AccessibleObject/ModuleSetAccessibleTest.java
@@ -36,7 +36,6 @@ import java.lang.reflect.Field;
import java.lang.reflect.InaccessibleObjectException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.lang.reflect.Module;
import jdk.internal.misc.Unsafe;
diff --git a/jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java b/jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java
index 3ef48cd79fa..da7b16938f0 100644
--- a/jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java
+++ b/jdk/test/java/lang/reflect/Proxy/ProxyClassAccessTest.java
@@ -23,7 +23,6 @@
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
import java.lang.reflect.Proxy;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -88,12 +87,12 @@ public class ProxyClassAccessTest {
@Test
public void testNoReadAccess() throws Exception {
ModuleFinder finder = ModuleFinder.of(MODS_DIR);
- Layer bootLayer = Layer.boot();
+ ModuleLayer bootLayer = ModuleLayer.boot();
Configuration cf = bootLayer
.configuration()
.resolveAndBind(ModuleFinder.of(), finder, modules);
ClassLoader parentLoader = this.getClass().getClassLoader();
- Layer layer = bootLayer.defineModulesWithOneLoader(cf, parentLoader);
+ ModuleLayer layer = bootLayer.defineModulesWithOneLoader(cf, parentLoader);
ClassLoader loader = layer.findLoader("m1");
Class>[] interfaces = new Class>[] {
diff --git a/jdk/test/java/lang/reflect/Proxy/ProxyForMethodHandle.java b/jdk/test/java/lang/reflect/Proxy/ProxyForMethodHandle.java
index 1c45901783d..a5877018705 100644
--- a/jdk/test/java/lang/reflect/Proxy/ProxyForMethodHandle.java
+++ b/jdk/test/java/lang/reflect/Proxy/ProxyForMethodHandle.java
@@ -28,7 +28,6 @@ import java.lang.invoke.MethodType;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Module;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
diff --git a/jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java b/jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java
index 767afd23323..c420ab4ee99 100644
--- a/jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java
+++ b/jdk/test/java/lang/reflect/Proxy/ProxyLayerTest.java
@@ -24,7 +24,6 @@
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Layer;
import java.lang.reflect.Proxy;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -70,18 +69,18 @@ public class ProxyLayerTest {
}
/**
- * Test proxy implementing interfaces in a Layer defined in
+ * Test proxy implementing interfaces in a layer defined in
* an unnamed module
*/
@Test
public void testProxyInUnnamed() throws Exception {
ModuleFinder finder = ModuleFinder.of(MODS_DIR);
- Layer bootLayer = Layer.boot();
+ ModuleLayer bootLayer = ModuleLayer.boot();
Configuration cf = bootLayer
.configuration()
.resolveAndBind(ModuleFinder.of(), finder, Arrays.asList(modules));
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
+ ModuleLayer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
ClassLoader loader = layer.findLoader("m1");
@@ -110,12 +109,12 @@ public class ProxyLayerTest {
@Test
public void testProxyInDynamicModule() throws Exception {
ModuleFinder finder = ModuleFinder.of(MODS_DIR);
- Layer bootLayer = Layer.boot();
+ ModuleLayer bootLayer = ModuleLayer.boot();
Configuration cf = bootLayer
.configuration()
.resolveAndBind(ModuleFinder.of(), finder, Arrays.asList(modules));
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
+ ModuleLayer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
ClassLoader loader = layer.findLoader("m1");
@@ -140,12 +139,12 @@ public class ProxyLayerTest {
@Test
public void testNoReadAccess() throws Exception {
ModuleFinder finder = ModuleFinder.of(MODS_DIR);
- Layer bootLayer = Layer.boot();
+ ModuleLayer bootLayer = ModuleLayer.boot();
Configuration cf = bootLayer
.configuration()
.resolveAndBind(ModuleFinder.of(), finder, Arrays.asList(modules));
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
+ ModuleLayer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
ClassLoader loader = layer.findLoader("m1");
diff --git a/jdk/test/java/lang/reflect/Proxy/ProxyModuleMapping.java b/jdk/test/java/lang/reflect/Proxy/ProxyModuleMapping.java
index bd8d1b042b3..4985adf97ac 100644
--- a/jdk/test/java/lang/reflect/Proxy/ProxyModuleMapping.java
+++ b/jdk/test/java/lang/reflect/Proxy/ProxyModuleMapping.java
@@ -23,7 +23,6 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Module;
import java.lang.reflect.Proxy;
/*
diff --git a/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/Main.java b/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/Main.java
index 188e3d9e084..0a342d25c78 100644
--- a/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/Main.java
+++ b/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/Main.java
@@ -25,7 +25,6 @@ package jdk.test;
import java.net.URL;
import java.net.URLClassLoader;
-import java.lang.reflect.Module;
import static jdk.test.ProxyTest.*;
public class Main {
diff --git a/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/ProxyTest.java b/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/ProxyTest.java
index bbe260bf159..ee5c0241bae 100644
--- a/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/ProxyTest.java
+++ b/jdk/test/java/lang/reflect/Proxy/src/test/jdk/test/ProxyTest.java
@@ -26,7 +26,6 @@ package jdk.test;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Module;
import java.lang.reflect.Proxy;
import java.util.Arrays;
diff --git a/jdk/test/java/security/Provider/DefaultProviderList.java b/jdk/test/java/security/Provider/DefaultProviderList.java
index 4aaeffeeacf..9a015b0b340 100644
--- a/jdk/test/java/security/Provider/DefaultProviderList.java
+++ b/jdk/test/java/security/Provider/DefaultProviderList.java
@@ -33,7 +33,6 @@ import java.security.Security;
import java.util.Arrays;
import java.util.Iterator;
import java.util.ServiceLoader;
-import java.lang.reflect.Module;
public class DefaultProviderList {
diff --git a/jdk/test/java/util/ResourceBundle/modules/cache/src/test/jdk/test/Main.java b/jdk/test/java/util/ResourceBundle/modules/cache/src/test/jdk/test/Main.java
index a6ae87208bd..234e841f691 100644
--- a/jdk/test/java/util/ResourceBundle/modules/cache/src/test/jdk/test/Main.java
+++ b/jdk/test/java/util/ResourceBundle/modules/cache/src/test/jdk/test/Main.java
@@ -23,7 +23,6 @@
package jdk.test;
-import java.lang.reflect.Module;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
@@ -56,4 +55,4 @@ public class Main {
jdk.test.util.Bundles.getBundle();
}
}
-}
\ No newline at end of file
+}
diff --git a/jdk/test/java/util/ResourceBundle/modules/security/src/test/jdk/test/Main.java b/jdk/test/java/util/ResourceBundle/modules/security/src/test/jdk/test/Main.java
index ecea6abd576..88b9222f137 100644
--- a/jdk/test/java/util/ResourceBundle/modules/security/src/test/jdk/test/Main.java
+++ b/jdk/test/java/util/ResourceBundle/modules/security/src/test/jdk/test/Main.java
@@ -24,7 +24,6 @@
package jdk.test;
import p1.Bundle;
-import java.lang.reflect.Module;
import java.util.ResourceBundle;
public class Main {
diff --git a/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithNoModuleArg.java b/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithNoModuleArg.java
index 5e100abc89b..1b7aef1ecdd 100644
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithNoModuleArg.java
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithNoModuleArg.java
@@ -23,7 +23,6 @@
package jdk.embargo;
-import java.lang.reflect.Module;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
diff --git a/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithUnnamedModuleArg.java b/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithUnnamedModuleArg.java
index 8f2ca8e1206..b2df284acfc 100644
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithUnnamedModuleArg.java
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/embargo/jdk/embargo/TestWithUnnamedModuleArg.java
@@ -23,7 +23,6 @@
package jdk.embargo;
-import java.lang.reflect.Module;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
diff --git a/jdk/test/java/util/ResourceBundle/modules/visibility/src/pkg/jdk/pkg/test/Main.java b/jdk/test/java/util/ResourceBundle/modules/visibility/src/pkg/jdk/pkg/test/Main.java
index 54ac2e7d686..8706ab2838b 100644
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/pkg/jdk/pkg/test/Main.java
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/pkg/jdk/pkg/test/Main.java
@@ -23,7 +23,6 @@
package jdk.pkg.test;
-import java.lang.reflect.Module;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
diff --git a/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithNoModuleArg.java b/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithNoModuleArg.java
index 19de28a8be1..3a16a412b1c 100644
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithNoModuleArg.java
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithNoModuleArg.java
@@ -23,7 +23,6 @@
package jdk.test;
-import java.lang.reflect.Module;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
diff --git a/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithUnnamedModuleArg.java b/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithUnnamedModuleArg.java
index d36b53f864a..fc6cd208f2c 100644
--- a/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithUnnamedModuleArg.java
+++ b/jdk/test/java/util/ResourceBundle/modules/visibility/src/test/jdk/test/TestWithUnnamedModuleArg.java
@@ -23,7 +23,6 @@
package jdk.test;
-import java.lang.reflect.Module;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
diff --git a/jdk/test/java/util/ServiceLoader/modules/BadProvidersTest.java b/jdk/test/java/util/ServiceLoader/modules/BadProvidersTest.java
index 8d3c2d27d3a..a1bf4abf099 100644
--- a/jdk/test/java/util/ServiceLoader/modules/BadProvidersTest.java
+++ b/jdk/test/java/util/ServiceLoader/modules/BadProvidersTest.java
@@ -33,7 +33,6 @@
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -87,14 +86,14 @@ public class BadProvidersTest {
private List loadProviders(Path mp, String moduleName) throws Exception {
ModuleFinder finder = ModuleFinder.of(mp);
- Layer bootLayer = Layer.boot();
+ ModuleLayer bootLayer = ModuleLayer.boot();
Configuration cf = bootLayer.configuration()
.resolveAndBind(finder, ModuleFinder.of(), Set.of(moduleName));
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer = Layer.boot().defineModulesWithOneLoader(cf, scl);
+ ModuleLayer layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, scl);
Class> service = layer.findLoader(moduleName).loadClass(TEST_SERVICE);
diff --git a/jdk/test/java/util/ServiceLoader/modules/Basic.java b/jdk/test/java/util/ServiceLoader/modules/Basic.java
index d697db6e993..75e30bc4413 100644
--- a/jdk/test/java/util/ServiceLoader/modules/Basic.java
+++ b/jdk/test/java/util/ServiceLoader/modules/Basic.java
@@ -34,7 +34,6 @@
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -229,7 +228,7 @@ public class Basic {
*/
@Test
public void testWithCustomLayer1() {
- Layer layer = createCustomLayer("bananascript");
+ ModuleLayer layer = createCustomLayer("bananascript");
ClassLoader loader = layer.findLoader("bananascript");
List providers
@@ -258,7 +257,7 @@ public class Basic {
*/
@Test
public void testWithCustomLayer2() {
- Layer layer = createCustomLayer("bananascript");
+ ModuleLayer layer = createCustomLayer("bananascript");
List factories
= collectAll(ServiceLoader.load(layer, ScriptEngineFactory.class));
@@ -293,7 +292,7 @@ public class Basic {
*/
@Test
public void testWithCustomLayer3() {
- Layer bootLayer = Layer.boot();
+ ModuleLayer bootLayer = ModuleLayer.boot();
Configuration cf0 = bootLayer.configuration();
// boot layer should contain "bananascript"
@@ -313,12 +312,12 @@ public class Basic {
// layer1
Configuration cf1 = cf0.resolveAndBind(finder, ModuleFinder.of(), Set.of());
- Layer layer1 = bootLayer.defineModulesWithOneLoader(cf1, scl);
+ ModuleLayer layer1 = bootLayer.defineModulesWithOneLoader(cf1, scl);
assertTrue(layer1.modules().size() == 1);
// layer2
Configuration cf2 = cf0.resolveAndBind(finder, ModuleFinder.of(), Set.of());
- Layer layer2 = bootLayer.defineModulesWithOneLoader(cf2, scl);
+ ModuleLayer layer2 = bootLayer.defineModulesWithOneLoader(cf2, scl);
assertTrue(layer2.modules().size() == 1);
// layer3 with layer1 and layer2 as parents
@@ -326,7 +325,8 @@ public class Basic {
List.of(cf1, cf2),
ModuleFinder.of(),
Set.of());
- Layer layer3 = Layer.defineModulesWithOneLoader(cf3, List.of(layer1, layer2), scl).layer();
+ ModuleLayer layer3
+ = ModuleLayer.defineModulesWithOneLoader(cf3, List.of(layer1, layer2), scl).layer();
assertTrue(layer3.modules().size() == 1);
@@ -390,12 +390,12 @@ public class Basic {
@Test(expectedExceptions = { NullPointerException.class })
public void testLoadNull3() {
class S { }
- ServiceLoader.load((Layer) null, S.class);
+ ServiceLoader.load((ModuleLayer) null, S.class);
}
@Test(expectedExceptions = { NullPointerException.class })
public void testLoadNull4() {
- ServiceLoader.load(Layer.empty(), null);
+ ServiceLoader.load(ModuleLayer.empty(), null);
}
@Test(expectedExceptions = { NullPointerException.class })
@@ -404,19 +404,19 @@ public class Basic {
}
/**
- * Create a custom Layer by resolving the given module names. The modules
+ * Create a custom layer by resolving the given module names. The modules
* are located in the {@code ${test.classes}/modules} directory.
*/
- private Layer createCustomLayer(String... modules) {
+ private ModuleLayer createCustomLayer(String... modules) {
Path dir = Paths.get(System.getProperty("test.classes", "."), "modules");
ModuleFinder finder = ModuleFinder.of(dir);
Set roots = new HashSet<>();
Collections.addAll(roots, modules);
- Layer bootLayer = Layer.boot();
+ ModuleLayer bootLayer = ModuleLayer.boot();
Configuration parent = bootLayer.configuration();
Configuration cf = parent.resolve(finder, ModuleFinder.of(), roots);
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
+ ModuleLayer layer = bootLayer.defineModulesWithOneLoader(cf, scl);
assertTrue(layer.modules().size() == 1);
return layer;
}
diff --git a/jdk/test/java/util/logging/LocalizedLevelName.java b/jdk/test/java/util/logging/LocalizedLevelName.java
index 627789f200e..4bb75b6dafd 100644
--- a/jdk/test/java/util/logging/LocalizedLevelName.java
+++ b/jdk/test/java/util/logging/LocalizedLevelName.java
@@ -21,7 +21,6 @@
* questions.
*/
-import java.lang.reflect.Module;
import java.util.*;
import java.util.logging.*;
diff --git a/jdk/test/java/util/logging/modules/pkgs/p3/test/ResourceBundleTest.java b/jdk/test/java/util/logging/modules/pkgs/p3/test/ResourceBundleTest.java
index 03d26146837..0eef17a3f67 100644
--- a/jdk/test/java/util/logging/modules/pkgs/p3/test/ResourceBundleTest.java
+++ b/jdk/test/java/util/logging/modules/pkgs/p3/test/ResourceBundleTest.java
@@ -23,7 +23,6 @@
package p3.test;
-import java.lang.reflect.Module;
import java.util.logging.Logger;
import java.util.MissingResourceException;
import java.util.PropertyResourceBundle;
diff --git a/jdk/test/java/util/spi/ResourceBundleControlProvider/test/jdk/test/ResourceBundleDelegate.java b/jdk/test/java/util/spi/ResourceBundleControlProvider/test/jdk/test/ResourceBundleDelegate.java
index 13a604abfb6..b9f2a5970f4 100644
--- a/jdk/test/java/util/spi/ResourceBundleControlProvider/test/jdk/test/ResourceBundleDelegate.java
+++ b/jdk/test/java/util/spi/ResourceBundleControlProvider/test/jdk/test/ResourceBundleDelegate.java
@@ -23,7 +23,6 @@
package jdk.test;
-import java.lang.reflect.Module;
import java.util.Locale;
import java.util.ResourceBundle;
diff --git a/jdk/test/javax/xml/jaxp/Encodings/CheckEncodingPropertiesFile.java b/jdk/test/javax/xml/jaxp/Encodings/CheckEncodingPropertiesFile.java
index d5c31961aca..994b6d0f7ac 100644
--- a/jdk/test/javax/xml/jaxp/Encodings/CheckEncodingPropertiesFile.java
+++ b/jdk/test/javax/xml/jaxp/Encodings/CheckEncodingPropertiesFile.java
@@ -39,7 +39,6 @@
import com.sun.org.apache.xml.internal.serializer.EncodingInfo;
import com.sun.org.apache.xml.internal.serializer.Encodings;
import java.io.InputStreamReader;
-import java.lang.reflect.Module;
import java.lang.reflect.Method;
import java.nio.charset.Charset;
import java.util.ArrayList;
diff --git a/jdk/test/jdk/internal/jimage/JImageOpenTest.java b/jdk/test/jdk/internal/jimage/JImageOpenTest.java
index 06c19937a41..9c828d71003 100644
--- a/jdk/test/jdk/internal/jimage/JImageOpenTest.java
+++ b/jdk/test/jdk/internal/jimage/JImageOpenTest.java
@@ -21,7 +21,6 @@
* questions.
*/
-import java.lang.reflect.Layer;
import java.net.URI;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
@@ -48,7 +47,7 @@ public class JImageOpenTest {
final List names = Files.walk(root)
.filter(p -> p.getNameCount() > 2)
- .filter(p -> Layer.boot().findModule(p.getName(1).toString()).isPresent())
+ .filter(p -> ModuleLayer.boot().findModule(p.getName(1).toString()).isPresent())
.map(p -> p.subpath(2, p.getNameCount()))
.map(p -> p.toString())
.filter(s -> s.endsWith(".class") && !s.endsWith("module-info.class"))
diff --git a/jdk/test/jdk/modules/etc/JdkQualifiedExportTest.java b/jdk/test/jdk/modules/etc/JdkQualifiedExportTest.java
index 0948f420f1a..d4dc0ea3818 100644
--- a/jdk/test/jdk/modules/etc/JdkQualifiedExportTest.java
+++ b/jdk/test/jdk/modules/etc/JdkQualifiedExportTest.java
@@ -40,7 +40,6 @@ import java.lang.module.ModuleDescriptor.Exports;
import java.lang.module.ModuleDescriptor.Opens;
import java.lang.module.ModuleFinder;
import java.lang.module.ModuleReference;
-import java.lang.reflect.Module;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
diff --git a/jdk/test/jdk/modules/etc/VerifyModuleDelegation.java b/jdk/test/jdk/modules/etc/VerifyModuleDelegation.java
index 182fb4ee985..2d8b30c4eea 100644
--- a/jdk/test/jdk/modules/etc/VerifyModuleDelegation.java
+++ b/jdk/test/jdk/modules/etc/VerifyModuleDelegation.java
@@ -31,8 +31,6 @@
import java.lang.module.ModuleDescriptor;
import java.lang.module.ModuleFinder;
import java.lang.module.ModuleReference;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.util.Set;
import static java.util.stream.Collectors.toSet;
@@ -49,7 +47,7 @@ public class VerifyModuleDelegation {
= ModuleDescriptor.newModule(JAVA_BASE).build();
private static final Set MREFS
- = Layer.boot().modules().stream().map(Module::getDescriptor)
+ = ModuleLayer.boot().modules().stream().map(Module::getDescriptor)
.collect(toSet());
private void check(ModuleDescriptor md, ModuleDescriptor ref) {
@@ -69,7 +67,7 @@ public class VerifyModuleDelegation {
@Test
public void checkLoaderDelegation() {
- Layer boot = Layer.boot();
+ ModuleLayer boot = ModuleLayer.boot();
MREFS.stream()
.forEach(md -> md.requires().stream().forEach(req ->
{
diff --git a/jdk/test/jdk/modules/incubator/DefaultImage.java b/jdk/test/jdk/modules/incubator/DefaultImage.java
index ff6f5261f14..dc2236351c8 100644
--- a/jdk/test/jdk/modules/incubator/DefaultImage.java
+++ b/jdk/test/jdk/modules/incubator/DefaultImage.java
@@ -34,6 +34,9 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
+import java.lang.module.ModuleDescriptor;
+import java.lang.module.ModuleFinder;
+import java.lang.module.ModuleReference;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -41,13 +44,13 @@ import java.util.function.Consumer;
import java.util.stream.Stream;
import org.testng.annotations.BeforeTest;
-import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import static java.nio.charset.StandardCharsets.UTF_8;
import static jdk.testlibrary.ProcessTools.executeCommand;
import static org.testng.Assert.*;
+@Test
public class DefaultImage {
private static final String JAVA_HOME = System.getProperty("java.home");
private static final Path TEST_SRC = Paths.get(System.getProperty("test.src"));
@@ -72,19 +75,13 @@ public class DefaultImage {
.resultChecker(r -> r.assertOutputDoesNotContain("jdk.incubator"));
}
- @DataProvider(name = "tokens")
- public Object[][] singleModuleValues() throws IOException {
- return new Object[][]{ { "ALL-DEFAULT" }, { "ALL-SYSTEM"} };
- }
-
- @Test(dataProvider = "tokens")
- public void testAddMods(String addModsToken) throws Throwable {
+ public void testAllDefault() throws Throwable {
if (isExplodedBuild()) {
System.out.println("Test cannot run on exploded build");
return;
}
- java("--add-modules", addModsToken,
+ java("--add-modules", "ALL-DEFAULT",
"-cp", CP_DIR.toString(),
"listmods.ListModules")
.assertSuccess()
@@ -92,6 +89,22 @@ public class DefaultImage {
.resultChecker(r -> r.assertOutputDoesNotContain("jdk.incubator"));
}
+ public void testAllSystem() throws Throwable {
+ if (isExplodedBuild()) {
+ System.out.println("Test cannot run on exploded build");
+ return;
+ }
+
+ if (containsAnyIncubatorModules()) {
+ java("--add-modules", "ALL-SYSTEM",
+ "-cp", CP_DIR.toString(),
+ "listmods.ListModules")
+ .assertSuccess()
+ .resultChecker(r -> r.assertOutputContains("java.base"))
+ .resultChecker(r -> r.assertOutputContains("jdk.incubator"));
+ }
+ }
+
static ToolResult java(String... opts) throws Throwable {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
@@ -155,4 +168,14 @@ public class DefaultImage {
Path modulesPath = Paths.get(JAVA_HOME).resolve("lib").resolve("modules");
return Files.notExists(modulesPath);
}
+
+ static boolean containsAnyIncubatorModules() {
+ return ModuleFinder.ofSystem().findAll().stream()
+ .map(ModuleReference::descriptor)
+ .map(ModuleDescriptor::name)
+ .filter(mn -> mn.startsWith("jdk.incubator"))
+ .map(mn -> true)
+ .findAny()
+ .orElse(false);
+ }
}
diff --git a/jdk/test/jdk/modules/incubator/ImageModules.java b/jdk/test/jdk/modules/incubator/ImageModules.java
index 347b1d4e221..cf3d297ae9f 100644
--- a/jdk/test/jdk/modules/incubator/ImageModules.java
+++ b/jdk/test/jdk/modules/incubator/ImageModules.java
@@ -98,7 +98,7 @@ public class ImageModules {
List.of("hello world", "message.converter", "java.base"),
List.of("WARNING") },
{ "--do-not-resolve-by-default",
- List.of("ALL-DEFAULT", "ALL-SYSTEM"),
+ List.of("ALL-DEFAULT"),
ToolResult.ASSERT_FAILURE,
List.of("java.base", "java.lang.ClassNotFoundException: converter.MessageConverter"),
List.of("WARNING", "message.converter") },
@@ -109,7 +109,7 @@ public class ImageModules {
"WARNING: Using incubator modules: message.converter"),
List.of() },
{ "--do-not-resolve-by-default --warn-if-resolved=incubating",
- List.of("ALL-DEFAULT", "ALL-SYSTEM"),
+ List.of("ALL-DEFAULT"),
ToolResult.ASSERT_FAILURE,
List.of("java.base", "java.lang.ClassNotFoundException: converter.MessageConverter"),
List.of("WARNING", "message.converter") },
@@ -215,13 +215,13 @@ public class ImageModules {
List.of() },
{ "--do-not-resolve-by-default",
"",
- List.of("ALL-DEFAULT", "ALL-SYSTEM"),
+ List.of("ALL-DEFAULT"),
ToolResult.ASSERT_FAILURE,
List.of("java.lang.ClassNotFoundException: writer.MessageWriter", "java.base"),
List.of("message.writer") },
{ "--do-not-resolve-by-default",
"--do-not-resolve-by-default",
- List.of("ALL-DEFAULT", "ALL-SYSTEM"),
+ List.of("ALL-DEFAULT"),
ToolResult.ASSERT_FAILURE,
List.of("java.lang.ClassNotFoundException: writer.MessageWriter", "java.base"),
List.of("message.converter", "message.writer") },
@@ -239,7 +239,8 @@ public class ImageModules {
ToolResult.ASSERT_SUCCESS,
List.of("HELLO CHEGAR !!!", "message.writer", "message.converter", "java.base",
"WARNING: Using incubator modules: message.converter"),
- List.of() } };
+ List.of() }
+ };
return values;
}
diff --git a/jdk/test/jdk/modules/incubator/src/cp/listmods/ListModules.java b/jdk/test/jdk/modules/incubator/src/cp/listmods/ListModules.java
index 2d80d198ee0..ceac4c516da 100644
--- a/jdk/test/jdk/modules/incubator/src/cp/listmods/ListModules.java
+++ b/jdk/test/jdk/modules/incubator/src/cp/listmods/ListModules.java
@@ -23,13 +23,11 @@
package listmods;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import static java.util.stream.Collectors.joining;
public class ListModules {
public static void main(String[] args) throws Exception {
- System.out.println(Layer.boot()
+ System.out.println(ModuleLayer.boot()
.modules()
.stream()
.map(Module::getName)
diff --git a/jdk/test/jdk/modules/incubator/src/cp/test/ConvertToLowerCase.java b/jdk/test/jdk/modules/incubator/src/cp/test/ConvertToLowerCase.java
index cf0d1c7cba9..4d0cc85252b 100644
--- a/jdk/test/jdk/modules/incubator/src/cp/test/ConvertToLowerCase.java
+++ b/jdk/test/jdk/modules/incubator/src/cp/test/ConvertToLowerCase.java
@@ -23,13 +23,11 @@
package test;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import static java.util.stream.Collectors.joining;
public class ConvertToLowerCase {
public static void main(String[] args) {
- System.out.println(Layer.boot()
+ System.out.println(ModuleLayer.boot()
.modules()
.stream()
.map(Module::getName)
diff --git a/jdk/test/jdk/modules/incubator/src/cp/test/WriteUpperCase.java b/jdk/test/jdk/modules/incubator/src/cp/test/WriteUpperCase.java
index 844fccb2fcf..f0662a55ed2 100644
--- a/jdk/test/jdk/modules/incubator/src/cp/test/WriteUpperCase.java
+++ b/jdk/test/jdk/modules/incubator/src/cp/test/WriteUpperCase.java
@@ -23,13 +23,11 @@
package test;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import static java.util.stream.Collectors.joining;
public class WriteUpperCase {
public static void main(String[] args) {
- System.out.println(Layer.boot()
+ System.out.println(ModuleLayer.boot()
.modules()
.stream()
.map(Module::getName)
diff --git a/jdk/test/jdk/modules/open/Basic.java b/jdk/test/jdk/modules/open/Basic.java
index 2af576e61e1..f63b1452b83 100644
--- a/jdk/test/jdk/modules/open/Basic.java
+++ b/jdk/test/jdk/modules/open/Basic.java
@@ -36,7 +36,6 @@ import java.lang.invoke.MethodType;
import java.lang.module.ModuleDescriptor;
import java.lang.reflect.Constructor;
import java.lang.reflect.InaccessibleObjectException;
-import java.lang.reflect.Module;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
diff --git a/jdk/test/jdk/modules/scenarios/automaticmodules/src/basictest/test/Main.java b/jdk/test/jdk/modules/scenarios/automaticmodules/src/basictest/test/Main.java
index 01d8283a4b3..4a729799e29 100644
--- a/jdk/test/jdk/modules/scenarios/automaticmodules/src/basictest/test/Main.java
+++ b/jdk/test/jdk/modules/scenarios/automaticmodules/src/basictest/test/Main.java
@@ -23,9 +23,6 @@
package test;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
-
import http.HttpServer;
/**
@@ -47,8 +44,8 @@ public class Main {
cl = ClassLoader.getSystemClassLoader();
assertTrue(httpModule.canRead(cl.getUnnamedModule()));
- // and read all modules in the boot Layer
- Layer layer = Layer.boot();
+ // and read all modules in the boot layer
+ ModuleLayer layer = ModuleLayer.boot();
layer.modules().forEach(m -> assertTrue(httpModule.canRead(m)));
// run code in the automatic modue, ensures access is allowed
diff --git a/jdk/test/jdk/modules/scenarios/automaticmodules/src/sptest/test/Main.java b/jdk/test/jdk/modules/scenarios/automaticmodules/src/sptest/test/Main.java
index 5897d671321..dc079b876b3 100644
--- a/jdk/test/jdk/modules/scenarios/automaticmodules/src/sptest/test/Main.java
+++ b/jdk/test/jdk/modules/scenarios/automaticmodules/src/sptest/test/Main.java
@@ -26,8 +26,6 @@ package test;
import java.lang.module.ModuleDescriptor;
import java.lang.module.ModuleDescriptor.Requires;
import java.lang.module.ModuleDescriptor.Provides;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.util.Map;
import java.util.Optional;
import java.util.ServiceLoader;
@@ -36,7 +34,7 @@ import java.util.stream.Collectors;
import javax.script.ScriptEngineFactory;
/**
- * Test that the automatic module "bananascript" is in the boot Layer and
+ * Test that the automatic module "bananascript" is in the boot layer and
* it behaves as a service provider.
*/
@@ -44,7 +42,7 @@ public class Main {
public static void main(String[] args) throws Exception {
- Optional om = Layer.boot().findModule("bananascript");
+ Optional om = ModuleLayer.boot().findModule("bananascript");
assertTrue(om.isPresent());
ModuleDescriptor descriptor = om.get().getDescriptor();
diff --git a/jdk/test/jdk/modules/scenarios/container/src/container/container/Main.java b/jdk/test/jdk/modules/scenarios/container/src/container/container/Main.java
index ca3f0f3a0d2..05b8513114e 100644
--- a/jdk/test/jdk/modules/scenarios/container/src/container/container/Main.java
+++ b/jdk/test/jdk/modules/scenarios/container/src/container/container/Main.java
@@ -27,9 +27,7 @@ import java.io.File;
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
import java.lang.module.ResolvedModule;
-import java.lang.reflect.Layer;
import java.lang.reflect.Method;
-import java.lang.reflect.Module;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Set;
@@ -43,7 +41,7 @@ public class Main {
public static void main(String[] args) throws Exception {
System.out.println("Boot layer");
- Layer.boot()
+ ModuleLayer.boot()
.modules()
.stream()
.map(Module::getName)
@@ -70,7 +68,7 @@ public class Main {
ModuleFinder finder = ModuleFinder.of(paths);
- Configuration cf = Layer.boot().configuration()
+ Configuration cf = ModuleLayer.boot().configuration()
.resolveAndBind(finder,
ModuleFinder.of(),
Set.of(appModuleName));
@@ -81,9 +79,9 @@ public class Main {
.sorted()
.forEach(mn -> System.out.format(" %s%n", mn));
- // reify the configuration as a Layer
+ // reify the configuration as a module layer
ClassLoader scl = ClassLoader.getSystemClassLoader();
- Layer layer = Layer.boot().defineModulesWithManyLoaders(cf, scl);
+ ModuleLayer layer = ModuleLayer.boot().defineModulesWithManyLoaders(cf, scl);
// invoke application main method
ClassLoader loader = layer.findLoader(appModuleName);
diff --git a/jdk/test/sun/management/LoggingTest/test.loggerfinder/test/loggerfinder/TestLoggerFinder.java b/jdk/test/sun/management/LoggingTest/test.loggerfinder/test/loggerfinder/TestLoggerFinder.java
index 39c555eee9e..c9ee9169e26 100644
--- a/jdk/test/sun/management/LoggingTest/test.loggerfinder/test/loggerfinder/TestLoggerFinder.java
+++ b/jdk/test/sun/management/LoggingTest/test.loggerfinder/test/loggerfinder/TestLoggerFinder.java
@@ -26,7 +26,6 @@ package test.loggerfinder;
import java.lang.System.Logger;
import java.lang.System.Logger.Level;
import java.lang.System.LoggerFinder;
-import java.lang.reflect.Module;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Optional;
diff --git a/jdk/test/sun/tools/jconsole/ResourceCheckTest.java b/jdk/test/sun/tools/jconsole/ResourceCheckTest.java
index 6a8b62d0d2c..a678a476136 100644
--- a/jdk/test/sun/tools/jconsole/ResourceCheckTest.java
+++ b/jdk/test/sun/tools/jconsole/ResourceCheckTest.java
@@ -34,7 +34,6 @@
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
-import java.lang.reflect.Module;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
diff --git a/jdk/test/tools/jar/modularJar/Basic.java b/jdk/test/tools/jar/modularJar/Basic.java
index 8ee9f1005a3..92cc0a981b0 100644
--- a/jdk/test/tools/jar/modularJar/Basic.java
+++ b/jdk/test/tools/jar/modularJar/Basic.java
@@ -869,8 +869,8 @@ public class Basic {
return new Object[][] {
// JAR file name module-name[@version]
{ "foo.jar", "foo" },
+ { "foo1.jar", "foo1" },
{ "foo4j.jar", "foo4j", },
- { "foo1.2.3.jar", "foo" },
{ "foo-1.2.3.4.jar", "foo@1.2.3.4" },
{ "foo-bar.jar", "foo.bar" },
{ "foo-1.2-SNAPSHOT.jar", "foo@1.2-SNAPSHOT" },
diff --git a/jdk/test/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java b/jdk/test/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java
index 2d1d844c818..a7bd3f1c222 100644
--- a/jdk/test/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java
+++ b/jdk/test/tools/jar/modularJar/src/bar/jdk/test/bar/Bar.java
@@ -28,7 +28,6 @@ import java.lang.module.ModuleDescriptor.Exports;
import java.lang.module.ModuleDescriptor.Provides;
import java.lang.module.ModuleReference;
import java.lang.module.ResolvedModule;
-import java.lang.reflect.Module;
import java.util.Optional;
import java.util.StringJoiner;
import java.util.HashSet;
diff --git a/jdk/test/tools/jlink/JLink2Test.java b/jdk/test/tools/jlink/JLink2Test.java
index 9eed823069a..5c0f7f33571 100644
--- a/jdk/test/tools/jlink/JLink2Test.java
+++ b/jdk/test/tools/jlink/JLink2Test.java
@@ -39,7 +39,6 @@
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.lang.reflect.Layer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
@@ -88,7 +87,7 @@ public class JLink2Test {
private static void testOptions() throws Exception {
List builtInPlugins = new ArrayList<>();
- builtInPlugins.addAll(PluginRepository.getPlugins(Layer.boot()));
+ builtInPlugins.addAll(PluginRepository.getPlugins(ModuleLayer.boot()));
if(builtInPlugins.isEmpty()) {
throw new Exception("No builtin plugins");
}
diff --git a/jdk/test/tools/jlink/JLinkTest.java b/jdk/test/tools/jlink/JLinkTest.java
index a964a694a8d..64b220710e5 100644
--- a/jdk/test/tools/jlink/JLinkTest.java
+++ b/jdk/test/tools/jlink/JLinkTest.java
@@ -25,7 +25,6 @@ import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Layer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -88,7 +87,7 @@ public class JLinkTest {
{
// number of built-in plugins
List builtInPlugins = new ArrayList<>();
- builtInPlugins.addAll(PluginRepository.getPlugins(Layer.boot()));
+ builtInPlugins.addAll(PluginRepository.getPlugins(ModuleLayer.boot()));
totalPlugins = builtInPlugins.size();
// actual num. of plugins loaded from jdk.jlink module
int actualJLinkPlugins = 0;
diff --git a/jdk/test/tools/jlink/basic/src/test/jdk/test/Test.java b/jdk/test/tools/jlink/basic/src/test/jdk/test/Test.java
index e038745c80b..79d07d85ad3 100644
--- a/jdk/test/tools/jlink/basic/src/test/jdk/test/Test.java
+++ b/jdk/test/tools/jlink/basic/src/test/jdk/test/Test.java
@@ -23,9 +23,6 @@
package jdk.test;
-import java.lang.reflect.Module;
-import java.lang.reflect.Layer;
-
public class Test {
public static void main(String[] args) {
System.out.println(Test.class + " ...");
@@ -36,7 +33,7 @@ public class Test {
ClassLoader scl = ClassLoader.getSystemClassLoader();
ClassLoader cl1 = Test.class.getClassLoader();
Module testModule = Test.class.getModule();
- ClassLoader cl2 = Layer.boot().findLoader(testModule.getName());
+ ClassLoader cl2 = ModuleLayer.boot().findLoader(testModule.getName());
if (cl1 != scl)
throw new RuntimeException("Not loaded by system class loader");
diff --git a/jdk/test/tools/jlink/plugins/PluginsNegativeTest.java b/jdk/test/tools/jlink/plugins/PluginsNegativeTest.java
index 6119fe41d92..17ae87e13bf 100644
--- a/jdk/test/tools/jlink/plugins/PluginsNegativeTest.java
+++ b/jdk/test/tools/jlink/plugins/PluginsNegativeTest.java
@@ -30,7 +30,6 @@
* jdk.jlink/jdk.tools.jlink.plugin
* @run main/othervm PluginsNegativeTest
*/
-import java.lang.reflect.Layer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -63,7 +62,7 @@ public class PluginsNegativeTest {
private void testDuplicateBuiltInProviders() {
List javaPlugins = new ArrayList<>();
- javaPlugins.addAll(PluginRepository.getPlugins(Layer.boot()));
+ javaPlugins.addAll(PluginRepository.getPlugins(ModuleLayer.boot()));
for (Plugin javaPlugin : javaPlugins) {
System.out.println("Registered plugin: " + javaPlugin.getName());
}
@@ -72,7 +71,7 @@ public class PluginsNegativeTest {
try {
PluginRepository.registerPlugin(new CustomPlugin(pluginName));
try {
- PluginRepository.getPlugin(pluginName, Layer.boot());
+ PluginRepository.getPlugin(pluginName, ModuleLayer.boot());
throw new AssertionError("Exception is not thrown for duplicate plugin: " + pluginName);
} catch (Exception ignored) {
}
@@ -83,7 +82,7 @@ public class PluginsNegativeTest {
}
private void testUnknownProvider() {
- if (PluginRepository.getPlugin("unknown", Layer.boot()) != null) {
+ if (PluginRepository.getPlugin("unknown", ModuleLayer.boot()) != null) {
throw new AssertionError("Exception expected for unknown plugin name");
}
}
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java
index 7128e1cfacd..ecdebe5b42e 100644
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java
@@ -24,7 +24,6 @@
import java.io.File;
import java.io.IOException;
import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Layer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m1/p1/Main.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m1/p1/Main.java
index 9d3a769eefa..aef19f535ef 100644
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m1/p1/Main.java
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m1/p1/Main.java
@@ -26,8 +26,6 @@ package p1;
import java.io.InputStream;
import java.io.IOException;
import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.net.URI;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/p3/Main.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/p3/Main.java
index c7ff38e6d50..aa7563e666e 100644
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/p3/Main.java
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m3/p3/Main.java
@@ -26,7 +26,6 @@ package p3;
import p4.Foo;
import java.lang.module.ModuleDescriptor;
import java.lang.reflect.Field;
-import java.lang.reflect.Module;
import static java.lang.module.ModuleDescriptor.Exports.Modifier.*;
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m4/p4/Main.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m4/p4/Main.java
index 66e18604913..a08fe01c67c 100644
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m4/p4/Main.java
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m4/p4/Main.java
@@ -27,7 +27,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.lang.module.ModuleDescriptor;
import java.lang.module.ModuleFinder;
-import java.lang.reflect.Layer;
import java.net.URI;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
@@ -100,7 +99,7 @@ public class Main {
private static void checkModule(String mn, String... packages) throws IOException {
// verify ModuleDescriptor from the runtime module
- ModuleDescriptor md = Layer.boot().findModule(mn).get()
+ ModuleDescriptor md = ModuleLayer.boot().findModule(mn).get()
.getDescriptor();
checkModuleDescriptor(md, packages);
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m5/p5/Main.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m5/p5/Main.java
index f22dfc5c10d..f0f46e68dff 100644
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m5/p5/Main.java
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/m5/p5/Main.java
@@ -23,7 +23,6 @@
package p5;
-import java.lang.reflect.Layer;
import p3.Foo;
import p3.Lib;
@@ -32,7 +31,7 @@ import p3.Lib;
*/
public class Main {
public static void main(String... args) {
- boolean libPresent = Layer.boot().findModule("m3").isPresent();
+ boolean libPresent = ModuleLayer.boot().findModule("m3").isPresent();
if (LibHelper.libClassFound != libPresent) {
throw new RuntimeException("Expected module m3 not in the boot layer");
}
diff --git a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/test/jdk/test/Main.java b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/test/jdk/test/Main.java
index e5c6fe8e6ca..d7f36589093 100644
--- a/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/test/jdk/test/Main.java
+++ b/jdk/test/tools/jlink/plugins/SystemModuleDescriptors/src/test/jdk/test/Main.java
@@ -24,8 +24,6 @@
package jdk.test;
import java.lang.module.ModuleDescriptor;
-import java.lang.reflect.Layer;
-import java.lang.reflect.Module;
import java.net.URI;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
@@ -65,7 +63,7 @@ public class Main {
// check the module descriptor of a system module
for (int i=0; i < modules.size(); i++) {
String mn = modules.get(i);
- Module module = Layer.boot().findModule(mn).orElseThrow(
+ Module module = ModuleLayer.boot().findModule(mn).orElseThrow(
() -> new RuntimeException(mn + " not found")
);
diff --git a/jdk/test/tools/launcher/modules/dryrun/DryRunTest.java b/jdk/test/tools/launcher/modules/dryrun/DryRunTest.java
index fe9a293be57..afb1fbc78f1 100644
--- a/jdk/test/tools/launcher/modules/dryrun/DryRunTest.java
+++ b/jdk/test/tools/launcher/modules/dryrun/DryRunTest.java
@@ -167,22 +167,6 @@ public class DryRunTest {
// test main method with and without --add-modules mm
int exitValue = exec("--module-path", LIBS_DIR.toString(),
"-m", mid);
- assertTrue(exitValue != 0);
-
- exitValue = exec("--module-path", LIBS_DIR.toString(),
- "--add-modules", M_MODULE,
- "-m", mid);
- assertTrue(exitValue == 0);
-
- // test dry run with and without --add-modules m
- // no resolution failure
- exitValue = exec("--dry-run", "--module-path", LIBS_DIR.toString(),
- "-m", mid);
- assertTrue(exitValue == 0);
-
- exitValue = exec("--dry-run", "--module-path", LIBS_DIR.toString(),
- "--add-modules", M_MODULE,
- "-m", mid);
assertTrue(exitValue == 0);
}
diff --git a/jdk/test/tools/launcher/modules/listmods/ListModsTest.java b/jdk/test/tools/launcher/modules/listmods/ListModsTest.java
index 7b1dd9340e7..8628539481e 100644
--- a/jdk/test/tools/launcher/modules/listmods/ListModsTest.java
+++ b/jdk/test/tools/launcher/modules/listmods/ListModsTest.java
@@ -115,7 +115,7 @@ public class ListModsTest {
.outputTo(System.out)
.errorTo(System.out);
output.shouldNotContain("java.base");
- output.shouldContain("java.rhubarb not observable");
+ output.shouldContain("java.rhubarb not found");
assertTrue(output.getExitValue() == 0);
}
diff --git a/jdk/test/tools/launcher/modules/patch/basic/src/test/jdk/test/Main.java b/jdk/test/tools/launcher/modules/patch/basic/src/test/jdk/test/Main.java
index f274a17ad2a..e23e38d2fba 100644
--- a/jdk/test/tools/launcher/modules/patch/basic/src/test/jdk/test/Main.java
+++ b/jdk/test/tools/launcher/modules/patch/basic/src/test/jdk/test/Main.java
@@ -28,8 +28,6 @@
package jdk.test;
-import java.lang.reflect.Module;
-
public class Main {
public static void main(String[] args) throws Exception {
diff --git a/jdk/test/tools/launcher/modules/upgrademodulepath/src/test/jdk/test/Main.java b/jdk/test/tools/launcher/modules/upgrademodulepath/src/test/jdk/test/Main.java
index e5540aded8b..b6ab2656a45 100644
--- a/jdk/test/tools/launcher/modules/upgrademodulepath/src/test/jdk/test/Main.java
+++ b/jdk/test/tools/launcher/modules/upgrademodulepath/src/test/jdk/test/Main.java
@@ -24,7 +24,6 @@
package jdk.test;
import java.lang.module.ModuleReference;
-import java.lang.reflect.Layer;
import java.net.URI;
import javax.enterprise.context.Scope;
@@ -53,7 +52,7 @@ public class Main {
// javax.transaction should be found in boot layer.
ModuleReference ref =
- Layer.boot().configuration().findModule(TRANSACTION_MODULE).get().reference();
+ ModuleLayer.boot().configuration().findModule(TRANSACTION_MODULE).get().reference();
// check uri of java.transaction found on the upgrade module path.
URI uri = ref.location().get();
System.out.println("uri: " + uri);
From 19becf9f6185a1458162fa8dded0963b1fd56752 Mon Sep 17 00:00:00 2001
From: Chris Hegarty
Date: Fri, 7 Apr 2017 10:39:46 +0100
Subject: [PATCH 36/40] 8178161: Default multicast interface on Mac
Reviewed-by: michaelm, bpb
---
.../classes/java/net/DefaultInterface.java | 53 ++++++++++++++-----
1 file changed, 39 insertions(+), 14 deletions(-)
diff --git a/jdk/src/java.base/macosx/classes/java/net/DefaultInterface.java b/jdk/src/java.base/macosx/classes/java/net/DefaultInterface.java
index 573de6986f8..b68e3aa0034 100644
--- a/jdk/src/java.base/macosx/classes/java/net/DefaultInterface.java
+++ b/jdk/src/java.base/macosx/classes/java/net/DefaultInterface.java
@@ -50,10 +50,11 @@ class DefaultInterface {
}
/**
- * Choose a default interface. This method returns an interface that is
- * both "up" and supports multicast. This method choses an interface in
+ * Choose a default interface. This method returns the first interface that
+ * is both "up" and supports multicast. This method chooses an interface in
* order of preference:
* 1. neither loopback nor point to point
+ * ( prefer interfaces with dual IP support )
* 2. point to point
* 3. loopback
*
@@ -66,32 +67,56 @@ class DefaultInterface {
try {
nifs = NetworkInterface.getNetworkInterfaces();
} catch (IOException ignore) {
- // unable to enumate network interfaces
+ // unable to enumerate network interfaces
return null;
}
+ NetworkInterface preferred = null;
NetworkInterface ppp = null;
NetworkInterface loopback = null;
while (nifs.hasMoreElements()) {
NetworkInterface ni = nifs.nextElement();
try {
- if (ni.isUp() && ni.supportsMulticast()) {
- boolean isLoopback = ni.isLoopback();
- boolean isPPP = ni.isPointToPoint();
- if (!isLoopback && !isPPP) {
- // found an interface that is not the loopback or a
- // point-to-point interface
+ if (!ni.isUp() || !ni.supportsMulticast())
+ continue;
+
+ boolean ip4 = false, ip6 = false;
+ Enumeration addrs = ni.getInetAddresses();
+ while (addrs.hasMoreElements()) {
+ InetAddress addr = addrs.nextElement();
+ if (!addr.isAnyLocalAddress()) {
+ if (addr instanceof Inet4Address) {
+ ip4 = true;
+ } else if (addr instanceof Inet6Address) {
+ ip6 = true;
+ }
+ }
+ }
+
+ boolean isLoopback = ni.isLoopback();
+ boolean isPPP = ni.isPointToPoint();
+ if (!isLoopback && !isPPP) {
+ // found an interface that is not the loopback or a
+ // point-to-point interface
+ if (preferred == null) {
+ preferred = ni;
+ } else if (ip4 && ip6){
return ni;
}
- if (ppp == null && isPPP)
- ppp = ni;
- if (loopback == null && isLoopback)
- loopback = ni;
}
+ if (ppp == null && isPPP)
+ ppp = ni;
+ if (loopback == null && isLoopback)
+ loopback = ni;
+
} catch (IOException skip) { }
}
- return (ppp != null) ? ppp : loopback;
+ if (preferred != null) {
+ return preferred;
+ } else {
+ return (ppp != null) ? ppp : loopback;
+ }
}
}
From 06164475decd52f2bc8822e3b3f8afa9f9c90cf0 Mon Sep 17 00:00:00 2001
From: Brian Burkhalter
Date: Fri, 7 Apr 2017 11:31:57 -0700
Subject: [PATCH 37/40] 8178074: (ch)
java/nio/channels/etc/AdaptorCloseAndInterrupt.java: add instrumentation
Add some print statements to indicate state at strategic points
Reviewed-by: chegar
---
.../etc/AdaptorCloseAndInterrupt.java | 32 ++++++++++++++++---
1 file changed, 28 insertions(+), 4 deletions(-)
diff --git a/jdk/test/java/nio/channels/etc/AdaptorCloseAndInterrupt.java b/jdk/test/java/nio/channels/etc/AdaptorCloseAndInterrupt.java
index 3e48ace3274..368437a3803 100644
--- a/jdk/test/java/nio/channels/etc/AdaptorCloseAndInterrupt.java
+++ b/jdk/test/java/nio/channels/etc/AdaptorCloseAndInterrupt.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2017, 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
@@ -36,6 +36,7 @@ import java.util.concurrent.Callable;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
import java.util.Random;
@@ -46,6 +47,9 @@ public class AdaptorCloseAndInterrupt {
final DatagramChannel peer;
final int port;
+ final AtomicBoolean isClosed = new AtomicBoolean();
+ final AtomicBoolean isInterrupted = new AtomicBoolean();
+
public AdaptorCloseAndInterrupt() {
listener = null;
peer = null;
@@ -96,6 +100,7 @@ public class AdaptorCloseAndInterrupt {
try {
sc.socket().getInputStream().read(new byte[100]);
+ System.err.format("close() was invoked: %s%n", isClosed.get());
throw new RuntimeException("read should not have completed");
} catch (ClosedChannelException expected) {}
@@ -119,7 +124,10 @@ public class AdaptorCloseAndInterrupt {
sc.socket().getInputStream().read(new byte[100]);
throw new RuntimeException("read should not have completed");
} catch (ClosedByInterruptException expected) {
- Thread.currentThread().interrupted();
+ System.out.format("interrupt() was invoked: %s%n",
+ isInterrupted.get());
+ System.out.format("scReadAsyncInterrupt was interrupted: %s%n",
+ Thread.currentThread().interrupted());
}
if (!sc.socket().isClosed())
@@ -140,6 +148,7 @@ public class AdaptorCloseAndInterrupt {
try {
dc.socket().receive(new DatagramPacket(new byte[100], 100));
+ System.err.format("close() was invoked: %s%n", isClosed.get());
throw new RuntimeException("receive should not have completed");
} catch (ClosedChannelException expected) {}
@@ -159,7 +168,16 @@ public class AdaptorCloseAndInterrupt {
dc.socket().receive(new DatagramPacket(new byte[100], 100));
throw new RuntimeException("receive should not have completed");
} catch (ClosedByInterruptException expected) {
- Thread.currentThread().interrupted();
+ System.out.format("interrupt() was invoked: %s%n",
+ isInterrupted.get());
+ System.out.format("dcReceiveAsyncInterrupt was interrupted: %s%n",
+ Thread.currentThread().interrupted());
+ } catch (SocketTimeoutException unexpected) {
+ System.err.format("Receive thread interrupt invoked: %s%n",
+ isInterrupted.get());
+ System.err.format("Receive thread was interrupted: %s%n",
+ Thread.currentThread().isInterrupted());
+ throw unexpected;
}
if (!dc.socket().isClosed())
@@ -175,6 +193,7 @@ public class AdaptorCloseAndInterrupt {
try {
ssc.socket().accept();
+ System.err.format("close() was invoked: %s%n", isClosed.get());
throw new RuntimeException("accept should not have completed");
} catch (ClosedChannelException expected) {}
@@ -193,7 +212,10 @@ public class AdaptorCloseAndInterrupt {
ssc.socket().accept();
throw new RuntimeException("accept should not have completed");
} catch (ClosedByInterruptException expected) {
- Thread.currentThread().interrupted();
+ System.out.format("interrupt() was invoked: %s%n",
+ isInterrupted.get());
+ System.out.format("ssAcceptAsyncInterrupt was interrupted: %s%n",
+ Thread.currentThread().interrupted());
}
if (!ssc.socket().isClosed())
@@ -204,6 +226,7 @@ public class AdaptorCloseAndInterrupt {
AdaptorCloseAndInterrupt.pool.schedule(new Callable() {
public Void call() throws Exception {
sc.close();
+ isClosed.set(true);
return null;
}
}, new Random().nextInt(1000), TimeUnit.MILLISECONDS);
@@ -214,6 +237,7 @@ public class AdaptorCloseAndInterrupt {
AdaptorCloseAndInterrupt.pool.schedule(new Callable() {
public Void call() throws Exception {
current.interrupt();
+ isInterrupted.set(true);
return null;
}
}, new Random().nextInt(1000), TimeUnit.MILLISECONDS);
From 80eb904ede5503fba9d7c0d6cb8c7c5a21750727 Mon Sep 17 00:00:00 2001
From: Stuart Marks
Date: Fri, 7 Apr 2017 15:41:07 -0700
Subject: [PATCH 38/40] 8173152: Wrong wording in Comparator.compare() method
spec
Reviewed-by: bpb
---
.../share/classes/java/lang/Comparable.java | 4 ++--
.../share/classes/java/util/Comparator.java | 16 ++++++++--------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/jdk/src/java.base/share/classes/java/lang/Comparable.java b/jdk/src/java.base/share/classes/java/lang/Comparable.java
index ff8892caacf..b1c27f1911d 100644
--- a/jdk/src/java.base/share/classes/java/lang/Comparable.java
+++ b/jdk/src/java.base/share/classes/java/lang/Comparable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -124,7 +124,7 @@ public interface Comparable {
* {@code sgn(}expression{@code )} designates the mathematical
* signum function, which is defined to return one of {@code -1},
* {@code 0}, or {@code 1} according to whether the value of
- * expression is negative, zero or positive.
+ * expression is negative, zero, or positive, respectively.
*
* @param o the object to be compared.
* @return a negative integer, zero, or a positive integer as this object
diff --git a/jdk/src/java.base/share/classes/java/util/Comparator.java b/jdk/src/java.base/share/classes/java/util/Comparator.java
index ade582dbd3b..85f25beaf63 100644
--- a/jdk/src/java.base/share/classes/java/util/Comparator.java
+++ b/jdk/src/java.base/share/classes/java/util/Comparator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, 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
@@ -112,12 +112,6 @@ public interface Comparator {
* zero, or a positive integer as the first argument is less than, equal
* to, or greater than the second.
*
- * In the foregoing description, the notation
- * {@code sgn(}expression{@code )} designates the mathematical
- * signum function, which is defined to return one of {@code -1},
- * {@code 0}, or {@code 1} according to whether the value of
- * expression is negative, zero or positive.
- *
* The implementor must ensure that {@code sgn(compare(x, y)) ==
* -sgn(compare(y, x))} for all {@code x} and {@code y}. (This
* implies that {@code compare(x, y)} must throw an exception if and only
@@ -135,7 +129,13 @@ public interface Comparator {
* {@code (compare(x, y)==0) == (x.equals(y))}. Generally speaking,
* any comparator that violates this condition should clearly indicate
* this fact. The recommended language is "Note: this comparator
- * imposes orderings that are inconsistent with equals."
+ * imposes orderings that are inconsistent with equals."
+ *
+ * In the foregoing description, the notation
+ * {@code sgn(}expression{@code )} designates the mathematical
+ * signum function, which is defined to return one of {@code -1},
+ * {@code 0}, or {@code 1} according to whether the value of
+ * expression is negative, zero, or positive, respectively.
*
* @param o1 the first object to be compared.
* @param o2 the second object to be compared.
From 5622eecc0a443563bf2b2a033ed15988918f9065 Mon Sep 17 00:00:00 2001
From: Lance Andersen
Date: Sun, 9 Apr 2017 14:25:07 -0400
Subject: [PATCH 39/40] 8178130: Minor update to the Connection javadocs
Reviewed-by: bpb
---
.../share/classes/java/sql/Connection.java | 48 +++++++++++--------
1 file changed, 29 insertions(+), 19 deletions(-)
diff --git a/jdk/src/java.sql/share/classes/java/sql/Connection.java b/jdk/src/java.sql/share/classes/java/sql/Connection.java
index 944042aeb65..446f63c0f36 100644
--- a/jdk/src/java.sql/share/classes/java/sql/Connection.java
+++ b/jdk/src/java.sql/share/classes/java/sql/Connection.java
@@ -1535,8 +1535,9 @@ throws SQLException;
*
The connection pool caches {@code PooledConnection} objects
*
Returns a logical connection handle when {@code getConnection} is
* called by the application
- *
The pool manager calls {@code Connection.close} on the logical connection handle
- * prior to returning the {@code PooledConnection} back to the cache
+ *
The logical {@code Connection} is closed by calling
+ * {@code Connection.close} prior to returning the {@code PooledConnection}
+ * to the cache.
*
* @throws SQLException if an error occurs
* @since 9
@@ -1577,8 +1578,9 @@ throws SQLException;
*
The connection pool caches {@code PooledConnection} objects
*
Returns a logical connection handle when {@code getConnection} is
* called by the application
- *
The pool manager calls {@code Connection.close} on the logical connection handle
- * prior to returning the {@code PooledConnection} back to the cache
+ *
The logical {@code Connection} is closed by calling
+ * {@code Connection.close} prior to returning the {@code PooledConnection}
+ * to the cache.
*
* @throws SQLException if an error occurs
* @since 9
@@ -1590,7 +1592,10 @@ throws SQLException;
}
/**
- * Sets and validates the sharding keys for this connection.
+ * Sets and validates the sharding keys for this connection. A {@code null}
+ * value may be specified for the sharding Key. The validity
+ * of a {@code null} sharding key is vendor-specific. Consult your vendor's
+ * documentation for additional information.
* @implSpec
* The default implementation will throw a
* {@code SQLFeatureNotSupportedException}.
@@ -1600,7 +1605,8 @@ throws SQLException;
* {@code Connection}. The timeout value indicates how long the driver
* should wait for the {@code Connection} to verify that the sharding key
* is valid before {@code setShardingKeyIfValid} returns false.
- * @param shardingKey the sharding key to be validated against this connection
+ * @param shardingKey the sharding key to be validated against this connection.
+ * The sharding key may be {@code null}
* @param superShardingKey the super sharding key to be validated against this
* connection. The super sharding key may be {@code null}.
* @param timeout time in seconds before which the validation process is expected to
@@ -1610,10 +1616,10 @@ throws SQLException;
* and set on this connection; false if the sharding keys are not valid or
* the timeout period expires before the operation completes.
* @throws SQLException if an error occurs while performing this validation;
- * the {@code shardingkey} is {@code null}; a {@code superSharedingKey} is specified
+ * a {@code superSharedingKey} is specified
* without a {@code shardingKey};
* this method is called on a closed {@code connection}; or
- * the {@code timeout} value is less than 0.
+ * the {@code timeout} value is negative.
* @throws SQLFeatureNotSupportedException if the driver does not support sharding
* @since 9
* @see ShardingKey
@@ -1626,7 +1632,10 @@ throws SQLException;
}
/**
- * Sets and validates the sharding key for this connection.
+ * Sets and validates the sharding key for this connection. A {@code null}
+ * value may be specified for the sharding Key. The validity
+ * of a {@code null} sharding key is vendor-specific. Consult your vendor's
+ * documentation for additional information.
* @implSpec
* The default implementation will throw a
* {@code SQLFeatureNotSupportedException}.
@@ -1635,7 +1644,8 @@ throws SQLException;
* {@code Connection}. The timeout value indicates how long the driver
* should wait for the {@code Connection} to verify that the sharding key
* is valid before {@code setShardingKeyIfValid} returns false.
- * @param shardingKey the sharding key to be validated against this connection
+ * @param shardingKey the sharding key to be validated against this connection.
+ * The sharding key may be {@code null}
* @param timeout time in seconds before which the validation process is expected to
* be completed,else the validation process is aborted. A value of 0 indicates
* the validation process will not time out.
@@ -1643,8 +1653,8 @@ throws SQLException;
* set on this connection; false if the sharding key is not valid or
* the timeout period expires before the operation completes.
* @throws SQLException if there is an error while performing this validation;
- * this method is called on a closed {@code connection}; the {@code shardingkey}
- * is {@code null}; or the {@code timeout} value is less than 0.
+ * this method is called on a closed {@code connection};
+ * or the {@code timeout} value is negative.
* @throws SQLFeatureNotSupportedException if the driver does not support sharding
* @since 9
* @see ShardingKey
@@ -1664,12 +1674,12 @@ throws SQLException;
* This method sets the specified sharding keys but does not require a
* round trip to the database to validate that the sharding keys are valid
* for the {@code Connection}.
- * @param shardingKey the sharding key to set on this connection.
+ * @param shardingKey the sharding key to set on this connection. The sharding
+ * key may be {@code null}
* @param superShardingKey the super sharding key to set on this connection.
* The super sharding key may be {@code null}
* @throws SQLException if an error occurs setting the sharding keys;
- * this method is called on a closed {@code connection};
- * the {@code shardingkey} is {@code null}; or
+ * this method is called on a closed {@code connection}; or
* a {@code superSharedingKey} is specified without a {@code shardingKey}
* @throws SQLFeatureNotSupportedException if the driver does not support sharding
* @since 9
@@ -1690,10 +1700,10 @@ throws SQLException;
* This method sets the specified sharding key but does not require a
* round trip to the database to validate that the sharding key is valid
* for the {@code Connection}.
- * @param shardingKey the sharding key to set on this connection.
- * @throws SQLException if an error occurs setting the sharding key;
- * this method is called on a closed {@code connection}; or the
- * {@code shardkingKey} is {@code null}
+ * @param shardingKey the sharding key to set on this connection. The sharding
+ * key may be {@code null}
+ * @throws SQLException if an error occurs setting the sharding key; or
+ * this method is called on a closed {@code connection}
* @throws SQLFeatureNotSupportedException if the driver does not support sharding
* @since 9
* @see ShardingKey
From 28f4bade5b11037045538849ea6ef57fec8ed9e4 Mon Sep 17 00:00:00 2001
From: Amit Sapre
Date: Mon, 10 Apr 2017 12:15:13 +0530
Subject: [PATCH 40/40] 8176204: [DOC] ThreadMXBean Fails to Detect
ReentrantReadWriteLock Deadlock
Update LockInfo class javadoc for own-able synchronizer examples
Reviewed-by: dholmes
---
.../share/classes/java/lang/management/LockInfo.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/jdk/src/java.management/share/classes/java/lang/management/LockInfo.java b/jdk/src/java.management/share/classes/java/lang/management/LockInfo.java
index 7ad4760a869..91e5545e387 100644
--- a/jdk/src/java.management/share/classes/java/lang/management/LockInfo.java
+++ b/jdk/src/java.management/share/classes/java/lang/management/LockInfo.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, 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,8 +38,8 @@ import sun.management.LockInfoCompositeData;
* a synchronizer that may be exclusively owned by a thread and uses
* {@link AbstractOwnableSynchronizer AbstractOwnableSynchronizer}
* (or its subclass) to implement its synchronization property.
- * {@link ReentrantLock ReentrantLock} and
- * {@link ReentrantReadWriteLock ReentrantReadWriteLock} are
+ * {@link ReentrantLock ReentrantLock} and the write-lock (but not
+ * the read-lock) of {@link ReentrantReadWriteLock ReentrantReadWriteLock} are
* two examples of ownable synchronizers provided by the platform.
*
*