# HG changeset patch # User mkos # Date 1381933403 14400 # Node ID 3fbf2a364eed6b58f9894a74d3d5fb9ac3635d5d # Parent 8e6877caefcb68257ce71c0426fda9a40c4faf09 8010935: Better XML handling Reviewed-by: mchung, mgrebac, mullan diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/tools/internal/jxc/model/nav/APTNavigator.java --- a/drop_included/jaxws_src/src/com/sun/tools/internal/jxc/model/nav/APTNavigator.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/tools/internal/jxc/model/nav/APTNavigator.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -71,8 +71,7 @@ * * @author Kohsuke Kawaguchi (kk@kohsuke.org) */ -public class APTNavigator implements Navigator { - +public final class APTNavigator implements Navigator { private final AnnotationProcessorEnvironment env; private final PrimitiveType primitiveByte; @@ -273,8 +272,9 @@ return clazz.getPackage().getQualifiedName(); } - public TypeDeclaration findClass(String className, TypeDeclaration referencePoint) { - return env.getTypeDeclaration(className); + @Override + public TypeDeclaration loadObjectFactory(TypeDeclaration referencePoint, String packageName) { + return env.getTypeDeclaration(packageName + ".ObjectFactory"); } public boolean isBridgeMethod(MethodDeclaration method) { diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/tools/internal/xjc/model/nav/EagerNType.java --- a/drop_included/jaxws_src/src/com/sun/tools/internal/xjc/model/nav/EagerNType.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/tools/internal/xjc/model/nav/EagerNType.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,6 @@ import com.sun.codemodel.internal.JType; import com.sun.tools.internal.xjc.outline.Aspect; import com.sun.tools.internal.xjc.outline.Outline; -import com.sun.xml.internal.bind.v2.model.nav.Navigator; /** * @author Kohsuke Kawaguchi @@ -69,6 +68,6 @@ } public String fullName() { - return Navigator.REFLECTION.getTypeName(t); + return Utils.REFLECTION_NAVIGATOR.getTypeName(t); } } diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/tools/internal/xjc/model/nav/NavigatorImpl.java --- a/drop_included/jaxws_src/src/com/sun/tools/internal/xjc/model/nav/NavigatorImpl.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/tools/internal/xjc/model/nav/NavigatorImpl.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,7 +56,7 @@ EagerNType ent = (EagerNType) nt; if (base instanceof EagerNClass) { EagerNClass enc = (EagerNClass) base; - return create(REFLECTION.getBaseClass(ent.t, enc.c)); + return create(Utils.REFLECTION_NAVIGATOR.getBaseClass(ent.t, enc.c)); } // lazy class can never be a base type of an eager type return null; @@ -172,7 +172,7 @@ public NType getTypeArgument(NType nt, int i) { if (nt instanceof EagerNType) { EagerNType ent = (EagerNType) nt; - return create(REFLECTION.getTypeArgument(ent.t,i)); + return create(Utils.REFLECTION_NAVIGATOR.getTypeArgument(ent.t,i)); } if (nt instanceof NClassByJClass) { NClassByJClass nnt = (NClassByJClass) nt; @@ -185,7 +185,7 @@ public boolean isParameterizedType(NType nt) { if (nt instanceof EagerNType) { EagerNType ent = (EagerNType) nt; - return REFLECTION.isParameterizedType(ent.t); + return Utils.REFLECTION_NAVIGATOR.isParameterizedType(ent.t); } if (nt instanceof NClassByJClass) { NClassByJClass nnt = (NClassByJClass) nt; @@ -299,8 +299,8 @@ throw new UnsupportedOperationException(); } - public NClass findClass(String className, NClass referencePoint) { - // TODO: implement this method later + @Override + public NClass loadObjectFactory(NClass referencePoint, String pkg) { throw new UnsupportedOperationException(); } diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/api/JAXBRIContext.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/api/JAXBRIContext.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/api/JAXBRIContext.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,6 @@ import com.sun.xml.internal.bind.api.impl.NameConverter; import com.sun.xml.internal.bind.v2.ContextFactory; import com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader; -import com.sun.xml.internal.bind.v2.model.nav.Navigator; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeInfoSet; /** @@ -360,7 +359,7 @@ * @since 2.0 FCS */ public static @Nullable Type getBaseType(@NotNull Type type, @NotNull Class baseType) { - return Navigator.REFLECTION.getBaseClass(type,baseType); + return Utils.REFLECTION_NAVIGATOR.getBaseClass(type, baseType); } diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/api/TypeReference.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/api/TypeReference.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/api/TypeReference.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,8 +31,6 @@ import javax.xml.namespace.QName; -import com.sun.xml.internal.bind.v2.model.nav.Navigator; - /** * A reference to a JAXB-bound type. * @@ -104,11 +102,10 @@ // if we are to reinstitute this check, check JAXB annotations only // assert annotations.length==0; // not designed to work with adapters. - Type base = Navigator.REFLECTION.getBaseClass(type, Collection.class); + Type base = Utils.REFLECTION_NAVIGATOR.getBaseClass(type, Collection.class); if(base==null) return this; // not a collection - return new TypeReference(tagName, - Navigator.REFLECTION.getTypeArgument(base,0)); + return new TypeReference(tagName, Utils.REFLECTION_NAVIGATOR.getTypeArgument(base,0)); } } diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/impl/ModelBuilder.java Wed Oct 16 10:23:23 2013 -0400 @@ -235,7 +235,7 @@ String pkg = nav.getPackageName(ci.getClazz()); if(!registries.containsKey(pkg)) { // insert the package's object factory - C c = loadObjectFactory(ci, pkg); + C c = nav.loadObjectFactory(clazz, pkg); if(c!=null) addRegistry(c,(Locatable)p); } @@ -264,15 +264,6 @@ return r; } - private C loadObjectFactory(ClassInfoImpl ci, String pkg) { - try { - return nav.findClass(pkg + ".ObjectFactory", ci.getClazz()); - } catch (SecurityException ignored) { - // treat SecurityException in same way as ClassNotFoundException in this case - return null; - } - } - /** * Checks the uniqueness of the type name. */ diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/impl/RuntimeAnyTypeImpl.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/impl/RuntimeAnyTypeImpl.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/impl/RuntimeAnyTypeImpl.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ import java.lang.reflect.Type; -import com.sun.xml.internal.bind.v2.model.nav.Navigator; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeNonElement; import com.sun.xml.internal.bind.v2.runtime.Transducer; @@ -36,7 +35,7 @@ */ final class RuntimeAnyTypeImpl extends AnyTypeImpl implements RuntimeNonElement { private RuntimeAnyTypeImpl() { - super(Navigator.REFLECTION); + super(Utils.REFLECTION_NAVIGATOR); } public Transducer getTransducer() { diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/impl/RuntimeElementInfoImpl.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/impl/RuntimeElementInfoImpl.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/impl/RuntimeElementInfoImpl.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,6 @@ import com.sun.xml.internal.bind.v2.model.runtime.RuntimeNonElement; import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeRef; -import com.sun.xml.internal.bind.v2.model.nav.Navigator; import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException; import com.sun.xml.internal.bind.v2.runtime.Transducer; import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor; @@ -122,7 +121,7 @@ } public Class getType() { - return Navigator.REFLECTION.erasure(super.getType()); + return (Class) Utils.REFLECTION_NAVIGATOR.erasure(super.getType()); } public RuntimeClassInfo getScope() { diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/impl/RuntimeModelBuilder.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/impl/RuntimeModelBuilder.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/impl/RuntimeModelBuilder.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,8 +37,6 @@ import com.sun.xml.internal.bind.v2.model.annotation.Locatable; import com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader; import com.sun.xml.internal.bind.v2.model.core.ID; -import com.sun.xml.internal.bind.v2.model.nav.Navigator; -import com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeNonElement; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeNonElementRef; import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo; @@ -75,7 +73,7 @@ public final @Nullable JAXBContextImpl context; public RuntimeModelBuilder(JAXBContextImpl context, RuntimeAnnotationReader annotationReader, Map subclassReplacements, String defaultNamespaceRemap) { - super(annotationReader, Navigator.REFLECTION, subclassReplacements, defaultNamespaceRemap); + super(annotationReader, Utils.REFLECTION_NAVIGATOR, subclassReplacements, defaultNamespaceRemap); this.context = context; } @@ -109,10 +107,6 @@ return new RuntimeArrayInfoImpl(this, upstream, (Class)arrayType); } - public ReflectionNavigator getNavigator() { - return (ReflectionNavigator)nav; - } - @Override protected RuntimeTypeInfoSetImpl createTypeInfoSet() { return new RuntimeTypeInfoSetImpl(reader); diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeInfoSetImpl.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeInfoSetImpl.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/impl/RuntimeTypeInfoSetImpl.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,9 +34,6 @@ import com.sun.xml.internal.bind.v2.model.annotation.AnnotationReader; import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet; -import com.sun.xml.internal.bind.v2.model.core.NonElement; -import com.sun.xml.internal.bind.v2.model.nav.Navigator; -import com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeNonElement; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeInfoSet; @@ -47,7 +44,7 @@ */ final class RuntimeTypeInfoSetImpl extends TypeInfoSetImpl implements RuntimeTypeInfoSet { public RuntimeTypeInfoSetImpl(AnnotationReader reader) { - super(Navigator.REFLECTION,reader,RuntimeBuiltinLeafInfoImpl.LEAVES); + super(Utils.REFLECTION_NAVIGATOR,reader,RuntimeBuiltinLeafInfoImpl.LEAVES); } @Override @@ -55,10 +52,6 @@ return RuntimeAnyTypeImpl.theInstance; } - public ReflectionNavigator getNavigator() { - return (ReflectionNavigator)super.getNavigator(); - } - public RuntimeNonElement getTypeInfo( Type type ) { return (RuntimeNonElement)super.getTypeInfo(type); } diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/nav/Navigator.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/nav/Navigator.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/nav/Navigator.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -240,10 +240,6 @@ */ T getComponentType(T t); - - /** The singleton instance. */ - public static final ReflectionNavigator REFLECTION = new ReflectionNavigator(); - /** * Gets the i-th type argument from a parameterized type. * @@ -352,14 +348,14 @@ String getPackageName(C clazz); /** - * Finds the class/interface/enum/annotation of the given name. + * Finds ObjectFactory for the given referencePoint. * * @param referencePoint * The class that refers to the specified class. * @return * null if not found. */ - C findClass(String className, C referencePoint); + C loadObjectFactory(C referencePoint, String packageName); /** * Returns true if this method is a bridge method as defined in JLS. diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/nav/ReflectionNavigator.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/nav/ReflectionNavigator.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/nav/ReflectionNavigator.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,15 +44,20 @@ * {@link Navigator} implementation for {@code java.lang.reflect}. * */ -public final class ReflectionNavigator implements Navigator { - /** - * Singleton. - * - * Use {@link Navigator#REFLECTION} - */ - ReflectionNavigator() {} +/*package*/final class ReflectionNavigator implements Navigator { +// ---------- Singleton ----------------- + private static final ReflectionNavigator INSTANCE = new ReflectionNavigator(); + + /*package*/static ReflectionNavigator getInstance() { // accessible through reflection from Utils classes + return INSTANCE; + } + + private ReflectionNavigator() { + } +// --------------------------------------- public Class getSuperClass(Class clazz) { + checkPackageAccess(clazz.getName()); if(clazz==Object.class) return null; Class sc = clazz.getSuperclass(); if(sc==null) sc=Object.class; // error recovery @@ -235,10 +240,12 @@ } public Collection getDeclaredFields(Class clazz) { + checkPackageAccess(clazz.getName()); return Arrays.asList(clazz.getDeclaredFields()); } public Field getDeclaredField(Class clazz, String fieldName) { + checkPackageAccess(clazz.getName()); try { return clazz.getDeclaredField(fieldName); } catch (NoSuchFieldException e) { @@ -247,6 +254,7 @@ } public Collection getDeclaredMethods(Class clazz) { + checkPackageAccess(clazz.getName()); return Arrays.asList(clazz.getDeclaredMethods()); } @@ -453,7 +461,7 @@ c.getDeclaredConstructor(); return true; } catch (NoSuchMethodException e) { - return false; + return false; // todo: do this WITHOUT exception throw } } @@ -474,6 +482,7 @@ } public Field[] getEnumConstants(Class clazz) { + checkPackageAccess(clazz.getName()); try { Object[] values = clazz.getEnumConstants(); Field[] fields = new Field[values.length]; @@ -498,11 +507,16 @@ else return name.substring(0,idx); } - public Class findClass(String className, Class referencePoint) { - try { + @Override + public Class loadObjectFactory(Class referencePoint, String pkg) { + String clName = pkg + ".ObjectFactory"; + checkPackageAccess(clName); ClassLoader cl = referencePoint.getClassLoader(); - if(cl==null) cl = ClassLoader.getSystemClassLoader(); - return cl.loadClass(className); + if (cl == null) + cl = ClassLoader.getSystemClassLoader(); + + try { + return cl.loadClass(clName); } catch (ClassNotFoundException e) { return null; } @@ -571,4 +585,24 @@ return t; } + + /** + * Checking if current thread can access class. + * + * @param clName name of the class to be checked + * @throws SecurityException is thrown if thread doesn't have privileges + */ + static void checkPackageAccess(String clName) { + SecurityManager sm = System.getSecurityManager(); + if (sm == null) + return; + if (clName.startsWith("[")) { // array + int nameStart = clName.lastIndexOf('[') + 2; + if (nameStart > 1 && nameStart < clName.length()) + clName = clName.substring(nameStart); + } + int packageEnd = clName.lastIndexOf('.'); + if (packageEnd != -1) + sm.checkPackageAccess(clName.substring(0, packageEnd)); + } } diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfoSet.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfoSet.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/model/runtime/RuntimeTypeInfoSet.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,8 +33,6 @@ import javax.xml.namespace.QName; import com.sun.xml.internal.bind.v2.model.core.TypeInfoSet; -import com.sun.xml.internal.bind.v2.model.core.NonElement; -import com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator; /** * {@link TypeInfoSet} refined for runtime. @@ -52,5 +50,4 @@ RuntimeElementInfo getElementInfo( Class scope, QName name ); Map getElementMappings( Class scope ); Iterable getAllElements(); - ReflectionNavigator getNavigator(); } diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/ElementBeanInfoImpl.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/ElementBeanInfoImpl.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/ElementBeanInfoImpl.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,6 @@ import com.sun.xml.internal.bind.api.AccessorException; import com.sun.xml.internal.bind.v2.model.core.PropertyKind; -import com.sun.xml.internal.bind.v2.model.nav.Navigator; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeElementInfo; import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo; import com.sun.xml.internal.bind.v2.runtime.property.Property; @@ -81,10 +80,10 @@ this.property = PropertyFactory.create(grammar,rei.getProperty()); tagName = rei.getElementName(); - expectedType = Navigator.REFLECTION.erasure(rei.getContentInMemoryType()); + expectedType = (Class) Utils.REFLECTION_NAVIGATOR.erasure(rei.getContentInMemoryType()); scope = rei.getScope()==null ? JAXBElement.GlobalScope.class : rei.getScope().getClazz(); - Class type = Navigator.REFLECTION.erasure(rei.getType()); + Class type = (Class) Utils.REFLECTION_NAVIGATOR.erasure(rei.getType()); if(type==JAXBElement.class) constructor = null; else { diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -91,7 +91,6 @@ import com.sun.xml.internal.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl; import com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder; import com.sun.xml.internal.bind.v2.model.nav.Navigator; -import com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeArrayInfo; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeBuiltinLeafInfo; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeClassInfo; @@ -343,7 +342,7 @@ beanInfoMap.put( e.getKey(), beanInfoMap.get(e.getValue()) ); // build bridges - ReflectionNavigator nav = typeSet.getNavigator(); + Navigator nav = typeSet.getNavigator(); for (TypeReference tr : typeRefs) { XmlJavaTypeAdapter xjta = tr.get(XmlJavaTypeAdapter.class); @@ -351,7 +350,7 @@ XmlList xl = tr.get(XmlList.class); // eventually compute the in-memory type - Class erasedType = nav.erasure(tr.type); + Class erasedType = (Class) nav.erasure(tr.type); if(xjta!=null) { a = new Adapter(xjta.value(),nav); @@ -362,7 +361,7 @@ } if(a!=null) { - erasedType = nav.erasure(a.defaultType); + erasedType = (Class) nav.erasure(a.defaultType); } Name name = nameBuilder.createElementName(tr.tagName); @@ -838,7 +837,7 @@ // this is a special class we introduced for JAX-WS that we *don't* want in the schema } else { NonElement typeInfo = getXmlType(tis,tr); - xsdgen.add(tr.tagName, !Navigator.REFLECTION.isPrimitive(tr.type),typeInfo); + xsdgen.add(tr.tagName, !tis.getNavigator().isPrimitive(tr.type),typeInfo); } } return xsdgen; diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/property/ArrayProperty.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/property/ArrayProperty.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/property/ArrayProperty.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ import com.sun.xml.internal.bind.api.AccessorException; -import com.sun.xml.internal.bind.v2.model.nav.Navigator; import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo; import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl; import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor; @@ -49,7 +48,7 @@ assert prop.isCollection(); lister = Lister.create( - Navigator.REFLECTION.erasure(prop.getRawType()),prop.id(),prop.getAdapter()); + Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType()),prop.id(),prop.getAdapter()); assert lister!=null; acc = prop.getAccessor().optimize(context); assert acc!=null; diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/property/SingleMapNodeProperty.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/property/SingleMapNodeProperty.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/property/SingleMapNodeProperty.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,6 @@ import com.sun.xml.internal.bind.v2.ClassFactory; import com.sun.xml.internal.bind.v2.util.QNameMap; import com.sun.xml.internal.bind.v2.model.core.PropertyKind; -import com.sun.xml.internal.bind.v2.model.nav.ReflectionNavigator; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeMapPropertyInfo; import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl; import com.sun.xml.internal.bind.v2.runtime.JaxBeanInfo; @@ -97,7 +96,8 @@ this.valueBeanInfo = context.getOrCreate(prop.getValueType()); // infer the implementation class - Class sig = ReflectionNavigator.REFLECTION.erasure(prop.getRawType()); + //noinspection unchecked + Class sig = (Class) Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType()); mapImplClass = ClassFactory.inferImplClass(sig,knownImplClasses); // TODO: error check for mapImplClass==null // what is the error reporting path for this part of the code? diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/reflect/Accessor.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/reflect/Accessor.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/reflect/Accessor.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,6 @@ import com.sun.xml.internal.bind.api.AccessorException; import com.sun.xml.internal.bind.api.JAXBRIContext; import com.sun.xml.internal.bind.v2.model.core.Adapter; -import com.sun.xml.internal.bind.v2.model.nav.Navigator; import com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder; import com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory; import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader; @@ -176,7 +175,7 @@ public final Accessor adapt(Adapter adapter) { return new AdaptedAccessor( - (Class)Navigator.REFLECTION.erasure(adapter.defaultType), + (Class) Utils.REFLECTION_NAVIGATOR.erasure(adapter.defaultType), this, adapter.adapterType); } diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/reflect/Lister.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/reflect/Lister.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/reflect/Lister.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,6 @@ import com.sun.xml.internal.bind.v2.TODO; import com.sun.xml.internal.bind.v2.model.core.Adapter; import com.sun.xml.internal.bind.v2.model.core.ID; -import com.sun.xml.internal.bind.v2.model.nav.Navigator; import com.sun.xml.internal.bind.v2.runtime.XMLSerializer; import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Patcher; import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext; @@ -116,7 +115,7 @@ public static Lister create(Type fieldType,ID idness, Adapter adapter) { - Class rawType = Navigator.REFLECTION.erasure(fieldType); + Class rawType = (Class) Utils.REFLECTION_NAVIGATOR.erasure(fieldType); Class itemType; Lister l; @@ -125,9 +124,9 @@ l = getArrayLister(itemType); } else if( Collection.class.isAssignableFrom(rawType) ) { - Type bt = Navigator.REFLECTION.getBaseClass(fieldType,Collection.class); + Type bt = Utils.REFLECTION_NAVIGATOR.getBaseClass(fieldType,Collection.class); if(bt instanceof ParameterizedType) - itemType = Navigator.REFLECTION.erasure(((ParameterizedType)bt).getActualTypeArguments()[0]); + itemType = (Class) Utils.REFLECTION_NAVIGATOR.erasure(((ParameterizedType)bt).getActualTypeArguments()[0]); else itemType = Object.class; l = new CollectionLister(getImplClass(rawType)); diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/reflect/TransducedAccessor.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/reflect/TransducedAccessor.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/reflect/TransducedAccessor.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ import com.sun.xml.internal.bind.api.AccessorException; import com.sun.xml.internal.bind.v2.model.core.ID; import com.sun.xml.internal.bind.v2.model.impl.RuntimeModelBuilder; -import com.sun.xml.internal.bind.v2.model.nav.Navigator; import com.sun.xml.internal.bind.v2.model.runtime.RuntimeNonElementRef; import com.sun.xml.internal.bind.v2.model.runtime.RuntimePropertyInfo; import com.sun.xml.internal.bind.v2.runtime.Name; @@ -144,8 +143,7 @@ if(prop.isCollection()) { return new ListTransducedAccessorImpl(xducer,prop.getAccessor(), - Lister.create(Navigator.REFLECTION.erasure(prop.getRawType()),prop.id(), - prop.getAdapter())); + Lister.create(Utils.REFLECTION_NAVIGATOR.erasure(prop.getRawType()), prop.id(), prop.getAdapter())); } if(prop.id()==ID.IDREF) diff -r 8e6877caefcb -r 3fbf2a364eed drop_included/jaxws_src/src/com/sun/xml/internal/ws/model/RuntimeModeler.java --- a/drop_included/jaxws_src/src/com/sun/xml/internal/ws/model/RuntimeModeler.java Thu Oct 17 17:37:46 2013 -0400 +++ b/drop_included/jaxws_src/src/com/sun/xml/internal/ws/model/RuntimeModeler.java Wed Oct 16 10:23:23 2013 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ import com.sun.istack.internal.NotNull; import com.sun.xml.internal.bind.api.CompositeStructure; import com.sun.xml.internal.bind.api.TypeReference; -import com.sun.xml.internal.bind.v2.model.nav.Navigator; import com.sun.xml.internal.ws.api.BindingID; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.model.ExceptionType; @@ -764,7 +763,7 @@ //set the actual type argument of Holder in the TypeReference if (isHolder) { if(clazzType==Holder.class){ - clazzType = Navigator.REFLECTION.erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]); + clazzType = (Class) Utils.REFLECTION_NAVIGATOR.erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]); } } Mode paramMode = isHolder ? Mode.INOUT : Mode.IN; @@ -949,7 +948,7 @@ //set the actual type argument of Holder in the TypeReference if (isHolder) { if (clazzType==Holder.class) - clazzType = Navigator.REFLECTION.erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]); + clazzType = (Class) Utils.REFLECTION_NAVIGATOR.erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]); } Mode paramMode = isHolder ? Mode.INOUT : Mode.IN; for (Annotation annotation : pannotations[pos]) { @@ -1184,7 +1183,7 @@ //set the actual type argument of Holder in the TypeReference if (isHolder) { if (clazzType==Holder.class) - clazzType = Navigator.REFLECTION.erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]); + clazzType = (Class) Utils.REFLECTION_NAVIGATOR.erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]); } Mode paramMode = isHolder ? Mode.INOUT : Mode.IN; @@ -1252,14 +1251,14 @@ private Class getAsyncReturnType(Method method, Class returnType) { if(Response.class.isAssignableFrom(returnType)){ Type ret = method.getGenericReturnType(); - return Navigator.REFLECTION.erasure(((ParameterizedType)ret).getActualTypeArguments()[0]); + return (Class) Utils.REFLECTION_NAVIGATOR.erasure(((ParameterizedType)ret).getActualTypeArguments()[0]); }else{ Type[] types = method.getGenericParameterTypes(); Class[] params = method.getParameterTypes(); int i = 0; for(Class cls : params){ if(AsyncHandler.class.isAssignableFrom(cls)){ - return Navigator.REFLECTION.erasure(((ParameterizedType)types[i]).getActualTypeArguments()[0]); + return (Class) Utils.REFLECTION_NAVIGATOR.erasure(((ParameterizedType)types[i]).getActualTypeArguments()[0]); } i++; }