Index: luni/src/main/java/java/io/ObjectStreamField.java =================================================================== --- luni/src/main/java/java/io/ObjectStreamField.java (revision 648985) +++ luni/src/main/java/java/io/ObjectStreamField.java (working copy) @@ -366,4 +366,22 @@ void setUnshared(boolean unshared) { this.unshared = unshared; } + + /** + * This method is for compatibility with RI-only. + */ + java.lang.reflect.Field getField() { + return null; + } + + /** + * This method is for compatibility with RI-only. + */ + String getSignature() { + if (isPrimitive()) { + return (typeString = "" + getTypeCode()); + } else { + return getTypeString(); + } + } } Index: suncompat/src/main/java/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java =================================================================== --- suncompat/src/main/java/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java (revision 0) +++ suncompat/src/main/java/com/sun/corba/se/impl/javax/rmi/CORBA/Util.java (revision 0) @@ -0,0 +1,91 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.corba.se.impl.javax.rmi.CORBA; + +import java.rmi.NoSuchObjectException; +import java.rmi.Remote; +import java.rmi.RemoteException; +import javax.rmi.CORBA.Stub; +import javax.rmi.CORBA.UtilDelegate; +import javax.rmi.CORBA.ValueHandler; +import javax.rmi.CORBA.Tie; +import org.omg.CORBA.ORB; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +public class Util implements UtilDelegate { + public Object copyObject(Object obj, ORB orb) throws RemoteException { + return javax.rmi.CORBA.Util.copyObject(obj, orb); + } + + public Object[] copyObjects(Object[] objs, ORB orb) throws RemoteException { + return javax.rmi.CORBA.Util.copyObjects(objs, orb); + } + + public ValueHandler createValueHandler() { + return javax.rmi.CORBA.Util.createValueHandler(); + } + + public String getCodebase(Class c) { + return javax.rmi.CORBA.Util.getCodebase(c); + } + + public Tie getTie(Remote r) { + return javax.rmi.CORBA.Util.getTie(r); + } + + public boolean isLocal(Stub s) throws RemoteException { + return javax.rmi.CORBA.Util.isLocal(s); + } + + public Class loadClass(String name, String codebase, ClassLoader loader) throws ClassNotFoundException { + return javax.rmi.CORBA.Util.loadClass(name, codebase, loader); + } + + public RemoteException mapSystemException(SystemException se) { + return javax.rmi.CORBA.Util.mapSystemException(se); + } + + public Object readAny(InputStream in) { + return javax.rmi.CORBA.Util.readAny(in); + } + + public void registerTarget(Tie tie, Remote target) { + javax.rmi.CORBA.Util.registerTarget(tie, target); + } + + public void unexportObject(Remote target) throws NoSuchObjectException { + javax.rmi.CORBA.Util.unexportObject(target); + } + + public RemoteException wrapException(Throwable obj) { + return javax.rmi.CORBA.Util.wrapException(obj); + } + + public void writeAbstractObject(OutputStream out, Object obj) { + javax.rmi.CORBA.Util.writeAbstractObject(out, obj); + } + + public void writeAny(OutputStream out, Object obj) { + javax.rmi.CORBA.Util.writeAny(out, obj); + } + + public void writeRemoteObject(OutputStream out, Object obj) { + javax.rmi.CORBA.Util.writeRemoteObject(out, obj); + } +} Index: suncompat/src/main/java/com/sun/mirror/apt/AnnotationProcessorEnvironment.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/apt/AnnotationProcessorEnvironment.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/apt/AnnotationProcessorEnvironment.java (revision 0) @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.apt; + +import java.util.Collection; +import java.util.Map; +import com.sun.mirror.declaration.TypeDeclaration; +import com.sun.mirror.declaration.PackageDeclaration; +import com.sun.mirror.util.Declarations; +import com.sun.mirror.util.Types; + +public interface AnnotationProcessorEnvironment { + //public void addListener(AnnotationProcessorListener listener); + //public Collection getDeclarationsAnnotatedWith(AnnotationTypeDeclaration a); + public Declarations getDeclarationUtils(); + //public Filer getFiler(); + //public Messages getMessager(); + public Map getOptions(); + public PackageDeclaration getPackage(String name); + public Collection getSpecifiedTypeDeclarations(); + public TypeDeclaration getTypeDeclaration(String name); + public Collection getTypeDeclarations(); + public Types getTypeUtils(); + //public void removeListener(AnnotationProcessorListener listener); +} Index: suncompat/src/main/java/com/sun/mirror/declaration/AnnotationMirror.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/AnnotationMirror.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/AnnotationMirror.java (revision 0) @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +import java.util.Map; +import com.sun.mirror.type.AnnotationType; +import com.sun.mirror.util.SourcePosition; + + +public interface AnnotationMirror { + public AnnotationType getAnnotationType(); + public Map getElementValues(); + public SourcePosition getPosition(); +} Index: suncompat/src/main/java/com/sun/mirror/declaration/AnnotationTypeDeclaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/AnnotationTypeDeclaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/AnnotationTypeDeclaration.java (revision 0) @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +import java.util.Collection; + + +public interface AnnotationTypeDeclaration extends InterfaceDeclaration { + public Collection getMethods(); +} Index: suncompat/src/main/java/com/sun/mirror/declaration/AnnotationTypeElementDeclaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/AnnotationTypeElementDeclaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/AnnotationTypeElementDeclaration.java (revision 0) @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +public interface AnnotationTypeElementDeclaration extends MethodDeclaration { + public AnnotationTypeDeclaration getDeclaringType(); + public AnnotationValue getDefaultValue(); +} Index: suncompat/src/main/java/com/sun/mirror/declaration/AnnotationValue.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/AnnotationValue.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/AnnotationValue.java (revision 0) @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +import com.sun.mirror.util.SourcePosition; + + +public interface AnnotationValue { + public SourcePosition getPosition(); + public Object getValue(); + public String toString(); +} Index: suncompat/src/main/java/com/sun/mirror/declaration/ClassDeclaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/ClassDeclaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/ClassDeclaration.java (revision 0) @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +import java.util.Collection; +import com.sun.mirror.type.ClassType; + + +public interface ClassDeclaration extends TypeDeclaration { + public Collection getConstructors(); + public Collection getMethods(); + public ClassType getSuperclass(); +} Index: suncompat/src/main/java/com/sun/mirror/declaration/ConstructorDeclaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/ConstructorDeclaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/ConstructorDeclaration.java (revision 0) @@ -0,0 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +public interface ConstructorDeclaration extends ExecutableDeclaration { +} Index: suncompat/src/main/java/com/sun/mirror/declaration/Declaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/Declaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/Declaration.java (revision 0) @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +import java.lang.annotation.Annotation; +import java.util.Collection; +import com.sun.mirror.util.DeclarationVisitor; +import com.sun.mirror.util.SourcePosition; + + +public interface Declaration { + public void accept(DeclarationVisitor v); + public boolean equals(Object obj); + public Annotation getAnnotation(Class type); + public Collection getAnnotationMirrors(); + public String getDocComment(); + public Collection getModifiers(); + public SourcePosition getPosition(); + public String getSimpleName(); +} \ No newline at end of file Index: suncompat/src/main/java/com/sun/mirror/declaration/EnumConstantDeclaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/EnumConstantDeclaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/EnumConstantDeclaration.java (revision 0) @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +public interface EnumConstantDeclaration extends FieldDeclaration { + public EnumDeclaration getDeclaringType(); +} Index: suncompat/src/main/java/com/sun/mirror/declaration/EnumDeclaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/EnumDeclaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/EnumDeclaration.java (revision 0) @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +import java.util.Collection; + + +public interface EnumDeclaration extends ClassDeclaration { + public Collection getEnumConstants(); +} Index: suncompat/src/main/java/com/sun/mirror/declaration/ExecutableDeclaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/ExecutableDeclaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/ExecutableDeclaration.java (revision 0) @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +import java.util.Collection; + + +public interface ExecutableDeclaration extends MemberDeclaration { + public Collection getFormalTypeParameters(); + public Collection getParameters(); + public Collection getThrownTypes(); + public boolean isVarArgs(); +} Index: suncompat/src/main/java/com/sun/mirror/declaration/FieldDeclaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/FieldDeclaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/FieldDeclaration.java (revision 0) @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +import com.sun.mirror.type.TypeMirror; + + +public interface FieldDeclaration extends MemberDeclaration { + public String getConstantExpression(); + public Object getConstantValue(); + public TypeMirror getType(); +} Index: suncompat/src/main/java/com/sun/mirror/declaration/InterfaceDeclaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/InterfaceDeclaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/InterfaceDeclaration.java (revision 0) @@ -0,0 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +public interface InterfaceDeclaration extends TypeDeclaration { +} Index: suncompat/src/main/java/com/sun/mirror/declaration/MemberDeclaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/MemberDeclaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/MemberDeclaration.java (revision 0) @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +public interface MemberDeclaration extends Declaration { + public TypeDeclaration getDeclaringType(); +} Index: suncompat/src/main/java/com/sun/mirror/declaration/MethodDeclaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/MethodDeclaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/MethodDeclaration.java (revision 0) @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +import com.sun.mirror.type.TypeMirror; + + +public interface MethodDeclaration extends ExecutableDeclaration { + public TypeMirror getReturnType(); +} Index: suncompat/src/main/java/com/sun/mirror/declaration/Modifier.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/Modifier.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/Modifier.java (revision 0) @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +public enum Modifier { + ABSTRACT, + FINAL, + NATIVE, + PRIVATE, + PROTECTED, + PUBLIC, + STATIC, + STRICTFP, + SYNCHRONIZED, + TRANSIENT, + VOLATILE; + + public String toString() { + return super.toString().toLowerCase(); + } +} Index: suncompat/src/main/java/com/sun/mirror/declaration/PackageDeclaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/PackageDeclaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/PackageDeclaration.java (revision 0) @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +import java.util.Collection; + + +public interface PackageDeclaration extends Declaration { + public Collection getAnnotationTypes(); + public Collection getClasses(); + public Collection getEnums(); + public Collection getInterfaces(); + public String getQualifiedName(); +} \ No newline at end of file Index: suncompat/src/main/java/com/sun/mirror/declaration/ParameterDeclaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/ParameterDeclaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/ParameterDeclaration.java (revision 0) @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +import com.sun.mirror.type.TypeMirror; + + +public interface ParameterDeclaration extends Declaration { + public TypeMirror getType(); +} Index: suncompat/src/main/java/com/sun/mirror/declaration/TypeDeclaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/TypeDeclaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/TypeDeclaration.java (revision 0) @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +import java.util.Collection; + + +public interface TypeDeclaration extends MemberDeclaration { + public Collection getFields(); + public Collection getFormalTypeParameters(); + public Collection getMethods(); + public Collection getNestedTypes(); + public PackageDeclaration getPackage(); + public String getQualifiedName(); + public Collection getSuperinterfaces(); +} Index: suncompat/src/main/java/com/sun/mirror/declaration/TypeParameterDeclaration.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/declaration/TypeParameterDeclaration.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/declaration/TypeParameterDeclaration.java (revision 0) @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.declaration; + +import java.util.Collection; + + +public interface TypeParameterDeclaration extends Declaration { + public Collection getBounds(); + public Declaration getOwner(); +} Index: suncompat/src/main/java/com/sun/mirror/type/AnnotationType.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/type/AnnotationType.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/type/AnnotationType.java (revision 0) @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.type; + +import com.sun.mirror.declaration.AnnotationTypeDeclaration; + + +public interface AnnotationType extends InterfaceType { + public AnnotationTypeDeclaration getDeclaration(); +} \ No newline at end of file Index: suncompat/src/main/java/com/sun/mirror/type/ArrayType.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/type/ArrayType.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/type/ArrayType.java (revision 0) @@ -0,0 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.type; + +public interface ArrayType extends ReferenceType { + public TypeMirror getComponentType(); +} Index: suncompat/src/main/java/com/sun/mirror/type/ClassType.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/type/ClassType.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/type/ClassType.java (revision 0) @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.type; + +import com.sun.mirror.declaration.ClassDeclaration; + + +public interface ClassType extends DeclaredType { + public ClassDeclaration getDeclaration(); + public ClassType getSuperclass(); +} \ No newline at end of file Index: suncompat/src/main/java/com/sun/mirror/type/DeclaredType.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/type/DeclaredType.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/type/DeclaredType.java (revision 0) @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.type; + +import java.util.Collection; +import com.sun.mirror.declaration.TypeDeclaration; + + +public interface DeclaredType extends ReferenceType { + public Collection getActualTypeArguments(); + public DeclaredType getContainingType(); + public TypeDeclaration getDeclaration(); + public Collection getSuperinterfaces(); +} \ No newline at end of file Index: suncompat/src/main/java/com/sun/mirror/type/EnumType.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/type/EnumType.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/type/EnumType.java (revision 0) @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.type; + +import com.sun.mirror.declaration.EnumDeclaration; + + +public interface EnumType extends ClassType { + public EnumDeclaration getDeclaration(); +} Index: suncompat/src/main/java/com/sun/mirror/type/InterfaceType.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/type/InterfaceType.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/type/InterfaceType.java (revision 0) @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.type; + +import com.sun.mirror.declaration.InterfaceDeclaration; + + +public interface InterfaceType extends DeclaredType { + public InterfaceDeclaration getDeclaration(); +} Index: suncompat/src/main/java/com/sun/mirror/type/PrimitiveType.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/type/PrimitiveType.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/type/PrimitiveType.java (revision 0) @@ -0,0 +1,26 @@ + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.type; + +public interface PrimitiveType extends TypeMirror { + public static enum Kind { + BOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, INT, LONG, SHORT + } + + public Kind getKind(); +} Index: suncompat/src/main/java/com/sun/mirror/type/ReferenceType.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/type/ReferenceType.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/type/ReferenceType.java (revision 0) @@ -0,0 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.type; + +public interface ReferenceType extends TypeMirror { +} Index: suncompat/src/main/java/com/sun/mirror/type/TypeMirror.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/type/TypeMirror.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/type/TypeMirror.java (revision 0) @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.type; + +import com.sun.mirror.util.TypeVisitor; + +public interface TypeMirror { + public void accept(TypeVisitor v); + public boolean equals(Object obj); + public String toString(); +} Index: suncompat/src/main/java/com/sun/mirror/type/TypeVariable.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/type/TypeVariable.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/type/TypeVariable.java (revision 0) @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.type; + +import com.sun.mirror.declaration.TypeParameterDeclaration; + + +public interface TypeVariable extends ReferenceType { + public TypeParameterDeclaration getDeclaration(); +} Index: suncompat/src/main/java/com/sun/mirror/type/VoidType.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/type/VoidType.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/type/VoidType.java (revision 0) @@ -0,0 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.type; + +public interface VoidType extends TypeMirror { +} Index: suncompat/src/main/java/com/sun/mirror/type/WildcardType.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/type/WildcardType.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/type/WildcardType.java (revision 0) @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.type; + +import java.util.Collection; + + +public interface WildcardType extends TypeMirror { + public Collection getLowerBounds(); + public Collection getUpperBounds(); +} Index: suncompat/src/main/java/com/sun/mirror/util/DeclarationFilter.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/util/DeclarationFilter.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/util/DeclarationFilter.java (revision 0) @@ -0,0 +1,164 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.util; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import com.sun.mirror.declaration.Declaration; +import com.sun.mirror.declaration.Modifier; + + +public class DeclarationFilter { + public static final DeclarationFilter FILTER_PUBLIC = new ModifierFilter(Modifier.PUBLIC); + public static final DeclarationFilter FILTER_PROTECTED = new ModifierFilter(Modifier.PROTECTED); + public static final DeclarationFilter FILTER_PRIVATE = new ModifierFilter(Modifier.PRIVATE); + public static final DeclarationFilter FILTER_PUBLIC_OR_PROTECTED = new OrFilter(FILTER_PUBLIC, FILTER_PROTECTED); + public static final DeclarationFilter FILTER_PACKAGE = new NotFilter(new OrFilter(FILTER_PUBLIC_OR_PROTECTED, FILTER_PRIVATE)); + + public DeclarationFilter() { + } + + public DeclarationFilter and(DeclarationFilter f) { + return new AndFilter(this, f); + } + + public Collection filter(Collection decls, Class resType) { + Set filtered = Collections.synchronizedSet(new HashSet()); + DeclarationFilter typeFilter = getFilter(resType); + + for (Iterator iter = decls.iterator(); iter.hasNext();) { + Declaration decl = (Declaration) iter.next(); + + if (matches(decl) && typeFilter.matches(decl)) { + filtered.add(decl); + } + } + return filtered; + } + + public Collection filter(Collection decls) { + Set filtered = Collections.synchronizedSet(new HashSet()); + + for (Iterator iter = decls.iterator(); iter.hasNext();) { + Declaration decl = (Declaration) iter.next(); + + if (matches(decl)) { + filtered.add(decl); + } + } + return filtered; + } + + public static DeclarationFilter getFilter(Class kind) { + return new ClassFilter(kind); + } + + public static DeclarationFilter getFilter(Collection mods) { + return new ModifiersFilter(mods); + } + + public boolean matches(Declaration decl) { + return true; + } + + public DeclarationFilter not() { + return new NotFilter(this); + } + + public DeclarationFilter or(DeclarationFilter f) { + return new OrFilter(this, f); + } + + static class ModifierFilter extends DeclarationFilter { + Modifier mod; + + public ModifierFilter(Modifier mod) { + this.mod = mod; + } + + public boolean matches(Declaration decl) { + return decl.getModifiers().contains(mod); + } + } + + static class ModifiersFilter extends DeclarationFilter { + Collection mods; + + public ModifiersFilter(Collection mods) { + this.mods = mods; + } + + public boolean matches(Declaration decl) { + return decl.getModifiers().containsAll(mods); + } + } + + static class ClassFilter extends DeclarationFilter { + private Class kind; + + public ClassFilter(Class cl) { + this.kind = cl; + } + + public boolean matches(Declaration decl) { + return kind.isAssignableFrom(decl.getClass()); + } + } + + static class AndFilter extends DeclarationFilter { + private DeclarationFilter f1; + private DeclarationFilter f2; + + public AndFilter(DeclarationFilter f1, DeclarationFilter f2) { + this.f1 = f1; + this.f2 = f2; + } + + public boolean matches(Declaration decl) { + return f1.matches(decl) & f2.matches(decl); + } + } + + static class OrFilter extends DeclarationFilter { + private DeclarationFilter f1; + private DeclarationFilter f2; + + public OrFilter(DeclarationFilter f1, DeclarationFilter f2) { + this.f1 = f1; + this.f2 = f2; + } + + public boolean matches(Declaration decl) { + return f1.matches(decl) | f2.matches(decl); + } + } + + static class NotFilter extends DeclarationFilter { + private DeclarationFilter f; + + public NotFilter(DeclarationFilter f) { + this.f = f; + } + + public boolean matches(Declaration decl) { + return !f.matches(decl); + } + } +} Index: suncompat/src/main/java/com/sun/mirror/util/Declarations.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/util/Declarations.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/util/Declarations.java (revision 0) @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.util; + +import com.sun.mirror.declaration.MemberDeclaration; +import com.sun.mirror.declaration.MethodDeclaration; + +public interface Declarations { + public boolean hides(MemberDeclaration sub, MemberDeclaration sup); + public boolean overrides(MethodDeclaration sub, MethodDeclaration sup); +} \ No newline at end of file Index: suncompat/src/main/java/com/sun/mirror/util/DeclarationVisitor.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/util/DeclarationVisitor.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/util/DeclarationVisitor.java (revision 0) @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.util; + +import com.sun.mirror.declaration.*; + + +public interface DeclarationVisitor { + public void visitAnnotationTypeDeclaration(AnnotationTypeDeclaration d); + public void visitAnnotationTypeElementDeclaration(AnnotationTypeElementDeclaration d); + public void visitClassDeclaration(ClassDeclaration d); + public void visitConstructorDeclaration(ConstructorDeclaration d); + public void visitDeclaration(Declaration d); + public void visitEnumConstantDeclaration(EnumConstantDeclaration d); + public void visitEnumDeclaration(EnumDeclaration d); + public void visitExecutableDeclaration(ExecutableDeclaration d); + public void visitFieldDeclaration(FieldDeclaration d); + public void visitInterfaceDeclaration(InterfaceDeclaration d); + public void visitMemberDeclaration(MemberDeclaration d); + public void visitMethodDeclaration(MethodDeclaration d); + public void visitPackageDeclaration(PackageDeclaration d); + public void visitParameterDeclaration(ParameterDeclaration d); + public void visitTypeDeclaration(TypeDeclaration d); + public void visitTypeParameterDeclaration(TypeParameterDeclaration d); +} \ No newline at end of file Index: suncompat/src/main/java/com/sun/mirror/util/SourcePosition.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/util/SourcePosition.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/util/SourcePosition.java (revision 0) @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.util; + +import java.io.File; + + +public interface SourcePosition { + public int column(); + public File file(); + public int line(); +} Index: suncompat/src/main/java/com/sun/mirror/util/Types.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/util/Types.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/util/Types.java (revision 0) @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.util; + +import java.util.Collection; +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.*; + + +public interface Types { + public ArrayType getArrayType(TypeMirror componentType); + public DeclaredType getDeclaredType(DeclaredType containing, TypeDeclaration decl, TypeMirror... typeArgs); + public DeclaredType getDeclaredType(TypeDeclaration decl, TypeMirror... typeArgs); + public TypeMirror getErasure(TypeMirror t); + public PrimitiveType getPrimitiveType(PrimitiveType.Kind kind); + public TypeVariable getTypeVariable(TypeParameterDeclaration tparam); + public VoidType getVoidType(); + public WildcardType getWildcardType(Collection upperBounds, Collection lowerBounds); + public boolean isAssignable(TypeMirror t1, TypeMirror t2); + public boolean isSubtype(TypeMirror t1, TypeMirror t2); +} \ No newline at end of file Index: suncompat/src/main/java/com/sun/mirror/util/TypeVisitor.java =================================================================== --- suncompat/src/main/java/com/sun/mirror/util/TypeVisitor.java (revision 0) +++ suncompat/src/main/java/com/sun/mirror/util/TypeVisitor.java (revision 0) @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.sun.mirror.util; + +import com.sun.mirror.type.*; + + +public interface TypeVisitor { + //public void visitAnnotationType(AnnotationType t); + //public void visitArrayType(ArrayType t); + //public void visitClassType(ClassType t); + public void visitDeclaredType(DeclaredType t); + //public void visitEnumType(EnumType t); + //public void visitInterfaceType(InterfaceType t); + //public void visitPrimitiveType(PrimitiveType t); + //public void visitReferenceType(ReferenceType t); + //public void visitTypeMirror(TypeMirror t); + //public void visitTypeVariable(TypeVariable t); + //public void visitVoidType(VoidType t); + //public void visitWildcardType(WildcardType t); +} Index: suncompat/src/main/java/sun/misc/BASE64Decoder.java =================================================================== --- suncompat/src/main/java/sun/misc/BASE64Decoder.java (revision 0) +++ suncompat/src/main/java/sun/misc/BASE64Decoder.java (revision 0) @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package sun.misc; + +import org.apache.harmony.luni.util.Base64; + +public class BASE64Decoder { + + public byte[] decode(byte[] in) { + return Base64.decode(in); + } + + public byte[] decode(String in) { + byte[] buf = new byte[in.length()]; + in.getBytes(0, in.length(), buf, 0); + return Base64.decode(buf); + } + + public byte[] decodeBuffer(byte[] in) { + return Base64.decode(in); + } + + public byte[] decodeBuffer(String in) { + byte[] buf = new byte[in.length()]; + in.getBytes(0, in.length(), buf, 0); + return Base64.decode(buf); + } +} Index: suncompat/src/main/java/sun/misc/Base64Encoder.java =================================================================== --- suncompat/src/main/java/sun/misc/Base64Encoder.java (revision 649058) +++ suncompat/src/main/java/sun/misc/Base64Encoder.java (working copy) @@ -26,4 +26,12 @@ public static String encode(byte[] in, String charsetName) throws UnsupportedEncodingException { return Base64.encode(in, charsetName); } + + public String encode(byte[] in) throws UnsupportedEncodingException { + return Base64.encode(in, null); + } + + public String encodeBuffer(byte[] in) throws UnsupportedEncodingException { + return Base64.encode(in, null); + } } Index: suncompat/src/main/java/sun/reflect/ReflectionFactory.java =================================================================== --- suncompat/src/main/java/sun/reflect/ReflectionFactory.java (revision 0) +++ suncompat/src/main/java/sun/reflect/ReflectionFactory.java (revision 0) @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package sun.reflect; + +import java.security.PrivilegedAction; + +public class ReflectionFactory { + public static class GetReflectionFactoryAction implements PrivilegedAction { + public Object run() { + return new ReflectionFactory(); + } + } +}