6658158: Mutable statics in SAAJ (findbugs)

6658163: txw2.DatatypeWriter.BUILDIN is a mutable static (findbugs)

Reviewed-by: darcy
This commit is contained in:
Tim Bell 2009-05-04 21:10:41 -07:00
parent 2fa719cdb7
commit 1f70f71621
38 changed files with 548 additions and 502 deletions

View File

@ -145,6 +145,7 @@ public interface JClassContainer {
* newly created Annotation Type Declaration * newly created Annotation Type Declaration
* @exception JClassAlreadyExistsException * @exception JClassAlreadyExistsException
* When the specified class/interface was already created. * When the specified class/interface was already created.
*/ */
public JDefinedClass _annotationTypeDeclaration(String name) throws JClassAlreadyExistsException; public JDefinedClass _annotationTypeDeclaration(String name) throws JClassAlreadyExistsException;
@ -156,6 +157,7 @@ public interface JClassContainer {
* newly created Enum * newly created Enum
* @exception JClassAlreadyExistsException * @exception JClassAlreadyExistsException
* When the specified class/interface was already created. * When the specified class/interface was already created.
*/ */
public JDefinedClass _enum (String name) throws JClassAlreadyExistsException; public JDefinedClass _enum (String name) throws JClassAlreadyExistsException;

View File

@ -428,6 +428,7 @@ public class JDefinedClass
* newly created Annotation Type Declaration * newly created Annotation Type Declaration
* @exception JClassAlreadyExistsException * @exception JClassAlreadyExistsException
* When the specified class/interface was already created. * When the specified class/interface was already created.
*/ */
public JDefinedClass _annotationTypeDeclaration(String name) throws JClassAlreadyExistsException { public JDefinedClass _annotationTypeDeclaration(String name) throws JClassAlreadyExistsException {
return _class (JMod.PUBLIC,name,ClassType.ANNOTATION_TYPE_DECL); return _class (JMod.PUBLIC,name,ClassType.ANNOTATION_TYPE_DECL);

View File

@ -33,17 +33,17 @@ package com.sun.codemodel.internal;
*/ */
public final class JForEach implements JStatement { public final class JForEach implements JStatement {
private final JType type; private final JType type;
private final String var; private final String var;
private JBlock body = null; // lazily created private JBlock body = null; // lazily created
private final JExpression collection; private final JExpression collection;
private final JVar loopVar; private final JVar loopVar;
public JForEach(JType vartype, String variable, JExpression collection) { public JForEach(JType vartype, String variable, JExpression collection) {
this.type = vartype; this.type = vartype;
this.var = variable; this.var = variable;
this.collection = collection; this.collection = collection;
loopVar = new JVar(JMods.forVar(JMod.NONE), type, var, collection); loopVar = new JVar(JMods.forVar(JMod.NONE), type, var, collection);
} }
@ -51,24 +51,24 @@ public final class JForEach implements JStatement {
/** /**
* Returns a reference to the loop variable. * Returns a reference to the loop variable.
*/ */
public JVar var() { public JVar var() {
return loopVar; return loopVar;
} }
public JBlock body() { public JBlock body() {
if (body == null) if (body == null)
body = new JBlock(); body = new JBlock();
return body; return body;
} }
public void state(JFormatter f) { public void state(JFormatter f) {
f.p("for ("); f.p("for (");
f.g(type).id(var).p(": ").g(collection); f.g(type).id(var).p(": ").g(collection);
f.p(')'); f.p(')');
if (body != null) if (body != null)
f.g(body).nl(); f.g(body).nl();
else else
f.p(';').nl(); f.p(';').nl();
} }
} }

View File

@ -38,49 +38,49 @@ import com.sun.codemodel.internal.util.ClassNameComparator;
*/ */
public class JMethod extends JGenerifiableImpl implements JDeclaration, JAnnotatable { public class JMethod extends JGenerifiableImpl implements JDeclaration, JAnnotatable {
/** /**
* Modifiers for this method * Modifiers for this method
*/ */
private JMods mods; private JMods mods;
/** /**
* Return type for this method * Return type for this method
*/ */
private JType type = null; private JType type = null;
/** /**
* Name of this method * Name of this method
*/ */
private String name = null; private String name = null;
/** /**
* List of parameters for this method's declaration * List of parameters for this method's declaration
*/ */
private final List<JVar> params = new ArrayList<JVar>(); private final List<JVar> params = new ArrayList<JVar>();
/** /**
* Set of exceptions that this method may throw. * Set of exceptions that this method may throw.
* A set instance lazily created. * A set instance lazily created.
*/ */
private Set<JClass> _throws; private Set<JClass> _throws;
/** /**
* JBlock of statements that makes up the body this method * JBlock of statements that makes up the body this method
*/ */
private JBlock body = null; private JBlock body = null;
private JDefinedClass outer; private JDefinedClass outer;
/** /**
* javadoc comments for this JMethod * javadoc comments for this JMethod
*/ */
private JDocComment jdoc = null; private JDocComment jdoc = null;
/** /**
* Variable parameter for this method's varargs declaration * Variable parameter for this method's varargs declaration
* introduced in J2SE 1.5 * introduced in J2SE 1.5
*/ */
private JVar varParam = null; private JVar varParam = null;
/** /**
* Annotations on this variable. Lazily created. * Annotations on this variable. Lazily created.
@ -88,9 +88,9 @@ public class JMethod extends JGenerifiableImpl implements JDeclaration, JAnnotat
private List<JAnnotationUse> annotations = null; private List<JAnnotationUse> annotations = null;
private boolean isConstructor() { private boolean isConstructor() {
return type == null; return type == null;
} }
/** To set the default value for the /** To set the default value for the
* annotation member * annotation member
@ -98,40 +98,40 @@ public class JMethod extends JGenerifiableImpl implements JDeclaration, JAnnotat
private JExpression defaultValue = null; private JExpression defaultValue = null;
/** /**
* JMethod constructor * JMethod constructor
* *
* @param mods * @param mods
* Modifiers for this method's declaration * Modifiers for this method's declaration
* *
* @param type * @param type
* Return type for the method * Return type for the method
* *
* @param name * @param name
* Name of this method * Name of this method
*/ */
JMethod(JDefinedClass outer, int mods, JType type, String name) { JMethod(JDefinedClass outer, int mods, JType type, String name) {
this.mods = JMods.forMethod(mods); this.mods = JMods.forMethod(mods);
this.type = type; this.type = type;
this.name = name; this.name = name;
this.outer = outer; this.outer = outer;
} }
/** /**
* Constructor constructor * Constructor constructor
* *
* @param mods * @param mods
* Modifiers for this constructor's declaration * Modifiers for this constructor's declaration
* *
* @param _class * @param _class
* JClass containing this constructor * JClass containing this constructor
*/ */
JMethod(int mods, JDefinedClass _class) { JMethod(int mods, JDefinedClass _class) {
this.mods = JMods.forMethod(mods); this.mods = JMods.forMethod(mods);
this.type = null; this.type = null;
this.name = _class.name(); this.name = _class.name();
this.outer = _class; this.outer = _class;
} }
private Set<JClass> getThrows() { private Set<JClass> getThrows() {
if(_throws==null) if(_throws==null)
@ -139,56 +139,56 @@ public class JMethod extends JGenerifiableImpl implements JDeclaration, JAnnotat
return _throws; return _throws;
} }
/** /**
* Add an exception to the list of exceptions that this * Add an exception to the list of exceptions that this
* method may throw. * method may throw.
* *
* @param exception * @param exception
* Name of an exception that this method may throw * Name of an exception that this method may throw
*/ */
public JMethod _throws(JClass exception) { public JMethod _throws(JClass exception) {
getThrows().add(exception); getThrows().add(exception);
return this; return this;
} }
public JMethod _throws(Class exception) { public JMethod _throws(Class exception) {
return _throws(outer.owner().ref(exception)); return _throws(outer.owner().ref(exception));
} }
/** /**
* Add the specified variable to the list of parameters * Add the specified variable to the list of parameters
* for this method signature. * for this method signature.
* *
* @param type * @param type
* JType of the parameter being added * JType of the parameter being added
* *
* @param name * @param name
* Name of the parameter being added * Name of the parameter being added
* *
* @return New parameter variable * @return New parameter variable
*/ */
public JVar param(int mods, JType type, String name) { public JVar param(int mods, JType type, String name) {
JVar v = new JVar(JMods.forVar(mods), type, name, null); JVar v = new JVar(JMods.forVar(mods), type, name, null);
params.add(v); params.add(v);
return v; return v;
} }
public JVar param(JType type, String name) { public JVar param(JType type, String name) {
return param(JMod.NONE, type, name); return param(JMod.NONE, type, name);
} }
public JVar param(int mods, Class type, String name) { public JVar param(int mods, Class type, String name) {
return param(mods, outer.owner()._ref(type), name); return param(mods, outer.owner()._ref(type), name);
} }
public JVar param(Class type, String name) { public JVar param(Class type, String name) {
return param(outer.owner()._ref(type), name); return param(outer.owner()._ref(type), name);
} }
/** /**
* @see #varParam(JType, String) * @see #varParam(JType, String)
*/ */
public JVar varParam(Class type, String name) { public JVar varParam(Class type, String name) {
return varParam(outer.owner()._ref(type),name); return varParam(outer.owner()._ref(type),name);
} }
@ -210,25 +210,25 @@ public class JMethod extends JGenerifiableImpl implements JDeclaration, JAnnotat
* method signature. * method signature.
*/ */
public JVar varParam(JType type, String name) { public JVar varParam(JType type, String name) {
if (!hasVarArgs()) { if (!hasVarArgs()) {
varParam = varParam =
new JVar( new JVar(
JMods.forVar(JMod.NONE), JMods.forVar(JMod.NONE),
type.array(), type.array(),
name, name,
null); null);
return varParam; return varParam;
} else { } else {
throw new IllegalStateException( throw new IllegalStateException(
"Cannot have two varargs in a method,\n" "Cannot have two varargs in a method,\n"
+ "Check if varParam method of JMethod is" + "Check if varParam method of JMethod is"
+ " invoked more than once"); + " invoked more than once");
}
} }
}
/** /**
* Adds an annotation to this variable. * Adds an annotation to this variable.
* @param clazz * @param clazz
@ -256,17 +256,17 @@ public class JMethod extends JGenerifiableImpl implements JDeclaration, JAnnotat
return TypedAnnotationWriter.create(clazz,this); return TypedAnnotationWriter.create(clazz,this);
} }
/** /**
* Check if there are any varargs declared * Check if there are any varargs declared
* for this method signature. * for this method signature.
*/ */
public boolean hasVarArgs() { public boolean hasVarArgs() {
return this.varParam!=null; return this.varParam!=null;
} }
public String name() { public String name() {
return name; return name;
} }
/** /**
* Changes the name of the method. * Changes the name of the method.
@ -276,11 +276,11 @@ public class JMethod extends JGenerifiableImpl implements JDeclaration, JAnnotat
} }
/** /**
* Returns the return type. * Returns the return type.
*/ */
public JType type() { public JType type() {
return type; return type;
} }
/** /**
* Overrides the return type. * Overrides the return type.
@ -290,72 +290,72 @@ public class JMethod extends JGenerifiableImpl implements JDeclaration, JAnnotat
} }
/** /**
* Returns all the parameter types in an array. * Returns all the parameter types in an array.
* @return * @return
* If there's no parameter, an empty array will be returned. * If there's no parameter, an empty array will be returned.
*/ */
public JType[] listParamTypes() { public JType[] listParamTypes() {
JType[] r = new JType[params.size()]; JType[] r = new JType[params.size()];
for (int i = 0; i < r.length; i++) for (int i = 0; i < r.length; i++)
r[i] = params.get(i).type(); r[i] = params.get(i).type();
return r; return r;
} }
/** /**
* Returns the varags parameter type. * Returns the varags parameter type.
* @return * @return
* If there's no vararg parameter type, null will be returned. * If there's no vararg parameter type, null will be returned.
*/ */
public JType listVarParamType() { public JType listVarParamType() {
if (varParam != null) if (varParam != null)
return varParam.type(); return varParam.type();
else else
return null; return null;
} }
/** /**
* Returns all the parameters in an array. * Returns all the parameters in an array.
* @return * @return
* If there's no parameter, an empty array will be returned. * If there's no parameter, an empty array will be returned.
*/ */
public JVar[] listParams() { public JVar[] listParams() {
return params.toArray(new JVar[params.size()]); return params.toArray(new JVar[params.size()]);
} }
/** /**
* Returns the variable parameter * Returns the variable parameter
* @return * @return
* If there's no parameter, null will be returned. * If there's no parameter, null will be returned.
*/ */
public JVar listVarParam() { public JVar listVarParam() {
return varParam; return varParam;
} }
/** /**
* Returns true if the method has the specified signature. * Returns true if the method has the specified signature.
*/ */
public boolean hasSignature(JType[] argTypes) { public boolean hasSignature(JType[] argTypes) {
JVar[] p = listParams(); JVar[] p = listParams();
if (p.length != argTypes.length) if (p.length != argTypes.length)
return false; return false;
for (int i = 0; i < p.length; i++) for (int i = 0; i < p.length; i++)
if (!p[i].type().equals(argTypes[i])) if (!p[i].type().equals(argTypes[i]))
return false; return false;
return true; return true;
} }
/** /**
* Get the block that makes up body of this method * Get the block that makes up body of this method
* *
* @return Body of method * @return Body of method
*/ */
public JBlock body() { public JBlock body() {
if (body == null) if (body == null)
body = new JBlock(); body = new JBlock();
return body; return body;
} }
/** /**
* Specify the default value for this annotation member * Specify the default value for this annotation member
@ -367,37 +367,37 @@ public class JMethod extends JGenerifiableImpl implements JDeclaration, JAnnotat
this.defaultValue = value; this.defaultValue = value;
} }
/** /**
* Creates, if necessary, and returns the class javadoc for this * Creates, if necessary, and returns the class javadoc for this
* JDefinedClass * JDefinedClass
* *
* @return JDocComment containing javadocs for this class * @return JDocComment containing javadocs for this class
*/ */
public JDocComment javadoc() { public JDocComment javadoc() {
if (jdoc == null) if (jdoc == null)
jdoc = new JDocComment(owner()); jdoc = new JDocComment(owner());
return jdoc; return jdoc;
} }
public void declare(JFormatter f) { public void declare(JFormatter f) {
if (jdoc != null) if (jdoc != null)
f.g(jdoc); f.g(jdoc);
if (annotations != null){ if (annotations != null){
for (JAnnotationUse a : annotations) for (JAnnotationUse a : annotations)
f.g(a).nl(); f.g(a).nl();
} }
// declare the generics parameters // declare the generics parameters
super.declare(f); super.declare(f);
f.g(mods); f.g(mods);
if (!isConstructor()) if (!isConstructor())
f.g(type); f.g(type);
f.id(name).p('(').i(); f.id(name).p('(').i();
// when parameters are printed in new lines, we want them to be indented. // when parameters are printed in new lines, we want them to be indented.
// there's a good chance no newlines happen, too, but just in case it does. // there's a good chance no newlines happen, too, but just in case it does.
boolean first = true; boolean first = true;
for (JVar var : params) { for (JVar var : params) {
if (!first) if (!first)
f.p(','); f.p(',');
@ -406,33 +406,33 @@ public class JMethod extends JGenerifiableImpl implements JDeclaration, JAnnotat
f.b(var); f.b(var);
first = false; first = false;
} }
if (hasVarArgs()) { if (hasVarArgs()) {
if (!first) if (!first)
f.p(','); f.p(',');
f.g(varParam.type().elementType()); f.g(varParam.type().elementType());
f.p("... "); f.p("... ");
f.id(varParam.name()); f.id(varParam.name());
} }
f.o().p(')'); f.o().p(')');
if (_throws!=null && !_throws.isEmpty()) { if (_throws!=null && !_throws.isEmpty()) {
f.nl().i().p("throws").g(_throws).nl().o(); f.nl().i().p("throws").g(_throws).nl().o();
} }
if (defaultValue != null) { if (defaultValue != null) {
f.p("default "); f.p("default ");
f.g(defaultValue); f.g(defaultValue);
} }
if (body != null) { if (body != null) {
f.s(body); f.s(body);
} else if ( } else if (
!outer.isInterface() && !outer.isAnnotationTypeDeclaration() && !mods.isAbstract() && !mods.isNative()) { !outer.isInterface() && !outer.isAnnotationTypeDeclaration() && !mods.isAbstract() && !mods.isNative()) {
// Print an empty body for non-native, non-abstract methods // Print an empty body for non-native, non-abstract methods
f.s(new JBlock()); f.s(new JBlock());
} else { } else {
f.p(';').nl(); f.p(';').nl();
}
} }
}
/** /**
* @return * @return
@ -447,10 +447,10 @@ public class JMethod extends JGenerifiableImpl implements JDeclaration, JAnnotat
* @deprecated use {@link #mods()} * @deprecated use {@link #mods()}
*/ */
public JMods getMods() { public JMods getMods() {
return mods; return mods;
} }
protected JCodeModel owner() { protected JCodeModel owner() {
return outer.owner(); return outer.owner();
} }
} }

View File

@ -41,17 +41,17 @@ public class JMods implements JGenerable {
= JMod.FINAL; = JMod.FINAL;
private static int FIELD private static int FIELD
= (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED = (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED
| JMod.STATIC | JMod.FINAL | JMod.STATIC | JMod.FINAL
| JMod.TRANSIENT | JMod.VOLATILE); | JMod.TRANSIENT | JMod.VOLATILE);
private static int METHOD private static int METHOD
= (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED | JMod.FINAL = (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED | JMod.FINAL
| JMod.ABSTRACT | JMod.STATIC | JMod.NATIVE | JMod.SYNCHRONIZED); | JMod.ABSTRACT | JMod.STATIC | JMod.NATIVE | JMod.SYNCHRONIZED);
private static int CLASS private static int CLASS
= (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED = (JMod.PUBLIC | JMod.PRIVATE | JMod.PROTECTED
| JMod.STATIC | JMod.FINAL | JMod.ABSTRACT ); | JMod.STATIC | JMod.FINAL | JMod.ABSTRACT );
private static int INTERFACE = JMod.PUBLIC; private static int INTERFACE = JMod.PUBLIC;

View File

@ -24,7 +24,7 @@
*/ */
/* /*
* @(#)SingleByteEncoder.java 1.14 03/01/23 * @(#)SingleByteEncoder.java 1.14 03/01/23
*/ */
package com.sun.codemodel.internal.util; package com.sun.codemodel.internal.util;
@ -51,109 +51,109 @@ abstract class SingleByteEncoder
private final Surrogate.Parser sgp = new Surrogate.Parser(); private final Surrogate.Parser sgp = new Surrogate.Parser();
protected SingleByteEncoder(Charset cs, protected SingleByteEncoder(Charset cs,
short[] index1, String index2, short[] index1, String index2,
int mask1, int mask2, int shift) int mask1, int mask2, int shift)
{ {
super(cs, 1.0f, 1.0f); super(cs, 1.0f, 1.0f);
this.index1 = index1; this.index1 = index1;
this.index2 = index2; this.index2 = index2;
this.mask1 = mask1; this.mask1 = mask1;
this.mask2 = mask2; this.mask2 = mask2;
this.shift = shift; this.shift = shift;
} }
public boolean canEncode(char c) { public boolean canEncode(char c) {
char testEncode; char testEncode;
testEncode = index2.charAt(index1[(c & mask1) >> shift] testEncode = index2.charAt(index1[(c & mask1) >> shift]
+ (c & mask2)); + (c & mask2));
if (testEncode == '\u0000') if (testEncode == '\u0000')
return false; return false;
else else
return true; return true;
} }
private CoderResult encodeArrayLoop(CharBuffer src, ByteBuffer dst) { private CoderResult encodeArrayLoop(CharBuffer src, ByteBuffer dst) {
char[] sa = src.array(); char[] sa = src.array();
int sp = src.arrayOffset() + src.position(); int sp = src.arrayOffset() + src.position();
int sl = src.arrayOffset() + src.limit(); int sl = src.arrayOffset() + src.limit();
sp = (sp <= sl ? sp : sl); sp = (sp <= sl ? sp : sl);
byte[] da = dst.array(); byte[] da = dst.array();
int dp = dst.arrayOffset() + dst.position(); int dp = dst.arrayOffset() + dst.position();
int dl = dst.arrayOffset() + dst.limit(); int dl = dst.arrayOffset() + dst.limit();
dp = (dp <= dl ? dp : dl); dp = (dp <= dl ? dp : dl);
try { try {
while (sp < sl) { while (sp < sl) {
char c = sa[sp]; char c = sa[sp];
if (Surrogate.is(c)) { if (Surrogate.is(c)) {
if (sgp.parse(c, sa, sp, sl) < 0) if (sgp.parse(c, sa, sp, sl) < 0)
return sgp.error(); return sgp.error();
return sgp.unmappableResult(); return sgp.unmappableResult();
} }
if (c >= '\uFFFE') if (c >= '\uFFFE')
return CoderResult.unmappableForLength(1); return CoderResult.unmappableForLength(1);
if (dl - dp < 1) if (dl - dp < 1)
return CoderResult.OVERFLOW; return CoderResult.OVERFLOW;
char e = index2.charAt(index1[(c & mask1) >> shift] char e = index2.charAt(index1[(c & mask1) >> shift]
+ (c & mask2)); + (c & mask2));
// If output byte is zero because input char is zero // If output byte is zero because input char is zero
// then character is mappable, o.w. fail // then character is mappable, o.w. fail
if (e == '\u0000' && c != '\u0000') if (e == '\u0000' && c != '\u0000')
return CoderResult.unmappableForLength(1); return CoderResult.unmappableForLength(1);
sp++; sp++;
da[dp++] = (byte)e; da[dp++] = (byte)e;
} }
return CoderResult.UNDERFLOW; return CoderResult.UNDERFLOW;
} finally { } finally {
src.position(sp - src.arrayOffset()); src.position(sp - src.arrayOffset());
dst.position(dp - dst.arrayOffset()); dst.position(dp - dst.arrayOffset());
} }
} }
private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) { private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) {
int mark = src.position(); int mark = src.position();
try { try {
while (src.hasRemaining()) { while (src.hasRemaining()) {
char c = src.get(); char c = src.get();
if (Surrogate.is(c)) { if (Surrogate.is(c)) {
if (sgp.parse(c, src) < 0) if (sgp.parse(c, src) < 0)
return sgp.error(); return sgp.error();
return sgp.unmappableResult(); return sgp.unmappableResult();
} }
if (c >= '\uFFFE') if (c >= '\uFFFE')
return CoderResult.unmappableForLength(1); return CoderResult.unmappableForLength(1);
if (!dst.hasRemaining()) if (!dst.hasRemaining())
return CoderResult.OVERFLOW; return CoderResult.OVERFLOW;
char e = index2.charAt(index1[(c & mask1) >> shift] char e = index2.charAt(index1[(c & mask1) >> shift]
+ (c & mask2)); + (c & mask2));
// If output byte is zero because input char is zero // If output byte is zero because input char is zero
// then character is mappable, o.w. fail // then character is mappable, o.w. fail
if (e == '\u0000' && c != '\u0000') if (e == '\u0000' && c != '\u0000')
return CoderResult.unmappableForLength(1); return CoderResult.unmappableForLength(1);
mark++; mark++;
dst.put((byte)e); dst.put((byte)e);
} }
return CoderResult.UNDERFLOW; return CoderResult.UNDERFLOW;
} finally { } finally {
src.position(mark); src.position(mark);
} }
} }
protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst) { protected CoderResult encodeLoop(CharBuffer src, ByteBuffer dst) {
if (true && src.hasArray() && dst.hasArray()) if (true && src.hasArray() && dst.hasArray())
return encodeArrayLoop(src, dst); return encodeArrayLoop(src, dst);
else else
return encodeBufferLoop(src, dst); return encodeBufferLoop(src, dst);
} }
public byte encode(char inputChar) { public byte encode(char inputChar) {
return (byte)index2.charAt(index1[(inputChar & mask1) >> shift] + return (byte)index2.charAt(index1[(inputChar & mask1) >> shift] +
(inputChar & mask2)); (inputChar & mask2));
} }
} }

View File

@ -112,7 +112,7 @@ class Surrogate {
public Parser() { } public Parser() { }
private int character; // UCS-4 private int character; // UCS-4
private CoderResult error = CoderResult.UNDERFLOW; private CoderResult error = CoderResult.UNDERFLOW;
private boolean isPair; private boolean isPair;

View File

@ -55,12 +55,19 @@ import com.sun.xml.internal.messaging.saaj.util.*;
*/ */
public class HttpSOAPConnection extends SOAPConnection { public class HttpSOAPConnection extends SOAPConnection {
protected static Logger log = public static final String vmVendor = System.getProperty("java.vendor.url");
private static final String sunVmVendor = "http://java.sun.com/";
private static final String ibmVmVendor = "http://www.ibm.com/";
private static final boolean isSunVM = sunVmVendor.equals(vmVendor) ? true: false;
private static final boolean isIBMVM = ibmVmVendor.equals(vmVendor) ? true : false;
private static final String JAXM_URLENDPOINT="javax.xml.messaging.URLEndpoint";
protected static final Logger log =
Logger.getLogger(LogDomainConstants.HTTP_CONN_DOMAIN, Logger.getLogger(LogDomainConstants.HTTP_CONN_DOMAIN,
"com.sun.xml.internal.messaging.saaj.client.p2p.LocalStrings"); "com.sun.xml.internal.messaging.saaj.client.p2p.LocalStrings");
public static String defaultProxyHost = null; public static final String defaultProxyHost = null;
public static int defaultProxyPort = -1; public static final int defaultProxyPort = -1;
MessageFactory messageFactory = null; MessageFactory messageFactory = null;
@ -72,6 +79,9 @@ public class HttpSOAPConnection extends SOAPConnection {
try { try {
messageFactory = MessageFactory.newInstance(SOAPConstants.DYNAMIC_SOAP_PROTOCOL); messageFactory = MessageFactory.newInstance(SOAPConstants.DYNAMIC_SOAP_PROTOCOL);
} catch (NoSuchMethodError ex) {
//fallback to default SOAP 1.1 in this case for backward compatibility
messageFactory = MessageFactory.newInstance();
} catch (Exception ex) { } catch (Exception ex) {
log.log(Level.SEVERE, "SAAJ0001.p2p.cannot.create.msg.factory", ex); log.log(Level.SEVERE, "SAAJ0001.p2p.cannot.create.msg.factory", ex);
throw new SOAPExceptionImpl("Unable to create message factory", ex); throw new SOAPExceptionImpl("Unable to create message factory", ex);
@ -96,13 +106,18 @@ public class HttpSOAPConnection extends SOAPConnection {
} }
Class urlEndpointClass = null; Class urlEndpointClass = null;
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try { try {
urlEndpointClass = Class.forName("javax.xml.messaging.URLEndpoint"); if (loader != null) {
} catch (Exception ex) { urlEndpointClass = loader.loadClass(JAXM_URLENDPOINT);
//Do nothing. URLEndpoint is available only when JAXM is there. } else {
log.finest("SAAJ0090.p2p.endpoint.available.only.for.JAXM"); urlEndpointClass = Class.forName(JAXM_URLENDPOINT);
} }
} catch (ClassNotFoundException ex) {
//Do nothing. URLEndpoint is available only when JAXM is there.
log.finest("SAAJ0090.p2p.endpoint.available.only.for.JAXM");
}
if (urlEndpointClass != null) { if (urlEndpointClass != null) {
if (urlEndpointClass.isInstance(endPoint)) { if (urlEndpointClass.isInstance(endPoint)) {
@ -639,10 +654,23 @@ public class HttpSOAPConnection extends SOAPConnection {
return ret; return ret;
} }
//private static String SSL_PKG = "com.sun.net.ssl.internal.www.protocol";
//private static String SSL_PROVIDER =
// "com.sun.net.ssl.internal.ssl.Provider";
private static final String SSL_PKG;
private static final String SSL_PROVIDER;
private static String SSL_PKG = "com.sun.net.ssl.internal.www.protocol";
private static String SSL_PROVIDER = static {
"com.sun.net.ssl.internal.ssl.Provider"; if (isIBMVM) {
SSL_PKG ="com.ibm.net.ssl.internal.www.protocol";
SSL_PROVIDER ="com.ibm.net.ssl.internal.ssl.Provider";
} else {
//if not IBM VM default to Sun.
SSL_PKG = "com.sun.net.ssl.internal.www.protocol";
SSL_PROVIDER ="com.sun.net.ssl.internal.ssl.Provider";
}
}
private void initHttps() { private void initHttps() {
//if(!setHttps) { //if(!setHttps) {
String pkgs = System.getProperty("java.protocol.handler.pkgs"); String pkgs = System.getProperty("java.protocol.handler.pkgs");

View File

@ -70,7 +70,7 @@ import javax.xml.soap.*;
*/ */
public class AttachmentPartImpl extends AttachmentPart { public class AttachmentPartImpl extends AttachmentPart {
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_DOMAIN, Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");

View File

@ -23,9 +23,9 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: EnvelopeFactory.java,v 1.24 2006/01/27 12:49:26 vj135062 Exp $ *
* $Revision: 1.24 $ *
* $Date: 2006/01/27 12:49:26 $ *
*/ */
@ -55,7 +55,7 @@ import com.sun.xml.internal.messaging.saaj.util.transform.EfficientStreamingTran
*/ */
public class EnvelopeFactory { public class EnvelopeFactory {
protected static Logger protected static final Logger
log = Logger.getLogger(LogDomainConstants.SOAP_DOMAIN, log = Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");

View File

@ -49,7 +49,7 @@ import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
public class ImageDataContentHandler extends Component public class ImageDataContentHandler extends Component
implements DataContentHandler { implements DataContentHandler {
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_DOMAIN, Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");

View File

@ -23,9 +23,9 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: MessageFactoryImpl.java,v 1.23 2006/01/27 12:49:27 vj135062 Exp $ *
* $Revision: 1.23 $ *
* $Date: 2006/01/27 12:49:27 $ *
*/ */
@ -54,15 +54,15 @@ import com.sun.xml.internal.messaging.saaj.util.TeeInputStream;
*/ */
public class MessageFactoryImpl extends MessageFactory { public class MessageFactoryImpl extends MessageFactory {
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_DOMAIN, Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");
protected static OutputStream listener; protected OutputStream listener;
protected boolean lazyAttachments = false; protected boolean lazyAttachments = false;
public static OutputStream listen(OutputStream newListener) { public OutputStream listen(OutputStream newListener) {
OutputStream oldListener = listener; OutputStream oldListener = listener;
listener = newListener; listener = newListener;
return oldListener; return oldListener;

View File

@ -23,9 +23,9 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: MessageImpl.java,v 1.5 2006/12/12 10:16:33 kumarjayanti Exp $ *
* $Revision: 1.5 $ *
* $Date: 2006/12/12 10:16:33 $ *
*/ */
@ -69,7 +69,7 @@ public abstract class MessageImpl
public static final String CONTENT_ID = "Content-ID"; public static final String CONTENT_ID = "Content-ID";
public static final String CONTENT_LOCATION = "Content-Location"; public static final String CONTENT_LOCATION = "Content-Location";
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_DOMAIN, Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");

View File

@ -37,7 +37,7 @@ import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
public class SAAJMetaFactoryImpl extends SAAJMetaFactory { public class SAAJMetaFactoryImpl extends SAAJMetaFactory {
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_DOMAIN, Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");

View File

@ -23,7 +23,7 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: SOAPDocumentImpl.java,v 1.15 2006/01/27 12:49:29 vj135062 Exp $ *
*/ */
@ -45,7 +45,7 @@ import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
public class SOAPDocumentImpl extends DocumentImpl implements SOAPDocument { public class SOAPDocumentImpl extends DocumentImpl implements SOAPDocument {
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_DOMAIN, Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");

View File

@ -23,9 +23,9 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: SOAPFactoryImpl.java,v 1.21 2006/01/27 12:49:29 vj135062 Exp $ *
* $Revision: 1.21 $ *
* $Date: 2006/01/27 12:49:29 $ *
*/ */
@ -50,7 +50,7 @@ import org.w3c.dom.Attr;
public abstract class SOAPFactoryImpl extends SOAPFactory { public abstract class SOAPFactoryImpl extends SOAPFactory {
protected static Logger protected static final Logger
log = Logger.getLogger(LogDomainConstants.SOAP_DOMAIN, log = Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");

View File

@ -23,9 +23,9 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: SOAPPartImpl.java,v 1.1.1.1 2006/01/27 13:10:55 kumarjayanti Exp $ *
* $Revision: 1.1.1.1 $ *
* $Date: 2006/01/27 13:10:55 $ *
*/ */
@ -59,7 +59,7 @@ import javax.xml.transform.sax.SAXSource;
* @author Anil Vijendran (anil@sun.com) * @author Anil Vijendran (anil@sun.com)
*/ */
public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument {
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_DOMAIN, Logger.getLogger(LogDomainConstants.SOAP_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.LocalStrings");

View File

@ -23,9 +23,9 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: CDATAImpl.java,v 1.19 2006/01/27 12:49:34 vj135062 Exp $ *
* $Revision: 1.19 $ *
* $Date: 2006/01/27 12:49:34 $ *
*/ */
@ -43,7 +43,7 @@ public class CDATAImpl
extends com.sun.org.apache.xerces.internal.dom.CDATASectionImpl extends com.sun.org.apache.xerces.internal.dom.CDATASectionImpl
implements javax.xml.soap.Text { implements javax.xml.soap.Text {
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN, Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings");

View File

@ -23,9 +23,9 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: CommentImpl.java,v 1.17 2006/01/27 12:49:34 vj135062 Exp $ *
* $Revision: 1.17 $ *
* $Date: 2006/01/27 12:49:34 $ *
*/ */
@ -47,7 +47,7 @@ public class CommentImpl
extends com.sun.org.apache.xerces.internal.dom.CommentImpl extends com.sun.org.apache.xerces.internal.dom.CommentImpl
implements javax.xml.soap.Text, org.w3c.dom.Comment { implements javax.xml.soap.Text, org.w3c.dom.Comment {
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN, Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings");
protected static ResourceBundle rb = protected static ResourceBundle rb =

View File

@ -23,9 +23,9 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: ElementImpl.java,v 1.6 2006/11/16 16:01:14 kumarjayanti Exp $ *
* $Revision: 1.6 $ *
* $Date: 2006/11/16 16:01:14 $ *
*/ */
@ -60,7 +60,7 @@ public class ElementImpl
protected QName elementQName; protected QName elementQName;
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN, Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings");

View File

@ -23,9 +23,9 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: TextImpl.java,v 1.19 2006/01/27 12:49:36 vj135062 Exp $ *
* $Revision: 1.19 $ *
* $Date: 2006/01/27 12:49:36 $ *
*/ */
@ -43,7 +43,7 @@ public class TextImpl
extends com.sun.org.apache.xerces.internal.dom.TextImpl extends com.sun.org.apache.xerces.internal.dom.TextImpl
implements javax.xml.soap.Text, org.w3c.dom.Text { implements javax.xml.soap.Text, org.w3c.dom.Text {
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN, Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings");

View File

@ -23,9 +23,9 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: NameImpl.java,v 1.48 2006/01/27 12:49:38 vj135062 Exp $ *
* $Revision: 1.48 $ *
* $Date: 2006/01/27 12:49:38 $ *
*/ */
@ -63,7 +63,7 @@ public class NameImpl implements Name {
protected String prefix = ""; protected String prefix = "";
private String qualifiedName = null; private String qualifiedName = null;
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.NAMING_DOMAIN, Logger.getLogger(LogDomainConstants.NAMING_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.name.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.name.LocalStrings");

View File

@ -23,7 +23,7 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: Fault1_1Impl.java,v 1.1.1.1 2006/01/27 13:10:57 kumarjayanti Exp $ *
*/ */
@ -57,7 +57,7 @@ import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl;
public class Fault1_1Impl extends FaultImpl { public class Fault1_1Impl extends FaultImpl {
protected static Logger log = protected static final Logger log =
Logger.getLogger( Logger.getLogger(
LogDomainConstants.SOAP_VER1_1_DOMAIN, LogDomainConstants.SOAP_VER1_1_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings");

View File

@ -23,7 +23,7 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: Header1_1Impl.java,v 1.29 2006/01/27 12:49:41 vj135062 Exp $ *
*/ */
@ -50,7 +50,7 @@ import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
public class Header1_1Impl extends HeaderImpl { public class Header1_1Impl extends HeaderImpl {
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_VER1_1_DOMAIN, Logger.getLogger(LogDomainConstants.SOAP_VER1_1_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings");

View File

@ -23,7 +23,7 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: HeaderElement1_1Impl.java,v 1.29 2006/01/27 12:49:41 vj135062 Exp $ *
*/ */
@ -49,7 +49,7 @@ import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
public class HeaderElement1_1Impl extends HeaderElementImpl { public class HeaderElement1_1Impl extends HeaderElementImpl {
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_VER1_1_DOMAIN, Logger.getLogger(LogDomainConstants.SOAP_VER1_1_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings");

View File

@ -23,7 +23,7 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: Message1_1Impl.java,v 1.24 2006/01/27 12:49:41 vj135062 Exp $ *
*/ */
@ -48,7 +48,7 @@ import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
public class Message1_1Impl extends MessageImpl implements SOAPConstants { public class Message1_1Impl extends MessageImpl implements SOAPConstants {
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_VER1_1_DOMAIN, Logger.getLogger(LogDomainConstants.SOAP_VER1_1_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings");

View File

@ -23,7 +23,7 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: SOAPPart1_1Impl.java,v 1.1.1.1 2006/01/27 13:10:57 kumarjayanti Exp $ *
*/ */
@ -48,7 +48,7 @@ import com.sun.xml.internal.messaging.saaj.util.XMLDeclarationParser;
public class SOAPPart1_1Impl extends SOAPPartImpl implements SOAPConstants { public class SOAPPart1_1Impl extends SOAPPartImpl implements SOAPConstants {
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.SOAP_VER1_1_DOMAIN, Logger.getLogger(LogDomainConstants.SOAP_VER1_1_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.ver1_1.LocalStrings");

View File

@ -23,7 +23,7 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: Body1_2Impl.java,v 1.32 2006/01/27 12:49:44 vj135062 Exp $ *
*/ */
@ -50,7 +50,7 @@ import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
public class Body1_2Impl extends BodyImpl { public class Body1_2Impl extends BodyImpl {
protected static Logger log = protected static final Logger log =
Logger.getLogger(Body1_2Impl.class.getName(), Logger.getLogger(Body1_2Impl.class.getName(),
"com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings");

View File

@ -23,7 +23,7 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: Detail1_2Impl.java,v 1.24 2006/01/27 12:49:45 vj135062 Exp $ *
*/ */
@ -47,7 +47,7 @@ import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
public class Detail1_2Impl extends DetailImpl { public class Detail1_2Impl extends DetailImpl {
protected static Logger log = protected static final Logger log =
Logger.getLogger(Detail1_2Impl.class.getName(), Logger.getLogger(Detail1_2Impl.class.getName(),
"com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings");

View File

@ -23,7 +23,7 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: Envelope1_2Impl.java,v 1.26 2006/01/27 12:49:47 vj135062 Exp $ *
*/ */
@ -47,7 +47,7 @@ import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
public class Envelope1_2Impl extends EnvelopeImpl { public class Envelope1_2Impl extends EnvelopeImpl {
protected static Logger log = protected static final Logger log =
Logger.getLogger(Envelope1_2Impl.class.getName(), Logger.getLogger(Envelope1_2Impl.class.getName(),
"com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings");

View File

@ -23,7 +23,7 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: Fault1_2Impl.java,v 1.1.1.1 2006/01/27 13:10:57 kumarjayanti Exp $ *
*/ */
@ -51,7 +51,7 @@ import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
public class Fault1_2Impl extends FaultImpl { public class Fault1_2Impl extends FaultImpl {
protected static Logger log = protected static final Logger log =
Logger.getLogger( Logger.getLogger(
LogDomainConstants.SOAP_VER1_2_DOMAIN, LogDomainConstants.SOAP_VER1_2_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings");

View File

@ -23,7 +23,7 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: Header1_2Impl.java,v 1.36 2006/01/27 12:49:48 vj135062 Exp $ *
*/ */
@ -53,7 +53,7 @@ import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants;
public class Header1_2Impl extends HeaderImpl { public class Header1_2Impl extends HeaderImpl {
protected static Logger log = protected static final Logger log =
Logger.getLogger( Logger.getLogger(
LogDomainConstants.SOAP_VER1_2_DOMAIN, LogDomainConstants.SOAP_VER1_2_DOMAIN,
"com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings");

View File

@ -23,7 +23,7 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: HeaderElement1_2Impl.java,v 1.29 2006/01/27 12:49:48 vj135062 Exp $ *
*/ */
@ -47,7 +47,7 @@ import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl;
public class HeaderElement1_2Impl extends HeaderElementImpl { public class HeaderElement1_2Impl extends HeaderElementImpl {
private static Logger log = private static final Logger log =
Logger.getLogger(HeaderElement1_2Impl.class.getName(), Logger.getLogger(HeaderElement1_2Impl.class.getName(),
"com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings");

View File

@ -23,7 +23,7 @@
* have any questions. * have any questions.
*/ */
/* /*
* $Id: SOAPPart1_2Impl.java,v 1.1.1.1 2006/01/27 13:10:57 kumarjayanti Exp $ *
*/ */
@ -47,7 +47,7 @@ import com.sun.xml.internal.messaging.saaj.util.XMLDeclarationParser;
public class SOAPPart1_2Impl extends SOAPPartImpl implements SOAPConstants{ public class SOAPPart1_2Impl extends SOAPPartImpl implements SOAPConstants{
protected static Logger log = protected static final Logger log =
Logger.getLogger(SOAPPart1_2Impl.class.getName(), Logger.getLogger(SOAPPart1_2Impl.class.getName(),
"com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings"); "com.sun.xml.internal.messaging.saaj.soap.ver1_2.LocalStrings");

View File

@ -45,12 +45,12 @@ import org.xml.sax.helpers.AttributesImpl;
* because they are not legal in SOAP. If the user of this class sets a * because they are not legal in SOAP. If the user of this class sets a
* LexicalHandler, then it forwards events to that handler. * LexicalHandler, then it forwards events to that handler.
* *
* $Id: RejectDoctypeSaxFilter.java,v 1.13 2006/01/27 12:49:52 vj135062 Exp $ *
* @author Edwin Goei * @author Edwin Goei
*/ */
public class RejectDoctypeSaxFilter extends XMLFilterImpl implements XMLReader, LexicalHandler{ public class RejectDoctypeSaxFilter extends XMLFilterImpl implements XMLReader, LexicalHandler{
protected static Logger log = protected static final Logger log =
Logger.getLogger(LogDomainConstants.UTIL_DOMAIN, Logger.getLogger(LogDomainConstants.UTIL_DOMAIN,
"com.sun.xml.internal.messaging.saaj.util.LocalStrings"); "com.sun.xml.internal.messaging.saaj.util.LocalStrings");

View File

@ -62,20 +62,22 @@ import com.sun.xml.internal.messaging.saaj.util.FastInfosetReflection;
public class EfficientStreamingTransformer public class EfficientStreamingTransformer
extends javax.xml.transform.Transformer { extends javax.xml.transform.Transformer {
static final String version; //static final String version;
static final String vendor; //static final String vendor;
protected static TransformerFactory transformerFactory = TransformerFactory.newInstance(); protected static final TransformerFactory transformerFactory = TransformerFactory.newInstance();
static { //removing support for Java 1.4 and 1.3 : CR6658158
version = System.getProperty("java.vm.version"); /*static {
vendor = System.getProperty("java.vm.vendor"); version = System.getProperty("java.vm.version");
if (vendor.startsWith("Sun") && vendor = System.getProperty("java.vm.vendor");
(version.startsWith("1.4") || version.startsWith("1.3"))) { if (vendor.startsWith("Sun") &&
transformerFactory = (version.startsWith("1.4") || version.startsWith("1.3"))) {
new com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl(); transformerFactory =
} new com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl();
} }
}
*/
/** /**
* TransformerFactory instance. * TransformerFactory instance.

View File

@ -25,6 +25,9 @@
package com.sun.xml.internal.txw2; package com.sun.xml.internal.txw2;
import java.util.AbstractList;
import java.util.Collections;
import java.util.List;
import javax.xml.namespace.QName; import javax.xml.namespace.QName;
/** /**
@ -53,50 +56,60 @@ public interface DatatypeWriter<DT> {
*/ */
void print(DT dt, NamespaceResolver resolver, StringBuilder buf); void print(DT dt, NamespaceResolver resolver, StringBuilder buf);
static final List<DatatypeWriter<?>> BUILTIN = Collections.unmodifiableList(new AbstractList() {
static final DatatypeWriter<?>[] BUILDIN = new DatatypeWriter<?>[] { private DatatypeWriter<?>[] BUILTIN_ARRAY = new DatatypeWriter<?>[] {
new DatatypeWriter<String>() { new DatatypeWriter<String>() {
public Class<String> getType() { public Class<String> getType() {
return String.class; return String.class;
} }
public void print(String s, NamespaceResolver resolver, StringBuilder buf) { public void print(String s, NamespaceResolver resolver, StringBuilder buf) {
buf.append(s); buf.append(s);
} }
}, },
new DatatypeWriter<Integer>() { new DatatypeWriter<Integer>() {
public Class<Integer> getType() { public Class<Integer> getType() {
return Integer.class; return Integer.class;
} }
public void print(Integer i, NamespaceResolver resolver, StringBuilder buf) { public void print(Integer i, NamespaceResolver resolver, StringBuilder buf) {
buf.append(i); buf.append(i);
} }
}, },
new DatatypeWriter<Float>() { new DatatypeWriter<Float>() {
public Class<Float> getType() { public Class<Float> getType() {
return Float.class; return Float.class;
} }
public void print(Float f, NamespaceResolver resolver, StringBuilder buf) { public void print(Float f, NamespaceResolver resolver, StringBuilder buf) {
buf.append(f); buf.append(f);
} }
}, },
new DatatypeWriter<Double>() { new DatatypeWriter<Double>() {
public Class<Double> getType() { public Class<Double> getType() {
return Double.class; return Double.class;
} }
public void print(Double d, NamespaceResolver resolver, StringBuilder buf) { public void print(Double d, NamespaceResolver resolver, StringBuilder buf) {
buf.append(d); buf.append(d);
} }
}, },
new DatatypeWriter<QName>() { new DatatypeWriter<QName>() {
public Class<QName> getType() { public Class<QName> getType() {
return QName.class; return QName.class;
} }
public void print(QName qn, NamespaceResolver resolver, StringBuilder buf) { public void print(QName qn, NamespaceResolver resolver, StringBuilder buf) {
String p = resolver.getPrefix(qn.getNamespaceURI()); String p = resolver.getPrefix(qn.getNamespaceURI());
if(p.length()!=0) if(p.length()!=0)
buf.append(p).append(':'); buf.append(p).append(':');
buf.append(qn.getLocalPart()); buf.append(qn.getLocalPart());
}
} }
};
public DatatypeWriter<?> get(int n) {
return BUILTIN_ARRAY[n];
} }
};
public int size() {
return BUILTIN_ARRAY.length;
}
});
} }

View File

@ -76,7 +76,7 @@ public final class Document {
Document(XmlSerializer out) { Document(XmlSerializer out) {
this.out = out; this.out = out;
for( DatatypeWriter dw : DatatypeWriter.BUILDIN ) for( DatatypeWriter dw : DatatypeWriter.BUILTIN )
datatypeWriters.put(dw.getType(),dw); datatypeWriters.put(dw.getType(),dw);
} }