--- a/make/java/java/FILES_java.gmk Fri Jul 18 12:47:04 2008 -0700
+++ b/make/java/java/FILES_java.gmk Tue Jul 22 19:01:27 2008 -0700
@@ -34,6 +34,7 @@ JAVA_JAVA_java = \
java/lang/Thread.java \
java/lang/Character.java \
java/lang/CharacterData.java \
+ java/lang/ModuleInfo.java \
sun/misc/ASCIICaseInsensitiveComparator.java \
sun/misc/VM.java \
sun/misc/Signal.java \
--- a/src/share/classes/java/lang/ClassLoader.java Fri Jul 18 12:47:04 2008 -0700
+++ b/src/share/classes/java/lang/ClassLoader.java Tue Jul 22 19:01:27 2008 -0700
@@ -419,7 +419,7 @@ public abstract class ClassLoader {
/**
* Converts an array of bytes into an instance of class <tt>ModuleInfo</tt>.
- * Typically this method will only invoked by a class loader's
+ * Typically this method will only be invoked by a class loader's
* {@link #findModuleInfo findModuleInfo()} method.
*
* @param name
@@ -447,7 +447,7 @@ public abstract class ClassLoader {
protected final ModuleInfo defineModuleInfo(String name, byte[] b, int off, int len)
throws ClassFormatError {
Class<?> clazz = defineClass(name, b, off, len);
- return new ModuleInfo(clazz);
+ return new ModuleInfo(clazz, b, off, len);
}
/**
--- a/src/share/classes/java/lang/ModuleInfo.java Fri Jul 18 12:47:04 2008 -0700
+++ b/src/share/classes/java/lang/ModuleInfo.java Tue Jul 22 19:01:27 2008 -0700
@@ -29,7 +29,8 @@ import java.lang.annotation.*;
import java.lang.annotation.*;
import java.lang.reflect.*;
import java.module.annotation.*;
-import sun.module.annotation.*;
+import sun.module.MetadataParser;
+import sun.module.ModuleParsingException;
/**
* A {@code ModuleInfo} object contain information about a Java module. The
@@ -53,30 +54,30 @@ import sun.module.annotation.*;
*/
public final class ModuleInfo implements AnnotatedElement {
- // The implementation of this class is a temporary approximation
- // designed to function without the javac and JVM support the final
- // implementation will be able to take advantage of.
- // The API is not expected to change, but the final implementation
- // will be very different.
-
- private final Set<String> exported, members;
- private final static String SUFFIX = ".module_info";
-
- /*
- * Private storage for the module name and annotations.
- */
private final String moduleName;
- private transient Map<Class, Annotation> annotations;
- private transient Map<Class, Annotation> declaredAnnotations;
+ private final Set<String> exportedClasses;
+ private final Set<String> exportedPackages;
+ private final Set<String> memberPackages;
+ private final Map<Class, Annotation> annotations;
+ private final Map<Class, Annotation> declaredAnnotations;
/**
* Construct a <code>ModuleInfo</code> instance based on the information
* of the module-info class.
*
* @param clazz the class the represents module-info.
- * @return a new module info.
- */
- ModuleInfo(Class<?> clazz) {
+ * @param b
+ * The bytes that make up the module data. The bytes in positions
+ * <tt>off</tt> through <tt>off+len-1</tt> should have the format
+ * of a valid module file as defined by the <a
+ * href="http://java.sun.com/docs/books/vmspec/">Java Virtual
+ * Machine Specification</a>.
+ * @param off
+ * The start offset in <tt>b</tt> of the module data
+ * @param len
+ * @throws ClassFormatError if the data doesn't contain a valid module info.
+ */
+ ModuleInfo(Class<?> clazz, byte[] b, int off, int len) throws ClassFormatError {
this.annotations = new HashMap<Class, Annotation>();
this.declaredAnnotations = new HashMap<Class, Annotation>();
@@ -88,79 +89,15 @@ public final class ModuleInfo implements
declaredAnnotations.put(a.annotationType(), a);
}
- // Determines module name using @ModuleName annotation if exists;
- // using the class name otherwise.
- //
- // @ModuleName is a workaround for building virtual module
- // definitions in the Java SE platform, and this should be
- // replaced after the actual JSR 294 support arrives.
- sun.module.annotation.ModuleName moduleNameAnnotation = clazz.getAnnotation(sun.module.annotation.ModuleName.class);
- if (moduleNameAnnotation == null) {
- String className = clazz.getName();
- if (className.endsWith(SUFFIX) == false) {
- throw new ClassFormatError("Not a module: " + className);
- }
- moduleName = className.substring(0, className.length() - SUFFIX.length()).replace('$', '.');
-
- // use LinkedHashSet to preserve order
- Set<String> setExported = new LinkedHashSet<String>();
- Set<String> setMembers = new LinkedHashSet<String>();
- Field[] fields = clazz.getDeclaredFields();
- for (Field field : fields) {
- Class type = field.getType();
- String name = field.getName().replace('$', '.');
- if (type == exports.class) {
- setExported.add(name);
- setMembers.add(name);
- }
- }
-
- LegacyClasses legacyClassesAnno = clazz.getAnnotation(LegacyClasses.class);
- if (legacyClassesAnno != null) {
- // Adds legacy classes as members
- setMembers.addAll(Arrays.asList(legacyClassesAnno.value()));
-
- ExportLegacyClasses exportLegacyClassesAnno = clazz.getAnnotation(ExportLegacyClasses.class);
- if (exportLegacyClassesAnno != null) {
- // Adds legacy classes as exported
- setExported.addAll(Arrays.asList(legacyClassesAnno.value()));
- }
- }
-
- exported = Collections.unmodifiableSet(getPackages(setExported));
- members = Collections.unmodifiableSet(getPackages(setMembers));
- } else {
- // Virtual modules in the JDK
- moduleName = moduleNameAnnotation.value();
-
- // XXX @ExportPackages is a workaround for building virtual modules
- // for the Java SE platform. It should be replaced after the
- // actual JSR 294 support arrives in javac.
- //
- sun.module.annotation.ExportPackages exportPackages =
- getAnnotation(sun.module.annotation.ExportPackages.class);
- if (exportPackages != null) {
- HashSet<String> setExportedPackages = new LinkedHashSet<String>();
- setExportedPackages.addAll(Arrays.asList(exportPackages.value()));
- exported = Collections.unmodifiableSet(setExportedPackages);
- members = exported;
- } else {
- members = Collections.emptySet();
- exported = Collections.emptySet();
- }
- }
- }
-
- /**
- * Construct a <code>ModuleInfo</code> instance based on the information
- * of the module-info class loaded from the classloader.
- *
- * @param moduleName the module name
- * @param loader the class loader to find the module-info class
- * @return a new module info.
- */
- ModuleInfo(String moduleName, ClassLoader loader) {
- this(getModuleInfo(moduleName, loader));
+ try {
+ MetadataParser metadata = new MetadataParser(b, off, len);
+ moduleName = metadata.getModuleName();
+ exportedClasses = new HashSet<String>(metadata.getModuleExportClassList(false));
+ memberPackages = new HashSet<String>(metadata.getModuleMemberPackageList());
+ exportedPackages = new HashSet<String>(metadata.getModuleExportPackageList());
+ } catch (ModuleParsingException mpe) {
+ throw new ClassFormatError("Invalid module data: " + mpe.getMessage());
+ }
}
private final static String[] S0 = new String[0];
@@ -183,11 +120,11 @@ public final class ModuleInfo implements
* the module has no members.
*
* @return an array of the names of all member packages
- * @throws UnsupporterOperationException if the packages cannot be
+ * @throws UnsupportedOperationException if the packages cannot be
* determined.
*/
public String[] getMemberPackages() {
- return members.toArray(S0);
+ return memberPackages.toArray(S0);
}
/**
@@ -201,11 +138,11 @@ public final class ModuleInfo implements
* the module has no members that are exported types.
*
* @return an array of the names of all packages that have exported types.
- * @throws UnsupporterOperationException if the packages cannot be
+ * @throws UnsupportedOperationException if the packages cannot be
* determined.
*/
public String[] getExportedPackages() {
- return exported.toArray(S0);
+ return exportedPackages.toArray(S0);
}
/**
@@ -217,25 +154,11 @@ public final class ModuleInfo implements
* the module has no exported types.
*
* @return an array of the names of all exported types.
- * @throws UnsupporterOperationException if the exported types cannot be
+ * @throws UnsupportedOperationException if the exported types cannot be
* determined.
*/
public String[] getExportedClasses() {
- return exported.toArray(S0);
- }
-
- private static Set<String> getPackages(Collection<String> classes) {
- Set<String> packages = new HashSet<String>();
- for (String clazz : classes ) {
- int k = clazz.lastIndexOf('.');
- if (k == -1) {
- packages.add("<unnamed package>");
- } else {
- String pkg = clazz.substring(0, k);
- packages.add(pkg);
- }
- }
- return packages;
+ return exportedClasses.toArray(S0);
}
private static final class Loader extends ClassLoader {
@@ -253,7 +176,7 @@ public final class ModuleInfo implements
*
* @param data the module data
* @return a new module info that represents the module data.
- * @throws ClassFormatErrror If the data did not contain a valid module
+ * @throws ClassFormatError If the data did not contain a valid module
*/
public static ModuleInfo getModuleInfo(byte[] data) throws ClassFormatError {
// we use a new ClassLoader for each ModuleInfo object so that we
@@ -263,19 +186,9 @@ public final class ModuleInfo implements
return loader.doDefineModuleInfo(data);
}
- private static Class<?> getModuleInfo(String name, ClassLoader loader) {
- try {
- return Class.forName(name + ".module-info", false, loader);
- } catch (ClassNotFoundException ex) {
- // store a proxy for the module info that has no annotations
- class ModuleInfoProxy {}
- return ModuleInfoProxy.class;
- }
- }
-
- /**
- * Find the module information by name in the callers {@code ClassLoader}
- * instance. The callers {@code ClassLoader} instance is used to find the
+ /**
+ * Find the module information by name in the caller's {@code ClassLoader}
+ * instance. The caller's {@code ClassLoader} instance is used to find the
* module information corresponding to the named module.
*
* @param name a module name, for example, {@code java.se.core}.
@@ -291,8 +204,8 @@ public final class ModuleInfo implements
* {@code ClassLoader} instance. Those modules correspond to classes loaded
* via or accessible by name to that {@code ClassLoader} instance.
*
- * @return a new array of module information known to the callers
- * {@code ClassLoader} instance. An zero length array is returned
+ * @return a new array of module information known to the caller's
+ * {@code ClassLoader} instance. A zero length array is returned
* if none are known.
*/
public static ModuleInfo[] getModuleInfos() {
@@ -351,7 +264,4 @@ public final class ModuleInfo implements
public String toString() {
return "module " + moduleName;
}
-
- /** Temporary for module definition until javac support arrives */
- public static class exports { private exports() {} };
}
--- a/src/share/classes/java/module/ModuleDefinition.java Fri Jul 18 12:47:04 2008 -0700
+++ b/src/share/classes/java/module/ModuleDefinition.java Tue Jul 22 19:01:27 2008 -0700
@@ -242,11 +242,10 @@ public abstract class ModuleDefinition {
*/
public boolean isClassExported(String name) {
try {
- // XXX: convert class name?
Set<String> exportedClasses = getExportedClasses();
return exportedClasses.contains(name);
} catch (UnsupportedOperationException uoe) {
- return false;
+ return true;
}
}
@@ -284,7 +283,7 @@ public abstract class ModuleDefinition {
Set<String> exportedResources = getExportedResources();
return exportedResources.contains(path);
} catch (UnsupportedOperationException uoe) {
- return false;
+ return true;
}
}
--- a/src/share/classes/sun/module/bootstrap/BootstrapModuleSystem.java Fri Jul 18 12:47:04 2008 -0700
+++ b/src/share/classes/sun/module/bootstrap/BootstrapModuleSystem.java Tue Jul 22 19:01:27 2008 -0700
@@ -44,11 +44,17 @@ import java.util.Map;
* @since 1.7
*/
public final class BootstrapModuleSystem extends ModuleSystem {
+ private static final BootstrapModuleSystem instance =
+ new BootstrapModuleSystem();
private Map<ModuleDefinition, VirtualModule> modules = new HashMap<ModuleDefinition, VirtualModule>();
- BootstrapModuleSystem() {
+ private BootstrapModuleSystem() {
// empty
+ }
+
+ static BootstrapModuleSystem getInstance() {
+ return instance;
}
@Override
--- a/src/share/classes/sun/module/bootstrap/VirtualModuleDefinitions.java Fri Jul 18 12:47:04 2008 -0700
+++ b/src/share/classes/sun/module/bootstrap/VirtualModuleDefinitions.java Tue Jul 22 19:01:27 2008 -0700
@@ -25,33 +25,18 @@
package sun.module.bootstrap;
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.File;
-import java.nio.ByteBuffer;
-import java.nio.channels.ReadableByteChannel;
-import java.module.Modules;
import java.module.ModuleDefinition;
-import java.module.ModuleContent;
-import java.module.ModuleSystem;
import java.module.annotation.ImportModule;
import java.module.annotation.ImportModules;
import java.module.annotation.ServiceProvider;
import java.module.annotation.ServiceProviders;
import java.module.annotation.Services;
import java.module.annotation.Version;
-import java.security.CodeSigner;
import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
import java.util.List;
import java.util.Set;
import sun.module.annotation.ModuleName;
import sun.module.annotation.ExportPackages;
-import sun.module.core.JamModuleDefinition;
/**
* Definitions of the virtual modules for the Java SE platform.
@@ -389,12 +374,10 @@ public final class VirtualModuleDefiniti
// empty
}
- // Bootstrap module system
- private static final ModuleSystem moduleSystem = new BootstrapModuleSystem();
-
/**
* Returns a list of virtual module definitions for the Java SE platform.
*/
+ @SuppressWarnings("unchecked")
static List<ModuleDefinition> getModuleDefinitions() {
Class[] metadataClasses = { JAVA_SE_CORE_PLATFORM.class,
CORBA.class,
@@ -412,101 +395,12 @@ public final class VirtualModuleDefiniti
List<ModuleDefinition> moduleDefs = new ArrayList<ModuleDefinition>();
for (Class clazz : metadataClasses) {
- byte[] metadata = getBytes(clazz);
- try {
- moduleDefs.add(new JamModuleDefinition(moduleSystem,
- null, null, metadata,
- null, new DummyModuleContent(),
- BootstrapRepository.getInstance(),
- false));
- } catch (Exception e) {
- e.printStackTrace();
- throw new RuntimeException("Cannot create virtual module definition from " + clazz, e);
- }
+ ModuleName moduleNameAnnotation = (ModuleName) clazz.getAnnotation(ModuleName.class);
+ Version versionAnnotation = (Version) clazz.getAnnotation(java.module.annotation.Version.class);
+ String name = moduleNameAnnotation.value();
+ String version = versionAnnotation.value();
+ moduleDefs.add(new VirtualModuleDefinition(name, java.module.Version.valueOf(version), clazz));
}
return moduleDefs;
}
-
- /**
- * Returns the byte array of the specified class.
- */
- private static byte[] getBytes(Class clazz) {
- String clazzName = clazz.getName().replace('.', '/') + ".class";
- try {
- // The trick here is to read the bytes back through the bootstrap
- // classloader.
- InputStream is = BOOTSTRAP_CLASSLOADER.getResourceAsStream(clazzName);
-
- BufferedInputStream bis = new BufferedInputStream(is);
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- byte[] buffer = new byte[8192];
- int byteRead = 0;
-
- // Read the stream until it is EOF
- while ((byteRead = bis.read(buffer, 0, 8192)) != -1)
- baos.write(buffer, 0, byteRead);
-
- // Close input stream
- bis.close();
-
- // Convert to byte array
- return baos.toByteArray();
- } catch (IOException e) {
- throw new RuntimeException("Cannot retrieve virtual module metadata from " + clazzName, e);
- }
- }
-
- /**
- * Dummy module content.
- *
- * This class is never used during normal operation (the ClassLoader of the
- * virtual module), so it is currently a dummy implementation that does
- * nothing.
- *
- * XXX It should probably be fixed later on when we have real modules in
- * place.
- */
- private static final class DummyModuleContent implements ModuleContent {
-
- private static final Set<CodeSigner> codeSigners = Collections.unmodifiableSet(new HashSet<CodeSigner>());
-
- DummyModuleContent() {
- // empty
- }
-
- @Override
- public boolean hasEntry(String name) throws IOException {
- throw new IOException();
- }
-
- @Override
- public ReadableByteChannel getEntryAsChannel(String name) throws IOException {
- throw new IOException();
- }
-
- @Override
- public ByteBuffer getEntryAsByteBuffer(String name) throws IOException {
- throw new IOException();
- }
-
- @Override
- public Set<String> getEntryNames() throws IOException {
- throw new IOException();
- }
-
- @Override
- public File getNativeLibrary(String libraryName) {
- return null;
- }
-
- @Override
- public Set<CodeSigner> getCodeSigners() {
- return codeSigners;
- }
-
- @Override
- public boolean isDownloaded() {
- return true;
- }
- }
}
--- a/src/share/classes/sun/module/core/JamModuleDefinition.java Fri Jul 18 12:47:04 2008 -0700
+++ b/src/share/classes/sun/module/core/JamModuleDefinition.java Tue Jul 22 19:01:27 2008 -0700
@@ -59,7 +59,6 @@ import java.module.annotation.ImportModu
import java.module.annotation.ImportModule;
import java.module.annotation.ImportModules;
import java.module.annotation.MainClass;
-import sun.module.annotation.LegacyClasses;
import sun.module.JamUtils;
/**
@@ -71,16 +70,12 @@ import sun.module.JamUtils;
*
* @since 1.7
*/
-public final class JamModuleDefinition extends ModuleDefinition {
-
- private final ModuleSystem moduleSystem;
+public final class JamModuleDefinition extends AbstractModuleDefinition {
+
private final String name;
private final Version version;
private byte[] metadata;
private final Callable<byte[]> metadataHandle;
- private final ModuleContent content;
- private final Repository repository;
- private final boolean moduleReleasable;
private volatile Set<String> memberClasses;
private volatile Set<String> exportedClasses;
private volatile Set<String> exportedResources;
@@ -89,26 +84,17 @@ public final class JamModuleDefinition e
private volatile Set<PackageDefinition> memberPackageDefs;
private volatile Set<PackageDefinition> exportedPackageDefs;
private volatile Map<Class,Annotation> annotations = null;
- private volatile List<ImportDependency> importDependencies = null;
public JamModuleDefinition(ModuleSystem moduleSystem,
String name, Version version, byte[] metadata,
Callable<byte[]> metadataHandle, ModuleContent content,
Repository repository, boolean moduleReleasable) {
- this.moduleSystem = moduleSystem;
+ super(moduleSystem, name, version, content, repository, moduleReleasable);
this.name = name;
this.version = version;
this.metadata = metadata;
this.metadataHandle = metadataHandle;
- this.content = content;
- this.repository = repository;
- this.moduleReleasable = moduleReleasable;
- }
-
- //
- // The module metadata arrangement below is temporary until the
- // full JSR 294 reflective APIs are in place
- //
+ }
/**
* Returns the contents of the MODULE-INF/MODULE.METADATA file.
@@ -170,75 +156,10 @@ public final class JamModuleDefinition e
}
@Override
- public List<ImportDependency> getImportDependencies() {
- if (importDependencies == null) {
- List<ImportDependency> dependencies = new ArrayList<ImportDependency>();
- ModuleInfo mInfo = getModuleInfo();
- ImportModules importModules = mInfo.getAnnotation(ImportModules.class);
- if (importModules != null) {
- for (ImportModule importModule : Arrays.asList(importModules.value())) {
- String name = importModule.name();
- VersionConstraint constraint = VersionConstraint.valueOf(importModule.version());
- boolean reexport = importModule.reexport();
- boolean optional = importModule.optional();
- Attribute[] attributes = importModule.attributes();
- Map<String, String> attrs = new HashMap<String, String>();
- if (attributes != null) {
- for (Attribute a : attributes) {
- attrs.put(a.name(), a.value());
- }
- }
- dependencies.add(Modules.newModuleDependency(name, constraint, reexport, optional, attrs));
- }
- }
- importDependencies = Collections.unmodifiableList(dependencies);
- }
- return importDependencies;
- }
-
- @Override
- public Set<String> getAttributeNames() {
- HashSet<String> names = new HashSet<String>();
- Attributes attrs = getAnnotation(Attributes.class);
- if (attrs != null) {
- for (Attribute attr : attrs.value()) {
- names.add(attr.name());
- }
- }
- return Collections.unmodifiableSet(names);
- }
-
- @Override
- public String getAttribute(String name) {
- if (name == null) {
- throw new NullPointerException("name must not be null.");
- }
- Attributes attrs = getAnnotation(Attributes.class);
- if (attrs != null) {
- for (Attribute attr : attrs.value()) {
- if (name.equals(attr.name())) {
- return attr.value();
- }
- }
- }
- return null;
- }
-
- @Override
- public String getMainClass() {
- java.module.annotation.MainClass mainClass = getAnnotation
- (java.module.annotation.MainClass.class);
- if (mainClass != null) {
- return mainClass.value();
- } else {
- return null;
- }
- }
-
- @Override
public Set<String> getMemberClasses() {
if (memberClassesNotAvailable) {
- throw new UnsupportedOperationException();
+ throw new UnsupportedOperationException("Module " + getName() +
+ "does not support the member class list.");
}
if (memberClasses == null) {
@@ -246,7 +167,7 @@ public final class JamModuleDefinition e
// Member classes consist of all types in the module
Set<String> s = new HashSet<String>();
- for (String className : content.getEntryNames()) {
+ for (String className : getModuleContent().getEntryNames()) {
// Skip classes in META-INF/ or MODULE-INF/
if (className.startsWith("META-INF/")
|| className.startsWith("MODULE-INF/")) {
@@ -259,18 +180,10 @@ public final class JamModuleDefinition e
}
}
- // XXX hack to support legacy classes, will remove once JSR 294
- // arrives.
- LegacyClasses legacyClassesAnno = getAnnotation(LegacyClasses.class);
- if (legacyClassesAnno != null) {
- // Adds legacy classes as members
- s.addAll(Arrays.asList(legacyClassesAnno.value()));
- }
-
memberClasses = Collections.unmodifiableSet(s);
} catch (IOException ioe) {
memberClassesNotAvailable = true;
- throw new UnsupportedOperationException();
+ throw new UnsupportedOperationException(ioe);
}
}
return memberClasses;
@@ -280,20 +193,8 @@ public final class JamModuleDefinition e
public Set<String> getExportedClasses() {
if (exportedClasses == null) {
// Exported classes consist of all exported types in the module
- Set<String> s = new HashSet<String>();
-
- for (String className : getMemberClasses()) {
- // XXX: determines if a type is exported by checking if it
- // is part of the exported packages. This is just an
- // approximation for now, and should be updated when we have
- // the exported type attribute in the module metadata.
- for (PackageDefinition packageDef : getExportedPackageDefinitions()) {
- if (className.startsWith(packageDef.getName() + ".")) {
- s.add(className);
- }
- }
- }
-
+ Set<String> s =
+ new HashSet<String>(Arrays.asList(getModuleInfo().getExportedClasses()));
exportedClasses = Collections.unmodifiableSet(s);
}
return exportedClasses;
@@ -328,36 +229,10 @@ public final class JamModuleDefinition e
}
@Override
- public boolean isClassExported(String className) {
- // XXX convert class name?
-
- // Use exported classes if available
- if (memberClassesNotAvailable == false) {
- try {
- return getExportedClasses().contains(className);
- } catch (UnsupportedOperationException uoe) {
- }
- }
-
- for (PackageDefinition packageDef : getExportedPackageDefinitions()) {
- String packageName = packageDef.getName();
- if (packageName.equals("*")) {
- // "*" is exported by the "java.classpath" module.
- return true;
- }
-
- // Checks if the specified class is exported from this module.
- if (className.startsWith(packageName + ".")) {
- return true;
- }
- }
- return false;
- }
-
- @Override
public Set<String> getExportedResources() {
if (exportedResourcesNotAvailable) {
- throw new UnsupportedOperationException();
+ throw new UnsupportedOperationException("Module " + getName() +
+ "does not support the exported resources list.");
}
if (exportedResources == null) {
@@ -456,7 +331,7 @@ public final class JamModuleDefinition e
try {
Pattern pattern = Pattern.compile(filter);
- for (String resource : content.getEntryNames()) {
+ for (String resource : getModuleContent().getEntryNames()) {
if (pattern.matcher(resource).matches())
s.add(resource);
}
@@ -467,24 +342,12 @@ public final class JamModuleDefinition e
pse.printStackTrace();
} catch (IOException ioe) {
exportedResourcesNotAvailable = true;
- throw new UnsupportedOperationException();
+ throw new UnsupportedOperationException(ioe);
}
}
exportedResources = Collections.unmodifiableSet(s);
}
return exportedResources;
- }
-
- @Override
- public boolean isResourceExported(String name) {
- // XXX special hack for now
- if (getRepository() == Repository.getBootstrapRepository()) {
- // Module definitions from the bootstrap repository are expected
- // to export all resources.
- return true;
- } else {
- return getExportedResources().contains(name);
- }
}
@Override
@@ -501,27 +364,4 @@ public final class JamModuleDefinition e
return Collections.unmodifiableList(Arrays.asList(getModuleInfo().getAnnotations()));
}
- @Override
- public boolean isModuleReleasable() {
- return moduleReleasable;
- }
-
- @Override
- public Repository getRepository() {
- return repository;
- }
-
- @Override
- public ModuleSystem getModuleSystem() {
- return moduleSystem;
- }
-
- @Override
- public ModuleContent getModuleContent() {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null) {
- sm.checkPermission(new ModuleSystemPermission("accessModuleContent"));
- }
- return content;
- }
}
--- a/src/share/classes/sun/module/core/JamPackageDefinition.java Fri Jul 18 12:47:04 2008 -0700
+++ b/src/share/classes/sun/module/core/JamPackageDefinition.java Tue Jul 22 19:01:27 2008 -0700
@@ -46,13 +46,13 @@ import java.util.Set;
*
* @since 1.7
*/
-class JamPackageDefinition extends PackageDefinition {
+public class JamPackageDefinition extends PackageDefinition {
private String packageName;
private Version version;
private ModuleDefinition moduleDef;
- JamPackageDefinition(String packageName, Version version, ModuleDefinition moduleDef) {
+ public JamPackageDefinition(String packageName, Version version, ModuleDefinition moduleDef) {
this.packageName = packageName;
this.version = version;
this.moduleDef = moduleDef;
--- a/src/share/classes/sun/module/core/ServiceProcessor.java Fri Jul 18 12:47:04 2008 -0700
+++ b/src/share/classes/sun/module/core/ServiceProcessor.java Tue Jul 22 19:01:27 2008 -0700
@@ -60,7 +60,7 @@ import javax.tools.StandardLocation;
* @since 1.7
*/
// XXX Increment to RELEASE_7 when that's in place.
-@SupportedSourceVersion(SourceVersion.RELEASE_6)
+@SupportedSourceVersion(SourceVersion.RELEASE_7)
@SupportedAnnotationTypes({"java.util.Service", "java.util.ServiceProvider"})
public class ServiceProcessor extends AbstractProcessor {
/**
--- a/test/java/module/modinit/RunMTest.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/modinit/RunMTest.java Tue Jul 22 19:01:27 2008 -0700
@@ -213,24 +213,14 @@ public class RunMTest {
File dir = new File(moduleDir, name.replace('.', SEP));
dir.mkdirs();
String mangledName = getMangledName();
- File spfile = new File(dir, "module_info.java");
+ File spfile = new File(dir, "module-info.java");
PrintWriter writer = new PrintWriter(spfile);
writer.println(WARNING_HEADER);
- writer.println("package " + mangledName + ";");
writer.println();
- for (String s : SP_HEADER) {
- writer.println(s);
- }
for (String s : annotations) {
writer.println(s);
}
- writer.println("class module_info {");
- writer.println();
- for (String s : exports) {
- writer.println(" exports " + s.replace(".", "$") + ";");
- }
- writer.println();
- writer.println("}");
+ writer.println("module " + mangledName + ";");
writer.close();
return spfile;
}
@@ -264,7 +254,7 @@ public class RunMTest {
private final Map<String,String> properties;
- private ClassDescription(String line) {
+ private ClassDescription(String line, String moduleName) {
String[] ss = line.split(" ");
String s = ss[ss.length - 1];
int k = s.lastIndexOf('.');
@@ -272,6 +262,7 @@ public class RunMTest {
name = s.substring(k + 1);
properties = new HashMap<String,String>();
properties.put("name", name);
+ properties.put("mod", moduleName);
properties.put("pkg", pkg);
properties.put("import", "");
properties.put("super", "");
@@ -407,8 +398,8 @@ public class RunMTest {
return test;
}
- private ClassDescription parseClass(String header, BufferedReader reader) throws IOException {
- ClassDescription cd = new ClassDescription(header);
+ private ClassDescription parseClass(String header, String moduleName, BufferedReader reader) throws IOException {
+ ClassDescription cd = new ClassDescription(header, moduleName);
String prop = "run";
while (true) {
String line = getLine(reader);
@@ -431,10 +422,12 @@ public class RunMTest {
final String name;
String sourceName;
+ boolean compile;
private FileDescription(String line) {
String[] ss = line.split(" ");
name = ss[ss.length - 1];
+ compile = false;
}
private File write(ModuleDescription md) throws IOException {
@@ -474,6 +467,12 @@ public class RunMTest {
fd.sourceName = name;
continue;
}
+ if (line.startsWith("> compile ")) {
+ String name = line.substring(10).trim();
+ fd.sourceName = name;
+ fd.compile = true;
+ continue;
+ }
throw new IOException("Invalid file declaration: " + line);
}
return fd;
@@ -491,7 +490,7 @@ public class RunMTest {
throw new EOFException();
}
if (line.startsWith(">> begin class ")) {
- md.classes.add(parseClass(line, reader));
+ md.classes.add(parseClass(line, name, reader));
continue;
}
if (line.startsWith(">> begin file ")) {
@@ -529,7 +528,10 @@ public class RunMTest {
md.sourceFiles.add(f);
}
for (FileDescription fd : md.otherFiles) {
- fd.write(md);
+ f = fd.write(md);
+ if (fd.compile) {
+ md.sourceFiles.add(f);
+ }
}
}
}
@@ -556,7 +558,7 @@ public class RunMTest {
srclist.append(f.getPath());
srclist.append(" ");
}
- String cmd = "-source 6 -target 6 -XDignore.symbol.file -implicit:none -Xlint:all -sourcepath "
+ String cmd = "-source 7 -target 7 -XDignore.symbol.file -implicit:none -Xlint:all -sourcepath "
+ srcpath.toString() + " " + srclist;
int r = compiler.run(null, null, null, cmd.split(" "));
if (r != 0) {
@@ -567,10 +569,8 @@ public class RunMTest {
File moduleJam = new File(outputDirectory, moduleDir.getName() + ".jam");
ArrayList<String> args = new ArrayList<String>();
- args.add("cfsS");
+ args.add("cf");
args.add(moduleJam.getCanonicalPath());
- args.add(module.getMangledName());
- args.add(moduleDir.getCanonicalPath() + File.separator);
// Presume all other entries are directories containing classes.
for (File f : moduleDir.listFiles()) {
--- a/test/java/module/modinit/cl-template.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/modinit/cl-template.java Tue Jul 22 19:01:27 2008 -0700
@@ -23,10 +23,12 @@
${header}
+module ${mod};
package ${pkg};
import java.io.*;
import java.util.*;
+import java.module.Version; // Temporary workaround of the javac bug
import java.module.*;
import java.module.annotation.MainClass;
--- a/test/java/module/modinit/mtest/classpath/basic1.mtest Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/modinit/mtest/classpath/basic1.mtest Tue Jul 22 19:01:27 2008 -0700
@@ -59,6 +59,9 @@ import java.net.URL;
in.close();
}
>> end class
+>> begin file ../../../../classp/cp1.txt
+> copy ../../classp/cp1.txt
+>> end file
>>> end module
>>> begin test m1
return
--- a/test/java/module/modinit/mtest/deepvalidate/deepvalidate.mtest Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/modinit/mtest/deepvalidate/deepvalidate.mtest Tue Jul 22 19:01:27 2008 -0700
@@ -10,9 +10,7 @@
@MainClass("m1.MainA")
@Version("1.0")
@ImportModules({
- @ImportModule(name="java.se")})
-@sun.module.annotation.LegacyClasses({ // Use it as a workaround to populate the membership list
- "m1.MainA"
+ @ImportModule(name="java.se")
})
> export
m1.MainA
@@ -118,9 +116,7 @@ m1.MainA
@Version("1.0")
@ImportModules({
@ImportModule(name="java.se"),
- @ImportModule(name="m3")})
-@sun.module.annotation.LegacyClasses({ // Use it as a workaround to populate the membership list
- "m2.MainB"
+ @ImportModule(name="m3")
})
>> begin class m2.MainB
>> end class
@@ -129,9 +125,7 @@ m1.MainA
> annotations
@Version("1.0")
@ImportModules({
- @ImportModule(name="java.se")})
-@sun.module.annotation.LegacyClasses({ // Use it as a workaround to populate the membership list
- "m3.MainC"
+ @ImportModule(name="java.se")
})
>> begin class m3.MainC
>> end class
@@ -141,22 +135,20 @@ m1.MainA
@Version("1.0")
@ImportModules({
@ImportModule(name="java.se"),
- @ImportModule(name="m5")})
-@sun.module.annotation.LegacyClasses({ // Use it as a workaround to populate the membership list
- "conflictTypeXYZ",
- "m4.MainD"
+ @ImportModule(name="m5")
})
>> begin class m4.MainD
>> end class
+>> begin file Foo.java
+> compile Foo.java
+>> end file
>>> end module
>>> begin module m5
> annotations
@Version("1.0")
@ImportModules({
@ImportModule(name="java.se"),
- @ImportModule(name="m6")})
-@sun.module.annotation.LegacyClasses({ // Use it as a workaround to populate the membership list
- "m5.MainE"
+ @ImportModule(name="m6")
})
>> begin class m5.MainE
@@ -168,12 +160,11 @@ m1.MainA
@ImportModules({
@ImportModule(name="java.se")
})
-@sun.module.annotation.LegacyClasses({ // Use it as a workaround to populate the membership list
- "conflictTypeXYZ",
- "m6.MainF"
-})
>> begin class m6.MainF
>> end class
+>> begin file Foo.java
+> compile Foo.java
+>> end file
>>> end module
>>> begin module m7
> annotations
@@ -182,9 +173,6 @@ m1.MainA
@ImportModule(name="java.se"),
@ImportModule(name="m4"),
@ImportModule(name="m6")
-})
-@sun.module.annotation.LegacyClasses({ // Use it as a workaround to populate the membership list
- "m7.MainG"
})
>> begin class m7.MainG
>> end class
@@ -196,10 +184,6 @@ m1.MainA
@ImportModule(name="java.se"),
@ImportModule(name="java.classpath")
})
-@sun.module.annotation.LegacyClasses({ // Use it as a workaround to populate the membership list
- "conflictTypeXYZ",
- "m8.MainH"
-})
>> begin class m8.MainH
>> end class
>>> end module
--- a/test/java/module/modinit/mtest/exportlegacyclasses/exportlegacyclasses1.mtest Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/modinit/mtest/exportlegacyclasses/exportlegacyclasses1.mtest Tue Jul 22 19:01:27 2008 -0700
@@ -5,9 +5,6 @@
>>> begin module m1
> annotations
@MainClass("m1.MainA")
-@sun.module.annotation.LegacyClasses({
- "a.b.c",
- "x.y.z"})
@ImportModules({
@ImportModule(name="java.se")
})
@@ -15,30 +12,108 @@ m1.MainA
m1.MainA
>> begin class m1.MainA
// m1 should only export m1.MainA
+ final String[] m1MemberTypes = {
+ "p.Bar", "p.Foo", "q.Gus", "m1.module-info", "m1.MainA"
+ };
+ final String[] m1MemberPackages = {
+ "p", "q", "m1"
+ };
+ final String[] m1ExportedTypes = {
+ "m1.MainA"
+ };
+ final String[] m1ExportedPackages = {
+ "m1"
+ };
+
+ Set<PackageDefinition> memberPkgs = module.getModuleDefinition().getMemberPackageDefinitions();
+ for (PackageDefinition pd : memberPkgs) {
+ System.out.println(pd);
+ }
+ if (memberPkgs == null) {
+ throw new Exception("getMemberPackageDefinitions() should never return null.");
+ }
+ if (memberPkgs.size() != m1MemberPackages.length) {
+ throw new Exception("m1 should have " +
+ m1MemberPackages.length + " member packages.");
+ }
+
+ boolean found;
+ for (String name : m1MemberPackages) {
+ found = false;
+ for (PackageDefinition pd : memberPkgs) {
+ if (pd.getName().equals(name)) {
+ found = true;
+ }
+ }
+ if (!found) {
+ throw new Exception("Missing member package \"" +
+ name + "\" in m1.");
+ }
+ }
+
Set<String> memberClasses = module.getModuleDefinition().getMemberClasses();
if (memberClasses == null) {
throw new Exception("getMemberClasses() should never return null.");
}
- // Workaround until JSR 294 support arrives
- // if (memberClasses.size() != 3) {
- // throw new Exception("m1 should have three member classes.");
- // }
- if (memberClasses.contains("m1.MainA") == false
- || memberClasses.contains("a.b.c") == false
- || memberClasses.contains("x.y.z") == false) {
- throw new Exception("Missing member classes in m1.");
- }
+ if (memberClasses.size() != m1MemberTypes.length) {
+ throw new Exception("m1 should have " +
+ m1MemberTypes.length + " member classes.");
+ }
+ for (String name : m1MemberTypes) {
+ if (memberClasses.contains(name) == false) {
+ throw new Exception("Missing member class \"" +
+ name + "\" in m1.");
+ }
+ }
+
+ Set<PackageDefinition> exportPkgs = module.getModuleDefinition().getExportedPackageDefinitions();
+ if (exportPkgs == null) {
+ throw new Exception("getExportedPackageDefinitions() should never return null.");
+ }
+ if (exportPkgs.size() != m1ExportedPackages.length) {
+ throw new Exception("m1 should have " +
+ m1ExportedPackages.length + " exported packages.");
+ }
+ for (String name : m1ExportedPackages) {
+ found = false;
+ for (PackageDefinition pd : exportPkgs) {
+ if (pd.getName().equals(name)) {
+ found = true;
+ }
+ }
+ if (!found) {
+ throw new Exception("Missing export package \"" +
+ name + "\" in m1.");
+ }
+ }
+
Set<String> exportedClasses = module.getModuleDefinition().getExportedClasses();
if (exportedClasses == null) {
throw new Exception("getExportedClasses() should never return null.");
}
- // Workaround until JSR 294 support arrives
- // if (exportedClasses.size() != 1) {
- // throw new Exception("m1 should have one exported class.");
- // }
- if (exportedClasses.contains("m1.MainA") == false) {
- throw new Exception("Missing exported classes in m1.");
- }
+ if (exportedClasses.size() != m1ExportedTypes.length) {
+ throw new Exception("m1 should have " +
+ m1ExportedTypes.length + " exported packages.");
+ }
+ for (String name : m1ExportedTypes) {
+ if (exportedClasses.contains(name) == false) {
+ throw new Exception("Missing export class \"" +
+ name + "\" in m1.");
+ }
+ }
+
+ final String[] m2MemberTypes = {
+ "p.Bar", "p.Foo", "q.Gus", "m2.module-info", "m2.MainB"
+ };
+ final String[] m2MemberPackages = {
+ "p", "q", "m2"
+ };
+ final String[] m2ExportedTypes = {
+ "p.Bar", "q.Gus", "m2.MainB"
+ };
+ final String[] m2ExportedPackages = {
+ "p", "q", "m2"
+ };
Module m2;
try {
@@ -49,49 +124,100 @@ m1.MainA
throw new Exception("Unable to instantiate m2.");
}
-for (PackageDefinition pd : m2.getModuleDefinition().getExportedPackageDefinitions()) {
- System.out.println("exported package: " + pd.getName());
-}
-
- // m2 should export m1.MainA, a.b.c, and x.y.z
+ // m2 should export m2.MainA, p.Bar, and q.Gus
+ memberClasses = m2.getModuleDefinition().getMemberClasses();
+ memberPkgs = m2.getModuleDefinition().getMemberPackageDefinitions();
+ if (memberPkgs == null) {
+ throw new Exception("getMemberPackageDefinitions() should never return null.");
+ }
+ if (memberPkgs.size() != m2MemberPackages.length) {
+ throw new Exception("m2 should have " +
+ m2MemberPackages.length + " member packages.");
+ }
+
+ for (String name : m2MemberPackages) {
+ found = false;
+ for (PackageDefinition pd : memberPkgs) {
+ if (pd.getName().equals(name)) {
+ found = true;
+ }
+ }
+ if (!found) {
+ throw new Exception("Missing member package \"" +
+ name + "\" in m2.");
+ }
+ }
+
memberClasses = m2.getModuleDefinition().getMemberClasses();
if (memberClasses == null) {
throw new Exception("getMemberClasses() should never return null.");
}
- // Workaround until JSR 294 support arrives
- // if (memberClasses.size() != 3) {
- // throw new Exception("m2 should have three member classes.");
- // }
- for (String s : memberClasses) {
- System.out.println("Member class: " + s);
- }
-
- if (memberClasses.contains("m2.MainB") == false
- || memberClasses.contains("a.b.c") == false
- || memberClasses.contains("x.y.z") == false) {
- throw new Exception("Missing member classes in m2.");
- }
+ if (memberClasses.size() != m2MemberTypes.length) {
+ throw new Exception("m2 should have " +
+ m2MemberTypes.length + " member classes.");
+ }
+ for (String name : m2MemberTypes) {
+ if (memberClasses.contains(name) == false) {
+ throw new Exception("Missing member class \"" +
+ name + "\" in m2.");
+ }
+ }
+
+ exportPkgs = m2.getModuleDefinition().getExportedPackageDefinitions();
+ if (exportPkgs == null) {
+ throw new Exception("getExportedPackageDefinitions() should never return null.");
+ }
+ if (exportPkgs.size() != m2ExportedPackages.length) {
+ throw new Exception("m2 should have " +
+ m2ExportedTypes.length + " exported packages.");
+ }
+ for (String name : m2ExportedPackages) {
+ found = false;
+ for (PackageDefinition pd : exportPkgs) {
+ if (pd.getName().equals(name)) {
+ found = true;
+ }
+ }
+ if (!found) {
+ throw new Exception("Missing export package \"" +
+ name + "\" in m2.");
+ }
+ }
+
exportedClasses = m2.getModuleDefinition().getExportedClasses();
if (exportedClasses == null) {
throw new Exception("getExportedClasses() should never return null.");
}
- // Workaround until JSR 294 support arrives
- // if (exportedClasses.size() != 3) {
- // throw new Exception("m2 should have three exported classes.");
- // }
- if (exportedClasses.contains("m2.MainB") == false
- || exportedClasses.contains("a.b.c") == false
- || exportedClasses.contains("x.y.z") == false) {
- throw new Exception("Missing exported classes in m2.");
+ if (exportedClasses.size() != m2ExportedTypes.length) {
+ throw new Exception("m2 should have " +
+ m2ExportedTypes.length + " exported packages.");
+ }
+ for (String name : m2ExportedTypes) {
+ found = false;
+ for (String exp : exportedClasses) {
+ if (exp.equals(name)) {
+ found = true;
+ }
+ }
+ if (!found) {
+ throw new Exception("Missing export class \"" +
+ name + "\" in m2.");
+ }
}
>> end class
+>> begin file p/Foo.java
+> compile p/Foo.java
+>> end file
+>> begin file p/Bar.java
+> compile p/Bar.java
+>> end file
+>> begin file q/Gus.java
+> compile q/Gus.java
+>> end file
>>> end module
>>> begin module m2
> annotations
@ExportLegacyClasses
-@sun.module.annotation.LegacyClasses({
- "a.b.c",
- "x.y.z"})
@ImportModules({
@ImportModule(name="java.se")
})
@@ -99,6 +225,15 @@ m2.MainB
m2.MainB
>> begin class m2.MainB
>> end class
+>> begin file p/Foo.java
+> compile p/Foo.java
+>> end file
+>> begin file p/Bar.java
+> compile p/Bar.java
+>> end file
+>> begin file q/Gus.java
+> compile q/Gus.java
+>> end file
>>> end module
>>> begin test m1
return
--- a/test/java/module/modinit/mtest/getresource/basic2.mtest Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/modinit/mtest/getresource/basic2.mtest Tue Jul 22 19:01:27 2008 -0700
@@ -42,16 +42,14 @@ import java.net.*;
checkClassStream2(urls.get(1).openStream());
}
- private static void checkClassStream1(InputStream in) throws Exception {
- int k = in.read();
- if (k != '#') {
- throw new Exception("Wrong data: " + k);
-
- }
- in.close();
+ private void checkClassStream1(InputStream is) throws Exception {
+ ClassLoader cl = new DupClassLoader(is);
+ Class<?> clazz = cl.loadClass("m.Dup");
+ // NoSuchMethodError thrown if the method doesn't exist
+ java.lang.reflect.Method method = clazz.getMethod("findIt");
}
- private static void checkClassStream2(InputStream in) throws Exception {
+ private void checkClassStream2(InputStream in) throws Exception {
DataInputStream din = new DataInputStream(in);
int k = din.readInt();
if (k != 0xcafebabe) {
@@ -97,6 +95,50 @@ import java.net.*;
in.close();
}
+ class DupClassLoader extends ClassLoader {
+ private final String dupClassName = "m.Dup";
+ private final InputStream is;
+ public DupClassLoader(InputStream is) {
+ super(null);
+ this.is = is;
+ }
+ public Class findClass(String name) throws ClassNotFoundException {
+ if (name.equals(dupClassName)) {
+ byte[] b = loadClassData();
+ return defineClass(name, b, 0, b.length);
+ } else {
+ throw new ClassNotFoundException(name);
+ }
+ }
+
+ private byte[] loadClassData() {
+ BufferedInputStream in = null;
+ ByteArrayOutputStream out = null;
+ try {
+ in = new BufferedInputStream(is);
+ out = new ByteArrayOutputStream();
+ int c;
+
+ while ((c = in.read()) != -1) {
+ out.write(c);
+ }
+ return out.toByteArray();
+ } catch (IOException ioe) {
+ return null;
+ } finally {
+ try {
+ if (in != null) {
+ in.close();
+ }
+ if (out != null) {
+ out.close();
+ }
+ } catch (IOException ioe) {
+ }
+ }
+ }
+ }
+
>> end class
>> begin class m.Dup
>> end class
@@ -109,9 +151,8 @@ import java.net.*;
>> begin file resources/r1.txt
> copy r1b.txt
>> end file
-# test file with .class extension; not really class file
->> begin file m/Dup.class
-> copy basic2.mtest
+>> begin file m/Dup.java
+> compile Dup.java
>> end file
>>> end module
>>> begin test m1
--- a/test/java/module/service/ServiceTest.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/ServiceTest.java Tue Jul 22 19:01:27 2008 -0700
@@ -93,6 +93,29 @@ abstract public class ServiceTest {
/** Compiles all files under srcDir to destDir. */
void compileSources(File srcDir, File destDir) throws Throwable {
+ destDir.mkdirs();
+
+ // compile all source files with annotation processor
+ compileSources(srcDir, destDir,
+ new FileFilter() {
+ public boolean accept(File pathname) {
+ String name = pathname.getName();
+ return name.endsWith(".java") &&
+ name.equals("module-info.java") == false;
+ }},
+ "-processor sun.module.core.ServiceProcessor");
+ // compile module-info.java
+ compileSources(srcDir, destDir,
+ new FileFilter() {
+ public boolean accept(File pathname) {
+ String name = pathname.getName();
+ return name.equals("module-info.java");
+ }},
+ "-verbose");
+ }
+
+ private void compileSources(File srcDir, File destDir,
+ FileFilter ff, String compilerFlags) throws Throwable {
List<File> srcs = new ArrayList<File>();
for (File dir : srcDir.listFiles(
new FileFilter() {
@@ -100,18 +123,15 @@ abstract public class ServiceTest {
return pathname.isDirectory();
}
})) {
- File[] srcFiles = dir.listFiles(
- new FileFilter() {
- public boolean accept(File pathname) {
- return pathname.getName().endsWith(".java");
- }});
+ File[] srcFiles = dir.listFiles(ff);
srcs.addAll(Arrays.asList(srcFiles));
}
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
- String cmdPrefix = "-source 6 -target 6 -implicit:class"
- + " -processor sun.module.core.ServiceProcessor";
- destDir.mkdirs();
+ String cmdPrefix = "-source 7 -target 7";
+ if (compilerFlags.length() > 0) {
+ cmdPrefix += " " + compilerFlags;
+ }
String cmd = cmdPrefix + " -d " + destDir + " -cp " + destDir;
for (File f : srcs) {
cmd += " " + f.getCanonicalPath();
@@ -165,46 +185,43 @@ abstract public class ServiceTest {
/**
* Creates a JAM file
+ * @param moduleName module name
* @param pkgName name of package that locates super_package file
- * @param srcDir name of directory that locates classes
+ * @param srcDir the name of directory that locates classes
* @param destDir directory where the JAM should be written
+ * @param destName name of resulting JAM file
* @return a {@code File} representing the JAM file
*/
- File createJam(String pkgName, String srcDir, File destDir) throws Exception {
- File rc = new File(destDir, srcDir + ".jam");
+ private File createJam(String moduleName, String pkgName,
+ String srcDir, File destDir, String destName) throws Exception {
+ File rc = new File(destDir, destName);
String classesDir = destDir + "/classes";
- String cmd = "cfsS ";
+ String cmd = "cvf ";
cmd += rc.getCanonicalPath() + " ";
- cmd += pkgName + "." + srcDir + " ";
- cmd += classesDir + " ";
if (new File(classesDir, "META-INF").exists()) {
cmd += "-C " + classesDir + " META-INF ";
}
cmd += "-C ";
cmd += classesDir + " ";
- cmd +=pkgName + "/" + srcDir;
+ cmd += pkgName + "/" + srcDir;
debug("jam: " + cmd);
Jam jamTool = new Jam(System.out, System.err, "jam");
if (!jamTool.run(cmd.split(" "))) {
- throw new Exception("jam failed for " + srcDir);
+ throw new Exception("jam failed for " + moduleName);
}
return rc;
}
- /**
- * @see #createJAM(String, String, File)
- * @param destName name of resulting JAM file
- */
- File createJam(String pkgName, String srcDir, File destDir,
- String destName) throws Exception {
- File f = createJam(pkgName, srcDir, destDir);
- File rc = new File(f.getParentFile(), destName);
- if (!f.renameTo(rc)) {
- throw new Exception("createJam: Couldn't rename " + f + " to " + rc);
- } else {
- return rc;
- }
+ File createJam(String pkgName, String srcDir, File destDir) throws Exception {
+ String moduleName = pkgName + "." + srcDir;
+ String destName = moduleName + ".jam";
+ return createJam(moduleName, pkgName, srcDir, destDir, destName);
+ }
+
+ File createJam(String pkgName, String srcDir, File destDir, String destName) throws Exception {
+ String moduleName = pkgName + "." + srcDir;
+ return createJam(moduleName, pkgName, srcDir, destDir, destName);
}
/**
@@ -255,7 +272,7 @@ abstract public class ServiceTest {
Process p = pb.start();
p.waitFor();
debug(name + " returned " + p.exitValue());
- check(p.exitValue() == 0);
+ boolean error = check(p.exitValue() == 0);
BufferedReader br = new BufferedReader(
new InputStreamReader(
p.getInputStream()), 8192);
@@ -264,7 +281,11 @@ abstract public class ServiceTest {
while ((s = br.readLine()) != null) {
msg += ">>> " + s + "\n";
}
- debug(msg);
+ if (error) {
+ System.err.println(msg);
+ } else {
+ debug(msg);
+ }
} catch (Exception ex) {
unexpected(ex);
}
--- a/test/java/module/service/src/charserv/client/Main.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/charserv/client/Main.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module charserv.client;
package charserv.client;
import java.nio.charset.spi.CharsetProvider;
--- a/test/java/module/service/src/charserv/provider/CharsetServiceProvider.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/charserv/provider/CharsetServiceProvider.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module charserv.provider;
package charserv.provider;
import java.nio.charset.Charset;
--- a/test/java/module/service/src/cliserv/client/Main.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/cliserv/client/Main.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module cliserv.client;
package cliserv.client;
import java.util.Iterator;
--- a/test/java/module/service/src/cliserv/client/MainCP.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/cliserv/client/MainCP.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module cliserv.client;
package cliserv.client;
import java.util.Iterator;
--- a/test/java/module/service/src/cliserv/provider/BarService.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/cliserv/provider/BarService.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module cliserv.provider;
package cliserv.provider;
import java.util.Iterator;
--- a/test/java/module/service/src/cliserv/provider/BarServiceProvider.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/cliserv/provider/BarServiceProvider.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module cliserv.provider;
package cliserv.provider;
import java.util.ServiceProvider;
--- a/test/java/module/service/src/cliserv/provider/FooService2Provider.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/cliserv/provider/FooService2Provider.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module cliserv.provider;
package cliserv.provider;
import java.util.ServiceProvider;
--- a/test/java/module/service/src/cliserv/service/FooService.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/cliserv/service/FooService.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module cliserv.service;
package cliserv.service;
import java.util.Service;
--- a/test/java/module/service/src/cliserv/service/FooServiceDefaultProvider.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/cliserv/service/FooServiceDefaultProvider.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,12 +21,14 @@
* have any questions.
*/
+module cliserv.service;
package cliserv.service;
import java.util.ServiceProvider;
/**
* The default implementation of FooService
+ * FIXME: Fails if this is a module-private class.
*/
@ServiceProvider
public class FooServiceDefaultProvider extends FooService {
--- a/test/java/module/service/src/cpserv/client/Main.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/cpserv/client/Main.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module cpserv.client;
package cpserv.client;
import java.module.ModuleDefinition;
--- a/test/java/module/service/src/cpserv/service/FooService.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/cpserv/service/FooService.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module cpserv.service;
package cpserv.service;
import java.util.Iterator;
--- a/test/java/module/service/src/cpserv/service/FooServiceDefaultProvider.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/cpserv/service/FooServiceDefaultProvider.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,12 +21,16 @@
* have any questions.
*/
+module cpserv.service;
package cpserv.service;
import java.util.ServiceProvider;
/**
* The default implementation of FooService
+ * It is a module private class.
+ *
+ * FIXME: Fails if this is a module-private class.
*/
@ServiceProvider
public class FooServiceDefaultProvider extends FooService {
--- a/test/java/module/service/src/defserv/client/Main.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/defserv/client/Main.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module defserv.client;
package defserv.client;
import java.module.ModuleDefinition;
--- a/test/java/module/service/src/defserv/provider/BarService.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/defserv/provider/BarService.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module defserv.provider;
package defserv.provider;
import java.util.Iterator;
--- a/test/java/module/service/src/defserv/provider/BarServiceDefaultProvider.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/defserv/provider/BarServiceDefaultProvider.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,15 +21,17 @@
* have any questions.
*/
+module defserv.provider;
package defserv.provider;
import java.util.ServiceProvider;
/**
* The default implementation of BarService
+ * FIXME: May fail if this is a module-private class.
*/
@ServiceProvider
-public class BarServiceDefaultProvider extends BarService {
+module class BarServiceDefaultProvider extends BarService {
public BarServiceDefaultProvider() {
}
--- a/test/java/module/service/src/defserv/provider/FooService2Provider.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/defserv/provider/FooService2Provider.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module defserv.provider;
package defserv.provider;
import java.util.ServiceProvider;
--- a/test/java/module/service/src/defserv/service/FooService.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/defserv/service/FooService.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module defserv.service;
package defserv.service;
import java.util.Iterator;
--- a/test/java/module/service/src/defserv/service/FooServiceDefaultProvider.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/defserv/service/FooServiceDefaultProvider.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,12 +21,14 @@
* have any questions.
*/
+module defserv.service;
package defserv.service;
import java.util.ServiceProvider;
/**
* The default implementation of FooService
+ * FIXME: Fails if this is a module private class.
*/
@ServiceProvider
public class FooServiceDefaultProvider extends FooService {
--- a/test/java/module/service/src/defserv/service/FooServiceDefaultProvider2.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/defserv/service/FooServiceDefaultProvider2.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,12 +21,14 @@
* have any questions.
*/
+module defserv.service;
package defserv.service;
import java.util.ServiceProvider;
/**
* The default implementation of FooService
+ * FIXME: Fails if this is a module private class.
*/
@ServiceProvider
public class FooServiceDefaultProvider2 extends FooService {
--- a/test/java/module/service/src/modserv/client/Main.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/modserv/client/Main.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module modserv.client;
package modserv.client;
import modserv.service.CodecSet;
--- a/test/java/module/service/src/modserv/provider1/AdvancedCodecs.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/modserv/provider1/AdvancedCodecs.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module modserv.provider1;
package modserv.provider1;
import java.util.ServiceProvider;
--- a/test/java/module/service/src/modserv/provider1/StandardCodecs.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/modserv/provider1/StandardCodecs.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module modserv.provider1;
package modserv.provider1;
import java.util.ServiceProvider;
--- a/test/java/module/service/src/modserv/provider2/AdvancedCodecs.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/modserv/provider2/AdvancedCodecs.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module modserv.provider2;
package modserv.provider2;
import java.util.ServiceProvider;
--- a/test/java/module/service/src/modserv/provider3/ImplCodecs.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/modserv/provider3/ImplCodecs.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module modserv.provider3;
package modserv.provider3;
import java.util.ServiceProvider;
--- a/test/java/module/service/src/modserv/service/CodecSet.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/modserv/service/CodecSet.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module modserv.service;
package modserv.service;
import java.util.Service;
--- a/test/java/module/service/src/modserv/service/Encoder.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/modserv/service/Encoder.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module modserv.service;
package modserv.service;
/**
--- a/test/java/module/service/src/reposerv/client/Main.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/reposerv/client/Main.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module reposerv.client;
package reposerv.client;
import java.module.*;
--- a/test/java/module/service/src/reposerv/provider/BarService.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/reposerv/provider/BarService.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module reposerv.provider;
package reposerv.provider;
import java.util.Iterator;
--- a/test/java/module/service/src/reposerv/provider/BarServiceDefaultProvider.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/reposerv/provider/BarServiceDefaultProvider.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,15 +21,17 @@
* have any questions.
*/
+module reposerv.provider;
package reposerv.provider;
import java.util.ServiceProvider;
/**
* The default implementation of BarService
+ * FIXME: May fail if this is a module private class.
*/
@ServiceProvider
-public class BarServiceDefaultProvider extends BarService {
+module class BarServiceDefaultProvider extends BarService {
public BarServiceDefaultProvider() {
}
--- a/test/java/module/service/src/reposerv/provider/FooService2Provider.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/reposerv/provider/FooService2Provider.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module reposerv.provider;
package reposerv.provider;
import java.util.ServiceProvider;
--- a/test/java/module/service/src/reposerv/service/FooService.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/reposerv/service/FooService.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module reposerv.service;
package reposerv.service;
import java.io.File;
--- a/test/java/module/service/src/reposerv/service/FooServiceDefaultProvider.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/reposerv/service/FooServiceDefaultProvider.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,12 +21,14 @@
* have any questions.
*/
+module reposerv.service;
package reposerv.service;
import java.util.ServiceProvider;
/**
* The default implementation of FooService
+ * FIXME: Fails if this is a module private class.
*/
@ServiceProvider
public class FooServiceDefaultProvider extends FooService {
--- a/test/java/module/service/src/rxpserv/client/Main.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/rxpserv/client/Main.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module rxpserv.client;
package rxpserv.client;
import java.module.ModuleDefinition;
--- a/test/java/module/service/src/rxpserv/provider/FooServiceProvider.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/rxpserv/provider/FooServiceProvider.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module rxpserv.provider;
package rxpserv.provider;
import java.util.ServiceProvider;
--- a/test/java/module/service/src/rxpserv/service/FooService.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/rxpserv/service/FooService.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module rxpserv.service;
package rxpserv.service;
import java.util.Iterator;
--- a/test/java/module/service/src/verserv/client/Main.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/verserv/client/Main.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module verserv.client;
package verserv.client;
import java.module.ModuleDefinition;
--- a/test/java/module/service/src/verserv/provider/BarService.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/verserv/provider/BarService.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module verserv.provider;
package verserv.provider;
import java.util.Iterator;
--- a/test/java/module/service/src/verserv/provider/BarServiceDefaultProvider.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/verserv/provider/BarServiceDefaultProvider.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,15 +21,17 @@
* have any questions.
*/
+module verserv.provider;
package verserv.provider;
import java.util.ServiceProvider;
/**
* The default implementation of BarService
+ * FIXME: May fail if this is a module private class.
*/
@ServiceProvider
-public class BarServiceDefaultProvider extends BarService {
+module class BarServiceDefaultProvider extends BarService {
public BarServiceDefaultProvider() {
}
--- a/test/java/module/service/src/verserv/provider/FooService2Provider.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/verserv/provider/FooService2Provider.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module verserv.provider;
package verserv.provider;
import java.util.ServiceProvider;
--- a/test/java/module/service/src/verserv/service/FooService.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/verserv/service/FooService.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,6 +21,7 @@
* have any questions.
*/
+module verserv.service;
package verserv.service;
import java.module.Repository;
--- a/test/java/module/service/src/verserv/service/FooServiceDefaultProvider.java Fri Jul 18 12:47:04 2008 -0700
+++ b/test/java/module/service/src/verserv/service/FooServiceDefaultProvider.java Tue Jul 22 19:01:27 2008 -0700
@@ -21,12 +21,14 @@
* have any questions.
*/
+module verserv.service;
package verserv.service;
import java.util.ServiceProvider;
/**
* The default implementation of FooService
+ * FIXME: It fails if this is a module private class.
*/
@ServiceProvider
public class FooServiceDefaultProvider extends FooService {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/module/bootstrap/VirtualModuleDefinition.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package sun.module.bootstrap;
+
+import java.lang.annotation.Annotation;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.module.ImportDependency;
+import java.module.Modules;
+import java.module.ModuleContent;
+import java.module.ModuleDefinition;
+import java.module.ModuleSystem;
+import java.module.PackageDefinition;
+import java.module.Version;
+import java.module.VersionConstraint;
+import java.module.Repository;
+import java.module.annotation.Attribute;
+import java.module.annotation.Attributes;
+import java.module.annotation.ImportModule;
+import java.module.annotation.ImportModules;
+import sun.module.core.AbstractModuleDefinition;
+import sun.module.core.JamPackageDefinition;
+
+/**
+ * A ModuleDefinition for the virtual modules.
+ *
+ * XXX: Need to revisit the implementation for
+ * getExportedPackageDefinition() and getMemberPackageDefinitions()
+ *
+ * One approach we can consider is to write a tool to
+ * generate the list of exported packages and member packages
+ * at JDK build time instead of hardcoding in the list in
+ * VirtualModuleDefinitions.java
+ */
+class VirtualModuleDefinition extends AbstractModuleDefinition {
+
+ private static final ModuleSystem moduleSystem = BootstrapModuleSystem.getInstance();
+ private static final Repository repository = BootstrapRepository.getInstance();
+
+ private final Class metadataClass;
+ private volatile Set<PackageDefinition> memberPackageDefs;
+ private volatile Set<PackageDefinition> exportedPackageDefs;
+
+ @SuppressWarnings({"unchecked"})
+ VirtualModuleDefinition(String name, Version version, Class<?> metadataClass) {
+ super(moduleSystem,
+ name,
+ version,
+ null,
+ repository,
+ false);
+ this.metadataClass = metadataClass;
+ }
+
+ @Override
+ public Set<String> getMemberClasses() {
+ throw new UnsupportedOperationException("Information about member classes is " +
+ "not available for \"" + getName() + "\" module");
+ }
+
+ @Override
+ public Set<String> getExportedClasses() {
+ throw new UnsupportedOperationException("Information about exported classes is " +
+ " not available for \"" + getName() + "\" module");
+ }
+
+ @Override
+ public Set<PackageDefinition> getMemberPackageDefinitions() {
+ if (memberPackageDefs == null) {
+ // XXX: return the exported package definitions for now
+ memberPackageDefs = getExportedPackageDefinitions();
+ }
+ return memberPackageDefs;
+ }
+
+ @Override
+ public Set<PackageDefinition> getExportedPackageDefinitions() {
+ if (exportedPackageDefs == null) {
+ sun.module.annotation.ExportPackages exportPackages =
+ getAnnotation(sun.module.annotation.ExportPackages.class);
+ List<String> exportedPackages = Arrays.asList(exportPackages.value());
+
+ HashSet<PackageDefinition> packageDefs = new HashSet<PackageDefinition>();
+ for (String s : exportedPackages) {
+ packageDefs.add(new JamPackageDefinition(s, Version.DEFAULT, this));
+ }
+ exportedPackageDefs = Collections.unmodifiableSet(packageDefs);
+ }
+ return exportedPackageDefs;
+ }
+
+ @Override
+ public String getMainClass() {
+ return null;
+ }
+
+ @Override
+ public boolean isClassExported(String className) {
+ for (PackageDefinition packageDef : getExportedPackageDefinitions()) {
+ String packageName = packageDef.getName();
+ if (packageName.equals("*")) {
+ // "*" is exported by the "java.classpath" module.
+ return true;
+ }
+
+ // Checks if the specified class is exported from this module.
+ if (className.startsWith(packageName + ".")) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public Set<String> getExportedResources() {
+ throw new UnsupportedOperationException("Information about exported resources is " +
+ "not available for \"" + getName() + "\" module");
+ }
+
+ @Override
+ public boolean isResourceExported(String name) {
+ // XXX special hack for now
+ // Module definitions from the bootstrap repository are expected
+ // to export all resources.
+ return true;
+ }
+
+ @Override
+ @SuppressWarnings({"unchecked"})
+ public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+ if (annotationClass == null) {
+ throw new NullPointerException();
+ }
+ return (T) metadataClass.getAnnotation(annotationClass);
+ }
+
+ @Override
+ public synchronized List<Annotation> getAnnotations() {
+ return Collections.unmodifiableList(Arrays.asList(metadataClass.getAnnotations()));
+ }
+
+ @Override
+ public boolean isDownloaded() {
+ return true;
+ }
+
+ @Override
+ public ModuleContent getModuleContent() {
+ throw new UnsupportedOperationException("No module content supported for \"" +
+ getName() + "\" module");
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/module/core/AbstractModuleDefinition.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,203 @@
+/*
+ * Copyright 2006-2008 Sun Microsystems, Inc. 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. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package sun.module.core;
+
+import java.lang.annotation.Annotation;
+import java.util.Collections;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.module.ImportDependency;
+import java.module.Module;
+import java.module.Modules;
+import java.module.ModuleContent;
+import java.module.ModuleDefinition;
+import java.module.ModuleDependency;
+import java.module.ModuleSystem;
+import java.module.ModuleSystemPermission;
+import java.module.PackageDefinition;
+import java.module.Repository;
+import java.module.Version;
+import java.module.VersionConstraint;
+import java.module.annotation.Attribute;
+import java.module.annotation.Attributes;
+import java.module.annotation.ExportResources;
+import java.module.annotation.ImportModule;
+import java.module.annotation.ImportModules;
+import java.module.annotation.MainClass;
+
+/**
+ */
+public abstract class AbstractModuleDefinition extends ModuleDefinition {
+
+ private final ModuleSystem moduleSystem;
+ private final String name;
+ private final Version version;
+ private final ModuleContent content;
+ private final Repository repository;
+ private final boolean moduleReleasable;
+ private volatile List<ImportDependency> importDependencies = null;
+ private volatile Map<String, String> attributesMap = null;
+
+ protected AbstractModuleDefinition(ModuleSystem moduleSystem,
+ String name, Version version, ModuleContent content,
+ Repository repository, boolean releasable) {
+ this.moduleSystem = moduleSystem;
+ this.name = name;
+ this.version = version;
+ this.content = content;
+ this.repository = repository;
+ this.moduleReleasable = releasable;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public java.module.Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public List<ImportDependency> getImportDependencies() {
+ if (importDependencies == null) {
+ List<ImportDependency> dependencies = new ArrayList<ImportDependency>();
+ ImportModules importModules = getAnnotation(ImportModules.class);
+ if (importModules != null) {
+ for (ImportModule importModule : Arrays.asList(importModules.value())) {
+ String name = importModule.name();
+ VersionConstraint constraint = VersionConstraint.valueOf(importModule.version());
+ boolean reexport = importModule.reexport();
+ boolean optional = importModule.optional();
+ Attribute[] attributes = importModule.attributes();
+ Map<String, String> attrs = new HashMap<String, String>();
+ if (attributes != null) {
+ for (Attribute a : attributes) {
+ attrs.put(a.name(), a.value());
+ }
+ }
+ dependencies.add(Modules.newModuleDependency(name, constraint, reexport, optional, attrs));
+ }
+ }
+ importDependencies = Collections.unmodifiableList(dependencies);
+ }
+ return importDependencies;
+ }
+
+ private synchronized Map<String, String> getAttributesMap() {
+ if (attributesMap == null) {
+ attributesMap = new HashMap<String, String>();
+ Attributes attrs = getAnnotation(Attributes.class);
+ if (attrs != null) {
+ for (Attribute attr : attrs.value()) {
+ attributesMap.put(attr.name(), attr.value());
+ }
+ }
+ }
+ return attributesMap;
+ }
+
+ @Override
+ public Set<String> getAttributeNames() {
+ return Collections.unmodifiableSet(getAttributesMap().keySet());
+ }
+
+ @Override
+ public String getAttribute(String name) {
+ if (name == null) {
+ throw new NullPointerException("name must not be null.");
+ }
+ return getAttributesMap().get(name);
+ }
+
+ @Override
+ public String getMainClass() {
+ java.module.annotation.MainClass mainClass = getAnnotation
+ (java.module.annotation.MainClass.class);
+ if (mainClass != null) {
+ return mainClass.value();
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public boolean isClassExported(String className) {
+ try {
+ return getExportedClasses().contains(className);
+ } catch (UnsupportedOperationException uoe) {
+ // returns true if the class is of one of the exported packages.
+ Set<PackageDefinition> pkgs = getExportedPackageDefinitions();
+ for (PackageDefinition p : pkgs) {
+ if (className.startsWith(p.getName() + ".")) {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ @Override
+ public boolean isResourceExported(String name) {
+ try {
+ return getExportedResources().contains(name);
+ } catch (UnsupportedOperationException uoe) {
+ // return true if we don't know so that the caller may try
+ // to find the resource
+ return true;
+ }
+ }
+
+ @Override
+ public boolean isModuleReleasable() {
+ return moduleReleasable;
+ }
+
+ @Override
+ public Repository getRepository() {
+ return repository;
+ }
+
+ @Override
+ public ModuleSystem getModuleSystem() {
+ return moduleSystem;
+ }
+
+ @Override
+ public ModuleContent getModuleContent() {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null) {
+ sm.checkPermission(new ModuleSystemPermission("accessModuleContent"));
+ }
+ return content;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/modinit/mtest/deepvalidate/Foo.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * A class member of both module m4 and m6.
+ */
+public class Foo {
+ private String name;
+ public Foo(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/modinit/mtest/exportlegacyclasses/p/Bar.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * This class does not have the module membership.
+ */
+package p;
+public class Bar {
+ public void bar() {
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/modinit/mtest/exportlegacyclasses/p/Foo.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * This class does not have the module membership but it's package-private.
+ */
+package p;
+class Foo {
+ public void foo () {
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/modinit/mtest/exportlegacyclasses/q/Gus.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * This class does not have the module membership.
+ */
+package q;
+public class Gus {
+ public void gus() {
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/modinit/mtest/getresource/Dup.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package m;
+public class Dup {
+ public static void findIt() {
+ System.out.println("Congrats! You found me!");
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/charserv/client/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 MERCHANTABbILITY 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@ImportModules({
+ @ImportModule(name="java.se.core"),
+ @ImportModule(name="java.classpath")
+})
+@MainClass("charserv.client.Main")
+module charserv.client;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/charserv/provider/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@ServiceProviders({
+ @ServiceProvider(service="java.nio.charset.spi.CharsetProvider",
+ providerClass="charserv.provider.CharsetServiceProvider")
+})
+@ImportModules({
+ @ImportModule(name="java.se.core")
+})
+module charserv.provider;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/cliserv/client/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 MERCHANTABbILITY 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@ImportModules({
+ @ImportModule(name="java.se.core"),
+ @ImportModule(name="cliserv.service")
+})
+@MainClass("cliserv.client.Main")
+module cliserv.client;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/cliserv/provider/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+
+@ServiceProviders({
+ @ServiceProvider(service="cliserv.service.FooService",
+ providerClass="cliserv.provider.FooService2Provider"),
+ @ServiceProvider(service="cliserv.service.BarService",
+ providerClass="cliserv.provider.BarServiceProvider")
+})
+@Services("BarProvider")
+@ImportModules({
+ @ImportModule(name="java.se.core"),
+ @ImportModule(name="cliserv.service") // Import service module defining Foo
+})
+module cliserv.provider;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/cliserv/service/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@Services({"cliserv.service.FooService"})
+@ServiceProviders({
+ @ServiceProvider(service="cliserv.service.FooService",
+ providerClass="cliserv.service.FooServiceDefaultProvider")
+})
+@ImportModules({
+ @ImportModule(name="java.se.core")
+})
+module cliserv.service;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/cpserv/client/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 MERCHANTABbILITY 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@ImportModules({
+ @ImportModule(name="java.se.core"),
+ @ImportModule(name="java.classpath"),
+ @ImportModule(name="cpserv.service")
+})
+@MainClass("cpserv.client.Main")
+module cpserv.client;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/cpserv/service/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@Services({"cpserv.service.FooService"})
+@ServiceProviders({
+ @ServiceProvider(service="cpserv.service.FooService",
+ providerClass="cpserv.service.FooServiceDefaultProvider")
+})
+@ImportModules({
+ @ImportModule(name="java.se.core")
+})
+module cpserv.service;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/defserv/client/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 MERCHANTABbILITY 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@ImportModules({
+ @ImportModule(name="java.se.core"),
+ @ImportModule(name="defserv.service")
+})
+@MainClass("defserv.client.Main")
+module defserv.client;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/defserv/provider/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@ServiceProviders({
+ @ServiceProvider(service="defserv.service.FooService",
+ providerClass="defserv.provider.FooService2Provider"),
+ @ServiceProvider(service="defserv.service.BarService",
+ providerClass="defserv.provider.BarServiceDefaultProvider")
+})
+@Services("BarProvider")
+@ImportModules({
+ @ImportModule(name="java.se.core"),
+ @ImportModule(name="defserv.service") // Import service module defining Foo
+})
+module defserv.provider;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/defserv/service/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@Services({"defserv.service.FooService"})
+@ServiceProviders({
+ @ServiceProvider(service="defserv.service.FooService",
+ providerClass="defserv.service.FooServiceDefaultProvider"),
+ @ServiceProvider(service="defserv.service.FooService",
+ providerClass="defserv.service.FooServiceDefaultProvider2")
+})
+@ImportModules({
+ @ImportModule(name="java.se.core")
+})
+module defserv.service;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/modserv/client/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@MainClass("modserv.client.Main")
+@ImportModules({
+ @ImportModule(name="java.se.core"),
+ @ImportModule(name="modserv.service", version="[2.0, 3.0)")
+})
+module modserv.client;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/modserv/provider1/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@ServiceProviders({
+ @ServiceProvider(service="modserv.service.CodecSet",
+ providerClass="modserv.provider1.StandardCodecs"),
+ @ServiceProvider(service="modserv.service.CodecSet",
+ providerClass="modserv.provider1.AdvancedCodecs")
+})
+@Version("1.3")
+@ImportModules({
+ @ImportModule(name="java.se.core"),
+ @ImportModule(name="modserv.service", version="[2.0, 3.0)")
+})
+module modserv.provider1;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/modserv/provider2/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@ServiceProviders({
+ @ServiceProvider(service="modserv.service.CodecSet",
+ providerClass="modserv.provider2.AdvancedCodecs")
+})
+@Version("2.0")
+@ImportModules({
+ @ImportModule(name="java.se.core"),
+ @ImportModule(name="modserv.service", version="[2.5, 3.0)")
+})
+module modserv.provider2;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/modserv/provider3/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@ServiceProviders({
+ @ServiceProvider(service="modserv.service.CodecSet",
+ providerClass="modserv.provider3.ImplCodecs")
+})
+
+// Since the service is defined as version 2.7, attempting to load this module
+// will generate a warning (eventually to be a log message).
+@ImportModules({
+ @ImportModule(name="java.se.core"),
+ @ImportModule(name="modserv.service", version="[1.0, 2.0)")
+})
+module modserv.provider3;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/modserv/service/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@Version("2.7")
+@Services({"modserv.service.CodecSet"})
+@ImportModules({
+ @ImportModule(name="java.se.core")
+})
+module modserv.service;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/reposerv/client/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 MERCHANTABbILITY 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@MainClass("reposerv.client.Main")
+@ImportModules({
+ @ImportModule(name="java.se.core"),
+ @ImportModule(name="reposerv.service", version="[1.0, 2.0)")
+})
+module reposerv.client;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/reposerv/provider/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@Version("1.0")
+@ServiceProviders({
+ @ServiceProvider(service="reposerv.service.FooService",
+ providerClass="reposerv.provider.FooService2Provider"),
+ @ServiceProvider(service="reposerv.service.BarService",
+ providerClass="reposerv.provider.BarServiceDefaultProvider")
+})
+@Services("BarProvider")
+@ImportModules({
+ @ImportModule(name="java.se.core"),
+ @ImportModule(name="reposerv.service", version="[1.0, 2.0)")
+})
+module reposerv.provider;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/reposerv/service/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@Version("1.0")
+@Services({"reposerv.service.FooService"})
+@ServiceProviders({
+ @ServiceProvider(service="reposerv.service.FooService",
+ providerClass="reposerv.service.FooServiceDefaultProvider")
+})
+@ImportModules({
+ @ImportModule(name="java.se.core")
+})
+module reposerv.service;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/rxpserv/client/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 MERCHANTABbILITY 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@ImportModules({
+ @ImportModule(name="java.se.core"),
+ @ImportModule(name="rxpserv.service", version="1.0")
+})
+@MainClass("rxpserv.client.Main")
+module rxpserv.client;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/rxpserv/extra/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * A module that just imports and reexports another module, but of a certain
+ * version.
+ */
+@ImportModules({
+ @ImportModule(name="rxpserv.provider", version="2.0")
+})
+module rxpserv.extra;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/rxpserv/provider/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@ServiceProviders({
+ @ServiceProvider(service="rxpserv.service.FooService",
+ providerClass="rxpserv.provider.FooServiceProvider")
+})
+// It is important that this be on a single line; see ServiceTest.redefineAnnotations
+@ImportModules({ @ImportModule(name="rxpserv.transitive"), @ImportModule(name="rxpserv.extra") })
+@Version("1.0")
+module rxpserv.provider;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/rxpserv/service/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@Services({"rxpserv.service.FooService"})
+@ImportModules({
+ @ImportModule(name="java.se.core")
+})
+@Version("1.0")
+module rxpserv.service;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/rxpserv/transitive/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * A module that just imports and reexports another module, but of a certain
+ * version.
+ */
+@ImportModules({
+ @ImportModule(name="rxpserv.service", version="1.0", reexport=true)
+})
+module rxpserv.transitive;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/verserv/client/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 MERCHANTABbILITY 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@MainClass("verserv.client.Main")
+@ImportModules({
+ @ImportModule(name="java.se.core"),
+ @ImportModule(name="verserv.service", version="[1.0, 2.0)")
+})
+module verserv.client;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/verserv/provider/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@Version("1.0")
+@ServiceProviders({
+ @ServiceProvider(service="verserv.service.FooService",
+ providerClass="verserv.provider.FooService2Provider"),
+ @ServiceProvider(service="verserv.service.BarService",
+ providerClass="verserv.provider.BarServiceDefaultProvider")
+})
+@Services("BarProvider")
+// It is important that this be on a single line; see ServiceTest.redefineAnnotations
+@ImportModules({ @ImportModule(name="java.se.core"), @ImportModule(name="verserv.service", version="[1.0, 2.0)") })
+module verserv.provider;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/module/service/src/verserv/service/module-info.java Tue Jul 22 19:01:27 2008 -0700
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+@Version("1.0")
+@Services({"verserv.service.FooService"})
+@ServiceProviders({
+ @ServiceProvider(service="verserv.service.FooService",
+ providerClass="verserv.service.FooServiceDefaultProvider")
+})
+@ImportModules({
+ @ImportModule(name="java.se.core")
+})
+module verserv.service;
--- a/test/java/module/service/src/charserv/client/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 MERCHANTABbILITY 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package charserv.client;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@ImportModules({
- @ImportModule(name="java.se.core"),
- @ImportModule(name="java.classpath")
-})
-@MainClass("charserv.client.Main")
-class module_info {
-}
--- a/test/java/module/service/src/charserv/provider/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package charserv.provider;
-
-import java.module.annotation.*;
-import java.lang.ModuleInfo.*;
-
-@ServiceProviders({
- @ServiceProvider(service="java.nio.charset.spi.CharsetProvider",
- providerClass="charserv.provider.CharsetServiceProvider")
-})
-@ImportModules({
- @ImportModule(name="java.se.core")
-})
-class module_info {
- // Export service provider type
- exports charserv$provider$CharsetServiceProvider;
-}
--- a/test/java/module/service/src/cliserv/client/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 MERCHANTABbILITY 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package cliserv.client;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-
-@ImportModules({
- @ImportModule(name="java.se.core"),
- @ImportModule(name="cliserv.service")
-})
-@MainClass("cliserv.client.Main")
-class module_info {
-}
--- a/test/java/module/service/src/cliserv/provider/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package cliserv.provider;
-
-import java.module.annotation.*;
-import java.lang.ModuleInfo.*;
-
-@ServiceProviders({
- @ServiceProvider(service="cliserv.service.FooService",
- providerClass="cliserv.provider.FooService2Provider"),
- @ServiceProvider(service="cliserv.service.BarService",
- providerClass="cliserv.provider.BarServiceProvider")
-})
-@Services("BarProvider")
-@ImportModules({
- @ImportModule(name="java.se.core"),
- @ImportModule(name="cliserv.service") // Import service module defining Foo
-})
-class module_info {
- // Export service provider type
- exports cliserv$provider$FooService2Provider;
-
- // Export service provider type
- exports cliserv$provider$BarServiceProvider;
-}
--- a/test/java/module/service/src/cliserv/service/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package cliserv.service;
-
-import java.module.annotation.*;
-import java.lang.ModuleInfo.*;
-
-@Services({"cliserv.service.FooService"})
-@ServiceProviders({
- @ServiceProvider(service="cliserv.service.FooService",
- providerClass="cliserv.service.FooServiceDefaultProvider")
-})
-@ImportModules({
- @ImportModule(name="java.se.core")
-})
-class module_info {
- // Export service type
- exports cliserv$service$FooService;
-
- // Note that the default service provider is *not* exported.
-}
--- a/test/java/module/service/src/cpserv/client/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 MERCHANTABbILITY 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package cpserv.client;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@ImportModules({
- @ImportModule(name="java.se.core"),
- @ImportModule(name="java.classpath"),
- @ImportModule(name="cpserv.service")
-})
-@MainClass("cpserv.client.Main")
-class module_info {
-}
--- a/test/java/module/service/src/cpserv/service/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package cpserv.service;
-
-import java.module.annotation.*;
-import java.lang.ModuleInfo.*;
-
-@Services({"cpserv.service.FooService"})
-@ServiceProviders({
- @ServiceProvider(service="cpserv.service.FooService",
- providerClass="cpserv.service.FooServiceDefaultProvider")
-})
-@ImportModules({
- @ImportModule(name="java.se.core")
-})
-class module_info {
- // Export service type
- exports cpserv$service$FooService;
-
- // Note that the default service providers are *not* exported.
-}
--- a/test/java/module/service/src/defserv/client/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 MERCHANTABbILITY 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package defserv.client;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@ImportModules({
- @ImportModule(name="java.se.core"),
- @ImportModule(name="defserv.service")
-})
-@MainClass("defserv.client.Main")
-class module_info {
-}
--- a/test/java/module/service/src/defserv/provider/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package defserv.provider;
-
-import java.module.annotation.*;
-import java.lang.ModuleInfo.*;
-
-@ServiceProviders({
- @ServiceProvider(service="defserv.service.FooService",
- providerClass="defserv.provider.FooService2Provider"),
- @ServiceProvider(service="defserv.service.BarService",
- providerClass="defserv.provider.BarServiceDefaultProvider")
-})
-@Services("BarProvider")
-@ImportModules({
- @ImportModule(name="java.se.core"),
- @ImportModule(name="defserv.service") // Import service module defining Foo
-})
-class module_info {
- // Export service type
- exports defserv$provider$BarService;
-
- // Export service provider type
- exports defserv$provider$FooService2Provider;
-
- // Note that the default service provider is *not* exported.
-}
--- a/test/java/module/service/src/defserv/service/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package defserv.service;
-
-import java.module.annotation.*;
-import java.lang.ModuleInfo.*;
-
-@Services({"defserv.service.FooService"})
-@ServiceProviders({
- @ServiceProvider(service="defserv.service.FooService",
- providerClass="defserv.service.FooServiceDefaultProvider"),
- @ServiceProvider(service="defserv.service.FooService",
- providerClass="defserv.service.FooServiceDefaultProvider2")
-})
-@ImportModules({
- @ImportModule(name="java.se.core")
-})
-class module_info {
- // Export service type
- exports defserv$service$FooService;
-
- // Note that the default service providers are *not* exported.
-}
--- a/test/java/module/service/src/modserv/client/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package modserv.client;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@MainClass("modserv.client.Main")
-@ImportModules({
- @ImportModule(name="java.se.core"),
- @ImportModule(name="modserv.service", version="[2.0, 3.0)")
-})
-class module_info {
-}
--- a/test/java/module/service/src/modserv/provider1/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package modserv.provider1;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@ServiceProviders({
- @ServiceProvider(service="modserv.service.CodecSet",
- providerClass="modserv.provider1.StandardCodecs"),
- @ServiceProvider(service="modserv.service.CodecSet",
- providerClass="modserv.provider1.AdvancedCodecs")
-})
-@Version("1.3")
-@ImportModules({
- @ImportModule(name="java.se.core"),
- @ImportModule(name="modserv.service", version="[2.0, 3.0)")
-})
-class module_info {
- // Export multiple service provider classes
- exports modserv$provider1$StandardCodecs;
- exports modserv$provider1$AdvancedCodecs;
-}
--- a/test/java/module/service/src/modserv/provider2/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package modserv.provider2;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@ServiceProviders({
- @ServiceProvider(service="modserv.service.CodecSet",
- providerClass="modserv.provider2.AdvancedCodecs")
-})
-@Version("2.0")
-@ImportModules({
- @ImportModule(name="java.se.core"),
- @ImportModule(name="modserv.service", version="[2.5, 3.0)")
-})
-class module_info {
- // Export service provider classe
- exports modserv$provider2$AdvancedCodecs;
-}
--- a/test/java/module/service/src/modserv/provider3/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package modserv.provider3;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@ServiceProviders({
- @ServiceProvider(service="modserv.service.CodecSet",
- providerClass="modserv.provider3.ImplCodecs")
-})
-
-// Since the service is defined as version 2.7, attempting to load this module
-// will generate a warning (eventually to be a log message).
-@ImportModules({
- @ImportModule(name="java.se.core"),
- @ImportModule(name="modserv.service", version="[1.0, 2.0)")
-})
-class module_info {
- // Export service provider classes
- exports modserv$provider3$ImplCodecs;
-}
--- a/test/java/module/service/src/modserv/service/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package modserv.service;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@Version("2.7")
-@Services({"modserv.service.CodecSet"})
-@ImportModules({
- @ImportModule(name="java.se.core")
-})
-class module_info {
- // Export service types
- exports modserv$service$CodecSet;
-
- // Export type provided by CodecSet service
- exports modserv$service$Encoder;
-}
--- a/test/java/module/service/src/reposerv/client/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 MERCHANTABbILITY 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package reposerv.client;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@MainClass("reposerv.client.Main")
-@ImportModules({
- @ImportModule(name="java.se.core"),
- @ImportModule(name="reposerv.service", version="[1.0, 2.0)")
-})
-class module_info {
-}
--- a/test/java/module/service/src/reposerv/provider/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package reposerv.provider;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@Version("1.0")
-@ServiceProviders({
- @ServiceProvider(service="reposerv.service.FooService",
- providerClass="reposerv.provider.FooService2Provider"),
- @ServiceProvider(service="reposerv.service.BarService",
- providerClass="reposerv.provider.BarServiceDefaultProvider")
-})
-@Services("BarProvider")
-@ImportModules({
- @ImportModule(name="java.se.core"),
- @ImportModule(name="reposerv.service", version="[1.0, 2.0)")
-})
-class module_info {
- // Export service type
- exports reposerv$provider$BarService;
-
- // Export service provider type
- exports reposerv$provider$FooService2Provider;
-
- // Note that the default service provider is *not* exported.
-}
--- a/test/java/module/service/src/reposerv/service/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package reposerv.service;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@Version("1.0")
-@Services({"reposerv.service.FooService"})
-@ServiceProviders({
- @ServiceProvider(service="reposerv.service.FooService",
- providerClass="reposerv.service.FooServiceDefaultProvider")
-})
-@ImportModules({
- @ImportModule(name="java.se.core")
-})
-class module_info {
- // Export service type
- exports reposerv$service$FooService;
-
- // Note that the default service provider is *not* exported.
-}
--- a/test/java/module/service/src/rxpserv/client/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 MERCHANTABbILITY 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package rxpserv.client;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@ImportModules({
- @ImportModule(name="java.se.core"),
- @ImportModule(name="rxpserv.service", version="1.0")
-})
-@MainClass("rxpserv.client.Main")
-class module_info {
-}
--- a/test/java/module/service/src/rxpserv/extra/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package rxpserv.extra;
-
-import java.module.annotation.*;
-
-/**
- * A module that just imports and reexports another module, but of a certain
- * version.
- */
-@ImportModules({
- @ImportModule(name="rxpserv.provider", version="2.0")
-})
-class module_info {
-}
--- a/test/java/module/service/src/rxpserv/provider/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package rxpserv.provider;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@ServiceProviders({
- @ServiceProvider(service="rxpserv.service.FooService",
- providerClass="rxpserv.provider.FooServiceProvider")
-})
-// It is important that this be on a single line; see ServiceTest.redefineAnnotations
-@ImportModules({ @ImportModule(name="rxpserv.transitive"), @ImportModule(name="rxpserv.extra") })
-@Version("1.0")
-class module_info {
- // Export service provider type
- exports rxpserv$provider$FooServiceProvider;
-}
--- a/test/java/module/service/src/rxpserv/service/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package rxpserv.service;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@Services({"rxpserv.service.FooService"})
-@ImportModules({
- @ImportModule(name="java.se.core")
-})
-@Version("1.0")
-class module_info {
- // Export service type
- exports rxpserv$service$FooService;
-}
--- a/test/java/module/service/src/rxpserv/transitive/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package rxpserv.transitive;
-
-import java.module.annotation.*;
-
-/**
- * A module that just imports and reexports another module, but of a certain
- * version.
- */
-@ImportModules({
- @ImportModule(name="rxpserv.service", version="1.0", reexport=true)
-})
-class module_info {
-}
--- a/test/java/module/service/src/verserv/client/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 MERCHANTABbILITY 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package verserv.client;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@MainClass("verserv.client.Main")
-@ImportModules({
- @ImportModule(name="java.se.core"),
- @ImportModule(name="verserv.service", version="[1.0, 2.0)")
-})
-class module_info {
-}
--- a/test/java/module/service/src/verserv/provider/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package verserv.provider;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@Version("1.0")
-@ServiceProviders({
- @ServiceProvider(service="verserv.service.FooService",
- providerClass="verserv.provider.FooService2Provider"),
- @ServiceProvider(service="verserv.service.BarService",
- providerClass="verserv.provider.BarServiceDefaultProvider")
-})
-@Services("BarProvider")
-// It is important that this be on a single line; see ServiceTest.redefineAnnotations
-@ImportModules({ @ImportModule(name="java.se.core"), @ImportModule(name="verserv.service", version="[1.0, 2.0)") })
-class module_info {
- // Export service type
- exports verserv$provider$BarService;
-
- // Export service provider type
- exports verserv$provider$FooService2Provider;
-
- // Note that the default service provider is *not* exported.
-}
--- a/test/java/module/service/src/verserv/service/module_info.java Fri Jul 18 12:47:04 2008 -0700
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright 2008 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package verserv.service;
-
-import java.lang.ModuleInfo.*;
-import java.module.annotation.*;
-
-@Version("1.0")
-@Services({"verserv.service.FooService"})
-@ServiceProviders({
- @ServiceProvider(service="verserv.service.FooService",
- providerClass="verserv.service.FooServiceDefaultProvider")
-})
-@ImportModules({
- @ImportModule(name="java.se.core")
-})
-class module_info {
- // Export service type
- exports verserv$service$FooService;
-
- // Note that the default service provider is *not* exported.
-}