diff --git a/.hgtags b/.hgtags
index 3f0316de8e5..a4213072502 100644
--- a/.hgtags
+++ b/.hgtags
@@ -155,3 +155,5 @@ e070119aa56ee4dc5506c19d2c4d2eecab8ad429 jdk8-b29
bac81e9f7d57b75fba5ab31b571f3fe0dc08af69 jdk8-b31
2c5208ccb863db936eab523f49450b3fcd230348 jdk8-b32
a6e6d42203e6d35f9e8b31eac25b0021b4dd58ad jdk8-b33
+0ae89825c75c9492e44efb3aca3d9ee3d8a209df jdk8-b34
+f151d5833912a82cd4f203944da0305c3be83ecc jdk8-b35
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index 91363f4c6ee..13d4a6d1f39 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -155,3 +155,5 @@ cc771d92284f71765eca14d6d08703c4af254c04 jdk8-b21
0b66f43b89a6c0ac1c15d7ec51992c541cdc9089 jdk8-b31
88176171e940f02916a312c265a34c32552a8376 jdk8-b32
42f275168fa5d9e7c70b246614dca8cf81f52c2e jdk8-b33
+894a478d2c4819a1a0f230bd7bdd09f3b2de9a8c jdk8-b34
+5285317ebb4e8e4f6d8d52b5616fa801e2ea844d jdk8-b35
diff --git a/corba/.hgtags b/corba/.hgtags
index e4f756fb9e2..c899f5d15ca 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -155,3 +155,5 @@ e45d6b406d5f91ff5256a5c82456ab1e7eb8becd jdk8-b25
1954151dfae8f73db24e396380f7c02bdd47c486 jdk8-b31
5d820cb6b1afd75b619e7fd69e4f2b0eb1d5d6a1 jdk8-b32
1e2ac1ea3f6c32a62bf88f3fa330120c30db59cb jdk8-b33
+e24c5cc8b0f7cc48374eef0f995838fb4823e0eb jdk8-b34
+e3d735914edd0a621b16bb85417423f8e6af5d51 jdk8-b35
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index 670f8c70f32..d8da4eb47f9 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -238,3 +238,6 @@ f4767e53d6e0d5da7e3f1775904076cce54247c1 hs24-b04
cd47da9383cd932cb2b659064057feafa2a91134 hs24-b06
785bcf415ead2eaa5f6677aaf528481008140bac jdk8-b33
7c6aba65acd2c334f1c3512b574f9038cddac24b hs24-b07
+f284b08835584517c1ca3dd67341f569e763841f jdk8-b34
+f621660a297baa48fab9dca28e99d318826e8304 jdk8-b35
+dff6e3459210f8dd0430b9b03ccc99280560da30 hs24-b08
diff --git a/hotspot/agent/src/os/linux/ps_core.c b/hotspot/agent/src/os/linux/ps_core.c
index 9739e161471..6c229da7b79 100644
--- a/hotspot/agent/src/os/linux/ps_core.c
+++ b/hotspot/agent/src/os/linux/ps_core.c
@@ -440,7 +440,7 @@ static bool sort_map_array(struct ps_prochandle* ph) {
int j = 0;
print_debug("---- sorted virtual address map ----\n");
for (j = 0; j < ph->core->num_maps; j++) {
- print_debug("base = 0x%lx\tsize = %d\n", ph->core->map_array[j]->vaddr,
+ print_debug("base = 0x%lx\tsize = %zd\n", ph->core->map_array[j]->vaddr,
ph->core->map_array[j]->memsz);
}
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSeq.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSeq.java
index d0da28bdd8a..5bd7f443de6 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSeq.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSeq.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, 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,7 @@ import sun.jvm.hotspot.types.TypeDataBase;
public class HeapRegionSeq extends VMObject {
// HeapRegion** _regions;
static private AddressField regionsField;
- // size_t _length;
+ // uint _length;
static private CIntegerField lengthField;
static {
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSetBase.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSetBase.java
index 2fbdce7f06c..4ac8f72c25f 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSetBase.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc_implementation/g1/HeapRegionSetBase.java
@@ -40,9 +40,9 @@ import sun.jvm.hotspot.types.TypeDataBase;
// Mirror class for HeapRegionSetBase. Represents a group of regions.
public class HeapRegionSetBase extends VMObject {
- // size_t _length;
+ // uint _length;
static private CIntegerField lengthField;
- // size_t _region_num;
+ // uint _region_num;
static private CIntegerField regionNumField;
// size_t _total_used_bytes;
static private CIntegerField totalUsedBytesField;
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java
index 4cbc1447ea9..a7d7d4ee768 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -889,15 +889,9 @@ public class VirtualMachineImpl extends MirrorImpl implements PathSearchingVirtu
Klass kls = ((ReferenceTypeImpl)type).ref();
if (kls instanceof InstanceKlass) {
InstanceKlass ik = (InstanceKlass) kls;
- if (ik.isInterface()) {
- if (ik.nofImplementors() == 0L) {
- return new ArrayList(0);
- }
- } else {
- // if the Klass is final or if there are no subklasses loaded yet
- if (ik.getAccessFlagsObj().isFinal() || ik.getSubklassKlass() == null) {
- includeSubtypes = false;
- }
+ // if the Klass is final or if there are no subklasses loaded yet
+ if (ik.getAccessFlagsObj().isFinal() || ik.getSubklassKlass() == null) {
+ includeSubtypes = false;
}
} else {
// no subtypes for primitive array types
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
index d75d890485c..f342eb72882 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, 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
@@ -52,7 +52,6 @@ public class InstanceKlass extends Klass {
private static int HIGH_OFFSET;
private static int GENERIC_SIGNATURE_INDEX_OFFSET;
private static int FIELD_SLOTS;
- public static int IMPLEMENTORS_LIMIT;
// ClassState constants
private static int CLASS_STATE_UNPARSABLE_BY_GC;
@@ -70,13 +69,6 @@ public class InstanceKlass extends Klass {
methodOrdering = new OopField(type.getOopField("_method_ordering"), Oop.getHeaderSize());
localInterfaces = new OopField(type.getOopField("_local_interfaces"), Oop.getHeaderSize());
transitiveInterfaces = new OopField(type.getOopField("_transitive_interfaces"), Oop.getHeaderSize());
- nofImplementors = new CIntField(type.getCIntegerField("_nof_implementors"), Oop.getHeaderSize());
- IMPLEMENTORS_LIMIT = db.lookupIntConstant("instanceKlass::implementors_limit").intValue();
- implementors = new OopField[IMPLEMENTORS_LIMIT];
- for (int i = 0; i < IMPLEMENTORS_LIMIT; i++) {
- long arrayOffset = Oop.getHeaderSize() + (i * db.getAddressSize());
- implementors[i] = new OopField(type.getOopField("_implementors[0]"), arrayOffset);
- }
fields = new OopField(type.getOopField("_fields"), Oop.getHeaderSize());
javaFieldsCount = new CIntField(type.getCIntegerField("_java_fields_count"), Oop.getHeaderSize());
constants = new OopField(type.getOopField("_constants"), Oop.getHeaderSize());
@@ -136,8 +128,6 @@ public class InstanceKlass extends Klass {
private static OopField methodOrdering;
private static OopField localInterfaces;
private static OopField transitiveInterfaces;
- private static CIntField nofImplementors;
- private static OopField[] implementors;
private static OopField fields;
private static CIntField javaFieldsCount;
private static OopField constants;
@@ -317,9 +307,6 @@ public class InstanceKlass extends Klass {
public TypeArray getMethodOrdering() { return (TypeArray) methodOrdering.getValue(this); }
public ObjArray getLocalInterfaces() { return (ObjArray) localInterfaces.getValue(this); }
public ObjArray getTransitiveInterfaces() { return (ObjArray) transitiveInterfaces.getValue(this); }
- public long nofImplementors() { return nofImplementors.getValue(this); }
- public Klass getImplementor() { return (Klass) implementors[0].getValue(this); }
- public Klass getImplementor(int i) { return (Klass) implementors[i].getValue(this); }
public TypeArray getFields() { return (TypeArray) fields.getValue(this); }
public int getJavaFieldsCount() { return (int) javaFieldsCount.getValue(this); }
public int getAllFieldsCount() { return (int)getFields().getLength() / FIELD_SLOTS; }
@@ -527,9 +514,6 @@ public class InstanceKlass extends Klass {
visitor.doOop(methodOrdering, true);
visitor.doOop(localInterfaces, true);
visitor.doOop(transitiveInterfaces, true);
- visitor.doCInt(nofImplementors, true);
- for (int i = 0; i < IMPLEMENTORS_LIMIT; i++)
- visitor.doOop(implementors[i], true);
visitor.doOop(fields, true);
visitor.doOop(constants, true);
visitor.doOop(classLoader, true);
diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version
index 27ff9dd9a6a..00601747489 100644
--- a/hotspot/make/hotspot_version
+++ b/hotspot/make/hotspot_version
@@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2011
HS_MAJOR_VER=24
HS_MINOR_VER=0
-HS_BUILD_NUMBER=07
+HS_BUILD_NUMBER=08
JDK_MAJOR_VER=1
JDK_MINOR_VER=8
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
index 1cbc67e6060..6a5fb90c050 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
@@ -2651,56 +2651,49 @@ void TemplateTable::jvmti_post_fast_field_mod() {
// Check to see if a field modification watch has been set before we take
// the time to call into the VM.
Label L2;
- __ mov32(rcx, ExternalAddress((address)JvmtiExport::get_field_modification_count_addr()));
- __ testl(rcx,rcx);
- __ jcc(Assembler::zero, L2);
- __ pop_ptr(rbx); // copy the object pointer from tos
- __ verify_oop(rbx);
- __ push_ptr(rbx); // put the object pointer back on tos
- __ subptr(rsp, sizeof(jvalue)); // add space for a jvalue object
- __ mov(rcx, rsp);
- __ push_ptr(rbx); // save object pointer so we can steal rbx,
- __ xorptr(rbx, rbx);
- const Address lo_value(rcx, rbx, Address::times_1, 0*wordSize);
- const Address hi_value(rcx, rbx, Address::times_1, 1*wordSize);
- switch (bytecode()) { // load values into the jvalue object
- case Bytecodes::_fast_bputfield: __ movb(lo_value, rax); break;
- case Bytecodes::_fast_sputfield: __ movw(lo_value, rax); break;
- case Bytecodes::_fast_cputfield: __ movw(lo_value, rax); break;
- case Bytecodes::_fast_iputfield: __ movl(lo_value, rax); break;
- case Bytecodes::_fast_lputfield:
- NOT_LP64(__ movptr(hi_value, rdx));
- __ movptr(lo_value, rax);
- break;
+ __ mov32(rcx, ExternalAddress((address)JvmtiExport::get_field_modification_count_addr()));
+ __ testl(rcx,rcx);
+ __ jcc(Assembler::zero, L2);
+ __ pop_ptr(rbx); // copy the object pointer from tos
+ __ verify_oop(rbx);
+ __ push_ptr(rbx); // put the object pointer back on tos
- // need to call fld_s() after fstp_s() to restore the value for below
- case Bytecodes::_fast_fputfield: __ fstp_s(lo_value); __ fld_s(lo_value); break;
+ // Save tos values before call_VM() clobbers them. Since we have
+ // to do it for every data type, we use the saved values as the
+ // jvalue object.
+ switch (bytecode()) { // load values into the jvalue object
+ case Bytecodes::_fast_aputfield: __ push_ptr(rax); break;
+ case Bytecodes::_fast_bputfield: // fall through
+ case Bytecodes::_fast_sputfield: // fall through
+ case Bytecodes::_fast_cputfield: // fall through
+ case Bytecodes::_fast_iputfield: __ push_i(rax); break;
+ case Bytecodes::_fast_dputfield: __ push_d(); break;
+ case Bytecodes::_fast_fputfield: __ push_f(); break;
+ case Bytecodes::_fast_lputfield: __ push_l(rax); break;
- // need to call fld_d() after fstp_d() to restore the value for below
- case Bytecodes::_fast_dputfield: __ fstp_d(lo_value); __ fld_d(lo_value); break;
+ default:
+ ShouldNotReachHere();
+ }
+ __ mov(rcx, rsp); // points to jvalue on the stack
+ // access constant pool cache entry
+ __ get_cache_entry_pointer_at_bcp(rax, rdx, 1);
+ __ verify_oop(rbx);
+ // rbx,: object pointer copied above
+ // rax,: cache entry pointer
+ // rcx: jvalue object on the stack
+ __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_modification), rbx, rax, rcx);
- // since rcx is not an object we don't call store_check() here
- case Bytecodes::_fast_aputfield: __ movptr(lo_value, rax); break;
-
- default: ShouldNotReachHere();
- }
- __ pop_ptr(rbx); // restore copy of object pointer
-
- // Save rax, and sometimes rdx because call_VM() will clobber them,
- // then use them for JVM/DI purposes
- __ push(rax);
- if (bytecode() == Bytecodes::_fast_lputfield) __ push(rdx);
- // access constant pool cache entry
- __ get_cache_entry_pointer_at_bcp(rax, rdx, 1);
- __ verify_oop(rbx);
- // rbx,: object pointer copied above
- // rax,: cache entry pointer
- // rcx: jvalue object on the stack
- __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_field_modification), rbx, rax, rcx);
- if (bytecode() == Bytecodes::_fast_lputfield) __ pop(rdx); // restore high value
- __ pop(rax); // restore lower value
- __ addptr(rsp, sizeof(jvalue)); // release jvalue object space
- __ bind(L2);
+ switch (bytecode()) { // restore tos values
+ case Bytecodes::_fast_aputfield: __ pop_ptr(rax); break;
+ case Bytecodes::_fast_bputfield: // fall through
+ case Bytecodes::_fast_sputfield: // fall through
+ case Bytecodes::_fast_cputfield: // fall through
+ case Bytecodes::_fast_iputfield: __ pop_i(rax); break;
+ case Bytecodes::_fast_dputfield: __ pop_d(); break;
+ case Bytecodes::_fast_fputfield: __ pop_f(); break;
+ case Bytecodes::_fast_lputfield: __ pop_l(rax); break;
+ }
+ __ bind(L2);
}
}
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
index 0e5ac274f36..6bb302f2992 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
@@ -2685,26 +2685,23 @@ void TemplateTable::jvmti_post_fast_field_mod() {
__ pop_ptr(rbx); // copy the object pointer from tos
__ verify_oop(rbx);
__ push_ptr(rbx); // put the object pointer back on tos
- __ subptr(rsp, sizeof(jvalue)); // add space for a jvalue object
- __ mov(c_rarg3, rsp);
- const Address field(c_rarg3, 0);
-
+ // Save tos values before call_VM() clobbers them. Since we have
+ // to do it for every data type, we use the saved values as the
+ // jvalue object.
switch (bytecode()) { // load values into the jvalue object
- case Bytecodes::_fast_aputfield: __ movq(field, rax); break;
- case Bytecodes::_fast_lputfield: __ movq(field, rax); break;
- case Bytecodes::_fast_iputfield: __ movl(field, rax); break;
- case Bytecodes::_fast_bputfield: __ movb(field, rax); break;
+ case Bytecodes::_fast_aputfield: __ push_ptr(rax); break;
+ case Bytecodes::_fast_bputfield: // fall through
case Bytecodes::_fast_sputfield: // fall through
- case Bytecodes::_fast_cputfield: __ movw(field, rax); break;
- case Bytecodes::_fast_fputfield: __ movflt(field, xmm0); break;
- case Bytecodes::_fast_dputfield: __ movdbl(field, xmm0); break;
+ case Bytecodes::_fast_cputfield: // fall through
+ case Bytecodes::_fast_iputfield: __ push_i(rax); break;
+ case Bytecodes::_fast_dputfield: __ push_d(); break;
+ case Bytecodes::_fast_fputfield: __ push_f(); break;
+ case Bytecodes::_fast_lputfield: __ push_l(rax); break;
+
default:
ShouldNotReachHere();
}
-
- // Save rax because call_VM() will clobber it, then use it for
- // JVMTI purposes
- __ push(rax);
+ __ mov(c_rarg3, rsp); // points to jvalue on the stack
// access constant pool cache entry
__ get_cache_entry_pointer_at_bcp(c_rarg2, rax, 1);
__ verify_oop(rbx);
@@ -2715,8 +2712,17 @@ void TemplateTable::jvmti_post_fast_field_mod() {
CAST_FROM_FN_PTR(address,
InterpreterRuntime::post_field_modification),
rbx, c_rarg2, c_rarg3);
- __ pop(rax); // restore lower value
- __ addptr(rsp, sizeof(jvalue)); // release jvalue object space
+
+ switch (bytecode()) { // restore tos values
+ case Bytecodes::_fast_aputfield: __ pop_ptr(rax); break;
+ case Bytecodes::_fast_bputfield: // fall through
+ case Bytecodes::_fast_sputfield: // fall through
+ case Bytecodes::_fast_cputfield: // fall through
+ case Bytecodes::_fast_iputfield: __ pop_i(rax); break;
+ case Bytecodes::_fast_dputfield: __ pop_d(); break;
+ case Bytecodes::_fast_fputfield: __ pop_f(); break;
+ case Bytecodes::_fast_lputfield: __ pop_l(rax); break;
+ }
__ bind(L2);
}
}
diff --git a/hotspot/src/os/bsd/vm/osThread_bsd.hpp b/hotspot/src/os/bsd/vm/osThread_bsd.hpp
index 0e60cc3eefd..914a0439c02 100644
--- a/hotspot/src/os/bsd/vm/osThread_bsd.hpp
+++ b/hotspot/src/os/bsd/vm/osThread_bsd.hpp
@@ -72,15 +72,18 @@
#ifdef _ALLBSD_SOURCE
#ifdef __APPLE__
+ static size_t thread_id_size() { return sizeof(thread_t); }
thread_t thread_id() const {
return _thread_id;
}
#else
+ static size_t thread_id_size() { return sizeof(pthread_t); }
pthread_t thread_id() const {
return _thread_id;
}
#endif
#else
+ static size_t thread_id_size() { return sizeof(pid_t); }
pid_t thread_id() const {
return _thread_id;
}
diff --git a/hotspot/src/os/linux/vm/osThread_linux.hpp b/hotspot/src/os/linux/vm/osThread_linux.hpp
index 22945135b78..fe9fe6188fa 100644
--- a/hotspot/src/os/linux/vm/osThread_linux.hpp
+++ b/hotspot/src/os/linux/vm/osThread_linux.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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,6 +56,8 @@
sigset_t caller_sigmask() const { return _caller_sigmask; }
void set_caller_sigmask(sigset_t sigmask) { _caller_sigmask = sigmask; }
+ static size_t thread_id_size() { return sizeof(pid_t); }
+
pid_t thread_id() const {
return _thread_id;
}
diff --git a/hotspot/src/os/solaris/vm/osThread_solaris.hpp b/hotspot/src/os/solaris/vm/osThread_solaris.hpp
index 7fe1417e342..6e79e1855db 100644
--- a/hotspot/src/os/solaris/vm/osThread_solaris.hpp
+++ b/hotspot/src/os/solaris/vm/osThread_solaris.hpp
@@ -36,6 +36,7 @@
bool _vm_created_thread; // true if the VM created this thread,
// false if primary thread or attached thread
public:
+ static size_t thread_id_size() { return sizeof(thread_t); }
thread_t thread_id() const { return _thread_id; }
uint lwp_id() const { return _lwp_id; }
int native_priority() const { return _native_priority; }
diff --git a/hotspot/src/os/windows/vm/osThread_windows.hpp b/hotspot/src/os/windows/vm/osThread_windows.hpp
index 1df8925c7a7..28cd45c5c2f 100644
--- a/hotspot/src/os/windows/vm/osThread_windows.hpp
+++ b/hotspot/src/os/windows/vm/osThread_windows.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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,6 +42,8 @@ typedef void* HANDLE;
HANDLE interrupt_event() const { return _interrupt_event; }
void set_interrupt_event(HANDLE interrupt_event) { _interrupt_event = interrupt_event; }
+
+ static size_t thread_id_size() { return sizeof(unsigned long); }
unsigned long thread_id() const { return _thread_id; }
#ifndef PRODUCT
// Used for debugging, return a unique integer for each thread.
diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
index b4659d97261..c11a2a2c177 100644
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
@@ -1694,7 +1694,9 @@ void GraphBuilder::invoke(Bytecodes::Code code) {
// they are roughly equivalent to Object.
ciInstanceKlass* singleton = NULL;
if (target->holder()->nof_implementors() == 1) {
- singleton = target->holder()->implementor(0);
+ singleton = target->holder()->implementor();
+ assert(singleton != NULL && singleton != target->holder(),
+ "just checking");
assert(holder->is_interface(), "invokeinterface to non interface?");
ciInstanceKlass* decl_interface = (ciInstanceKlass*)holder;
@@ -3130,10 +3132,23 @@ bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) {
bool cantrap = true;
vmIntrinsics::ID id = callee->intrinsic_id();
switch (id) {
- case vmIntrinsics::_arraycopy :
+ case vmIntrinsics::_arraycopy:
if (!InlineArrayCopy) return false;
break;
+#ifdef TRACE_HAVE_INTRINSICS
+ case vmIntrinsics::_classID:
+ case vmIntrinsics::_threadID:
+ preserves_state = true;
+ cantrap = true;
+ break;
+
+ case vmIntrinsics::_counterTime:
+ preserves_state = true;
+ cantrap = false;
+ break;
+#endif
+
case vmIntrinsics::_currentTimeMillis:
case vmIntrinsics::_nanoTime:
preserves_state = true;
diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
index 3c7f305222a..6ed6edf47c3 100644
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
@@ -2879,6 +2879,50 @@ void LIRGenerator::do_IfOp(IfOp* x) {
__ cmove(lir_cond(x->cond()), t_val.result(), f_val.result(), reg, as_BasicType(x->x()->type()));
}
+void LIRGenerator::do_RuntimeCall(address routine, int expected_arguments, Intrinsic* x) {
+ assert(x->number_of_arguments() == expected_arguments, "wrong type");
+ LIR_Opr reg = result_register_for(x->type());
+ __ call_runtime_leaf(routine, getThreadTemp(),
+ reg, new LIR_OprList());
+ LIR_Opr result = rlock_result(x);
+ __ move(reg, result);
+}
+
+#ifdef TRACE_HAVE_INTRINSICS
+void LIRGenerator::do_ThreadIDIntrinsic(Intrinsic* x) {
+ LIR_Opr thread = getThreadPointer();
+ LIR_Opr osthread = new_pointer_register();
+ __ move(new LIR_Address(thread, in_bytes(JavaThread::osthread_offset()), osthread->type()), osthread);
+ size_t thread_id_size = OSThread::thread_id_size();
+ if (thread_id_size == (size_t) BytesPerLong) {
+ LIR_Opr id = new_register(T_LONG);
+ __ move(new LIR_Address(osthread, in_bytes(OSThread::thread_id_offset()), T_LONG), id);
+ __ convert(Bytecodes::_l2i, id, rlock_result(x));
+ } else if (thread_id_size == (size_t) BytesPerInt) {
+ __ move(new LIR_Address(osthread, in_bytes(OSThread::thread_id_offset()), T_INT), rlock_result(x));
+ } else {
+ ShouldNotReachHere();
+ }
+}
+
+void LIRGenerator::do_ClassIDIntrinsic(Intrinsic* x) {
+ CodeEmitInfo* info = state_for(x);
+ CodeEmitInfo* info2 = new CodeEmitInfo(info); // Clone for the second null check
+ assert(info != NULL, "must have info");
+ LIRItem arg(x->argument_at(1), this);
+ arg.load_item();
+ LIR_Opr klass = new_register(T_OBJECT);
+ __ move(new LIR_Address(arg.result(), java_lang_Class::klass_offset_in_bytes(), T_OBJECT), klass, info);
+ LIR_Opr id = new_register(T_LONG);
+ ByteSize offset = TRACE_ID_OFFSET;
+ LIR_Address* trace_id_addr = new LIR_Address(klass, in_bytes(offset), T_LONG);
+ __ move(trace_id_addr, id);
+ __ logical_or(id, LIR_OprFact::longConst(0x01l), id);
+ __ store(id, trace_id_addr);
+ __ logical_and(id, LIR_OprFact::longConst(~0x3l), id);
+ __ move(id, rlock_result(x));
+}
+#endif
void LIRGenerator::do_Intrinsic(Intrinsic* x) {
switch (x->id()) {
@@ -2890,25 +2934,21 @@ void LIRGenerator::do_Intrinsic(Intrinsic* x) {
break;
}
- case vmIntrinsics::_currentTimeMillis: {
- assert(x->number_of_arguments() == 0, "wrong type");
- LIR_Opr reg = result_register_for(x->type());
- __ call_runtime_leaf(CAST_FROM_FN_PTR(address, os::javaTimeMillis), getThreadTemp(),
- reg, new LIR_OprList());
- LIR_Opr result = rlock_result(x);
- __ move(reg, result);
+#ifdef TRACE_HAVE_INTRINSICS
+ case vmIntrinsics::_threadID: do_ThreadIDIntrinsic(x); break;
+ case vmIntrinsics::_classID: do_ClassIDIntrinsic(x); break;
+ case vmIntrinsics::_counterTime:
+ do_RuntimeCall(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), 0, x);
break;
- }
+#endif
- case vmIntrinsics::_nanoTime: {
- assert(x->number_of_arguments() == 0, "wrong type");
- LIR_Opr reg = result_register_for(x->type());
- __ call_runtime_leaf(CAST_FROM_FN_PTR(address, os::javaTimeNanos), getThreadTemp(),
- reg, new LIR_OprList());
- LIR_Opr result = rlock_result(x);
- __ move(reg, result);
+ case vmIntrinsics::_currentTimeMillis:
+ do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeMillis), 0, x);
+ break;
+
+ case vmIntrinsics::_nanoTime:
+ do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeNanos), 0, x);
break;
- }
case vmIntrinsics::_Object_init: do_RegisterFinalizer(x); break;
case vmIntrinsics::_getClass: do_getClass(x); break;
diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp
index 56b28e4eb8e..67127df04d8 100644
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
@@ -426,6 +426,12 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
SwitchRangeArray* create_lookup_ranges(LookupSwitch* x);
void do_SwitchRanges(SwitchRangeArray* x, LIR_Opr value, BlockBegin* default_sux);
+ void do_RuntimeCall(address routine, int expected_arguments, Intrinsic* x);
+#ifdef TRACE_HAVE_INTRINSICS
+ void do_ThreadIDIntrinsic(Intrinsic* x);
+ void do_ClassIDIntrinsic(Intrinsic* x);
+#endif
+
public:
Compilation* compilation() const { return _compilation; }
FrameMap* frame_map() const { return _compilation->frame_map(); }
diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp
index 765dec48098..47703492d1e 100644
--- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp
+++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp
@@ -295,6 +295,9 @@ const char* Runtime1::name_for_address(address entry) {
FUNCTION_CASE(entry, SharedRuntime::dtrace_method_entry);
FUNCTION_CASE(entry, SharedRuntime::dtrace_method_exit);
FUNCTION_CASE(entry, trace_block_entry);
+#ifdef TRACE_HAVE_INTRINSICS
+ FUNCTION_CASE(entry, TRACE_TIME_METHOD);
+#endif
#undef FUNCTION_CASE
diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp
index b7c2ab75850..be730a00ce9 100644
--- a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp
+++ b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -59,10 +59,7 @@ ciInstanceKlass::ciInstanceKlass(KlassHandle h_k) :
_has_nonstatic_fields = ik->has_nonstatic_fields();
_nonstatic_fields = NULL; // initialized lazily by compute_nonstatic_fields:
- _nof_implementors = ik->nof_implementors();
- for (int i = 0; i < implementors_limit; i++) {
- _implementors[i] = NULL; // we will fill these lazily
- }
+ _implementor = NULL; // we will fill these lazily
Thread *thread = Thread::current();
if (ciObjectFactory::is_initialized()) {
@@ -102,7 +99,6 @@ ciInstanceKlass::ciInstanceKlass(ciSymbol* name,
_nonstatic_field_size = -1;
_has_nonstatic_fields = false;
_nonstatic_fields = NULL;
- _nof_implementors = -1;
_loader = loader;
_protection_domain = protection_domain;
_is_shared = false;
@@ -132,17 +128,6 @@ bool ciInstanceKlass::compute_shared_has_subklass() {
)
}
-// ------------------------------------------------------------------
-// ciInstanceKlass::compute_shared_nof_implementors
-int ciInstanceKlass::compute_shared_nof_implementors() {
- // We requery this property, since it is a very old ciObject.
- GUARDED_VM_ENTRY(
- instanceKlass* ik = get_instanceKlass();
- _nof_implementors = ik->nof_implementors();
- return _nof_implementors;
- )
-}
-
// ------------------------------------------------------------------
// ciInstanceKlass::loader
oop ciInstanceKlass::loader() {
@@ -540,7 +525,7 @@ bool ciInstanceKlass::is_leaf_type() {
if (is_shared()) {
return is_final(); // approximately correct
} else {
- return !_has_subklass && (_nof_implementors == 0);
+ return !_has_subklass && (nof_implementors() == 0);
}
}
@@ -548,35 +533,31 @@ bool ciInstanceKlass::is_leaf_type() {
// ciInstanceKlass::implementor
//
// Report an implementor of this interface.
-// Returns NULL if exact information is not available.
// Note that there are various races here, since my copy
// of _nof_implementors might be out of date with respect
// to results returned by instanceKlass::implementor.
// This is OK, since any dependencies we decide to assert
// will be checked later under the Compile_lock.
-ciInstanceKlass* ciInstanceKlass::implementor(int n) {
- if (n >= implementors_limit) {
- return NULL;
- }
- ciInstanceKlass* impl = _implementors[n];
+ciInstanceKlass* ciInstanceKlass::implementor() {
+ ciInstanceKlass* impl = _implementor;
if (impl == NULL) {
- if (_nof_implementors > implementors_limit) {
- return NULL;
- }
// Go into the VM to fetch the implementor.
{
VM_ENTRY_MARK;
- klassOop k = get_instanceKlass()->implementor(n);
+ klassOop k = get_instanceKlass()->implementor();
if (k != NULL) {
- impl = CURRENT_THREAD_ENV->get_object(k)->as_instance_klass();
+ if (k == get_instanceKlass()->as_klassOop()) {
+ // More than one implementors. Use 'this' in this case.
+ impl = this;
+ } else {
+ impl = CURRENT_THREAD_ENV->get_object(k)->as_instance_klass();
+ }
}
}
// Memoize this result.
if (!is_shared()) {
- _implementors[n] = (impl == NULL)? this: impl;
+ _implementor = impl;
}
- } else if (impl == this) {
- impl = NULL; // memoized null result from a VM query
}
return impl;
}
diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp
index 05ecf87a1e2..f8d0a7bd9eb 100644
--- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp
+++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -65,9 +65,11 @@ private:
ciConstantPoolCache* _field_cache; // cached map index->field
GrowableArray Use Service Mechanism The
+ * {@link MethodGen#addLocalVariable(String,Type,InstructionHandle,InstructionHandle)}
+ * and
+ * {@link MethodGen#addLocalVariable(String,Type,int,InstructionHandle,InstructionHandle)}
+ * methods of {@link MethodGen} will only keep track of
+ * {@link LocalVariableGen} object until it'ss removed by a call to
+ * {@link MethodGen#removeLocalVariable(LocalVariableGen)}. In order to support efficient copying of local variables to outlined
+ * methods by
+ * {@link #outline(InstructionHandle,InstructionHandle,String,ClassGenerator)},
+ * this class keeps track of all local variables defined by the method. A If only one registration of use of a particular slot occurs, the
+ * corresponding entry of Preconditions:
+ *
+ *
+ */
+ public static final String ORACLE_FEATURE_SERVICE_MECHANISM = "http://www.oracle.com/feature/use-service-mechanism";
+
+} // class Constants
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/extensions/ExpressionContext.java b/jaxp/src/com/sun/org/apache/xalan/internal/extensions/ExpressionContext.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/extensions/ExpressionContext.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/extensions/ExpressionContext.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/extensions/package.html b/jaxp/src/com/sun/org/apache/xalan/internal/extensions/package.html
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/extensions/package.html
rename to jaxp/src/com/sun/org/apache/xalan/internal/extensions/package.html
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltBase.java b/jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltBase.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltBase.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltBase.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltCommon.java b/jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltCommon.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltCommon.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltCommon.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltDatetime.java b/jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltDatetime.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltDatetime.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltDatetime.java
index 51b6396344b..d717d8d1fa2 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltDatetime.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltDatetime.java
@@ -97,7 +97,7 @@ public class ExsltDatetime
// In a few cases, the time zone may be +/-hh:30.
int min = offset%(60*60*1000);
char posneg = hrs < 0? '-': '+';
- buff.append(posneg + formatDigits(hrs) + ':' + formatDigits(min));
+ buff.append(posneg).append(formatDigits(hrs)).append(':').append(formatDigits(min));
}
return buff.toString();
}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltDynamic.java b/jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltDynamic.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltDynamic.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltDynamic.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltMath.java b/jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltMath.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltMath.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltMath.java
index 6d760fc1975..6066832a2a6 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltMath.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltMath.java
@@ -381,7 +381,7 @@ public class ExsltMath extends ExsltBase
if (bits <= value.length())
value = value.substring(0, bits);
- return new Double(value).doubleValue();
+ return Double.parseDouble(value);
}
else
return Double.NaN;
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltSets.java b/jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltSets.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltSets.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltSets.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltStrings.java b/jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltStrings.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/ExsltStrings.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/lib/ExsltStrings.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/Extensions.java b/jaxp/src/com/sun/org/apache/xalan/internal/lib/Extensions.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/Extensions.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/lib/Extensions.java
index 8efb91bcce9..27e4083617d 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/Extensions.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/lib/Extensions.java
@@ -35,6 +35,7 @@ import com.sun.org.apache.xpath.internal.NodeSet;
import com.sun.org.apache.xpath.internal.objects.XBoolean;
import com.sun.org.apache.xpath.internal.objects.XNumber;
import com.sun.org.apache.xpath.internal.objects.XObject;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentFragment;
@@ -363,8 +364,7 @@ public class Extensions
try
{
// Use reflection to try to find xml-commons utility 'Which'
- Class clazz = ObjectFactory.findProviderClass(
- WHICH_CLASSNAME, ObjectFactory.findClassLoader(), true);
+ Class clazz = ObjectFactory.findProviderClass(WHICH_CLASSNAME, true);
if (null == clazz)
return null;
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/NodeInfo.java b/jaxp/src/com/sun/org/apache/xalan/internal/lib/NodeInfo.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/NodeInfo.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/lib/NodeInfo.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/package.html b/jaxp/src/com/sun/org/apache/xalan/internal/lib/package.html
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/lib/package.html
rename to jaxp/src/com/sun/org/apache/xalan/internal/lib/package.html
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLMessages.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLMessages.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLMessages.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/res/XSLMessages.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_en.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_en.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_en.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_en.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTInfo.properties b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTInfo.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/XSLTInfo.properties
rename to jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTInfo.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/package.html b/jaxp/src/com/sun/org/apache/xalan/internal/res/package.html
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/res/package.html
rename to jaxp/src/com/sun/org/apache/xalan/internal/res/package.html
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/templates/Constants.java b/jaxp/src/com/sun/org/apache/xalan/internal/templates/Constants.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/templates/Constants.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/templates/Constants.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/templates/package.html b/jaxp/src/com/sun/org/apache/xalan/internal/templates/package.html
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/templates/package.html
rename to jaxp/src/com/sun/org/apache/xalan/internal/templates/package.html
diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/utils/ConfigurationError.java b/jaxp/src/com/sun/org/apache/xalan/internal/utils/ConfigurationError.java
new file mode 100644
index 00000000000..5832f82868b
--- /dev/null
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/ConfigurationError.java
@@ -0,0 +1,61 @@
+/*
+ * reserved comment block
+ * DO NOT REMOVE OR ALTER!
+ */
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+/*
+ * $Id: ObjectFactory.java,v 1.2.4.1 2005/09/15 02:39:54 jeffsuttor Exp $
+ */
+
+package com.sun.org.apache.xalan.internal.utils;
+
+/**
+ * A configuration error. This was an internal class in ObjectFactory previously
+ */
+public final class ConfigurationError
+ extends Error {
+
+ //
+ // Data
+ //
+
+ /** Exception. */
+ private Exception exception;
+
+ //
+ // Constructors
+ //
+
+ /**
+ * Construct a new instance with the specified detail string and
+ * exception.
+ */
+ ConfigurationError(String msg, Exception x) {
+ super(msg);
+ this.exception = x;
+ } // true
instructs the implementation to use service mechanism to find implementation.
+ * This is the default behavior.
+ * false
instructs the implementation to skip service mechanism and use the default implementation.
+ * InternalError
with the specified error message.
+ * @param msg the error message
+ */
+ public InternalError(String msg) {
+ super(msg);
+ }
+}
diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MarkerInstruction.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MarkerInstruction.java
new file mode 100644
index 00000000000..e76a3fe500f
--- /dev/null
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MarkerInstruction.java
@@ -0,0 +1,98 @@
+/*
+ * reserved comment block
+ * DO NOT REMOVE OR ALTER!
+ */
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+/*
+ * $Id: MethodGenerator.java,v 1.10 2010-11-01 04:34:19 joehw Exp $
+ */
+package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import com.sun.org.apache.bcel.internal.Constants;
+import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
+import com.sun.org.apache.bcel.internal.generic.Instruction;
+import com.sun.org.apache.bcel.internal.generic.Visitor;
+
+/**
+ * A special abstract dummy subclass of
+ * {@link org.apache.bcel.generic.Instruction} used to mark locations of
+ * interest in an {@link com.sun.org.apache.bcel.internal.generic.InstructionList}. It and
+ * its subclasses are only used as placeholders, and do not contribute to the
+ * actual byte code instruction stream.
+ */
+abstract class MarkerInstruction extends Instruction {
+ /**
+ * Zero-argument constructor. Sets the opcode to an invalid value and
+ * sets the length to zero, as it will not be written as part of the
+ * generated byte code.
+ */
+ public MarkerInstruction() {
+ super(Constants.UNDEFINED, (short) 0);
+ }
+
+ /**
+ * {@link com.sun.org.apache.bcel.internal.generic.Visitor}s will know nothing about this
+ * kind of {@link org.apche.bcel.generic.Instruction}, so this method does
+ * nothing.
+ */
+ public void accept(Visitor v) {
+ }
+
+ /**
+ * The number of JVM stack entries consumed by the instruction.
+ * This instruction is just a place holder, so it does not consume any
+ * stack entries.
+ * @param cpg The {@link com.sun.org.apache.bcel.internal.generic.ConstantPoolGen} for the
+ * current {@link com.sun.org.apache.bcel.internal.generic.ClassGen}
+ * @return 0
always
+ */
+ final public int consumeStack(ConstantPoolGen cpg) {
+ return 0;
+ }
+ /**
+ * The number of JVM stack entries produced by the instruction.
+ * This instruction is just a place holder, so it does not produce any
+ * stack entries.
+ * @param cpg The {@link com.sun.org.apache.bcel.internal.generic.ConstantPoolGen} for the
+ * current {@link com.sun.org.apache.bcel.internal.generic.ClassGen}
+ * @return 0
always
+ */
+ final public int produceStack(ConstantPoolGen cpg) {
+ return 0;
+ }
+
+ /**
+ * Produce a copy of the instruction. By default a
+ * {@link MarkerInstruction} has no parameters, so the base implementation
+ * of {@link #copy()} returns the instruction itself.
+ * @return The instruction itself.
+ */
+ public Instruction copy() {
+ return this;
+ }
+ /**
+ * Dump instruction as byte code to stream out. A {@link MarkerInstruction}
+ * has no effect on the generated byte code so it is never emitted to the
+ * output stream.
+ * @param out Output stream
+ */
+ final public void dump(DataOutputStream out) throws IOException {
+ }
+}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MatchGenerator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MatchGenerator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MatchGenerator.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MatchGenerator.java
diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java
new file mode 100644
index 00000000000..9ba426f24f6
--- /dev/null
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodGenerator.java
@@ -0,0 +1,2149 @@
+/*
+ * reserved comment block
+ * DO NOT REMOVE OR ALTER!
+ */
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+/*
+ * $Id: MethodGenerator.java,v 1.2.4.1 2005/09/05 11:16:47 pvedula Exp $
+ */
+
+package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+ import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Stack;
+
+
+import com.sun.org.apache.bcel.internal.Constants;
+import com.sun.org.apache.bcel.internal.classfile.Field;
+import com.sun.org.apache.bcel.internal.classfile.Method;
+import com.sun.org.apache.bcel.internal.generic.ALOAD;
+import com.sun.org.apache.bcel.internal.generic.ASTORE;
+import com.sun.org.apache.bcel.internal.generic.BranchHandle;
+import com.sun.org.apache.bcel.internal.generic.BranchInstruction;
+import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
+import com.sun.org.apache.bcel.internal.generic.DLOAD;
+import com.sun.org.apache.bcel.internal.generic.DSTORE;
+import com.sun.org.apache.bcel.internal.generic.FLOAD;
+import com.sun.org.apache.bcel.internal.generic.FSTORE;
+import com.sun.org.apache.bcel.internal.generic.GETFIELD;
+import com.sun.org.apache.bcel.internal.generic.GOTO;
+import com.sun.org.apache.bcel.internal.generic.ICONST;
+import com.sun.org.apache.bcel.internal.generic.IfInstruction;
+import com.sun.org.apache.bcel.internal.generic.ILOAD;
+import com.sun.org.apache.bcel.internal.generic.IndexedInstruction;
+import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
+import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
+import com.sun.org.apache.bcel.internal.generic.INVOKESTATIC;
+import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
+import com.sun.org.apache.bcel.internal.generic.ISTORE;
+import com.sun.org.apache.bcel.internal.generic.Instruction;
+import com.sun.org.apache.bcel.internal.generic.InstructionConstants;
+import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
+import com.sun.org.apache.bcel.internal.generic.InstructionList;
+import com.sun.org.apache.bcel.internal.generic.InstructionTargeter;
+import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
+import com.sun.org.apache.bcel.internal.generic.LocalVariableInstruction;
+import com.sun.org.apache.bcel.internal.generic.LLOAD;
+import com.sun.org.apache.bcel.internal.generic.LSTORE;
+import com.sun.org.apache.bcel.internal.generic.MethodGen;
+import com.sun.org.apache.bcel.internal.generic.NEW;
+import com.sun.org.apache.bcel.internal.generic.PUTFIELD;
+import com.sun.org.apache.bcel.internal.generic.RET;
+import com.sun.org.apache.bcel.internal.generic.Select;
+import com.sun.org.apache.bcel.internal.generic.TargetLostException;
+import com.sun.org.apache.bcel.internal.generic.Type;
+
+import com.sun.org.apache.xalan.internal.xsltc.compiler.Pattern;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
+
+/**
+ * @author Jacek Ambroziak
+ * @author Santiago Pericas-Geertsen
+ */
+public class MethodGenerator extends MethodGen
+ implements com.sun.org.apache.xalan.internal.xsltc.compiler.Constants {
+ protected static final int INVALID_INDEX = -1;
+
+ private static final String START_ELEMENT_SIG
+ = "(" + STRING_SIG + ")V";
+ private static final String END_ELEMENT_SIG
+ = START_ELEMENT_SIG;
+
+ private InstructionList _mapTypeSub;
+
+ private static final int DOM_INDEX = 1;
+ private static final int ITERATOR_INDEX = 2;
+ private static final int HANDLER_INDEX = 3;
+
+ private static final int MAX_METHOD_SIZE = 65535;
+ private static final int MAX_BRANCH_TARGET_OFFSET = 32767;
+ private static final int MIN_BRANCH_TARGET_OFFSET = -32768;
+
+ private static final int TARGET_METHOD_SIZE = 60000;
+ private static final int MINIMUM_OUTLINEABLE_CHUNK_SIZE = 1000;
+
+ private Instruction _iloadCurrent;
+ private Instruction _istoreCurrent;
+ private final Instruction _astoreHandler;
+ private final Instruction _aloadHandler;
+ private final Instruction _astoreIterator;
+ private final Instruction _aloadIterator;
+ private final Instruction _aloadDom;
+ private final Instruction _astoreDom;
+
+ private final Instruction _startElement;
+ private final Instruction _endElement;
+ private final Instruction _startDocument;
+ private final Instruction _endDocument;
+ private final Instruction _attribute;
+ private final Instruction _uniqueAttribute;
+ private final Instruction _namespace;
+
+ private final Instruction _setStartNode;
+ private final Instruction _reset;
+ private final Instruction _nextNode;
+
+ private SlotAllocator _slotAllocator;
+ private boolean _allocatorInit = false;
+ private LocalVariableRegistry _localVariableRegistry;
+ /**
+ * A mapping between patterns and instruction lists used by
+ * test sequences to avoid compiling the same pattern multiple
+ * times. Note that patterns whose kernels are "*", "node()"
+ * and "@*" can between shared by test sequences.
+ */
+ private Hashtable _preCompiled = new Hashtable();
+
+
+ public MethodGenerator(int access_flags, Type return_type,
+ Type[] arg_types, String[] arg_names,
+ String method_name, String class_name,
+ InstructionList il, ConstantPoolGen cpg) {
+ super(access_flags, return_type, arg_types, arg_names, method_name,
+ class_name, il, cpg);
+
+ _astoreHandler = new ASTORE(HANDLER_INDEX);
+ _aloadHandler = new ALOAD(HANDLER_INDEX);
+ _astoreIterator = new ASTORE(ITERATOR_INDEX);
+ _aloadIterator = new ALOAD(ITERATOR_INDEX);
+ _aloadDom = new ALOAD(DOM_INDEX);
+ _astoreDom = new ASTORE(DOM_INDEX);
+
+ final int startElement =
+ cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
+ "startElement",
+ START_ELEMENT_SIG);
+ _startElement = new INVOKEINTERFACE(startElement, 2);
+
+ final int endElement =
+ cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
+ "endElement",
+ END_ELEMENT_SIG);
+ _endElement = new INVOKEINTERFACE(endElement, 2);
+
+ final int attribute =
+ cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
+ "addAttribute",
+ "("
+ + STRING_SIG
+ + STRING_SIG
+ + ")V");
+ _attribute = new INVOKEINTERFACE(attribute, 3);
+
+ final int uniqueAttribute =
+ cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
+ "addUniqueAttribute",
+ "("
+ + STRING_SIG
+ + STRING_SIG
+ + "I)V");
+ _uniqueAttribute = new INVOKEINTERFACE(uniqueAttribute, 4);
+
+ final int namespace =
+ cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
+ "namespaceAfterStartElement",
+ "("
+ + STRING_SIG
+ + STRING_SIG
+ + ")V");
+ _namespace = new INVOKEINTERFACE(namespace, 3);
+
+ int index = cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
+ "startDocument",
+ "()V");
+ _startDocument = new INVOKEINTERFACE(index, 1);
+
+ index = cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
+ "endDocument",
+ "()V");
+ _endDocument = new INVOKEINTERFACE(index, 1);
+
+
+ index = cpg.addInterfaceMethodref(NODE_ITERATOR,
+ SET_START_NODE,
+ SET_START_NODE_SIG);
+ _setStartNode = new INVOKEINTERFACE(index, 2);
+
+ index = cpg.addInterfaceMethodref(NODE_ITERATOR,
+ "reset", "()"+NODE_ITERATOR_SIG);
+ _reset = new INVOKEINTERFACE(index, 1);
+
+ index = cpg.addInterfaceMethodref(NODE_ITERATOR, NEXT, NEXT_SIG);
+ _nextNode = new INVOKEINTERFACE(index, 1);
+
+ _slotAllocator = new SlotAllocator();
+ _slotAllocator.initialize(getLocalVariableRegistry().getLocals(false));
+ _allocatorInit = true;
+ }
+
+ /**
+ * Allocates a local variable. If the slot allocator has already been
+ * initialized, then call addLocalVariable2() so that the new variable
+ * is known to the allocator. Failing to do this may cause the allocator
+ * to return a slot that is already in use.
+ */
+ public LocalVariableGen addLocalVariable(String name, Type type,
+ InstructionHandle start,
+ InstructionHandle end)
+ {
+ LocalVariableGen lvg;
+
+ if (_allocatorInit) {
+ lvg = addLocalVariable2(name, type, start);
+ } else {
+ lvg = super.addLocalVariable(name, type, start, end);
+ getLocalVariableRegistry().registerLocalVariable(lvg);
+ }
+ return lvg;
+ }
+
+ public LocalVariableGen addLocalVariable2(String name, Type type,
+ InstructionHandle start)
+ {
+ LocalVariableGen lvg = super.addLocalVariable(name, type,
+ _slotAllocator.allocateSlot(type),
+ start, null);
+ getLocalVariableRegistry().registerLocalVariable(lvg);
+ return lvg;
+ }
+ private LocalVariableRegistry getLocalVariableRegistry() {
+ if (_localVariableRegistry == null) {
+ _localVariableRegistry = new LocalVariableRegistry();
+ }
+
+ return _localVariableRegistry;
+ }
+
+ /**
+ * Keeps track of all local variables used in the method.
+ * java.lang.ArrayList
of all
+ * {@link LocalVariableGen}s created for this method, indexed by the
+ * slot number of the local variable. The JVM stack frame of local
+ * variables is divided into "slots". A single slot can be used to
+ * store more than one variable in a method, without regard to type, so
+ * long as the byte code keeps the ranges of the two disjoint._variables
contains the
+ * LocalVariableGen
; if more than one occurs, the
+ * corresponding entry contains all such LocalVariableGen
s
+ * registered for the same slot; and if none occurs, the entry will be
+ * null
.
+ */
+ protected ArrayList _variables = new ArrayList();
+
+ /**
+ * Maps a name to a {@link LocalVariableGen}
+ */
+ protected HashMap _nameToLVGMap = new HashMap();
+
+ /**
+ * Registers a {@link org.apache.bcel.generic.LocalVariableGen}
+ * for this method.
+ *
+ *
lvg
does not
+ * overlap with the range of instructions for any
+ * LocalVariableGen
with the same slot index previously
+ * registered for this method. (Unchecked.)
Find which {@link LocalVariableGen}, if any, is registered for a + * particular JVM local stack frame slot at a particular position in the + * byte code for the method.
+ *Preconditions: + *
LocalVariableGen
for the local variable
+ * stored in the relevant slot at the relevant offset; null
+ * if there is none.
+ */
+ protected LocalVariableGen lookupRegisteredLocalVariable(int slot,
+ int offset) {
+ Object localsInSlot = (_variables != null) ? _variables.get(slot)
+ : null;
+
+ // If this slot index was never used, _variables.get will return
+ // null; if it was used once, it will return the LocalVariableGen;
+ // more than once it will return an ArrayList of all the
+ // LocalVariableGens for variables stored in that slot. For each
+ // LocalVariableGen, check whether its range includes the
+ // specified offset, and return the first such encountered.
+ if (localsInSlot != null) {
+ if (localsInSlot instanceof LocalVariableGen) {
+ LocalVariableGen lvg = (LocalVariableGen)localsInSlot;
+ if (offsetInLocalVariableGenRange(lvg, offset)) {
+ return lvg;
+ }
+ } else {
+ ArrayList listOfLocalsInSlot = (ArrayList) localsInSlot;
+ int size = listOfLocalsInSlot.size();
+
+ for (int i = 0; i < size; i++) {
+ LocalVariableGen lvg =
+ (LocalVariableGen)listOfLocalsInSlot.get(i);
+ if (offsetInLocalVariableGenRange(lvg, offset)) {
+ return lvg;
+ }
+ }
+ }
+ }
+
+ // No local variable stored in the specified slot at the specified
+ return null;
+ }
+
+ /**
+ * Set up a mapping of the name of the specified
+ * {@link LocalVariableGen} object to the LocalVariableGen
+ * itself.
This is a bit of a hack. XSLTC is relying on the fact that the
+ * name that is being looked up won't be duplicated, which isn't
+ * guaranteed. It replaces code which used to call
+ * {@link MethodGen#getLocalVariables()} and looped through the
+ * LocalVariableGen
objects it contained to find the one
+ * with the specified name. However, getLocalVariables()
+ * has the side effect of setting the start and end for any
+ * LocalVariableGen
which did not already have them
+ * set, which causes problems for outlining..
See also {@link #lookUpByName(String)} and + * {@link #removeByNameTracking(LocalVariableGen)}
LocalVariableGen + */ + protected void registerByName(LocalVariableGen lvg) { + Object duplicateNameEntry = _nameToLVGMap.get(lvg.getName()); + + if (duplicateNameEntry == null) { + _nameToLVGMap.put(lvg.getName(), lvg); + } else { + ArrayList sameNameList; + + if (duplicateNameEntry instanceof ArrayList) { + sameNameList = (ArrayList) duplicateNameEntry; + sameNameList.add(lvg); + } else { + sameNameList = new ArrayList(); + sameNameList.add(duplicateNameEntry); + sameNameList.add(lvg); + } + + _nameToLVGMap.put(lvg.getName(), sameNameList); + } + } + + /** + * Remove the mapping from the name of the specified + * {@link LocalVariableGen} to itself. + * See also {@link #registerByName(LocalVariableGen)} and + * {@link #lookUpByName(String)} + * @param lvg aLocalVariableGen
+ */
+ protected void removeByNameTracking(LocalVariableGen lvg) {
+ Object duplicateNameEntry = _nameToLVGMap.get(lvg.getName());
+
+ if (duplicateNameEntry instanceof ArrayList) {
+ ArrayList sameNameList = (ArrayList) duplicateNameEntry;
+ for (int i = 0; i < sameNameList.size(); i++) {
+ if (sameNameList.get(i) == lvg) {
+ sameNameList.remove(i);
+ break;
+ }
+ }
+ } else {
+ _nameToLVGMap.remove(lvg);
+ }
+ }
+
+ /**
+ * Given the name of a variable, finds a {@link LocalVariableGen} + * corresponding to it.
+ *See also {@link #registerByName(LocalVariableGen)} and + * {@link #removeByNameTracking(LocalVariableGen)}
+ * @param name + * @return + */ + protected LocalVariableGen lookUpByName(String name) { + LocalVariableGen lvg = null; + Object duplicateNameEntry = _nameToLVGMap.get(name); + + if (duplicateNameEntry instanceof ArrayList) { + ArrayList sameNameList = (ArrayList) duplicateNameEntry; + + for (int i = 0; i < sameNameList.size(); i++) { + lvg = (LocalVariableGen)sameNameList.get(i); + if (lvg.getName() == name) { + break; + } + } + } else { + lvg = (LocalVariableGen) duplicateNameEntry; + } + + return lvg; + } + + /** + *Gets all {@link LocalVariableGen} objects for this method.
+ *When the includeRemoved
argument has the value
+ * false
, this method replaces uses of
+ * {@link MethodGen#getLocalVariables()} which has
+ * a side-effect of setting the start and end range for any
+ * LocalVariableGen
if either was null
. That
+ * side-effect causes problems for outlining of code in XSLTC.
+ * @param includeRemoved Specifies whether all local variables ever
+ * declared should be returned (true
) or only those not
+ * removed (false
)
+ * @return an array of LocalVariableGen
containing all the
+ * local variables
+ */
+ protected LocalVariableGen[] getLocals(boolean includeRemoved) {
+ LocalVariableGen[] locals = null;
+ ArrayList allVarsEverDeclared = new ArrayList();
+
+ if (includeRemoved) {
+ int slotCount = allVarsEverDeclared.size();
+
+ for (int i = 0; i < slotCount; i++) {
+ Object slotEntries = _variables.get(i);
+ if (slotEntries != null) {
+ if (slotEntries instanceof ArrayList) {
+ ArrayList slotList = (ArrayList) slotEntries;
+
+ for (int j = 0; j < slotList.size(); j++) {
+ allVarsEverDeclared.add(slotList.get(i));
+ }
+ } else {
+ allVarsEverDeclared.add(slotEntries);
+ }
+ }
+ }
+ } else {
+ Iterator nameVarsPairsIter = _nameToLVGMap.entrySet().iterator();
+
+ while (nameVarsPairsIter.hasNext()) {
+ Map.Entry nameVarsPair =
+ (Map.Entry) nameVarsPairsIter.next();
+ Object vars = nameVarsPair.getValue();
+ if (vars != null) {
+ if (vars instanceof ArrayList) {
+ ArrayList varsList = (ArrayList) vars;
+ for (int i = 0; i < varsList.size(); i++) {
+ allVarsEverDeclared.add(varsList.get(i));
+ }
+ } else {
+ allVarsEverDeclared.add(vars);
+ }
+ }
+ }
+ }
+
+ locals = new LocalVariableGen[allVarsEverDeclared.size()];
+ allVarsEverDeclared.toArray(locals);
+
+ return locals;
+ }
+ }
+
+ /**
+ * Determines whether a particular variable is in use at a particular offset
+ * in the byte code for this method.
+ *
Preconditions: + *
true
if and only if the specified variable is in
+ * use at the particular byte code offset.
+ */
+ boolean offsetInLocalVariableGenRange(LocalVariableGen lvg, int offset) {
+ InstructionHandle lvgStart = lvg.getStart();
+ InstructionHandle lvgEnd = lvg.getEnd();
+
+ // If no start handle is recorded for the LocalVariableGen, it is
+ // assumed to be in use from the beginning of the method.
+ if (lvgStart == null) {
+ lvgStart = getInstructionList().getStart();
+ }
+
+ // If no end handle is recorded for the LocalVariableGen, it is assumed
+ // to be in use to the end of the method.
+ if (lvgEnd == null) {
+ lvgEnd = getInstructionList().getEnd();
+ }
+
+ // Does the range of the instruction include the specified offset?
+ // Note that the InstructionHandle.getPosition method returns the
+ // offset of the beginning of an instruction. A LocalVariableGen's
+ // range includes the end instruction itself, so that instruction's
+ // length must be taken into consideration in computing whether the
+ // varible is in range at a particular offset.
+ return ((lvgStart.getPosition() <= offset)
+ && (lvgEnd.getPosition()
+ + lvgEnd.getInstruction().getLength() >= offset));
+ }
+
+ public void removeLocalVariable(LocalVariableGen lvg) {
+ _slotAllocator.releaseSlot(lvg);
+ getLocalVariableRegistry().removeByNameTracking(lvg);
+ super.removeLocalVariable(lvg);
+ }
+
+ public Instruction loadDOM() {
+ return _aloadDom;
+ }
+
+ public Instruction storeDOM() {
+ return _astoreDom;
+ }
+
+ public Instruction storeHandler() {
+ return _astoreHandler;
+ }
+
+ public Instruction loadHandler() {
+ return _aloadHandler;
+ }
+
+ public Instruction storeIterator() {
+ return _astoreIterator;
+ }
+
+ public Instruction loadIterator() {
+ return _aloadIterator;
+ }
+
+ public final Instruction setStartNode() {
+ return _setStartNode;
+ }
+
+ public final Instruction reset() {
+ return _reset;
+ }
+
+ public final Instruction nextNode() {
+ return _nextNode;
+ }
+
+ public final Instruction startElement() {
+ return _startElement;
+ }
+
+ public final Instruction endElement() {
+ return _endElement;
+ }
+
+ public final Instruction startDocument() {
+ return _startDocument;
+ }
+
+ public final Instruction endDocument() {
+ return _endDocument;
+ }
+
+ public final Instruction attribute() {
+ return _attribute;
+ }
+
+ public final Instruction uniqueAttribute() {
+ return _uniqueAttribute;
+ }
+
+ public final Instruction namespace() {
+ return _namespace;
+ }
+
+ public Instruction loadCurrentNode() {
+ if (_iloadCurrent == null) {
+ int idx = getLocalIndex("current");
+ if (idx > 0)
+ _iloadCurrent = new ILOAD(idx);
+ else
+ _iloadCurrent = new ICONST(0);
+ }
+ return _iloadCurrent;
+ }
+
+ public Instruction storeCurrentNode() {
+ return _istoreCurrent != null
+ ? _istoreCurrent
+ : (_istoreCurrent = new ISTORE(getLocalIndex("current")));
+ }
+
+ /** by default context node is the same as current node. MK437 */
+ public Instruction loadContextNode() {
+ return loadCurrentNode();
+ }
+
+ public Instruction storeContextNode() {
+ return storeCurrentNode();
+ }
+
+ public int getLocalIndex(String name) {
+ return getLocalVariable(name).getIndex();
+ }
+
+ public LocalVariableGen getLocalVariable(String name) {
+ return getLocalVariableRegistry().lookUpByName(name);
+ }
+
+ public void setMaxLocals() {
+
+ // Get the current number of local variable slots
+ int maxLocals = super.getMaxLocals();
+ int prevLocals = maxLocals;
+
+ // Get numer of actual variables
+ final LocalVariableGen[] localVars = super.getLocalVariables();
+ if (localVars != null) {
+ if (localVars.length > maxLocals)
+ maxLocals = localVars.length;
+ }
+
+ // We want at least 5 local variable slots (for parameters)
+ if (maxLocals < 5) maxLocals = 5;
+
+ super.setMaxLocals(maxLocals);
+ }
+
+ /**
+ * Add a pre-compiled pattern to this mode.
+ */
+ public void addInstructionList(Pattern pattern, InstructionList ilist) {
+ _preCompiled.put(pattern, ilist);
+ }
+
+ /**
+ * Get the instruction list for a pre-compiled pattern. Used by
+ * test sequences to avoid compiling patterns more than once.
+ */
+ public InstructionList getInstructionList(Pattern pattern) {
+ return (InstructionList) _preCompiled.get(pattern);
+ }
+
+ /**
+ * Used to keep track of an outlineable chunk of instructions in the
+ * current method. See {@link OutlineableChunkStart} and
+ * {@link OutlineableChunkEnd} for more information.
+ */
+ private class Chunk implements Comparable {
+ /**
+ * {@link InstructionHandle} of the first instruction in the outlineable
+ * chunk.
+ */
+ private InstructionHandle m_start;
+
+ /**
+ * {@link org.apache.bcel.generic.InstructionHandle} of the first
+ * instruction in the outlineable chunk.
+ */
+ private InstructionHandle m_end;
+
+ /**
+ * Number of bytes in the instructions contained in this outlineable
+ * chunk.
+ */
+ private int m_size;
+
+ /**
+ * Constructor for an outlineable {@link MethodGenerator.Chunk}.
+ *Preconditions: + *
MethodGenerator.Chunk
, with no other intervening
+ * instructions, including {@link OutlineableChunkStart} or
+ * {@link OutlineableChunkEnd} instructions.
+ * @param neighbour an outlineable {@link MethodGenerator.Chunk}
+ * @return true
if and only if the argument chunk
+ * immediately follows this
chunk
+ */
+ boolean isAdjacentTo(Chunk neighbour) {
+ return getChunkEnd().getNext() == neighbour.getChunkStart();
+ }
+
+ /**
+ * Getter method for the start of this {@linke MethodGenerator.Chunk}
+ * @return the {@link org.apache.bcel.generic.InstructionHandle} of the
+ * start of this chunk
+ */
+ InstructionHandle getChunkStart() {
+ return m_start;
+ }
+
+ /**
+ * Getter method for the end of this {@link MethodGenerator.Chunk}
+ * @return the {@link InstructionHandle} of the start of this chunk
+ */
+ InstructionHandle getChunkEnd() {
+ return m_end;
+ }
+
+ /**
+ * The size of this {@link MethodGenerator.Chunk}
+ * @return the number of bytes in the byte code represented by this
+ * chunk.
+ */
+ int getChunkSize() {
+ return m_size;
+ }
+
+ /**
+ * Implements the java.util.Comparable.compareTo(Object)
+ * method.
+ * @return
+ * int
if the length of this
+ * chunk in bytes is greater than that of comparand
int
if the length of this
+ * chunk in bytes is less than that of comparand
java.util.ArrayList
containing the
+ * {@link MethodGenerator.Chunk}s that may be outlined from this method
+ */
+ private ArrayList getCandidateChunks(ClassGenerator classGen,
+ int totalMethodSize) {
+ Iterator instructions = getInstructionList().iterator();
+ ArrayList candidateChunks = new ArrayList();
+ ArrayList currLevelChunks = new ArrayList();
+ Stack subChunkStack = new Stack();
+ boolean openChunkAtCurrLevel = false;
+ boolean firstInstruction = true;
+
+ InstructionHandle currentHandle;
+
+ if (m_openChunks != 0) {
+ String msg =
+ (new ErrorMsg(ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS))
+ .toString();
+ throw new InternalError(msg);
+ }
+
+ // Scan instructions in the method, keeping track of the nesting level
+ // of outlineable chunks.
+ //
+ // currLevelChunks
+ // keeps track of the child chunks of a chunk. For each chunk,
+ // there will be a pair of entries: the InstructionHandles for the
+ // start and for the end of the chunk
+ // subChunkStack
+ // a stack containing the partially accumulated currLevelChunks for
+ // each chunk that's still open at the current position in the
+ // InstructionList.
+ // candidateChunks
+ // the list of chunks which have been accepted as candidates chunks
+ // for outlining
+ do {
+ // Get the next instruction. The loop will perform one extra
+ // iteration after it reaches the end of the InstructionList, with
+ // currentHandle set to null.
+ currentHandle = instructions.hasNext()
+ ? (InstructionHandle) instructions.next()
+ : null;
+ Instruction inst =
+ (currentHandle != null) ? currentHandle.getInstruction()
+ : null;
+
+ // At the first iteration, create a chunk representing all the
+ // code in the method. This is done just to simplify the logic -
+ // this chunk can never be outlined because it will be too big.
+ if (firstInstruction) {
+ openChunkAtCurrLevel = true;
+ currLevelChunks.add(currentHandle);
+ firstInstruction = false;
+ }
+
+ // Found a new chunk
+ if (inst instanceof OutlineableChunkStart) {
+ // If last MarkerInstruction encountered was an
+ // OutlineableChunkStart, this represents the first chunk
+ // nested within that previous chunk - push the list of chunks
+ // from the outer level onto the stack
+ if (openChunkAtCurrLevel) {
+ subChunkStack.push(currLevelChunks);
+ currLevelChunks = new ArrayList();
+ }
+
+ openChunkAtCurrLevel = true;
+ currLevelChunks.add(currentHandle);
+ // Close off an open chunk
+ } else if (currentHandle == null
+ || inst instanceof OutlineableChunkEnd) {
+ ArrayList nestedSubChunks = null;
+
+ // If the last MarkerInstruction encountered was an
+ // OutlineableChunkEnd, it means that the current instruction
+ // marks the end of a chunk that contained child chunks.
+ // Those children might need to be examined below in case they
+ // are better candidates for outlining than the current chunk.
+ if (!openChunkAtCurrLevel) {
+ nestedSubChunks = currLevelChunks;
+ currLevelChunks = (ArrayList)subChunkStack.pop();
+ }
+
+ // Get the handle for the start of this chunk (the last entry
+ // in currLevelChunks)
+ InstructionHandle chunkStart =
+ (InstructionHandle) currLevelChunks.get(
+ currLevelChunks.size()-1);
+
+ int chunkEndPosition =
+ (currentHandle != null) ? currentHandle.getPosition()
+ : totalMethodSize;
+ int chunkSize = chunkEndPosition - chunkStart.getPosition();
+
+ // Two ranges of chunk size to consider:
+ //
+ // 1. [0,TARGET_METHOD_SIZE]
+ // Keep this chunk in consideration as a candidate,
+ // and ignore its subchunks, if any - there's nothing to be
+ // gained by outlining both the current chunk and its
+ // children!
+ //
+ // 2. (TARGET_METHOD_SIZE,+infinity)
+ // Ignore this chunk - it's too big. Add its subchunks
+ // as candidates, after merging adjacent chunks to produce
+ // chunks that are as large as possible
+ if (chunkSize <= TARGET_METHOD_SIZE) {
+ currLevelChunks.add(currentHandle);
+ } else {
+ if (!openChunkAtCurrLevel) {
+ int childChunkCount = nestedSubChunks.size() / 2;
+ if (childChunkCount > 0) {
+ Chunk[] childChunks = new Chunk[childChunkCount];
+
+ // Gather all the child chunks of the current chunk
+ for (int i = 0; i < childChunkCount; i++) {
+ InstructionHandle start =
+ (InstructionHandle) nestedSubChunks
+ .get(i*2);
+ InstructionHandle end =
+ (InstructionHandle) nestedSubChunks
+ .get(i*2+1);
+
+ childChunks[i] = new Chunk(start, end);
+ }
+
+ // Merge adjacent siblings
+ ArrayList mergedChildChunks =
+ mergeAdjacentChunks(childChunks);
+
+ // Add chunks that mean minimum size requirements
+ // to the list of candidate chunks for outlining
+ for (int i = 0; i < mergedChildChunks.size(); i++) {
+ Chunk mergedChunk =
+ (Chunk)mergedChildChunks.get(i);
+ int mergedSize = mergedChunk.getChunkSize();
+
+ if (mergedSize >= MINIMUM_OUTLINEABLE_CHUNK_SIZE
+ && mergedSize <= TARGET_METHOD_SIZE) {
+ candidateChunks.add(mergedChunk);
+ }
+ }
+ }
+ }
+
+ // Drop the chunk which was too big
+ currLevelChunks.remove(currLevelChunks.size() - 1);
+ }
+
+ // currLevelChunks contains pairs of InstructionHandles. If
+ // its size is an odd number, the loop has encountered the
+ // start of a chunk at this level, but not its end.
+ openChunkAtCurrLevel = ((currLevelChunks.size() & 0x1) == 1);
+ }
+
+ } while (currentHandle != null);
+
+ return candidateChunks;
+ }
+
+ /**
+ * Merge adjacent sibling chunks to produce larger candidate chunks for
+ * outlining
+ * @param chunks array of sibling {@link MethodGenerator.Chunk}s that are
+ * under consideration for outlining. Chunks must be in
+ * the order encountered in the {@link InstructionList}
+ * @return a java.util.ArrayList
of
+ * MethodGenerator.Chunk
s maximally merged
+ */
+ private ArrayList mergeAdjacentChunks(Chunk[] chunks) {
+ int[] adjacencyRunStart = new int[chunks.length];
+ int[] adjacencyRunLength = new int[chunks.length];
+ boolean[] chunkWasMerged = new boolean[chunks.length];
+
+ int maximumRunOfChunks = 0;
+ int startOfCurrentRun;
+ int numAdjacentRuns = 0;
+
+ ArrayList mergedChunks = new ArrayList();
+
+ startOfCurrentRun = 0;
+
+ // Loop through chunks, and record in adjacencyRunStart where each
+ // run of adjacent chunks begins and how many are in that run. For
+ // example, given chunks A B C D E F, if A is adjacent to B, but not
+ // to C, and C, D, E and F are all adjacent,
+ // adjacencyRunStart[0] == 0; adjacencyRunLength[0] == 2
+ // adjacencyRunStart[1] == 2; adjacencyRunLength[1] == 4
+ for (int i = 1; i < chunks.length; i++) {
+ if (!chunks[i-1].isAdjacentTo(chunks[i])) {
+ int lengthOfRun = i - startOfCurrentRun;
+
+ // Track the longest run of chunks found
+ if (maximumRunOfChunks < lengthOfRun) {
+ maximumRunOfChunks = lengthOfRun;
+ }
+
+ if (lengthOfRun > 1 ) {
+ adjacencyRunLength[numAdjacentRuns] = lengthOfRun;
+ adjacencyRunStart[numAdjacentRuns] = startOfCurrentRun;
+ numAdjacentRuns++;
+ }
+
+ startOfCurrentRun = i;
+ }
+ }
+
+ if (chunks.length - startOfCurrentRun > 1) {
+ int lengthOfRun = chunks.length - startOfCurrentRun;
+
+ // Track the longest run of chunks found
+ if (maximumRunOfChunks < lengthOfRun) {
+ maximumRunOfChunks = lengthOfRun;
+ }
+
+ adjacencyRunLength[numAdjacentRuns] =
+ chunks.length - startOfCurrentRun;
+ adjacencyRunStart[numAdjacentRuns] = startOfCurrentRun;
+ numAdjacentRuns++;
+ }
+
+ // Try merging adjacent chunks to come up with better sized chunks for
+ // outlining. This algorithm is not optimal, but it should be
+ // reasonably fast. Consider an example like this, where four chunks
+ // of the sizes specified in brackets are adjacent. The best way of
+ // combining these chunks would be to merge the first pair and merge
+ // the last three to form two chunks, but the algorithm will merge the
+ // three in the middle instead, leaving three chunks in all.
+ // [25000] [25000] [20000] [1000] [20000]
+
+ // Start by trying to merge the maximum number of adjacent chunks, and
+ // work down from there.
+ for (int numToMerge = maximumRunOfChunks; numToMerge>1; numToMerge--) {
+ // Look at each run of adjacent chunks
+ for (int run = 0; run < numAdjacentRuns; run++) {
+ int runStart = adjacencyRunStart[run];
+ int runEnd = runStart + adjacencyRunLength[run] - 1;
+
+ boolean foundChunksToMerge = false;
+
+ // Within the current run of adjacent chunks, look at all
+ // "subruns" of length numToMerge, until we run out or find
+ // a subrun that can be merged.
+ for (int mergeStart = runStart;
+ mergeStart+numToMerge-1 <= runEnd && !foundChunksToMerge;
+ mergeStart++) {
+ int mergeEnd = mergeStart + numToMerge - 1;
+ int mergeSize = 0;
+
+ // Find out how big the subrun is
+ for (int j = mergeStart; j <= mergeEnd; j++) {
+ mergeSize = mergeSize + chunks[j].getChunkSize();
+ }
+
+ // If the current subrun is small enough to outline,
+ // merge it, and split the remaining chunks in the run
+ if (mergeSize <= TARGET_METHOD_SIZE) {
+ foundChunksToMerge = true;
+
+ for (int j = mergeStart; j <= mergeEnd; j++) {
+ chunkWasMerged[j] = true;
+ }
+
+ mergedChunks.add(
+ new Chunk(chunks[mergeStart].getChunkStart(),
+ chunks[mergeEnd].getChunkEnd()));
+
+ // Adjust the length of the current run of adjacent
+ // chunks to end at the newly merged chunk...
+ adjacencyRunLength[run] =
+ adjacencyRunStart[run] - mergeStart;
+
+ int trailingRunLength = runEnd - mergeEnd;
+
+ // and any chunks that follow the newly merged chunk
+ // in the current run of adjacent chunks form another
+ // new run of adjacent chunks
+ if (trailingRunLength >= 2) {
+ adjacencyRunStart[numAdjacentRuns] = mergeEnd + 1;
+ adjacencyRunLength[numAdjacentRuns] =
+ trailingRunLength;
+ numAdjacentRuns++;
+ }
+ }
+ }
+ }
+ }
+
+ // Make a final pass for any chunk that wasn't merged with a sibling
+ // and include it in the list of chunks after merging.
+ for (int i = 0; i < chunks.length; i++) {
+ if (!chunkWasMerged[i]) {
+ mergedChunks.add(chunks[i]);
+ }
+ }
+
+ return mergedChunks;
+ }
+
+ /**
+ * Breaks up the IL for this {@link MethodGenerator} into separate
+ * outlined methods so that no method exceeds the 64KB limit on the length
+ * of the byte code associated with a method.
+ * @param classGen The {@link ClassGen} with which the generated methods
+ * will be associated
+ * @param originalMethodSize The number of bytes of bytecode represented by
+ * the {@link InstructionList} of this method
+ * @return an array of the outlined Method
s and the original
+ * method itself
+ */
+ public Method[] outlineChunks(ClassGenerator classGen,
+ int originalMethodSize) {
+ ArrayList methodsOutlined = new ArrayList();
+ int currentMethodSize = originalMethodSize;
+
+ int outlinedCount = 0;
+ boolean moreMethodsOutlined;
+ String originalMethodName = getName();
+
+ // Special handling for initialization methods. No other methods can
+ // include the less than and greater than characters in their names,
+ // so we munge the names here.
+ if (originalMethodName.equals("InstructionHandle
of the last instruction in
+ * the chunk to outline
+ * @param outlinedMethodName The name of the new method
+ * @param classGen The {@link ClassGenerator} of which the original
+ * and new methods will be members
+ * @return The new {@link Method} containing the outlined code.
+ */
+ private Method outline(InstructionHandle first, InstructionHandle last,
+ String outlinedMethodName, ClassGenerator classGen) {
+ // We're not equipped to deal with exception handlers yet. Bail out!
+ if (getExceptionHandlers().length != 0) {
+ String msg = (new ErrorMsg(ErrorMsg.OUTLINE_ERR_TRY_CATCH))
+ .toString();
+ throw new InternalError(msg);
+ }
+
+ int outlineChunkStartOffset = first.getPosition();
+ int outlineChunkEndOffset = last.getPosition()
+ + last.getInstruction().getLength();
+
+ ConstantPoolGen cpg = getConstantPool();
+
+ // Create new outlined method with signature:
+ //
+ // private final outlinedMethodName(CopyLocals copyLocals);
+ //
+ // CopyLocals is an object that is used to copy-in/copy-out local
+ // variables that are used by the outlined method. Only locals whose
+ // value is potentially set or referenced outside the range of the
+ // chunk that is being outlined will be represented in CopyLocals. The
+ // type of the variable for copying local variables is actually
+ // generated to be unique - it is not named CopyLocals.
+ //
+ // The outlined method never needs to be referenced outside of this
+ // class, and will never be overridden, so we mark it private final.
+ final InstructionList newIL = new InstructionList();
+
+ final XSLTC xsltc = classGen.getParser().getXSLTC();
+ final String argTypeName = xsltc.getHelperClassName();
+ final Type[] argTypes =
+ new Type[] {(new ObjectType(argTypeName)).toJCType()};
+ final String argName = "copyLocals";
+ final String[] argNames = new String[] {argName};
+
+ int methodAttributes = ACC_PRIVATE | ACC_FINAL;
+ final boolean isStaticMethod = (getAccessFlags() & ACC_STATIC) != 0;
+
+ if (isStaticMethod) {
+ methodAttributes = methodAttributes | ACC_STATIC;
+ }
+
+ final MethodGenerator outlinedMethodGen =
+ new MethodGenerator(methodAttributes,
+ com.sun.org.apache.bcel.internal.generic.Type.VOID,
+ argTypes, argNames, outlinedMethodName,
+ getClassName(), newIL, cpg);
+
+ // Create class for copying local variables to the outlined method.
+ // The fields the class will need to contain will be determined as the
+ // code in the outlineable chunk is examined.
+ ClassGenerator copyAreaCG
+ = new ClassGenerator(argTypeName, OBJECT_CLASS, argTypeName+".java",
+ ACC_FINAL | ACC_PUBLIC | ACC_SUPER, null,
+ classGen.getStylesheet()) {
+ public boolean isExternal() {
+ return true;
+ }
+ };
+ ConstantPoolGen copyAreaCPG = copyAreaCG.getConstantPool();
+ copyAreaCG.addEmptyConstructor(ACC_PUBLIC);
+
+ // Number of fields in the copy class
+ int copyAreaFieldCount = 0;
+
+ // The handle for the instruction after the last one to be outlined.
+ // Note that this should never end up being null. An outlineable chunk
+ // won't contain a RETURN instruction or other branch out of the chunk,
+ // and the JVM specification prohibits code in a method from just
+ // "falling off the end" so this should always point to a valid handle.
+ InstructionHandle limit = last.getNext();
+
+ // InstructionLists for copying values into and out of an instance of
+ // CopyLocals:
+ // oldMethCoypInIL - from locals in old method into an instance
+ // of the CopyLocals class (oldMethCopyInIL)
+ // oldMethCopyOutIL - from CopyLocals back into locals in the old
+ // method
+ // newMethCopyInIL - from CopyLocals into locals in the new
+ // method
+ // newMethCopyOutIL - from locals in new method into the instance
+ // of the CopyLocals class
+ InstructionList oldMethCopyInIL = new InstructionList();
+ InstructionList oldMethCopyOutIL = new InstructionList();
+ InstructionList newMethCopyInIL = new InstructionList();
+ InstructionList newMethCopyOutIL = new InstructionList();
+
+ // Allocate instance of class in which we'll copy in or copy out locals
+ // and make two copies: last copy is used to invoke constructor;
+ // other two are used for references to fields in the CopyLocals object
+ InstructionHandle outlinedMethodCallSetup =
+ oldMethCopyInIL.append(new NEW(cpg.addClass(argTypeName)));
+ oldMethCopyInIL.append(InstructionConstants.DUP);
+ oldMethCopyInIL.append(InstructionConstants.DUP);
+ oldMethCopyInIL.append(
+ new INVOKESPECIAL(cpg.addMethodref(argTypeName, "InstructionList
is empty.
+ * See {@link OutlineableChunkStart} for more information.
+ */
+ public void markChunkStart() {
+ // m_chunkTree.markChunkStart();
+ getInstructionList()
+ .append(OutlineableChunkStart.OUTLINEABLECHUNKSTART);
+ m_totalChunks++;
+ m_openChunks++;
+ }
+
+ /**
+ * Mark the end of an outlineable chunk of code. See
+ * {@link OutlineableChunkStart} for more information.
+ */
+ public void markChunkEnd() {
+ // m_chunkTree.markChunkEnd();
+ getInstructionList()
+ .append(OutlineableChunkEnd.OUTLINEABLECHUNKEND);
+ m_openChunks--;
+ if (m_openChunks < 0) {
+ String msg = (new ErrorMsg(ErrorMsg.OUTLINE_ERR_UNBALANCED_MARKERS))
+ .toString();
+ throw new InternalError(msg);
+ }
+ }
+
+ /**
+ * Get all {@link Method}s generated by this {@link MethodGenerator}.
+ * The {@link MethodGen#getMethod()} only returns a single
+ * Method
object. This method takes into account the Java
+ * Virtual Machine Specification limit of 64KB on the size of a method, and
+ * may return more than one Method
.
If the code associated with the MethodGenerator
would
+ * exceed the 64KB limit, this method will attempt to split the code in
+ * the {@link InstructionList} associated with this
+ * MethodGenerator
into several methods.
Method
s generated
+ */
+ Method[] getGeneratedMethods(ClassGenerator classGen) {
+ Method[] generatedMethods;
+ InstructionList il = getInstructionList();
+ InstructionHandle last = il.getEnd();
+
+ il.setPositions();
+
+ int instructionListSize =
+ last.getPosition() + last.getInstruction().getLength();
+
+ // Need to look for any branch target offsets that exceed the range
+ // [-32768,32767]
+ if (instructionListSize > MAX_BRANCH_TARGET_OFFSET) {
+ boolean ilChanged = widenConditionalBranchTargetOffsets();
+
+ // If any branch instructions needed widening, recompute the size
+ // of the byte code for the method
+ if (ilChanged) {
+ il.setPositions();
+ last = il.getEnd();
+ instructionListSize =
+ last.getPosition() + last.getInstruction().getLength();
+ }
+ }
+
+ if (instructionListSize > MAX_METHOD_SIZE) {
+ generatedMethods = outlineChunks(classGen, instructionListSize);
+ } else {
+ generatedMethods = new Method[] {getThisMethod()};
+ }
+ return generatedMethods;
+ }
+
+ protected Method getThisMethod() {
+ stripAttributes(true);
+ setMaxLocals();
+ setMaxStack();
+ removeNOPs();
+
+ return getMethod();
+ }
+ /**
+ * Rewrites branches to avoid the JVM limits of relative branch + * offsets. There is no need to invoke this method if the bytecode for the + * {@link MethodGenerator} does not exceed 32KB.
+ *The Java Virtual Machine Specification permits the code portion of a + * method to be up to 64KB in length. However, some control transfer + * instructions specify relative offsets as a signed 16-bit quantity, + * limiting the range to a subset of the instructions that might be in a + * method.
+ *The TABLESWITCH
and LOOKUPSWITCH
+ * instructions always use 32-bit signed relative offsets, so they are
+ * immune to this problem.
The GOTO
and JSR
+ * instructions come in two forms, one of which uses 16-bit relative
+ * offsets, and the other of which uses 32-bit relative offsets. The BCEL
+ * library decides whether to use the wide form of GOTO
or
+ * JSR
instructions based on the relative offset of the target
+ * of the instruction without any intervention by the user of the
+ * library.
This leaves the various conditional branch instructions,
+ * IFEQ
, IFNULL
, IF_ICMPEQ
,
+ * et al., all of which use 16-bit signed relative offsets, with no
+ * 32-bit wide form available.
This method scans the {@link InstructionList} associated with this
+ * {@link MethodGenerator} and finds all conditional branch instructions
+ * that might exceed the 16-bit limitation for relative branch offsets.
+ * The logic of each such instruction is inverted, and made to target the
+ * instruction which follows it. An unconditional branch to the original
+ * target of the instruction is then inserted between the conditional
+ * branch and the instruction which previously followed it. The
+ * unconditional branch is permitted to have a 16-bit or a 32-bit relative
+ * offset, as described above. For example,
+ *
+ * 1234: NOP
+ * ...
+ * 55278: IFEQ -54044
+ * 55280: NOP
+ *
+ * is rewritten as
+ *
+ * 1234: NOP
+ * ...
+ * 55278: IFNE 7
+ * 55280: GOTO_W -54046
+ * 55285: NOP
+ *
Preconditions: + *
InstructionList
associated with this
+ * MethodGenerator
.
+ * Postconditions: + *
InstructionList
for this
+ * MethodGenerator
will invalidate the changes made by this
+ * method.true
if the InstructionList
was
+ * modified; false
otherwise
+ * @see The Java Virtual Machine Specification, Second Edition
+ */
+ boolean widenConditionalBranchTargetOffsets() {
+ boolean ilChanged = false;
+ int maxOffsetChange = 0;
+ InstructionList il = getInstructionList();
+
+ // Loop through all the instructions, finding those that would be
+ // affected by inserting new instructions in the InstructionList, and
+ // calculating the maximum amount by which the relative offset between
+ // two instructions could possibly change.
+ // In part this loop duplicates code in
+ // org.apache.bcel.generic.InstructionList.setPosition(), which does
+ // this to determine whether to use 16-bit or 32-bit offsets for GOTO
+ // and JSR instructions. Ideally, that method would do the same for
+ // conditional branch instructions, but it doesn't, so we duplicate the
+ // processing here.
+ for (InstructionHandle ih = il.getStart();
+ ih != null;
+ ih = ih.getNext()) {
+ Instruction inst = ih.getInstruction();
+
+ switch (inst.getOpcode()) {
+ // Instructions that may have 16-bit or 32-bit branch targets.
+ // The size of the branch offset might increase by two bytes.
+ case Constants.GOTO:
+ case Constants.JSR:
+ maxOffsetChange = maxOffsetChange + 2;
+ break;
+ // Instructions that contain padding for alignment purposes
+ // Up to three bytes of padding might be needed. For greater
+ // accuracy, we should be able to discount any padding already
+ // added to these instructions by InstructionList.setPosition(),
+ // their APIs do not expose that information.
+ case Constants.TABLESWITCH:
+ case Constants.LOOKUPSWITCH:
+ maxOffsetChange = maxOffsetChange + 3;
+ break;
+ // Instructions that might be rewritten by this method as a
+ // conditional branch followed by an unconditional branch.
+ // The unconditional branch would require five bytes.
+ case Constants.IF_ACMPEQ:
+ case Constants.IF_ACMPNE:
+ case Constants.IF_ICMPEQ:
+ case Constants.IF_ICMPGE:
+ case Constants.IF_ICMPGT:
+ case Constants.IF_ICMPLE:
+ case Constants.IF_ICMPLT:
+ case Constants.IF_ICMPNE:
+ case Constants.IFEQ:
+ case Constants.IFGE:
+ case Constants.IFGT:
+ case Constants.IFLE:
+ case Constants.IFLT:
+ case Constants.IFNE:
+ case Constants.IFNONNULL:
+ case Constants.IFNULL:
+ maxOffsetChange = maxOffsetChange + 5;
+ break;
+ }
+ }
+
+ // Now that the maximum number of bytes by which the method might grow
+ // has been determined, look for conditional branches to see which
+ // might possibly exceed the 16-bit relative offset.
+ for (InstructionHandle ih = il.getStart();
+ ih != null;
+ ih = ih.getNext()) {
+ Instruction inst = ih.getInstruction();
+
+ if (inst instanceof IfInstruction) {
+ IfInstruction oldIfInst = (IfInstruction)inst;
+ BranchHandle oldIfHandle = (BranchHandle)ih;
+ InstructionHandle target = oldIfInst.getTarget();
+ int relativeTargetOffset = target.getPosition()
+ - oldIfHandle.getPosition();
+
+ // Consider the worst case scenario in which the conditional
+ // branch and its target are separated by all the instructions
+ // in the method that might increase in size. If that results
+ // in a relative offset that cannot be represented as a 32-bit
+ // signed quantity, rewrite the instruction as described above.
+ if ((relativeTargetOffset - maxOffsetChange
+ < MIN_BRANCH_TARGET_OFFSET)
+ || (relativeTargetOffset + maxOffsetChange
+ > MAX_BRANCH_TARGET_OFFSET)) {
+ // Invert the logic of the IF instruction, and append
+ // that to the InstructionList following the original IF
+ // instruction
+ InstructionHandle nextHandle = oldIfHandle.getNext();
+ IfInstruction invertedIfInst = oldIfInst.negate();
+ BranchHandle invertedIfHandle = il.append(oldIfHandle,
+ invertedIfInst);
+
+ // Append an unconditional branch to the target of the
+ // original IF instruction after the new IF instruction
+ BranchHandle gotoHandle = il.append(invertedIfHandle,
+ new GOTO(target));
+
+ // If the original IF was the last instruction in
+ // InstructionList, add a new no-op to act as the target
+ // of the new IF
+ if (nextHandle == null) {
+ nextHandle = il.append(gotoHandle, NOP);
+ }
+
+ // Make the new IF instruction branch around the GOTO
+ invertedIfHandle.updateTarget(target, nextHandle);
+
+ // If anything still "points" to the old IF instruction,
+ // make adjustments to refer to either the new IF or GOTO
+ // instruction
+ if (oldIfHandle.hasTargeters()) {
+ InstructionTargeter[] targeters =
+ oldIfHandle.getTargeters();
+
+ for (int i = 0; i < targeters.length; i++) {
+ InstructionTargeter targeter = targeters[i];
+ // Ideally, one should simply be able to use
+ // InstructionTargeter.updateTarget to change
+ // references to the old IF instruction to the new
+ // IF instruction. However, if a LocalVariableGen
+ // indicated the old IF marked the end of the range
+ // in which the IF variable is in use, the live
+ // range of the variable must extend to include the
+ // newly created GOTO instruction. The need for
+ // this sort of specific knowledge of an
+ // implementor of the InstructionTargeter interface
+ // makes the code more fragile. Future implementors
+ // of the interface might have similar requirements
+ // which wouldn't be accommodated seemlessly.
+ if (targeter instanceof LocalVariableGen) {
+ LocalVariableGen lvg =
+ (LocalVariableGen) targeter;
+ if (lvg.getStart() == oldIfHandle) {
+ lvg.setStart(invertedIfHandle);
+ } else if (lvg.getEnd() == oldIfHandle) {
+ lvg.setEnd(gotoHandle);
+ }
+ } else {
+ targeter.updateTarget(oldIfHandle,
+ invertedIfHandle);
+ }
+ }
+ }
+
+ try {
+ il.delete(oldIfHandle);
+ } catch (TargetLostException tle) {
+ // This can never happen - we updated the list of
+ // instructions that target the deleted instruction
+ // prior to deleting it.
+ String msg =
+ new ErrorMsg(ErrorMsg.OUTLINE_ERR_DELETED_TARGET,
+ tle.getMessage()).toString();
+ throw new InternalError(msg);
+ }
+
+ // Adjust the pointer in the InstructionList to point after
+ // the newly inserted IF instruction
+ ih = gotoHandle;
+
+ // Indicate that this method rewrote at least one IF
+ ilChanged = true;
+ }
+ }
+ }
+
+ // Did this method rewrite any IF instructions?
+ return ilChanged;
+ }
+}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodType.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodType.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodType.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MethodType.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MultiHashtable.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MultiHashtable.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MultiHashtable.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/MultiHashtable.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NamedMethodGenerator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NamedMethodGenerator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NamedMethodGenerator.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NamedMethodGenerator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeCounterGenerator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeCounterGenerator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeCounterGenerator.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeCounterGenerator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSetType.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSetType.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSetType.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSetType.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordFactGenerator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordFactGenerator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordFactGenerator.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordFactGenerator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordGenerator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordGenerator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordGenerator.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeSortRecordGenerator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeType.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeType.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeType.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NodeType.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NumberType.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NumberType.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NumberType.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/NumberType.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ObjectType.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ObjectType.java
similarity index 97%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ObjectType.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ObjectType.java
index e093bd163d5..206b59efe62 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ObjectType.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ObjectType.java
@@ -34,6 +34,7 @@ import com.sun.org.apache.bcel.internal.generic.Instruction;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
import com.sun.org.apache.bcel.internal.generic.PUSH;
import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
/**
* @author Todd Miller
@@ -53,8 +54,7 @@ public final class ObjectType extends Type {
_javaClassName = javaClassName;
try {
- _clazz = ObjectFactory.findProviderClass(
- javaClassName, ObjectFactory.findClassLoader(), true);
+ _clazz = ObjectFactory.findProviderClass(javaClassName, true);
}
catch (ClassNotFoundException e) {
_clazz = null;
diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/OutlineableChunkEnd.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/OutlineableChunkEnd.java
new file mode 100644
index 00000000000..b2daff35cf0
--- /dev/null
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/OutlineableChunkEnd.java
@@ -0,0 +1,70 @@
+/*
+ * reserved comment block
+ * DO NOT REMOVE OR ALTER!
+ */
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+/*
+ * $Id: OutlineableChunkEnd.java,v 1.10 2010-11-01 04:34:19 joehw Exp $
+ */
+package com.sun.org.apache.xalan.internal.xsltc.compiler.util;
+import com.sun.org.apache.bcel.internal.generic.Instruction;
+/**
+ * Marks the end of a region of byte code that can be copied into a new + * method. See the {@link OutlineableChunkStart} pseudo-instruction for + * details.
+ */ +class OutlineableChunkEnd extends MarkerInstruction { + /** + * A constant instance of {@link OutlineableChunkEnd}. As it has no fields, + * there should be no need to create an instance of this class. + */ + public static final Instruction OUTLINEABLECHUNKEND = + new OutlineableChunkEnd(); + + /** + * Private default constructor. As it has no fields, + * there should be no need to create an instance of this class. See + * {@link OutlineableChunkEnd#OUTLINEABLECHUNKEND}. + */ + private OutlineableChunkEnd() { + } + + /** + * Get the name of this instruction. Used for debugging. + * @return the instruction name + */ + public String getName() { + return OutlineableChunkEnd.class.getName(); + } + + /** + * Get the name of this instruction. Used for debugging. + * @return the instruction name + */ + public String toString() { + return getName(); + } + + /** + * Get the name of this instruction. Used for debugging. + * @return the instruction name + */ + public String toString(boolean verbose) { + return getName(); + } +} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/OutlineableChunkStart.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/OutlineableChunkStart.java new file mode 100644 index 00000000000..9b54cac0f22 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/OutlineableChunkStart.java @@ -0,0 +1,80 @@ +/* + * reserved comment block + * DO NOT REMOVE OR ALTER! + */ +/* + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed 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. + */ + +/* + * $Id: MethodGenerator.java,v 1.10 2010-11-01 04:34:19 joehw Exp $ + */ +package com.sun.org.apache.xalan.internal.xsltc.compiler.util; +import com.sun.org.apache.bcel.internal.generic.Instruction; + +/** + *This pseudo-instruction marks the beginning of a region of byte code that + * can be copied into a new method, termed an "outlineable" chunk. The size of + * the Java stack must be the same at the start of the region as it is at the + * end of the region, any value on the stack at the start of the region must not + * be consumed by an instruction in the region of code, the region must not + * contain a return instruction, no branch instruction in the region is + * permitted to have a target that is outside the region, and no branch + * instruction outside the region is permitted to have a target that is inside + * the region.
+ *The end of the region is marked by an {@link OutlineableChunkEnd} + * pseudo-instruction.
+ *Such a region of code may contain other outlineable regions.
+ */ +class OutlineableChunkStart extends MarkerInstruction { + /** + * A constant instance of {@link OutlineableChunkStart}. As it has no fields, + * there should be no need to create an instance of this class. + */ + public static final Instruction OUTLINEABLECHUNKSTART = + new OutlineableChunkStart(); + + /** + * Private default constructor. As it has no fields, + * there should be no need to create an instance of this class. See + * {@link OutlineableChunkStart#OUTLINEABLECHUNKSTART}. + */ + private OutlineableChunkStart() { + } + + /** + * Get the name of this instruction. Used for debugging. + * @return the instruction name + */ + public String getName() { + return OutlineableChunkStart.class.getName(); + } + + /** + * Get the name of this instruction. Used for debugging. + * @return the instruction name + */ + public String toString() { + return getName(); + } + + /** + * Get the name of this instruction. Used for debugging. + * @return the instruction name + */ + public String toString(boolean verbose) { + return getName(); + } +} diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RealType.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RealType.java similarity index 98% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RealType.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RealType.java index 2d1e74504de..f70a210c0ab 100644 --- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RealType.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RealType.java @@ -170,8 +170,8 @@ public final class RealType extends NumberType { il.append(DUP2); local = methodGen.addLocalVariable("real_to_boolean_tmp", com.sun.org.apache.bcel.internal.generic.Type.DOUBLE, - il.getEnd(), null); - il.append(new DSTORE(local.getIndex())); + null, null); + local.setStart(il.append(new DSTORE(local.getIndex()))); // Compare it to 0.0 il.append(DCONST_0); @@ -181,7 +181,7 @@ public final class RealType extends NumberType { //!!! call isNaN // Compare it to itself to see if NaN il.append(new DLOAD(local.getIndex())); - il.append(new DLOAD(local.getIndex())); + local.setEnd(il.append(new DLOAD(local.getIndex()))); il.append(DCMPG); flowlist.add(il.append(new IFNE(null))); // NaN != NaN return flowlist; diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ReferenceType.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ReferenceType.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ReferenceType.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ReferenceType.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ResultTreeType.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ResultTreeType.java similarity index 97% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ResultTreeType.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ResultTreeType.java index c6d8dd0e3dd..e61f7cbc87a 100644 --- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ResultTreeType.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ResultTreeType.java @@ -180,7 +180,7 @@ public final class ResultTreeType extends Type { methodGen.addLocalVariable("rt_to_string_handler", Util.getJCRefType(STRING_VALUE_HANDLER_SIG), null, null); - il.append(new ASTORE(handler.getIndex())); + handler.setStart(il.append(new ASTORE(handler.getIndex()))); // Call the method that implements this result tree index = cpg.addMethodref(className, _methodName, @@ -188,7 +188,7 @@ public final class ResultTreeType extends Type { il.append(new INVOKEVIRTUAL(index)); // Restore new handler and call getValue() - il.append(new ALOAD(handler.getIndex())); + handler.setEnd(il.append(new ALOAD(handler.getIndex()))); index = cpg.addMethodref(STRING_VALUE_HANDLER, "getValue", "()" + STRING_SIG); @@ -255,7 +255,7 @@ public final class ResultTreeType extends Type { Util.getJCRefType(DOM_INTF_SIG), null, null); il.append(new CHECKCAST(cpg.addClass(DOM_INTF_SIG))); - il.append(new ASTORE(newDom.getIndex())); + newDom.setStart(il.append(new ASTORE(newDom.getIndex()))); // Overwrite old handler with DOM handler index = cpg.addInterfaceMethodref(DOM_INTF, @@ -275,7 +275,7 @@ public final class ResultTreeType extends Type { methodGen.addLocalVariable("rt_to_reference_handler", Util.getJCRefType(TRANSLET_OUTPUT_SIG), null, null); - il.append(new ASTORE(domBuilder.getIndex())); + domBuilder.setStart(il.append(new ASTORE(domBuilder.getIndex()))); // Call startDocument on the new handler index = cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE, @@ -292,13 +292,13 @@ public final class ResultTreeType extends Type { il.append(new INVOKEVIRTUAL(index)); // Call endDocument on the DOM handler - il.append(new ALOAD(domBuilder.getIndex())); + domBuilder.setEnd(il.append(new ALOAD(domBuilder.getIndex()))); index = cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE, "endDocument", "()V"); il.append(new INVOKEINTERFACE(index, 1)); // Push the new DOM on the stack - il.append(new ALOAD(newDom.getIndex())); + newDom.setEnd(il.append(new ALOAD(newDom.getIndex()))); } } diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RtMethodGenerator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RtMethodGenerator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RtMethodGenerator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/RtMethodGenerator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/SlotAllocator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/SlotAllocator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/SlotAllocator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/SlotAllocator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringStack.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringStack.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringStack.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringStack.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringType.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringType.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringType.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/StringType.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TestGenerator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TestGenerator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TestGenerator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TestGenerator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Type.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TypeCheckError.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TypeCheckError.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TypeCheckError.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/TypeCheckError.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Util.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Util.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Util.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/Util.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/VoidType.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/VoidType.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/util/VoidType.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/VoidType.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.cup b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.cup similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.cup rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.cup diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.lex b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.lex similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.lex rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/xpath.lex diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/AbsoluteIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/AbsoluteIterator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/AbsoluteIterator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/AbsoluteIterator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/AdaptiveResultTreeImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/AdaptiveResultTreeImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/AdaptiveResultTreeImpl.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/AdaptiveResultTreeImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/AnyNodeCounter.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/AnyNodeCounter.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/AnyNodeCounter.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/AnyNodeCounter.java diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/ArrayNodeListIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/ArrayNodeListIterator.java new file mode 100644 index 00000000000..d7cf3a54fd0 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/ArrayNodeListIterator.java @@ -0,0 +1,91 @@ +/* + * reserved comment block + * DO NOT REMOVE OR ALTER! + */ +/* + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed 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. + */ + +/* + * $Id: ArrayNodeListIterator.java,v 1.0 2009-11-25 04:34:24 joehw Exp $ + */ +package com.sun.org.apache.xalan.internal.xsltc.dom; + +import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator; + +public class ArrayNodeListIterator implements DTMAxisIterator { + + private int _pos = 0; + + private int _mark = 0; + + private int _nodes[]; + + private static final int[] EMPTY = { }; + + public ArrayNodeListIterator(int[] nodes) { + _nodes = nodes; + } + + public int next() { + return _pos < _nodes.length ? _nodes[_pos++] : END; + } + + public DTMAxisIterator reset() { + _pos = 0; + return this; + } + + public int getLast() { + return _nodes.length; + } + + public int getPosition() { + return _pos; + } + + public void setMark() { + _mark = _pos; + } + + public void gotoMark() { + _pos = _mark; + } + + public DTMAxisIterator setStartNode(int node) { + if (node == END) _nodes = EMPTY; + return this; + } + + public int getStartNode() { + return END; + } + + public boolean isReverse() { + return false; + } + + public DTMAxisIterator cloneIterator() { + return new ArrayNodeListIterator(_nodes); + } + + public void setRestartable(boolean isRestartable) { + } + + public int getNodeByPosition(int position) { + return _nodes[position - 1]; + } + +} diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/BitArray.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/BitArray.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/BitArray.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/BitArray.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/CachedNodeListIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/CachedNodeListIterator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/CachedNodeListIterator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/CachedNodeListIterator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/ClonedNodeListIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/ClonedNodeListIterator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/ClonedNodeListIterator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/ClonedNodeListIterator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/CollatorFactoryBase.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/CollatorFactoryBase.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/CollatorFactoryBase.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/CollatorFactoryBase.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListFilter.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListFilter.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListFilter.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListFilter.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListIterator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListIterator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/CurrentNodeListIterator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DOMAdapter.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMAdapter.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DOMAdapter.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMAdapter.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DOMBuilder.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMBuilder.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DOMBuilder.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMBuilder.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DOMWSFilter.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMWSFilter.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DOMWSFilter.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/DOMWSFilter.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/DocumentCache.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DupFilterIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/DupFilterIterator.java similarity index 93% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DupFilterIterator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/DupFilterIterator.java index c76f11d61e7..8ba00f4c6bf 100644 --- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/DupFilterIterator.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/DupFilterIterator.java @@ -88,7 +88,9 @@ public final class DupFilterIterator extends DTMAxisIteratorBase { if (_isRestartable) { // KeyIndex iterators are always relative to the root node, so there // is never any point in re-reading the iterator (and we SHOULD NOT). - if (_source instanceof KeyIndex + boolean sourceIsKeyIndex = _source instanceof KeyIndex; + + if (sourceIsKeyIndex && _startNode == DTMDefaultBase.ROOTNODE) { return this; } @@ -100,7 +102,12 @@ public final class DupFilterIterator extends DTMAxisIteratorBase { while ((node = _source.next()) != END) { _nodes.add(node); } - _nodes.sort(); + + // Nodes produced by KeyIndex are known to be in document order. + // Take advantage of it. + if (!sourceIsKeyIndex) { + _nodes.sort(); + } _nodesSize = _nodes.cardinality(); _current = 0; _lastNext = END; diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/EmptyFilter.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/EmptyFilter.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/EmptyFilter.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/EmptyFilter.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/ExtendedSAX.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/ExtendedSAX.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/ExtendedSAX.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/ExtendedSAX.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/Filter.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/Filter.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/Filter.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/Filter.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/FilterIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/FilterIterator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/FilterIterator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/FilterIterator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/FilteredStepIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/FilteredStepIterator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/FilteredStepIterator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/FilteredStepIterator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/ForwardPositionIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/ForwardPositionIterator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/ForwardPositionIterator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/ForwardPositionIterator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/KeyIndex.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/LoadDocument.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/LoadDocument.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/LoadDocument.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/LoadDocument.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/MatchingIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/MatchingIterator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/MatchingIterator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/MatchingIterator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiDOM.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/MultiValuedNodeHeapIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiValuedNodeHeapIterator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/MultiValuedNodeHeapIterator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultiValuedNodeHeapIterator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/MultipleNodeCounter.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultipleNodeCounter.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/MultipleNodeCounter.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/MultipleNodeCounter.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeCounter.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeCounter.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeCounter.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeCounter.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeIteratorBase.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeIteratorBase.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeIteratorBase.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeIteratorBase.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java similarity index 99% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java index 8f3684a7ae8..7057a32ffe2 100644 --- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecord.java @@ -32,6 +32,7 @@ import com.sun.org.apache.xalan.internal.xsltc.DOM; import com.sun.org.apache.xalan.internal.xsltc.TransletException; import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet; import com.sun.org.apache.xml.internal.utils.StringComparable; +import com.sun.org.apache.xalan.internal.utils.ObjectFactory; /** * Base class for sort records containing application specific sort keys @@ -119,8 +120,7 @@ public abstract class NodeSortRecord { if (colFactClassname != null) { try { - Object candObj = ObjectFactory.findProviderClass( - colFactClassname, ObjectFactory.findClassLoader(), true); + Object candObj = ObjectFactory.findProviderClass(colFactClassname, true); _collatorFactory = (CollatorFactory)candObj; } catch (ClassNotFoundException e) { throw new TransletException(e); diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java similarity index 97% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java index 009abcb7edf..1cc464c4937 100644 --- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NodeSortRecordFactory.java @@ -28,6 +28,7 @@ import com.sun.org.apache.xalan.internal.xsltc.Translet; import com.sun.org.apache.xalan.internal.xsltc.TransletException; import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet; import com.sun.org.apache.xml.internal.utils.LocaleUtility; +import com.sun.org.apache.xalan.internal.utils.ObjectFactory; import java.util.Locale; import java.text.Collator; @@ -82,8 +83,7 @@ public class NodeSortRecordFactory { _class = translet.getAuxiliaryClass(className); // This code is only run when the native API is used if (_class == null) { - _class = ObjectFactory.findProviderClass( - className, ObjectFactory.findClassLoader(), true); + _class = ObjectFactory.findProviderClass(className, true); } int levels = order.length; diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NthIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NthIterator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/NthIterator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/NthIterator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/SAXImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SimpleResultTreeImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/SimpleResultTreeImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SimpleResultTreeImpl.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/SimpleResultTreeImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SingleNodeCounter.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/SingleNodeCounter.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SingleNodeCounter.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/SingleNodeCounter.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SingletonIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/SingletonIterator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SingletonIterator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/SingletonIterator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SortSettings.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/SortSettings.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SortSettings.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/SortSettings.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SortingIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/SortingIterator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/SortingIterator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/SortingIterator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/StepIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/StepIterator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/StepIterator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/StepIterator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/StripWhitespaceFilter.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/StripWhitespaceFilter.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/StripWhitespaceFilter.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/StripWhitespaceFilter.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/UnionIterator.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/UnionIterator.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/UnionIterator.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/UnionIterator.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/XSLTCDTMManager.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/XSLTCDTMManager.java similarity index 97% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/XSLTCDTMManager.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/XSLTCDTMManager.java index b416ca714cd..43eb1024c3e 100644 --- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/dom/XSLTCDTMManager.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/dom/XSLTCDTMManager.java @@ -42,6 +42,7 @@ import com.sun.org.apache.xml.internal.utils.SystemIDResolver; import com.sun.org.apache.xalan.internal.xsltc.trax.DOM2SAX; import com.sun.org.apache.xalan.internal.xsltc.trax.StAXEvent2SAX; import com.sun.org.apache.xalan.internal.xsltc.trax.StAXStream2SAX; +import com.sun.org.apache.xalan.internal.utils.ObjectFactory; import org.xml.sax.InputSource; import org.xml.sax.SAXNotRecognizedException; @@ -102,9 +103,22 @@ public class XSLTCDTMManager extends DTMManagerDefault * The default iscom.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager
.
*/
public static Class getDTMManagerClass() {
- Class mgrClass = ObjectFactory.lookUpFactoryClass(DEFAULT_PROP_NAME,
+ return getDTMManagerClass(true);
+ }
+
+ public static Class getDTMManagerClass(boolean useServicesMechanism) {
+ Class mgrClass = null;
+ if (useServicesMechanism) {
+ mgrClass = ObjectFactory.lookUpFactoryClass(DEFAULT_PROP_NAME,
null,
DEFAULT_CLASS_NAME);
+ } else {
+ try {
+ mgrClass = ObjectFactory.findProviderClass(DEFAULT_CLASS_NAME, true);
+ } catch (Exception e) {
+ //will not happen
+ }
+ }
// If no class found, default to this one. (This should never happen -
// the ObjectFactory has already been told that the current class is
// the default).
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/javax.xml.transform.TransformerFactory b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/javax.xml.transform.TransformerFactory
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/javax.xml.transform.TransformerFactory
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/javax.xml.transform.TransformerFactory
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java
similarity index 97%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java
index c902255336e..71e1e4abf7a 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java
@@ -23,6 +23,7 @@
package com.sun.org.apache.xalan.internal.xsltc.runtime;
+import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
import java.io.File;
import java.io.FileOutputStream;
import java.io.BufferedOutputStream;
@@ -66,6 +67,8 @@ public abstract class AbstractTranslet implements Translet {
public String _encoding = "UTF-8";
public boolean _omitHeader = false;
public String _standalone = null;
+ //see OutputPropertiesFactory.ORACLE_IS_STANDALONE
+ public boolean _isStandalone = false;
public String _doctypePublic = null;
public String _doctypeSystem = null;
public boolean _indent = false;
@@ -105,6 +108,7 @@ public abstract class AbstractTranslet implements Translet {
// This is the name of the index used for ID attributes
private final static String ID_INDEX_NAME = "##id";
+ private boolean _useServicesMechanism;
/************************************************************************
* Debugging
@@ -669,6 +673,7 @@ public abstract class AbstractTranslet implements Translet {
if (_doctypeSystem != null) {
handler.setDoctype(_doctypeSystem, _doctypePublic);
}
+ handler.setIsStandalone(_isStandalone);
}
else if (_method.equals("html")) {
handler.setIndent(_indent);
@@ -691,6 +696,7 @@ public abstract class AbstractTranslet implements Translet {
}
handler.setIndent(_indent);
handler.setDoctype(_doctypeSystem, _doctypePublic);
+ handler.setIsStandalone(_isStandalone);
}
}
@@ -738,6 +744,19 @@ public abstract class AbstractTranslet implements Translet {
public void setTemplates(Templates templates) {
_templates = templates;
}
+ /**
+ * Return the state of the services mechanism feature.
+ */
+ public boolean useServicesMechnism() {
+ return _useServicesMechanism;
+ }
+
+ /**
+ * Set the state of the services mechanism feature.
+ */
+ public void setServicesMechnism(boolean flag) {
+ _useServicesMechanism = flag;
+ }
/************************************************************************
* DOMImplementation caching for basis library
@@ -748,8 +767,8 @@ public abstract class AbstractTranslet implements Translet {
throws ParserConfigurationException
{
if (_domImplementation == null) {
- _domImplementation = DocumentBuilderFactory.newInstance()
- .newDocumentBuilder().getDOMImplementation();
+ DocumentBuilderFactory dbf = FactoryImpl.getDOMFactory(_useServicesMechanism);
+ _domImplementation = dbf.newDocumentBuilder().getDOMImplementation();
}
return _domImplementation.createDocument(uri, qname, null);
}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/Attributes.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Attributes.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/Attributes.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Attributes.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java
similarity index 87%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java
index b8e766dced0..fc388d92ea9 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java
@@ -40,12 +40,17 @@ import com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter;
import com.sun.org.apache.xalan.internal.xsltc.dom.MultiDOM;
import com.sun.org.apache.xalan.internal.xsltc.dom.SingletonIterator;
import com.sun.org.apache.xalan.internal.xsltc.dom.StepIterator;
+import com.sun.org.apache.xalan.internal.xsltc.dom.ArrayNodeListIterator;
+import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
import com.sun.org.apache.xml.internal.dtm.DTMManager;
import com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase;
+import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy;
import org.w3c.dom.DOMException;
+import org.w3c.dom.Attr;
import org.w3c.dom.Document;
+import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import com.sun.org.apache.xml.internal.serializer.NamespaceMappings;
@@ -153,7 +158,7 @@ public final class BasisLibrary {
return dom.getStringValueX(((Node)obj).node);
}
else if (obj instanceof DOM) {
- // When the first argument is a DOM we want the whole fecking
+ // When the first argument is a DOM we want the whole
// DOM and not just a single node - that would not make sense.
//return ((DOM)obj).getStringValueX(node);
return ((DOM)obj).getStringValue();
@@ -1003,7 +1008,7 @@ public final class BasisLibrary {
}
// Convert var/param -> node-set
else if (obj instanceof DTMAxisIterator) {
- return(((DTMAxisIterator)obj).cloneIterator());
+ return(((DTMAxisIterator)obj).cloneIterator().reset());
}
else {
final String className = obj.getClass().getName();
@@ -1143,90 +1148,42 @@ public final class BasisLibrary {
}
/**
- * Utility function used to copy a node list to be under a parent node.
+ * In a perfect world, this would be the implementation for
+ * nodeList2Iterator. In reality, though, this causes a
+ * ClassCastException in getDTMHandleFromNode because SAXImpl is
+ * not an instance of DOM2DTM. So we use the more lengthy
+ * implementation below until this issue has been addressed.
+ *
+ * @see org.apache.xml.dtm.ref.DTMManagerDefault#getDTMHandleFromNode
*/
- private static void copyNodes(org.w3c.dom.NodeList nodeList,
- org.w3c.dom.Document doc, org.w3c.dom.Node parent)
+ private static DTMAxisIterator nodeList2IteratorUsingHandleFromNode(
+ org.w3c.dom.NodeList nodeList,
+ Translet translet, DOM dom)
{
- final int size = nodeList.getLength();
-
- // copy Nodes from NodeList into new w3c DOM
- for (int i = 0; i < size; i++)
- {
- org.w3c.dom.Node curr = nodeList.item(i);
- int nodeType = curr.getNodeType();
- String value = null;
- try {
- value = curr.getNodeValue();
- } catch (DOMException ex) {
- runTimeError(RUN_TIME_INTERNAL_ERR, ex.getMessage());
- return;
+ final int n = nodeList.getLength();
+ final int[] dtmHandles = new int[n];
+ DTMManager dtmManager = null;
+ if (dom instanceof MultiDOM)
+ dtmManager = ((MultiDOM) dom).getDTMManager();
+ for (int i = 0; i < n; ++i) {
+ org.w3c.dom.Node node = nodeList.item(i);
+ int handle;
+ if (dtmManager != null) {
+ handle = dtmManager.getDTMHandleFromNode(node);
}
-
- String nodeName = curr.getNodeName();
- org.w3c.dom.Node newNode = null;
- switch (nodeType){
- case org.w3c.dom.Node.ATTRIBUTE_NODE:
- newNode = doc.createAttributeNS(curr.getNamespaceURI(),
- nodeName);
- break;
- case org.w3c.dom.Node.CDATA_SECTION_NODE:
- newNode = doc.createCDATASection(value);
- break;
- case org.w3c.dom.Node.COMMENT_NODE:
- newNode = doc.createComment(value);
- break;
- case org.w3c.dom.Node.DOCUMENT_FRAGMENT_NODE:
- newNode = doc.createDocumentFragment();
- break;
- case org.w3c.dom.Node.DOCUMENT_NODE:
- newNode = doc.createElementNS(null, "__document__");
- copyNodes(curr.getChildNodes(), doc, newNode);
- break;
- case org.w3c.dom.Node.DOCUMENT_TYPE_NODE:
- // nothing?
- break;
- case org.w3c.dom.Node.ELEMENT_NODE:
- // For Element node, also copy the children and the
- // attributes.
- org.w3c.dom.Element element = doc.createElementNS(
- curr.getNamespaceURI(), nodeName);
- if (curr.hasAttributes())
- {
- org.w3c.dom.NamedNodeMap attributes = curr.getAttributes();
- for (int k = 0; k < attributes.getLength(); k++) {
- org.w3c.dom.Node attr = attributes.item(k);
- element.setAttributeNS(attr.getNamespaceURI(),
- attr.getNodeName(), attr.getNodeValue());
- }
- }
- copyNodes(curr.getChildNodes(), doc, element);
- newNode = element;
- break;
- case org.w3c.dom.Node.ENTITY_NODE:
- // nothing ?
- break;
- case org.w3c.dom.Node.ENTITY_REFERENCE_NODE:
- newNode = doc.createEntityReference(nodeName);
- break;
- case org.w3c.dom.Node.NOTATION_NODE:
- // nothing ?
- break;
- case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE:
- newNode = doc.createProcessingInstruction(nodeName,
- value);
- break;
- case org.w3c.dom.Node.TEXT_NODE:
- newNode = doc.createTextNode(value);
- break;
+ else if (node instanceof DTMNodeProxy
+ && ((DTMNodeProxy) node).getDTM() == dom) {
+ handle = ((DTMNodeProxy) node).getDTMNodeNumber();
}
- try {
- parent.appendChild(newNode);
- } catch (DOMException e) {
- runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage());
- return;
+ else {
+ runTimeError(RUN_TIME_INTERNAL_ERR, "need MultiDOM");
+ return null;
}
+ dtmHandles[i] = handle;
+ System.out.println("Node " + i + " has handle 0x" +
+ Integer.toString(handle, 16));
}
+ return new ArrayNodeListIterator(dtmHandles);
}
/**
@@ -1237,26 +1194,93 @@ public final class BasisLibrary {
org.w3c.dom.NodeList nodeList,
Translet translet, DOM dom)
{
- // w3c NodeList -> w3c DOM
+ // First pass: build w3c DOM for all nodes not proxied from our DOM.
+ //
+ // Notice: this looses some (esp. parent) context for these nodes,
+ // so some way to wrap the original nodes inside a DTMAxisIterator
+ // might be preferable in the long run.
+ int n = 0; // allow for change in list length, just in case.
Document doc = null;
- try {
- doc = ((AbstractTranslet) translet).newDocument("", "__top__");
+ DTMManager dtmManager = null;
+ int[] proxyNodes = new int[nodeList.getLength()];
+ if (dom instanceof MultiDOM)
+ dtmManager = ((MultiDOM) dom).getDTMManager();
+ for (int i = 0; i < nodeList.getLength(); ++i) {
+ org.w3c.dom.Node node = nodeList.item(i);
+ if (node instanceof DTMNodeProxy) {
+ DTMNodeProxy proxy = (DTMNodeProxy)node;
+ DTM nodeDTM = proxy.getDTM();
+ int handle = proxy.getDTMNodeNumber();
+ boolean isOurDOM = (nodeDTM == dom);
+ if (!isOurDOM && dtmManager != null) {
+ try {
+ isOurDOM = (nodeDTM == dtmManager.getDTM(handle));
+ }
+ catch (ArrayIndexOutOfBoundsException e) {
+ // invalid node handle, so definitely not our doc
+ }
+ }
+ if (isOurDOM) {
+ proxyNodes[i] = handle;
+ ++n;
+ continue;
+ }
+ }
+ proxyNodes[i] = DTM.NULL;
+ int nodeType = node.getNodeType();
+ if (doc == null) {
+ if (dom instanceof MultiDOM == false) {
+ runTimeError(RUN_TIME_INTERNAL_ERR, "need MultiDOM");
+ return null;
+ }
+ try {
+ AbstractTranslet at = (AbstractTranslet) translet;
+ doc = at.newDocument("", "__top__");
+ }
+ catch (javax.xml.parsers.ParserConfigurationException e) {
+ runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage());
+ return null;
+ }
+ }
+ // Use one dummy element as container for each node of the
+ // list. That way, it is easier to detect resp. avoid
+ // funny things which change the number of nodes,
+ // e.g. auto-concatenation of text nodes.
+ Element mid;
+ switch (nodeType) {
+ case org.w3c.dom.Node.ELEMENT_NODE:
+ case org.w3c.dom.Node.TEXT_NODE:
+ case org.w3c.dom.Node.CDATA_SECTION_NODE:
+ case org.w3c.dom.Node.COMMENT_NODE:
+ case org.w3c.dom.Node.ENTITY_REFERENCE_NODE:
+ case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE:
+ mid = doc.createElementNS(null, "__dummy__");
+ mid.appendChild(doc.importNode(node, true));
+ doc.getDocumentElement().appendChild(mid);
+ ++n;
+ break;
+ case org.w3c.dom.Node.ATTRIBUTE_NODE:
+ // The mid element also serves as a container for
+ // attributes, avoiding problems with conflicting
+ // attributes or node order.
+ mid = doc.createElementNS(null, "__dummy__");
+ mid.setAttributeNodeNS((Attr)doc.importNode(node, true));
+ doc.getDocumentElement().appendChild(mid);
+ ++n;
+ break;
+ default:
+ // Better play it safe for all types we aren't sure we know
+ // how to deal with.
+ runTimeError(RUN_TIME_INTERNAL_ERR,
+ "Don't know how to convert node type "
+ + nodeType);
+ }
}
- catch (javax.xml.parsers.ParserConfigurationException e) {
- runTimeError(RUN_TIME_INTERNAL_ERR, e.getMessage());
- return null;
- }
-
- // Copy all the nodes in the nodelist to be under the top element
- copyNodes(nodeList, doc, doc.getDocumentElement());
// w3cDOM -> DTM -> DOMImpl
- if (dom instanceof MultiDOM) {
+ DTMAxisIterator iter = null, childIter = null, attrIter = null;
+ if (doc != null) {
final MultiDOM multiDOM = (MultiDOM) dom;
-
- DTMDefaultBase dtm = (DTMDefaultBase)((DOMAdapter)multiDOM.getMain()).getDOMImpl();
- DTMManager dtmManager = dtm.getManager();
-
DOM idom = (DOM)dtmManager.getDTM(new DOMSource(doc), false,
null, true, false);
// Create DOMAdapter and register with MultiDOM
@@ -1269,16 +1293,57 @@ public final class BasisLibrary {
DTMAxisIterator iter1 = idom.getAxisIterator(Axis.CHILD);
DTMAxisIterator iter2 = idom.getAxisIterator(Axis.CHILD);
- DTMAxisIterator iter = new AbsoluteIterator(
+ iter = new AbsoluteIterator(
new StepIterator(iter1, iter2));
iter.setStartNode(DTMDefaultBase.ROOTNODE);
- return iter;
+
+ childIter = idom.getAxisIterator(Axis.CHILD);
+ attrIter = idom.getAxisIterator(Axis.ATTRIBUTE);
}
- else {
- runTimeError(RUN_TIME_INTERNAL_ERR, "nodeList2Iterator()");
- return null;
+
+ // Second pass: find DTM handles for every node in the list.
+ int[] dtmHandles = new int[n];
+ n = 0;
+ for (int i = 0; i < nodeList.getLength(); ++i) {
+ if (proxyNodes[i] != DTM.NULL) {
+ dtmHandles[n++] = proxyNodes[i];
+ continue;
+ }
+ org.w3c.dom.Node node = nodeList.item(i);
+ DTMAxisIterator iter3 = null;
+ int nodeType = node.getNodeType();
+ switch (nodeType) {
+ case org.w3c.dom.Node.ELEMENT_NODE:
+ case org.w3c.dom.Node.TEXT_NODE:
+ case org.w3c.dom.Node.CDATA_SECTION_NODE:
+ case org.w3c.dom.Node.COMMENT_NODE:
+ case org.w3c.dom.Node.ENTITY_REFERENCE_NODE:
+ case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE:
+ iter3 = childIter;
+ break;
+ case org.w3c.dom.Node.ATTRIBUTE_NODE:
+ iter3 = attrIter;
+ break;
+ default:
+ // Should not happen, as first run should have got all these
+ throw new InternalRuntimeError("Mismatched cases");
+ }
+ if (iter3 != null) {
+ iter3.setStartNode(iter.next());
+ dtmHandles[n] = iter3.next();
+ // For now, play it self and perform extra checks:
+ if (dtmHandles[n] == DTMAxisIterator.END)
+ throw new InternalRuntimeError("Expected element missing at " + i);
+ if (iter3.next() != DTMAxisIterator.END)
+ throw new InternalRuntimeError("Too many elements at " + i);
+ ++n;
+ }
}
+ if (n != dtmHandles.length)
+ throw new InternalRuntimeError("Nodes lost in second pass");
+
+ return new ArrayNodeListIterator(dtmHandles);
}
/**
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/Constants.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Constants.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/Constants.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Constants.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/Hashtable.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Hashtable.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/Hashtable.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Hashtable.java
index 12c9b5127ae..e222e476adb 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/Hashtable.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Hashtable.java
@@ -294,7 +294,7 @@ public class Hashtable {
for (i = 0; i <= max; i++) {
String s1 = k.nextElement().toString();
String s2 = e.nextElement().toString();
- buf.append(s1 + "=" + s2);
+ buf.append(s1).append('=').append(s2);
if (i < max) buf.append(", ");
}
buf.append("}");
diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/InternalRuntimeError.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/InternalRuntimeError.java
new file mode 100644
index 00000000000..1f11788021e
--- /dev/null
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/InternalRuntimeError.java
@@ -0,0 +1,36 @@
+/*
+ * reserved comment block
+ * DO NOT REMOVE OR ALTER!
+ */
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+/*
+ * $Id: InternalRuntimeError.java,v 1.0 2009-11-25 04:34:28 joehw Exp $
+ */
+package com.sun.org.apache.xalan.internal.xsltc.runtime;
+
+/**
+ * Class to express failed assertions and similar for the xsltc runtime.
+ * As java.lang.AssertionError was introduced in JDK 1.4 we can't use that yet.
+ */
+public class InternalRuntimeError extends Error {
+
+ public InternalRuntimeError(String message) {
+ super(message);
+ }
+
+}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/MessageHandler.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/MessageHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/MessageHandler.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/MessageHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/Node.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Node.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/Node.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Node.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/Operators.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Operators.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/Operators.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Operators.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/Parameter.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Parameter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/Parameter.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/Parameter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/StringValueHandler.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/StringValueHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/StringValueHandler.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/StringValueHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/output/OutputBuffer.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/OutputBuffer.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/output/OutputBuffer.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/OutputBuffer.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/output/StringOutputBuffer.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/StringOutputBuffer.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/output/StringOutputBuffer.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/StringOutputBuffer.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/output/TransletOutputHandlerFactory.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/TransletOutputHandlerFactory.java
similarity index 94%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/output/TransletOutputHandlerFactory.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/TransletOutputHandlerFactory.java
index 29c5a322bd8..8b76f3a68b0 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/output/TransletOutputHandlerFactory.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/TransletOutputHandlerFactory.java
@@ -72,10 +72,18 @@ public class TransletOutputHandlerFactory {
private ContentHandler _handler = null;
private LexicalHandler _lexHandler = null;
+ private boolean _useServicesMechanism;
+
static public TransletOutputHandlerFactory newInstance() {
- return new TransletOutputHandlerFactory();
+ return new TransletOutputHandlerFactory(true);
+ }
+ static public TransletOutputHandlerFactory newInstance(boolean useServicesMechanism) {
+ return new TransletOutputHandlerFactory(useServicesMechanism);
}
+ public TransletOutputHandlerFactory(boolean useServicesMechanism) {
+ _useServicesMechanism = useServicesMechanism;
+ }
public void setOutputType(int outputType) {
_outputType = outputType;
}
@@ -188,7 +196,7 @@ public class TransletOutputHandlerFactory {
return result;
case DOM :
- _handler = (_node != null) ? new SAX2DOM(_node, _nextSibling) : new SAX2DOM();
+ _handler = (_node != null) ? new SAX2DOM(_node, _nextSibling, _useServicesMechanism) : new SAX2DOM(_useServicesMechanism);
_lexHandler = (LexicalHandler) _handler;
// falls through
case STAX :
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/output/WriterOutputBuffer.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/WriterOutputBuffer.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/runtime/output/WriterOutputBuffer.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/output/WriterOutputBuffer.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2SAX.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2TO.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2TO.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2TO.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/DOM2TO.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/OutputSettings.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/OutputSettings.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/OutputSettings.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/OutputSettings.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java
similarity index 88%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java
index b4d20526abb..a26f093ee08 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2DOM.java
@@ -49,6 +49,7 @@ import org.xml.sax.ext.Locator2;
/**
* @author G. Todd Miller
* @author Sunitha Reddy
+ * @author Huizhe Wang
*/
public class SAX2DOM implements ContentHandler, LexicalHandler, Constants {
@@ -69,27 +70,16 @@ public class SAX2DOM implements ContentHandler, LexicalHandler, Constants {
* synchronization because the Javadoc is not explicit about
* thread safety.
*/
- static final DocumentBuilderFactory _factory =
+ private DocumentBuilderFactory _factory =
DocumentBuilderFactory.newInstance();
- static final DocumentBuilder _internalBuilder;
- static {
- DocumentBuilder tmpBuilder = null;
- try {
- if (_factory instanceof com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl) {
- tmpBuilder = _factory.newDocumentBuilder();
- }
- } catch(Exception e) {
- // It's OK. Will create DocumentBuilder every time
- }
- _internalBuilder = tmpBuilder;
- }
+ private boolean _internal = true;
- public SAX2DOM() throws ParserConfigurationException {
- _document = createDocument();
+ public SAX2DOM(boolean useServicesMachnism) throws ParserConfigurationException {
+ _document = createDocument(useServicesMachnism);
_root = _document;
}
- public SAX2DOM(Node root, Node nextSibling) throws ParserConfigurationException {
+ public SAX2DOM(Node root, Node nextSibling, boolean useServicesMachnism) throws ParserConfigurationException {
_root = root;
if (root instanceof Document) {
_document = (Document)root;
@@ -98,15 +88,15 @@ public class SAX2DOM implements ContentHandler, LexicalHandler, Constants {
_document = root.getOwnerDocument();
}
else {
- _document = createDocument();
+ _document = createDocument(useServicesMachnism);
_root = _document;
}
_nextSibling = nextSibling;
}
- public SAX2DOM(Node root) throws ParserConfigurationException {
- this(root, null);
+ public SAX2DOM(Node root, boolean useServicesMachnism) throws ParserConfigurationException {
+ this(root, null, useServicesMachnism);
}
public Node getDOM() {
@@ -318,11 +308,23 @@ public class SAX2DOM implements ContentHandler, LexicalHandler, Constants {
public void startDTD(String name, String publicId, String systemId)
throws SAXException {}
- private static Document createDocument() throws ParserConfigurationException {
+ private Document createDocument(boolean useServicesMachnism) throws ParserConfigurationException {
+ if (_factory == null) {
+ if (useServicesMachnism)
+ _factory = DocumentBuilderFactory.newInstance();
+ if (!(_factory instanceof com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl)) {
+ _internal = false;
+ }
+ else
+ _factory = DocumentBuilderFactory.newInstance(
+ "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl",
+ SAX2DOM.class.getClassLoader()
+ );
+ }
Document doc;
- if (_internalBuilder != null) {
+ if (_internal) {
//default implementation is thread safe
- doc = _internalBuilder.newDocument();
+ doc = _factory.newDocumentBuilder().newDocument();
} else {
synchronized(SAX2DOM.class) {
doc = _factory.newDocumentBuilder().newDocument();
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXBaseWriter.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXBaseWriter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXBaseWriter.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXBaseWriter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXEventWriter.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXEventWriter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXEventWriter.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXEventWriter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXStreamWriter.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXStreamWriter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXStreamWriter.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SAX2StAXStreamWriter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SmartTransformerFactoryImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SmartTransformerFactoryImpl.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SmartTransformerFactoryImpl.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SmartTransformerFactoryImpl.java
index 8f030d8ce15..4637dce2035 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/SmartTransformerFactoryImpl.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/SmartTransformerFactoryImpl.java
@@ -43,6 +43,7 @@ import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
import org.xml.sax.XMLFilter;
/**
@@ -93,7 +94,7 @@ public class SmartTransformerFactoryImpl extends SAXTransformerFactory
try {
Class xalanFactClass = ObjectFactory.findProviderClass(
"com.sun.org.apache.xalan.internal.processor.TransformerFactoryImpl",
- ObjectFactory.findClassLoader(), true);
+ true);
_xalanFactory = (SAXTransformerFactory)
xalanFactClass.newInstance();
}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/StAXEvent2SAX.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXEvent2SAX.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/StAXEvent2SAX.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXEvent2SAX.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/StAXStream2SAX.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXStream2SAX.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/StAXStream2SAX.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/StAXStream2SAX.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java
similarity index 95%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java
index e7b0f0a2b4d..2eb161dafee 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java
@@ -95,10 +95,15 @@ public class TemplatesHandlerImpl
_tfactory = tfactory;
// Instantiate XSLTC and get reference to parser object
- XSLTC xsltc = new XSLTC();
+ XSLTC xsltc = new XSLTC(tfactory.useServicesMechnism());
if (tfactory.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING))
xsltc.setSecureProcessing(true);
+ if ("true".equals(tfactory.getAttribute(TransformerFactoryImpl.ENABLE_INLINING)))
+ xsltc.setTemplateInlining(true);
+ else
+ xsltc.setTemplateInlining(false);
+
_parser = xsltc.getParser();
}
@@ -188,7 +193,7 @@ public class TemplatesHandlerImpl
XSLTC xsltc = _parser.getXSLTC();
// Set the translet class name if not already set
- String transletName = null;
+ String transletName;
if (_systemId != null) {
transletName = Util.baseName(_systemId);
}
@@ -210,6 +215,11 @@ public class TemplatesHandlerImpl
stylesheet.setSystemId(_systemId);
stylesheet.setParentStylesheet(null);
+ if (xsltc.getTemplateInlining())
+ stylesheet.setTemplateInlining(true);
+ else
+ stylesheet.setTemplateInlining(false);
+
// Set a document loader (for xsl:include/import) if defined
if (_uriResolver != null) {
stylesheet.setSourceLoader(this);
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
similarity index 95%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
index f31ed040d96..4ebf238565f 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesImpl.java
@@ -42,6 +42,7 @@ import com.sun.org.apache.xalan.internal.xsltc.Translet;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.org.apache.xalan.internal.xsltc.runtime.AbstractTranslet;
import com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
/**
* @author Morten Jorgensen
@@ -118,6 +119,8 @@ public final class TemplatesImpl implements Templates, Serializable {
*/
private transient TransformerFactoryImpl _tfactory = null;
+ private boolean _useServicesMechanism;
+
static final class TransletClassLoader extends ClassLoader {
TransletClassLoader(ClassLoader parent) {
super(parent);
@@ -142,10 +145,7 @@ public final class TemplatesImpl implements Templates, Serializable {
TransformerFactoryImpl tfactory)
{
_bytecodes = bytecodes;
- _name = transletName;
- _outputProperties = outputProperties;
- _indentNumber = indentNumber;
- _tfactory = tfactory;
+ init(transletName, outputProperties, indentNumber, tfactory);
}
/**
@@ -156,14 +156,19 @@ public final class TemplatesImpl implements Templates, Serializable {
TransformerFactoryImpl tfactory)
{
_class = transletClasses;
- _name = transletName;
_transletIndex = 0;
+ init(transletName, outputProperties, indentNumber, tfactory);
+ }
+
+ private void init(String transletName,
+ Properties outputProperties, int indentNumber,
+ TransformerFactoryImpl tfactory) {
+ _name = transletName;
_outputProperties = outputProperties;
_indentNumber = indentNumber;
_tfactory = tfactory;
+ _useServicesMechanism = tfactory.useServicesMechnism();
}
-
-
/**
* Need for de-serialization, see readObject().
*/
@@ -207,6 +212,12 @@ public final class TemplatesImpl implements Templates, Serializable {
}
}
+ /**
+ * Return the state of the services mechanism feature.
+ */
+ public boolean useServicesMechnism() {
+ return _useServicesMechanism;
+ }
/**
* Store URIResolver needed for Transformers.
@@ -357,6 +368,7 @@ public final class TemplatesImpl implements Templates, Serializable {
AbstractTranslet translet = (AbstractTranslet) _class[_transletIndex].newInstance();
translet.postInitialization();
translet.setTemplates(this);
+ translet.setServicesMechnism(_useServicesMechanism);
if (_auxClasses != null) {
translet.setAuxiliaryClasses(_auxClasses);
}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TrAXFilter.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TrAXFilter.java
similarity index 94%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TrAXFilter.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TrAXFilter.java
index 400bdab82ac..172907e7af0 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TrAXFilter.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TrAXFilter.java
@@ -55,6 +55,7 @@ public class TrAXFilter extends XMLFilterImpl {
private Templates _templates;
private TransformerImpl _transformer;
private TransformerHandlerImpl _transformerHandler;
+ private boolean _useServicesMechanism = true;
public TrAXFilter(Templates templates) throws
TransformerConfigurationException
@@ -62,6 +63,7 @@ public class TrAXFilter extends XMLFilterImpl {
_templates = templates;
_transformer = (TransformerImpl) templates.newTransformer();
_transformerHandler = new TransformerHandlerImpl(_transformer);
+ _useServicesMechanism = _transformer.useServicesMechnism();
}
public Transformer getTransformer() {
@@ -106,7 +108,7 @@ public class TrAXFilter extends XMLFilterImpl {
try {
if (getParent() == null) {
try {
- managedReader = XMLReaderManager.getInstance()
+ managedReader = XMLReaderManager.getInstance(_useServicesMechanism)
.getXMLReader();
setParent(managedReader);
} catch (SAXException e) {
@@ -118,7 +120,7 @@ public class TrAXFilter extends XMLFilterImpl {
getParent().parse(input);
} finally {
if (managedReader != null) {
- XMLReaderManager.getInstance().releaseXMLReader(managedReader);
+ XMLReaderManager.getInstance(_useServicesMechanism).releaseXMLReader(managedReader);
}
}
}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java
similarity index 96%
rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java
rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java
index 4211d40d0d8..26b2f56de86 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java
@@ -49,6 +49,7 @@ import javax.xml.transform.Templates;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
import javax.xml.transform.URIResolver;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
@@ -64,11 +65,14 @@ import javax.xml.transform.stax.*;
import com.sun.org.apache.xml.internal.utils.StylesheetPIHandler;
import com.sun.org.apache.xml.internal.utils.StopParseException;
+import com.sun.org.apache.xalan.internal.XalanConstants;
import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader;
import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
+import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
import org.xml.sax.InputSource;
@@ -212,11 +216,28 @@ public class TransformerFactoryImpl
* State of secure mode.
*/ private boolean _isSecureMode = false; + + /** + * Indicates whether implementation parts should use + * service loader (or similar). + * Note the default value (false) is the safe option.. + */ + private boolean _useServicesMechanism; + /** * javax.xml.transform.sax.TransformerFactory implementation. */ public TransformerFactoryImpl() { - m_DTMManagerClass = XSLTCDTMManager.getDTMManagerClass(); + this(true); + } + + public static TransformerFactory newTransformerFactoryNoServiceLoader() { + return new TransformerFactoryImpl(false); + } + + private TransformerFactoryImpl(boolean useServicesMechanism) { + this.m_DTMManagerClass = XSLTCDTMManager.getDTMManagerClass(useServicesMechanism); + this._useServicesMechanism = useServicesMechanism; if (System.getSecurityManager() != null) { _isSecureMode = true; _isNotSecureProcessing = false; @@ -274,6 +295,12 @@ public class TransformerFactoryImpl else if (name.equals(AUTO_TRANSLET)) { return new Boolean(_autoTranslet); } + else if (name.equals(ENABLE_INLINING)) { + if (_enableInlining) + return Boolean.TRUE; + else + return Boolean.FALSE; + } // Throw an exception for all other attributes ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_INVALID_ATTR_ERR, name); @@ -420,6 +447,11 @@ public class TransformerFactoryImpl // all done processing feature return; } + else if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) { + //in secure mode, let _useServicesMechanism be determined by the constructor + if (!_isSecureMode) + _useServicesMechanism = value; + } else { // unknown feature ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name); @@ -448,7 +480,8 @@ public class TransformerFactoryImpl StreamSource.FEATURE, StreamResult.FEATURE, SAXTransformerFactory.FEATURE, - SAXTransformerFactory.FEATURE_XMLFILTER + SAXTransformerFactory.FEATURE_XMLFILTER, + XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM }; // feature name cannot be null @@ -471,6 +504,12 @@ public class TransformerFactoryImpl // Feature not supported return false; } + /** + * Return the state of the services mechanism feature. + */ + public boolean useServicesMechnism() { + return _useServicesMechanism; + } /** * javax.xml.transform.sax.TransformerFactory implementation. @@ -543,7 +582,7 @@ public class TransformerFactoryImpl isource = SAXSource.sourceToInputSource(source); baseId = isource.getSystemId(); - SAXParserFactory factory = SAXParserFactory.newInstance(); + SAXParserFactory factory = FactoryImpl.getSAXFactory(_useServicesMechanism); factory.setNamespaceAware(true); if (!_isNotSecureProcessing) { @@ -702,8 +741,7 @@ public class TransformerFactoryImpl transletName = _packageName + "." + transletName; try { - final Class clazz = ObjectFactory.findProviderClass( - transletName, ObjectFactory.findClassLoader(), true); + final Class clazz = ObjectFactory.findProviderClass(transletName, true); resetTransientAttributes(); return new TemplatesImpl(new Class[]{clazz}, transletName, null, _indentNumber, this); @@ -753,9 +791,13 @@ public class TransformerFactoryImpl } // Create and initialize a stylesheet compiler - final XSLTC xsltc = new XSLTC(); + final XSLTC xsltc = new XSLTC(_useServicesMechanism); if (_debug) xsltc.setDebug(true); - if (_enableInlining) xsltc.setTemplateInlining(true); + if (_enableInlining) + xsltc.setTemplateInlining(true); + else + xsltc.setTemplateInlining(false); + if (!_isNotSecureProcessing) xsltc.setSecureProcessing(true); xsltc.init(); diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerHandlerImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java similarity index 96% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java index 6af03b77fea..16e178eba9a 100644 --- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java @@ -23,6 +23,7 @@ package com.sun.org.apache.xalan.internal.xsltc.trax; +import com.sun.org.apache.xalan.internal.utils.FactoryImpl; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -182,7 +183,7 @@ public final class TransformerImpl extends Transformer /** * A reference to an object that creates and caches XMLReader objects. */ - private XMLReaderManager _readerManager = XMLReaderManager.getInstance(); + private XMLReaderManager _readerManager; /** * A flag indicating whether we use incremental building of the DTM. @@ -200,6 +201,13 @@ public final class TransformerImpl extends Transformer */ private boolean _isSecureProcessing = false; + /** + * Indicates whether implementation parts should use + * service loader (or similar). + * Note the default value (false) is the safe option.. + */ + private boolean _useServicesMechanism; + /** * A hashtable to store parameters for the identity transform. These * are not needed during the transformation, but we must keep track of @@ -251,6 +259,8 @@ public final class TransformerImpl extends Transformer _propertiesClone = (Properties) _properties.clone(); _indentNumber = indentNumber; _tfactory = tfactory; + _useServicesMechanism = _tfactory.useServicesMechnism(); + _readerManager = XMLReaderManager.getInstance(_useServicesMechanism); //_isIncremental = tfactory._incremental; } @@ -267,6 +277,19 @@ public final class TransformerImpl extends Transformer public void setSecureProcessing(boolean flag) { _isSecureProcessing = flag; } + /** + * Return the state of the services mechanism feature. + */ + public boolean useServicesMechnism() { + return _useServicesMechanism; + } + + /** + * Set the state of the services mechanism feature. + */ + public void setServicesMechnism(boolean flag) { + _useServicesMechanism = flag; + } /** * Returns the translet wrapped inside this Transformer or @@ -347,7 +370,7 @@ public final class TransformerImpl extends Transformer // Get encoding using getProperty() to use defaults _encoding = (String) _properties.getProperty(OutputKeys.ENCODING); - _tohFactory = TransletOutputHandlerFactory.newInstance(); + _tohFactory = TransletOutputHandlerFactory.newInstance(_useServicesMechanism); _tohFactory.setEncoding(_encoding); if (_method != null) { _tohFactory.setOutputMethod(_method); @@ -435,9 +458,7 @@ public final class TransformerImpl extends Transformer // the systemId will be URI encoded as a result of File.toURI(), // it must be decoded for use by URL try{ - Class clazz = ObjectFactory.findProviderClass("java.net.URI", ObjectFactory.findClassLoader(), true); - Constructor construct = clazz.getConstructor(new Class[] {java.lang.String.class} ); - URI uri = (URI) construct.newInstance(new Object[]{systemId}) ; + URI uri = new URI(systemId) ; systemId = "file:"; String host = uri.getHost(); // decoded String @@ -454,10 +475,6 @@ public final class TransformerImpl extends Transformer systemId += "//" + path; } } - catch(ClassNotFoundException e){ - // running on J2SE 1.3 which doesn't have URI Class so OK to ignore - //ClassNotFoundException. - } catch (Exception exception) { // URI exception which means nothing can be done so OK to ignore } @@ -524,6 +541,7 @@ public final class TransformerImpl extends Transformer _dtmManager = (XSLTCDTMManager)_tfactory.getDTMManagerClass() .newInstance(); + _dtmManager.setServicesMechnism(_useServicesMechanism); } dom = (DOM)_dtmManager.getDTM(source, false, wsfilter, true, false, false, 0, hasIdCall); @@ -695,10 +713,8 @@ public final class TransformerImpl extends Transformer ((SAXSource)source).getXMLReader()==null )|| (source instanceof DOMSource && ((DOMSource)source).getNode()==null)){ - DocumentBuilderFactory builderF = - DocumentBuilderFactory.newInstance(); - DocumentBuilder builder = - builderF.newDocumentBuilder(); + DocumentBuilderFactory builderF = FactoryImpl.getDOMFactory(_useServicesMechanism); + DocumentBuilder builder = builderF.newDocumentBuilder(); String systemID = source.getSystemId(); source = new DOMSource(builder.newDocument()); @@ -974,6 +990,11 @@ public final class TransformerImpl extends Transformer } } } + else if (name.equals(OutputPropertiesFactory.ORACLE_IS_STANDALONE)) { + if (value != null && value.equals("yes")) { + translet._isStandalone = true; + } + } } } @@ -1033,6 +1054,11 @@ public final class TransformerImpl extends Transformer handler.setIndentAmount(Integer.parseInt(value)); } } + else if (name.equals(OutputPropertiesFactory.ORACLE_IS_STANDALONE)) { + if (value != null && value.equals("yes")) { + handler.setIsStandalone(true); + } + } else if (name.equals(OutputKeys.CDATA_SECTION_ELEMENTS)) { if (value != null) { StringTokenizer e = new StringTokenizer(value); @@ -1146,6 +1172,7 @@ public final class TransformerImpl extends Transformer name.equals(OutputKeys.OMIT_XML_DECLARATION) || name.equals(OutputKeys.STANDALONE) || name.equals(OutputKeys.VERSION) || + name.equals(OutputPropertiesFactory.ORACLE_IS_STANDALONE) || name.charAt(0) == '{'); } @@ -1252,7 +1279,7 @@ public final class TransformerImpl extends Transformer try { // Argument to document function was: document(''); if (href.length() == 0) { - href = new String(baseURI); + href = baseURI; } /* diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java similarity index 97% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java index 76a071df641..f5e1c85b98c 100644 --- a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java @@ -42,6 +42,7 @@ import javax.xml.transform.stax.StAXResult; import javax.xml.transform.stax.StAXSource; import javax.xml.transform.stream.StreamSource; +import com.sun.org.apache.xalan.internal.utils.FactoryImpl; import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; @@ -109,8 +110,7 @@ public final class Util { //Incase there is an exception thrown // resort to JAXP - SAXParserFactory parserFactory = - SAXParserFactory.newInstance(); + SAXParserFactory parserFactory = FactoryImpl.getSAXFactory(xsltc.useServicesMechnism()); parserFactory.setNamespaceAware(true); if (xsltc.isSecureProcessing()) { diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/XSLTCSource.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/XSLTCSource.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/XSLTCSource.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/XSLTCSource.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/util/IntegerArray.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/util/IntegerArray.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/util/IntegerArray.java rename to jaxp/src/com/sun/org/apache/xalan/internal/xsltc/util/IntegerArray.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/AttrImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/AttrImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/AttrImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/AttrImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/AttrNSImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/AttrNSImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/AttrNSImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/AttrNSImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/AttributeMap.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/AttributeMap.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/AttributeMap.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/AttributeMap.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/CDATASectionImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/CDATASectionImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/CDATASectionImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/CDATASectionImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/CharacterDataImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/CharacterDataImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/CharacterDataImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/CharacterDataImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/ChildNode.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/ChildNode.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/ChildNode.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/ChildNode.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/CommentImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/CommentImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/CommentImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/CommentImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java similarity index 97% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java index ab1952cb1a4..f20775e3f7a 100644 --- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java @@ -21,7 +21,10 @@ package com.sun.org.apache.xerces.internal.dom; import com.sun.org.apache.xerces.internal.impl.RevalidationHandler; import com.sun.org.apache.xerces.internal.parsers.DOMParserImpl; +import com.sun.org.apache.xerces.internal.parsers.DTDConfiguration; +import com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration; import com.sun.org.apache.xerces.internal.util.XMLChar; +import com.sun.org.apache.xerces.internal.utils.ObjectFactory; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription; import com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl; import org.w3c.dom.DOMException; @@ -49,6 +52,7 @@ import org.w3c.dom.ls.LSSerializer; * * @xerces.internal * + * @version $Id: CoreDOMImplementationImpl.java,v 1.6 2010-11-01 04:39:37 joehw Exp $ * @since PR-DOM-Level-1-19980818. */ public class CoreDOMImplementationImpl @@ -114,8 +118,7 @@ public class CoreDOMImplementationImpl && (anyVersion || version.equals("3.0"))) { try { Class xpathClass = ObjectFactory.findProviderClass( - "com.sun.org.apache.xpath.internal.domapi.XPathEvaluatorImpl", - ObjectFactory.findClassLoader(), true); + "com.sun.org.apache.xpath.internal.domapi.XPathEvaluatorImpl", true); // Check if the DOM XPath implementation implements // the interface org.w3c.dom.XPathEvaluator @@ -281,9 +284,7 @@ public class CoreDOMImplementationImpl if ((feature.equalsIgnoreCase("+XPath"))) { try { Class xpathClass = ObjectFactory.findProviderClass( - "com.sun.org.apache.xpath.internal.domapi.XPathEvaluatorImpl", - ObjectFactory.findClassLoader(), true); - + "com.sun.org.apache.xpath.internal.domapi.XPathEvaluatorImpl", true); // Check if the DOM XPath implementation implements // the interface org.w3c.dom.XPathEvaluator Class interfaces[] = xpathClass.getInterfaces(); @@ -361,14 +362,12 @@ public class CoreDOMImplementationImpl } if (schemaType != null && schemaType.equals("http://www.w3.org/TR/REC-xml")) { - return new DOMParserImpl( - "com.sun.org.apache.xerces.internal.parsers.DTDConfiguration", + return new DOMParserImpl(new DTDConfiguration(), schemaType); } else { // create default parser configuration validating against XMLSchemas - return new DOMParserImpl( - "com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration", + return new DOMParserImpl(new XIncludeAwareParserConfiguration(), schemaType); } } diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java similarity index 99% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java index 56e280950cb..46cbc349ff4 100644 --- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java @@ -31,6 +31,8 @@ import org.w3c.dom.UserDataHandler; import com.sun.org.apache.xerces.internal.util.XMLChar; import com.sun.org.apache.xerces.internal.util.XML11Char; import com.sun.org.apache.xerces.internal.xni.NamespaceContext; +import com.sun.org.apache.xerces.internal.utils.ObjectFactory; +import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import org.w3c.dom.Attr; import org.w3c.dom.CDATASection; import org.w3c.dom.Comment; @@ -77,7 +79,7 @@ import org.w3c.dom.ls.LSSerializer; * @author Joe Kesselman, IBM * @author Andy Clark, IBM * @author Ralf Pfeiffer, IBM - * @version $Id: CoreDocumentImpl.java,v 1.7 2009/08/04 05:07:20 joehw Exp $ + * @version $Id: CoreDocumentImpl.java,v 1.9 2010-11-01 04:39:37 joehw Exp $ * @since PR-DOM-Level-1-19980818. */ @@ -258,8 +260,7 @@ extends ParentNode implements Document { super(null); ownerDocument = this; allowGrammarAccess = grammarAccess; - SecuritySupport ss = SecuritySupport.getInstance(); - String systemProp = ss.getSystemProperty(Constants.SUN_DOM_PROPERTY_PREFIX+Constants.SUN_DOM_ANCESTOR_CHECCK); + String systemProp = SecuritySupport.getSystemProperty(Constants.SUN_DOM_PROPERTY_PREFIX+Constants.SUN_DOM_ANCESTOR_CHECCK); if (systemProp != null) { if (systemProp.equalsIgnoreCase("false")) { ancestorChecking = false; @@ -516,9 +517,8 @@ extends ParentNode implements Document { } try { - Class xpathClass = ObjectFactory.findProviderClass( - "com.sun.org.apache.xpath.internal.domapi.XPathEvaluatorImpl", - ObjectFactory.findClassLoader(), true); + Class xpathClass = ObjectFactory.findProviderClass ( + "com.sun.org.apache.xpath.internal.domapi.XPathEvaluatorImpl", true); Constructor xpathClassConstr = xpathClass.getConstructor(new Class[] { Document.class }); diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java similarity index 99% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java index 012c827bed4..ad11c0416ee 100644 --- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java @@ -55,6 +55,7 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver; import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler; import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; +import com.sun.org.apache.xerces.internal.utils.ObjectFactory; import org.w3c.dom.DOMException; import org.w3c.dom.ls.LSResourceResolver; @@ -324,8 +325,7 @@ public class DOMConfigurationImpl extends ParserConfigurationSettings MessageFormatter xmft = null; try { xmft = (MessageFormatter)( - ObjectFactory.newInstance("com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter", - ObjectFactory.findClassLoader(), true)); + ObjectFactory.newInstance("com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter", true)); } catch (Exception exception){ } diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMErrorImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMErrorImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMErrorImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMErrorImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMImplementationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMImplementationImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMImplementationImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMImplementationImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMImplementationListImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMImplementationListImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMImplementationListImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMImplementationListImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMImplementationSourceImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMImplementationSourceImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMImplementationSourceImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMImplementationSourceImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMInputImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMInputImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMInputImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMInputImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMLocatorImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMLocatorImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMLocatorImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMLocatorImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMMessageFormatter.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMNormalizer.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMOutputImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMOutputImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMOutputImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMOutputImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMStringListImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMStringListImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMStringListImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMStringListImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMXSImplementationSourceImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMXSImplementationSourceImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DOMXSImplementationSourceImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMXSImplementationSourceImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeepNodeListImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeepNodeListImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeepNodeListImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeepNodeListImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredAttrImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredAttrImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredAttrImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredAttrImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredAttrNSImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredAttrNSImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredAttrNSImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredAttrNSImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredCDATASectionImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredCDATASectionImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredCDATASectionImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredCDATASectionImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredCommentImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredCommentImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredCommentImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredCommentImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDOMImplementationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredDOMImplementationImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDOMImplementationImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredDOMImplementationImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDocumentTypeImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentTypeImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredDocumentTypeImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredDocumentTypeImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredElementDefinitionImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredElementDefinitionImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredElementDefinitionImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredElementDefinitionImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredElementImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredElementImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredElementImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredElementImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredElementNSImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredElementNSImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredElementNSImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredElementNSImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredEntityImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredEntityImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredEntityImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredEntityImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredEntityReferenceImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredEntityReferenceImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredEntityReferenceImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredEntityReferenceImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredNode.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredNode.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredNode.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredNode.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredNotationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredNotationImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredNotationImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredNotationImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredProcessingInstructionImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredProcessingInstructionImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredProcessingInstructionImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredProcessingInstructionImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredTextImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredTextImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DeferredTextImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DeferredTextImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentFragmentImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DocumentFragmentImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentFragmentImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DocumentFragmentImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DocumentImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentTypeImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DocumentTypeImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/DocumentTypeImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/DocumentTypeImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/ElementDefinitionImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/ElementDefinitionImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/ElementDefinitionImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/ElementDefinitionImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/ElementImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/ElementImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/ElementImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/ElementImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/ElementNSImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/ElementNSImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/ElementNSImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/ElementNSImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/EntityImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/EntityImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/EntityImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/EntityImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/EntityReferenceImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/EntityReferenceImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/EntityReferenceImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/EntityReferenceImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/LCount.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/LCount.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/LCount.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/LCount.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/NamedNodeMapImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/NodeImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/NodeImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/NodeImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/NodeImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/NodeIteratorImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/NodeIteratorImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/NodeIteratorImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/NodeIteratorImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/NodeListCache.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/NodeListCache.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/NodeListCache.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/NodeListCache.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/NotationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/NotationImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/NotationImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/NotationImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/PSVIAttrNSImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/PSVIAttrNSImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/PSVIAttrNSImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/PSVIAttrNSImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/PSVIDOMImplementationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/PSVIDOMImplementationImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/PSVIDOMImplementationImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/PSVIDOMImplementationImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/PSVIDocumentImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/PSVIDocumentImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/PSVIDocumentImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/PSVIDocumentImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/PSVIElementNSImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/PSVIElementNSImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/PSVIElementNSImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/PSVIElementNSImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/ParentNode.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/ParentNode.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/ParentNode.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/ParentNode.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/ProcessingInstructionImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/ProcessingInstructionImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/ProcessingInstructionImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/ProcessingInstructionImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/RangeExceptionImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/RangeExceptionImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/RangeExceptionImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/RangeExceptionImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/RangeImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/RangeImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/RangeImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/RangeImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/TextImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/TextImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/TextImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/TextImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/TreeWalkerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/TreeWalkerImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/TreeWalkerImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/TreeWalkerImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/events/EventImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/events/EventImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/events/EventImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/events/EventImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/events/MutationEventImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/events/MutationEventImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/events/MutationEventImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/events/MutationEventImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/org.apache.xerces.dom.DOMImplementationSourceImpl b/jaxp/src/com/sun/org/apache/xerces/internal/dom/org.apache.xerces.dom.DOMImplementationSourceImpl similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/org.apache.xerces.dom.DOMImplementationSourceImpl rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/org.apache.xerces.dom.DOMImplementationSourceImpl diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/org.w3c.dom.DOMImplementationSourceList b/jaxp/src/com/sun/org/apache/xerces/internal/dom/org.w3c.dom.DOMImplementationSourceList similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/dom/org.w3c.dom.DOMImplementationSourceList rename to jaxp/src/com/sun/org/apache/xerces/internal/dom/org.w3c.dom.DOMImplementationSourceList diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/Constants.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java similarity index 99% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/Constants.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java index 63095ea9092..d6f457db839 100644 --- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/Constants.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java @@ -136,7 +136,9 @@ public final class Constants { /** XML string property ("xml-string"). */ public static final String XML_STRING_PROPERTY = "xml-string"; - public static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing"; + public static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing"; + + public static final String ORACLE_FEATURE_SERVICE_MECHANISM = "http://www.oracle.com/feature/use-service-mechanism"; /** Document XML version property ("document-xml-version"). */ public static final String DOCUMENT_XML_VERSION_PROPERTY = "document-xml-version"; diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/ExternalSubsetResolver.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/ExternalSubsetResolver.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/ExternalSubsetResolver.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/ExternalSubsetResolver.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/PropertyManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/PropertyManager.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/RevalidationHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/RevalidationHandler.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/RevalidationHandler.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/RevalidationHandler.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/Version.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/Version.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/Version.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/Version.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XML11DTDScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11DTDScannerImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XML11DTDScannerImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11DTDScannerImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11DocumentScannerImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11EntityScanner.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XML11NamespaceBinder.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NamespaceBinder.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XML11NamespaceBinder.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NamespaceBinder.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java similarity index 99% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java index 2bba625a65d..f1c611b0d1a 100644 --- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java @@ -1803,6 +1803,7 @@ public class XMLDocumentFragmentScannerImpl String name = fEntityScanner.scanName(); if (name == null) { reportFatalError("NameRequiredInReference", null); + return; } if (!fEntityScanner.skipChar(';')) { reportFatalError("SemicolonRequiredInReference", new Object []{name}); diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentScannerImpl.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLEntityDescription.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityDescription.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLEntityDescription.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityDescription.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLEntityHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityHandler.java similarity index 100% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLEntityHandler.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityHandler.java diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java similarity index 98% rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java index 78ad12c3713..c1ddeb6cb59 100644 --- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java @@ -365,11 +365,6 @@ protected static final String PARSER_SETTINGS = // shared context - /** Shared declared entities. - * XXX understand it more deeply, why are we doing this ?? Is it really required ? - */ - protected Hashtable fDeclaredEntities; - protected XMLEntityStorage fEntityStorage ; protected final Object [] defaultEncoding = new Object[]{"UTF-8", null}; @@ -408,24 +403,6 @@ protected static final String PARSER_SETTINGS = reset(propertyManager); } //
- * REVISIT: We might want to think about the "right"
- * way to expose the list of declared entities. For now, the knowledge
- * how to access the entity declarations is implicit.
- */
- public XMLEntityManager(XMLEntityManager entityManager) {
-
-
- // save shared entity declarations
- fDeclaredEntities = entityManager != null
- ? entityManager.getEntityStore().getDeclaredEntities() : null;
-
- setScannerVersion(Constants.XML_VERSION_1_0);
- } //
@@ -1111,7 +1088,7 @@ protected static final String PARSER_SETTINGS =
throws IOException, XNIException {
// was entity declared?
- Entity entity = (Entity)fEntityStorage.getDeclaredEntities().get(entityName);
+ Entity entity = (Entity)fEntityStorage.getEntity(entityName);
if (entity == null) {
if (fEntityHandler != null) {
String encoding = null;
@@ -1331,23 +1308,16 @@ protected static final String PARSER_SETTINGS =
(fEntityStack.empty() ? null : fEntityStack.elementAt(0));
}
- // a list of Readers ever seen
- protected Vector fOwnReaders = new Vector();
/**
* Close all opened InputStreams and Readers opened by this parser.
*/
public void closeReaders() {
- // close all readers
- for (int i = fOwnReaders.size()-1; i >= 0; i--) {
- try {
- ((Reader)fOwnReaders.elementAt(i)).close();
- } catch (IOException e) {
- // ignore
- }
- }
- // and clear the list
- fOwnReaders.removeAllElements();
+ /** this call actually does nothing, readers are closed in the endEntity method
+ * through the current entity.
+ * The change seems to have happened during the jdk6 development with the
+ * addition of StAX
+ **/
}
public void endEntity() throws IOException, XNIException {
@@ -1361,6 +1331,20 @@ protected static final String PARSER_SETTINGS =
//pop the entity from the stack
Entity.ScannedEntity entity = fEntityStack.size() > 0 ? (Entity.ScannedEntity)fEntityStack.pop() : null ;
+ /** need to close the reader first since the program can end
+ * prematurely (e.g. fEntityHandler.endEntity may throw exception)
+ * leaving the reader open
+ */
+ //close the reader
+ if(fCurrentEntity != null){
+ //close the reader
+ try{
+ fCurrentEntity.close();
+ }catch(IOException ex){
+ throw new XNIException(ex);
+ }
+ }
+
if (fEntityHandler != null) {
//so this is the last opened entity, signal it to current fEntityHandler using Augmentation
if(entity == null){
@@ -1375,16 +1359,6 @@ protected static final String PARSER_SETTINGS =
//check if it is a document entity
boolean documentEntity = fCurrentEntity.name == XMLEntity;
- //close the reader
- if(fCurrentEntity != null){
- //close the reader
- try{
- fCurrentEntity.close();
- }catch(IOException ex){
- throw new XNIException(ex);
- }
- }
-
//set popped entity as current entity
fCurrentEntity = entity;
fEntityScanner.setCurrentEntity(fCurrentEntity);
@@ -1536,15 +1510,6 @@ protected static final String PARSER_SETTINGS =
}
}
- // copy declared entities
- if (fDeclaredEntities != null) {
- java.util.Enumeration keys = fDeclaredEntities.keys();
- while (keys.hasMoreElements()) {
- Object key = keys.nextElement();
- Object value = fDeclaredEntities.get(key);
- fEntities.put(key, value);
- }
- }
fEntityHandler = null;
// reset scanner
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java
index 90deaa14b16..48a1c88a6b3 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityScanner.java
@@ -136,7 +136,9 @@ public class XMLEntityScanner implements XMLLocator {
VALID_NAMES[58]=true;
VALID_NAMES[95]=true;
}
-
+ // SAPJVM: Remember, that the XML version has explicitly been set,
+ // so that XMLStreamReader.getVersion() can find that out.
+ boolean xmlVersionSetExplicitly = false;
//
// Constructors
//
@@ -248,6 +250,7 @@ public class XMLEntityScanner implements XMLLocator {
* @param xmlVersion the XML version of the current entity
*/
public final void setXMLVersion(String xmlVersion) {
+ xmlVersionSetExplicitly = true; // SAPJVM
fCurrentEntity.xmlVersion = xmlVersion;
} // setXMLVersion(String)
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLErrorReporter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLStreamFilterImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLStreamFilterImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLStreamFilterImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLStreamFilterImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java
similarity index 98%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java
index a6f166b701c..a0c999df21f 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLStreamReaderImpl.java
@@ -447,7 +447,13 @@ public class XMLStreamReaderImpl implements javax.xml.stream.XMLStreamReader {
/** Get the XML language version of the current document being parsed */
public String getVersion() {
- return fEntityScanner.getXMLVersion();
+ //apply SAP's patch: the default version in the scanner was set to 1.0 because of DOM and SAX
+ //so this patch is a workaround of the difference between StAX and DOM
+ // SAPJVM: Return null if the XML version has not been declared (as specified in the JavaDoc).
+
+ String version = fEntityScanner.getXMLVersion();
+
+ return "1.0".equals(version) && !fEntityScanner.xmlVersionSetExplicitly ? null : version;
}
/**
@@ -1045,11 +1051,10 @@ public class XMLStreamReaderImpl implements javax.xml.stream.XMLStreamReader {
return fScanner.getCharacterData().toString();
XMLEntityStorage entityStore = fEntityManager.getEntityStore();
- Hashtable ht = entityStore.getDeclaredEntities();
- Entity en = (Entity)ht.get(name);
- if(en == null)
- return null;
- if(en.isExternal())
+ Entity en = entityStore.getEntity(name);
+ if(en == null)
+ return null;
+ if(en.isExternal())
return ((Entity.ExternalEntity)en).entityLocation.getExpandedSystemId();
else
return ((Entity.InternalEntity)en).text;
@@ -1176,8 +1181,7 @@ public class XMLStreamReaderImpl implements javax.xml.stream.XMLStreamReader {
return true;
XMLEntityStorage entityStore = fEntityManager.getEntityStore();
- Hashtable ht = entityStore.getDeclaredEntities();
- Entity en =(Entity)ht.get(name);
+ Entity en = entityStore.getEntity(name);
if(en == null)
return false;
if(en.isExternal()){
@@ -1318,15 +1322,14 @@ public class XMLStreamReaderImpl implements javax.xml.stream.XMLStreamReader {
protected List getEntityDecls(){
if(fEventType == XMLStreamConstants.DTD){
XMLEntityStorage entityStore = fEntityManager.getEntityStore();
- Hashtable ht = entityStore.getDeclaredEntities();
ArrayList list = null;
- if(ht != null){
+ if(entityStore.hasEntities()){
EntityDeclarationImpl decl = null;
- list = new ArrayList(ht.size());
- Enumeration enu = ht.keys();
+ list = new ArrayList(entityStore.getEntitySize());
+ Enumeration enu = entityStore.getEntityKeys();
while(enu.hasMoreElements()){
String key = (String)enu.nextElement();
- Entity en = (Entity)ht.get(key);
+ Entity en = (Entity)entityStore.getEntity(key);
decl = new EntityDeclarationImpl();
decl.setEntityName(key);
if(en.isExternal()){
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLVersionDetector.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLVersionDetector.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLVersionDetector.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLVersionDetector.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/BalancedDTDGrammar.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/BalancedDTDGrammar.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/BalancedDTDGrammar.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/BalancedDTDGrammar.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammar.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammarBucket.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammarBucket.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammarBucket.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/DTDGrammarBucket.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDProcessor.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDProcessor.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDProcessor.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDProcessor.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XML11DTDValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XML11NSDTDValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XML11NSDTDValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XML11NSDTDValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XML11NSDTDValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLAttributeDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLAttributeDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLAttributeDecl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLAttributeDecl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLContentSpec.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLContentSpec.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLContentSpec.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLContentSpec.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDDescription.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDDescription.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDDescription.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDDescription.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDLoader.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDProcessor.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidatorFilter.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidatorFilter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidatorFilter.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidatorFilter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLElementDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLElementDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLElementDecl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLElementDecl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLEntityDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLEntityDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLEntityDecl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLEntityDecl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLNSDTDValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLNSDTDValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLNSDTDValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLNSDTDValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLNotationDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLNotationDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLNotationDecl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLNotationDecl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLSimpleType.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLSimpleType.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/XMLSimpleType.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLSimpleType.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/CMAny.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMAny.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/CMAny.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMAny.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/CMBinOp.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMBinOp.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/CMBinOp.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMBinOp.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/CMLeaf.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMLeaf.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/CMLeaf.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMLeaf.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/CMNode.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMNode.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/CMNode.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMNode.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/CMStateSet.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMStateSet.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/CMStateSet.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMStateSet.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/CMUniOp.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMUniOp.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/CMUniOp.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/CMUniOp.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/ContentModelValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/ContentModelValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/ContentModelValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/ContentModelValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/MixedContentModel.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/MixedContentModel.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/MixedContentModel.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/MixedContentModel.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/SimpleContentModel.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/SimpleContentModel.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/SimpleContentModel.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/models/SimpleContentModel.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java
similarity index 85%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java
index 5e13994db33..15afa2e1407 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DTDDVFactory.java
@@ -21,6 +21,7 @@
package com.sun.org.apache.xerces.internal.impl.dv;
import java.util.Hashtable;
+import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
/**
* The factory to create and return DTD types. The implementation should
@@ -31,6 +32,7 @@ import java.util.Hashtable;
*
* @author Sandy Gao, IBM
*
+ * @version $Id: DTDDVFactory.java,v 1.6 2010-11-01 04:39:43 joehw Exp $
*/
public abstract class DTDDVFactory {
@@ -43,7 +45,7 @@ public abstract class DTDDVFactory {
* @exception DVFactoryException cannot create an instance of the specified
* class name or the default class name
*/
- public static synchronized final DTDDVFactory getInstance() throws DVFactoryException {
+ public static final DTDDVFactory getInstance() throws DVFactoryException {
return getInstance(DEFAULT_FACTORY_CLASS);
}
@@ -55,19 +57,19 @@ public abstract class DTDDVFactory {
* @exception DVFactoryException cannot create an instance of the specified
* class name or the default class name
*/
- public static synchronized final DTDDVFactory getInstance(String factoryClass) throws DVFactoryException {
-
+ public static final DTDDVFactory getInstance(String factoryClass) throws DVFactoryException {
try {
// if the class name is not specified, use the default one
return (DTDDVFactory)
- (ObjectFactory.newInstance(factoryClass, ObjectFactory.findClassLoader(), true));
- } catch (ClassCastException e) {
+ (ObjectFactory.newInstance(factoryClass, true));
+ }
+ catch (ClassCastException e) {
throw new DVFactoryException("DTD factory class " + factoryClass + " does not extend from DTDDVFactory.");
}
}
// can't create a new object of this class
- protected DTDDVFactory(){}
+ protected DTDDVFactory() {}
/**
* return a dtd type of the given name
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/DVFactoryException.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DVFactoryException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/DVFactoryException.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DVFactoryException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/DatatypeValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/DatatypeValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/DatatypeValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeFacetException.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeFacetException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeFacetException.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeFacetException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeValueException.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeValueException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeValueException.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/InvalidDatatypeValueException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/SchemaDVFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/SchemaDVFactory.java
similarity index 96%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/SchemaDVFactory.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/SchemaDVFactory.java
index 3a04ae4f801..902d9d3fdea 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/SchemaDVFactory.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/SchemaDVFactory.java
@@ -22,6 +22,7 @@ package com.sun.org.apache.xerces.internal.impl.dv;
import com.sun.org.apache.xerces.internal.util.SymbolHash;
import com.sun.org.apache.xerces.internal.xs.XSObjectList;
+import com.sun.org.apache.xerces.internal.utils.ObjectFactory;
/**
* Defines a factory API that enables applications to
@@ -39,6 +40,7 @@ import com.sun.org.apache.xerces.internal.xs.XSObjectList;
*
* @author Sandy Gao, IBM
*
+ * @version $Id: SchemaDVFactory.java,v 1.6 2010-11-01 04:39:43 joehw Exp $
*/
public abstract class SchemaDVFactory {
@@ -68,8 +70,7 @@ public abstract class SchemaDVFactory {
try {
// if the class name is not specified, use the default one
- return (SchemaDVFactory)(ObjectFactory.newInstance(
- factoryClass, ObjectFactory.findClassLoader(), true));
+ return (SchemaDVFactory)(ObjectFactory.newInstance(factoryClass, true));
} catch (ClassCastException e4) {
throw new DVFactoryException("Schema factory class " + factoryClass + " does not extend from SchemaDVFactory.");
}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/ValidatedInfo.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/ValidatedInfo.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/ValidatedInfo.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/ValidatedInfo.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/ValidationContext.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/ValidationContext.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/ValidationContext.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/ValidationContext.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/XSFacets.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/XSFacets.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/XSFacets.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/XSFacets.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/XSSimpleType.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/XSSimpleType.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/XSSimpleType.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/XSSimpleType.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/DTDDVFactoryImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/DTDDVFactoryImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/DTDDVFactoryImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/DTDDVFactoryImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/ENTITYDatatypeValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/ENTITYDatatypeValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/ENTITYDatatypeValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/ENTITYDatatypeValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDDatatypeValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDDatatypeValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDDatatypeValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDDatatypeValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDREFDatatypeValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDREFDatatypeValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDREFDatatypeValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/IDREFDatatypeValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/ListDatatypeValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/ListDatatypeValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/ListDatatypeValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/ListDatatypeValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/NMTOKENDatatypeValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/NMTOKENDatatypeValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/NMTOKENDatatypeValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/NMTOKENDatatypeValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/NOTATIONDatatypeValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/NOTATIONDatatypeValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/NOTATIONDatatypeValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/NOTATIONDatatypeValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/StringDatatypeValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/StringDatatypeValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/StringDatatypeValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/StringDatatypeValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11DTDDVFactoryImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11DTDDVFactoryImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11DTDDVFactoryImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11DTDDVFactoryImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDDatatypeValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDDatatypeValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDDatatypeValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDDatatypeValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDREFDatatypeValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDREFDatatypeValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDREFDatatypeValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11IDREFDatatypeValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11NMTOKENDatatypeValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11NMTOKENDatatypeValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11NMTOKENDatatypeValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/dtd/XML11NMTOKENDatatypeValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/util/Base64.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/util/Base64.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/util/Base64.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/util/Base64.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/util/ByteListImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/util/HexBin.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/util/HexBin.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/util/HexBin.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/util/HexBin.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/AbstractDateTimeDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AbstractDateTimeDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/AbstractDateTimeDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AbstractDateTimeDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyAtomicDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyAtomicDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyAtomicDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyAtomicDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/AnySimpleDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnySimpleDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/AnySimpleDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnySimpleDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyURIDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyURIDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyURIDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/AnyURIDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/Base64BinaryDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/Base64BinaryDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/Base64BinaryDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/Base64BinaryDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseDVFactory.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseSchemaDVFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseSchemaDVFactory.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseSchemaDVFactory.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BaseSchemaDVFactory.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/BooleanDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BooleanDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/BooleanDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/BooleanDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/DateDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/DateDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/DateTimeDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateTimeDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/DateTimeDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DateTimeDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/DayDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/DayDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/DayTimeDurationDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayTimeDurationDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/DayTimeDurationDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DayTimeDurationDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/DecimalDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DecimalDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/DecimalDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DecimalDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/DoubleDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DoubleDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/DoubleDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DoubleDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/DurationDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DurationDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/DurationDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/DurationDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/EntityDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/EntityDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/EntityDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/EntityDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ExtendedSchemaDVFactoryImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/FloatDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/FloatDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/FloatDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/FloatDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/FullDVFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/FullDVFactory.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/FullDVFactory.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/FullDVFactory.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/HexBinaryDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/HexBinaryDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/HexBinaryDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/HexBinaryDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/IDDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/IDDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/IDDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/IDDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/IDREFDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/IDREFDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/IDREFDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/IDREFDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/IntegerDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/IntegerDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/IntegerDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/IntegerDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/ListDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ListDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/ListDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/ListDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDayDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDayDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDayDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/MonthDayDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/PrecisionDecimalDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/PrecisionDecimalDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/PrecisionDecimalDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/PrecisionDecimalDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/QNameDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/QNameDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/QNameDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/QNameDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDVFactoryImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDateTimeException.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDateTimeException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDateTimeException.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/SchemaDateTimeException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/StringDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/StringDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/StringDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/StringDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/TimeDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/TimeDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/TimeDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/TimeDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/TypeValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/TypeValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/TypeValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/TypeValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/UnionDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/UnionDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/UnionDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/UnionDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDecl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDelegate.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDelegate.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDelegate.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/XSSimpleTypeDelegate.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/YearDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/YearDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDurationDV.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDurationDV.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDurationDV.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/dv/xs/YearMonthDurationDV.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/io/ASCIIReader.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/io/ASCIIReader.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/io/ASCIIReader.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/io/ASCIIReader.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/io/MalformedByteSequenceException.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/io/MalformedByteSequenceException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/io/MalformedByteSequenceException.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/io/MalformedByteSequenceException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/io/UCSReader.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/io/UCSReader.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/io/UCSReader.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/io/UCSReader.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/io/UTF8Reader.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/io/UTF8Reader.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/io/UTF8Reader.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/io/UTF8Reader.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_de.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_de.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_de.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_es.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_es.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_es.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_fr.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_fr.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_fr.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_it.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_it.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_it.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ja.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ja.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ja.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ko.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ko.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_ko.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_pt_BR.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_pt_BR.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_pt_BR.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_sv.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_sv.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_sv.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_CN.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_CN.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_CN.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_TW.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_TW.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DOMMessages_zh_TW.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_de.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_de.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_de.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_es.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_es.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_es.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_fr.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_fr.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_fr.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_it.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_it.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_it.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ja.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ja.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ja.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ko.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ko.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_ko.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_pt_BR.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_pt_BR.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_pt_BR.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_sv.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_sv.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_sv.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_CN.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_CN.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_CN.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_TW.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_TW.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/DatatypeMessages_zh_TW.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_de.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_de.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_de.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_es.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_es.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_es.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_fr.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_fr.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_fr.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_it.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ja.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ja.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ja.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ko.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ko.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_ko.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_pt_BR.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_pt_BR.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_pt_BR.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_sv.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_sv.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_sv.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_CN.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_CN.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_CN.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_TW.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_TW.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/JAXPValidationMessages_zh_TW.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_de.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_de.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_de.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_es.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_es.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_es.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_fr.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_fr.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_fr.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_it.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_it.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_it.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ja.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ja.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ja.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ko.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ko.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_ko.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_pt_BR.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_pt_BR.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_pt_BR.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_sv.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_CN.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_CN.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_CN.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_TW.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_TW.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/SAXMessages_zh_TW.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_de.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_de.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_de.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_es.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_es.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_es.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_fr.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_fr.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_fr.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_it.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_it.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_it.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ja.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ja.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ja.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ko.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ko.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_ko.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_pt_BR.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_pt_BR.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_pt_BR.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_sv.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_sv.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_sv.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_CN.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_CN.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_CN.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_TW.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_TW.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XIncludeMessages_zh_TW.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_de.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_es.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_fr.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_it.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ja.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_ko.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_pt_BR.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_sv.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_CN.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessageFormatter_zh_TW.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_de.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_es.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_fr.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_it.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ja.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_ko.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_pt_BR.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_sv.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_CN.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages_zh_TW.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties
index 9605b7d9027..d2e847199ec 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages.properties
@@ -289,3 +289,6 @@
TargetNamespace.2 = TargetNamespace.2: Expecting no namespace, but the schema document has a target namespace of ''{1}''.
UndeclaredEntity = UndeclaredEntity: Entity ''{0}'' is not declared.
UndeclaredPrefix = UndeclaredPrefix: Cannot resolve ''{0}'' as a QName: the prefix ''{1}'' is not declared.
+null
+null
+null
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_de.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_es.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_fr.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_it.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ja.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_ko.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_pt_BR.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_sv.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_CN.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSchemaMessages_zh_TW.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_de.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_de.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_de.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_es.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_es.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_es.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_fr.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_fr.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_fr.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_it.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_it.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_it.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ja.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ja.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ja.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ko.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ko.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_ko.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_pt_BR.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_pt_BR.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_pt_BR.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_sv.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_CN.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_CN.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_CN.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_TW.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_TW.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLSerializerMessages_zh_TW.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_de.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_de.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_de.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_de.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_es.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_es.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_es.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_es.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_fr.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_fr.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_fr.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_it.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_it.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_it.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_it.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ja.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ja.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ja.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ko.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ko.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ko.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_ko.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_pt_BR.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_pt_BR.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_pt_BR.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_pt_BR.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_sv.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_sv.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_sv.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_sv.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_CN.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_CN.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_CN.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_CN.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_TW.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_TW.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_TW.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XPointerMessages_zh_TW.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/validation/EntityState.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/validation/EntityState.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/validation/EntityState.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/validation/EntityState.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/validation/ValidationManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/validation/ValidationManager.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/validation/ValidationManager.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/validation/ValidationManager.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/validation/ValidationState.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/validation/ValidationState.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/validation/ValidationState.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/validation/ValidationState.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/XPathException.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/XPathException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/XPathException.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/XPathException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/BMPattern.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/BMPattern.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/BMPattern.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/BMPattern.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/CaseInsensitiveMap.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/CaseInsensitiveMap.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/CaseInsensitiveMap.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/CaseInsensitiveMap.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/Match.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Match.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/Match.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Match.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/Op.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Op.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/Op.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Op.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParseException.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParseException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParseException.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParseException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java
similarity index 97%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java
index 3576ad28703..22e2a710c9b 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/ParserForXMLSchema.java
@@ -383,16 +383,13 @@ class ParserForXMLSchema extends RegexParser {
tok = Token.createRange();
setupRange(tok, DIGITS);
- ranges.put("xml:isDigit", tok);
- ranges2.put("xml:isDigit", Token.complementRanges(tok));
-
- tok = Token.createRange();
- setupRange(tok, DIGITS);
+ setupRange(tok, DIGITS_INT);
ranges.put("xml:isDigit", tok);
ranges2.put("xml:isDigit", Token.complementRanges(tok));
tok = Token.createRange();
setupRange(tok, LETTERS);
+ setupRange(tok, LETTERS_INT);
tok.mergeRanges((Token)ranges.get("xml:isDigit"));
ranges.put("xml:isWord", tok);
ranges2.put("xml:isWord", Token.complementRanges(tok));
@@ -420,6 +417,12 @@ class ParserForXMLSchema extends RegexParser {
range.addRange(src.charAt(i), src.charAt(i+1));
}
+ static void setupRange(Token range, int[] src) {
+ int len = src.length;
+ for (int i = 0; i < len; i += 2)
+ range.addRange(src[i], src[i+1]);
+ }
+
private static final String SPACES = "\t\n\r\r ";
private static final String NAMECHARS =
"\u002d\u002e\u0030\u003a\u0041\u005a\u005f\u005f\u0061\u007a\u00b7\u00b7\u00c0\u00d6"
@@ -466,7 +469,8 @@ class ParserForXMLSchema extends RegexParser {
+"";
private static final String LETTERS =
"\u0041\u005a\u0061\u007a\u00c0\u00d6\u00d8\u00f6\u00f8\u0131\u0134\u013e\u0141\u0148"
- +"\u014a\u017e\u0180\u01c3\u01cd\u01f0\u01f4\u01f5\u01fa\u0217\u0250\u02a8\u02bb\u02c1"
+ +"\u014a\u017e\u0180\u01f0\u01f4\u01f5\u01fa\u0217\u0250\u02a8\u02bb\u02c1"
+ +"\u02b0\u02d1"
+"\u0386\u0386\u0388\u038a\u038c\u038c\u038e\u03a1\u03a3\u03ce\u03d0\u03d6\u03da\u03da"
+"\u03dc\u03dc\u03de\u03de\u03e0\u03e0\u03e2\u03f3\u0401\u040c\u040e\u044f\u0451\u045c"
+"\u045e\u0481\u0490\u04c4\u04c7\u04c8\u04cb\u04cc\u04d0\u04eb\u04ee\u04f5\u04f8\u04f9"
@@ -494,9 +498,15 @@ class ParserForXMLSchema extends RegexParser {
+"\u1f5f\u1f7d\u1f80\u1fb4\u1fb6\u1fbc\u1fbe\u1fbe\u1fc2\u1fc4\u1fc6\u1fcc\u1fd0\u1fd3"
+"\u1fd6\u1fdb\u1fe0\u1fec\u1ff2\u1ff4\u1ff6\u1ffc\u2126\u2126\u212a\u212b\u212e\u212e"
+"\u2180\u2182\u3007\u3007\u3021\u3029\u3041\u3094\u30a1\u30fa\u3105\u312c\u4e00\u9fa5"
- +"\uac00\ud7a3";
+ +"\uac00\ud7a3\uff66\uff9f";
+
+ private static final int[] LETTERS_INT = {0x1d790, 0x1d7a8, 0x1d7aa, 0x1d7c9, 0x2fa1b, 0x2fa1d};
+
private static final String DIGITS =
"\u0030\u0039\u0660\u0669\u06F0\u06F9\u0966\u096F\u09E6\u09EF\u0A66\u0A6F\u0AE6\u0AEF"
+"\u0B66\u0B6F\u0BE7\u0BEF\u0C66\u0C6F\u0CE6\u0CEF\u0D66\u0D6F\u0E50\u0E59\u0ED0\u0ED9"
+"\u0F20\u0F29\u1040\u1049\u1369\u1371\u17E0\u17E9\u1810\u1819\uFF10\uFF19";
+
+ private static final int[] DIGITS_INT = {0x1D7CE, 0x1D7FF};
+
}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/REUtil.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/REUtil.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/REUtil.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/REUtil.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/RangeToken.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RangeToken.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/RangeToken.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RangeToken.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegexParser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/RegularExpression.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/Token.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/message.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/message.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_fr.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_fr.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_fr.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_fr.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_ja.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_ja.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_ja.properties
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/regex/message_ja.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/AttributePSVImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/ElementPSVImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/ElementPSVImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/ElementPSVImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/ElementPSVImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SchemaGrammar.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaGrammar.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SchemaGrammar.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaGrammar.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SchemaNamespaceSupport.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaNamespaceSupport.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SchemaNamespaceSupport.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaNamespaceSupport.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SchemaSymbols.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaSymbols.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SchemaSymbols.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SchemaSymbols.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/SubstitutionGroupHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaException.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaException.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java
index ff5b46b0005..4b7ba136685 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java
@@ -154,6 +154,8 @@ XSLoader, DOMConfiguration {
protected static final String SCHEMA_DV_FACTORY =
Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY;
+ protected static final String USE_SERVICE_MECHANISM = Constants.ORACLE_FEATURE_SERVICE_MECHANISM;
+
// recognized features:
private static final String[] RECOGNIZED_FEATURES = {
SCHEMA_FULL_CHECKING,
@@ -166,7 +168,8 @@ XSLoader, DOMConfiguration {
VALIDATE_ANNOTATIONS,
HONOUR_ALL_SCHEMALOCATIONS,
NAMESPACE_GROWTH,
- TOLERATE_DUPLICATES
+ TOLERATE_DUPLICATES,
+ USE_SERVICE_MECHANISM
};
// property identifiers
@@ -1148,7 +1151,8 @@ XSLoader, DOMConfiguration {
name.equals(GENERATE_SYNTHETIC_ANNOTATIONS) ||
name.equals(HONOUR_ALL_SCHEMALOCATIONS) ||
name.equals(NAMESPACE_GROWTH) ||
- name.equals(TOLERATE_DUPLICATES)) {
+ name.equals(TOLERATE_DUPLICATES) ||
+ name.equals(USE_SERVICE_MECHANISM)) {
return true;
}
@@ -1227,6 +1231,7 @@ XSLoader, DOMConfiguration {
v.add(HONOUR_ALL_SCHEMALOCATIONS);
v.add(NAMESPACE_GROWTH);
v.add(TOLERATE_DUPLICATES);
+ v.add(USE_SERVICE_MECHANISM);
fRecognizedParameters = new DOMStringListImpl(v);
}
return fRecognizedParameters;
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java
index aa6dc744252..c14673ec26a 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java
@@ -233,6 +233,8 @@ public class XMLSchemaValidator
protected static final String SCHEMA_DV_FACTORY =
Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY;
+ protected static final String USE_SERVICE_MECHANISM = Constants.ORACLE_FEATURE_SERVICE_MECHANISM;
+
// recognized features and properties
/** Recognized features. */
@@ -250,7 +252,8 @@ public class XMLSchemaValidator
HONOUR_ALL_SCHEMALOCATIONS,
USE_GRAMMAR_POOL_ONLY,
NAMESPACE_GROWTH,
- TOLERATE_DUPLICATES
+ TOLERATE_DUPLICATES,
+ USE_SERVICE_MECHANISM
};
/** Feature defaults. */
@@ -272,7 +275,8 @@ public class XMLSchemaValidator
null,
null,
null,
- null
+ null,
+ Boolean.TRUE
};
/** Recognized properties. */
@@ -3488,7 +3492,8 @@ public class XMLSchemaValidator
if (fIdentityConstraint.getCategory() == IdentityConstraint.IC_KEY) {
String code = "AbsentKeyValue";
String eName = fIdentityConstraint.getElementName();
- reportSchemaError(code, new Object[] { eName });
+ String cName = fIdentityConstraint.getIdentityConstraintName();
+ reportSchemaError(code, new Object[] { eName, cName });
}
return;
}
@@ -3503,9 +3508,9 @@ public class XMLSchemaValidator
if (fIdentityConstraint.getCategory() == IdentityConstraint.IC_KEY) {
String code = "KeyNotEnoughValues";
UniqueOrKey key = (UniqueOrKey) fIdentityConstraint;
- String ename = fIdentityConstraint.getElementName();
- String kname = key.getIdentityConstraintName();
- reportSchemaError(code, new Object[] { ename, kname });
+ String eName = fIdentityConstraint.getElementName();
+ String cName = key.getIdentityConstraintName();
+ reportSchemaError(code, new Object[] { eName, cName });
}
return;
}
@@ -3558,12 +3563,15 @@ public class XMLSchemaValidator
// do we even know this field?
if (i == -1) {
String code = "UnknownField";
- reportSchemaError(code, new Object[] { field.toString()});
+ String eName = fIdentityConstraint.getElementName();
+ String cName = fIdentityConstraint.getIdentityConstraintName();
+ reportSchemaError(code, new Object[] { field.toString(), eName, cName });
return;
}
if (Boolean.TRUE != mayMatch(field)) {
String code = "FieldMultipleMatch";
- reportSchemaError(code, new Object[] { field.toString()});
+ String cName = fIdentityConstraint.getIdentityConstraintName();
+ reportSchemaError(code, new Object[] { field.toString(), cName });
} else {
fValuesCount++;
}
@@ -3844,8 +3852,9 @@ public class XMLSchemaValidator
if (contains()) {
String code = "DuplicateUnique";
String value = toString(fLocalValues);
- String ename = fIdentityConstraint.getElementName();
- reportSchemaError(code, new Object[] { value, ename });
+ String eName = fIdentityConstraint.getElementName();
+ String cName = fIdentityConstraint.getIdentityConstraintName();
+ reportSchemaError(code, new Object[] { value, eName, cName });
}
} // duplicateValue(Hashtable)
@@ -3880,8 +3889,9 @@ public class XMLSchemaValidator
if (contains()) {
String code = "DuplicateKey";
String value = toString(fLocalValues);
- String ename = fIdentityConstraint.getElementName();
- reportSchemaError(code, new Object[] { value, ename });
+ String eName = fIdentityConstraint.getElementName();
+ String cName = fIdentityConstraint.getIdentityConstraintName();
+ reportSchemaError(code, new Object[] { value, eName, cName });
}
} // duplicateValue(Hashtable)
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSAnnotationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAnnotationImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSAnnotationImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAnnotationImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeDecl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeDecl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeGroupDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeGroupDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeGroupDecl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeGroupDecl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeUseImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeUseImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeUseImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSAttributeUseImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSDDescription.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSDDescription.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSDDescription.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSDDescription.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSDeclarationPool.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSDeclarationPool.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSDeclarationPool.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSDeclarationPool.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSElementDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSElementDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSElementDecl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSElementDecl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSGrammarBucket.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSGroupDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSGroupDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSGroupDecl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSGroupDecl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSImplementationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSImplementationImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSImplementationImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSImplementationImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSLoaderImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSLoaderImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSLoaderImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSLoaderImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSMessageFormatter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSModelGroupImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelGroupImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSModelGroupImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelGroupImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSModelImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSModelImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSModelImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSNotationDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSNotationDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSNotationDecl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSNotationDecl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSParticleDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSParticleDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSParticleDecl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSParticleDecl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSWildcardDecl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSWildcardDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSWildcardDecl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XSWildcardDecl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/Field.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Field.java
similarity index 97%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/Field.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Field.java
index ae1ae14e2ae..ca968f8d41e 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/Field.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Field.java
@@ -35,6 +35,7 @@ import com.sun.org.apache.xerces.internal.xs.XSTypeDefinition;
* @xerces.internal
*
* @author Andy Clark, IBM
+ * @version $Id: Field.java,v 1.6 2010-11-01 04:39:57 joehw Exp $
*/
public class Field {
@@ -176,7 +177,8 @@ public class Field {
super.matched(actualValue, valueType, itemValueType, isNil);
if(isNil && (fIdentityConstraint.getCategory() == IdentityConstraint.IC_KEY)) {
String code = "KeyMatchesNillable";
- fStore.reportError(code, new Object[]{fIdentityConstraint.getElementName()});
+ fStore.reportError(code,
+ new Object[]{fIdentityConstraint.getElementName(), fIdentityConstraint.getIdentityConstraintName()});
}
fStore.addValue(Field.this, actualValue, convertToPrimitiveKind(valueType), convertToPrimitiveKind(itemValueType));
// once we've stored the value for this field, we set the mayMatch
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/FieldActivator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/FieldActivator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/FieldActivator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/FieldActivator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/IdentityConstraint.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/IdentityConstraint.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/IdentityConstraint.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/IdentityConstraint.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/KeyRef.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/KeyRef.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/KeyRef.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/KeyRef.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/Selector.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Selector.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/Selector.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/Selector.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/UniqueOrKey.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/UniqueOrKey.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/UniqueOrKey.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/UniqueOrKey.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/ValueStore.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/ValueStore.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/ValueStore.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/ValueStore.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/XPathMatcher.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/XPathMatcher.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/identity/XPathMatcher.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/identity/XPathMatcher.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMBuilder.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSAllCM.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSAllCM.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSAllCM.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSAllCM.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMBinOp.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMBinOp.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMBinOp.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMBinOp.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMLeaf.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMLeaf.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMLeaf.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMLeaf.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMRepeatingLeaf.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMRepeatingLeaf.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMRepeatingLeaf.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMRepeatingLeaf.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMUniOp.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMUniOp.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMUniOp.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMUniOp.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMValidator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMValidator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSCMValidator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSDFACM.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSDFACM.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSDFACM.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSDFACM.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSEmptyCM.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSEmptyCM.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/models/XSEmptyCM.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/XSEmptyCM.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/AttrImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/AttrImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/AttrImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/AttrImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultDocument.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultDocument.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultDocument.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultDocument.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultElement.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultElement.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultElement.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultElement.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultNode.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultNode.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultNode.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultNode.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultText.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultText.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultText.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultText.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultXMLDocumentHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultXMLDocumentHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultXMLDocumentHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/DefaultXMLDocumentHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/ElementImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/ElementImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/ElementImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/ElementImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/NamedNodeMapImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/NamedNodeMapImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/NamedNodeMapImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/NamedNodeMapImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/NodeImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/NodeImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/NodeImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/NodeImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOM.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOM.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOM.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOM.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMImplementation.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMImplementation.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMImplementation.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMImplementation.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMParser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMParser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaDOMParser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaParsingConfig.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaParsingConfig.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaParsingConfig.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaParsingConfig.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/TextImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/TextImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/opti/TextImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/opti/TextImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/SchemaContentHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/SchemaContentHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/SchemaContentHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/SchemaContentHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/StAXSchemaParser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAnnotationInfo.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAnnotationInfo.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAnnotationInfo.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAnnotationInfo.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractIDConstraintTraverser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractParticleTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractParticleTraverser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractParticleTraverser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractParticleTraverser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAbstractTraverser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeGroupTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeGroupTraverser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeGroupTraverser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeGroupTraverser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeTraverser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeTraverser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDAttributeTraverser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDComplexTypeTraverser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDElementTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDElementTraverser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDElementTraverser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDElementTraverser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDGroupTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDGroupTraverser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDGroupTraverser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDGroupTraverser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDKeyrefTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDKeyrefTraverser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDKeyrefTraverser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDKeyrefTraverser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDNotationTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDNotationTraverser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDNotationTraverser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDNotationTraverser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDSimpleTypeTraverser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDUniqueOrKeyTraverser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDWildcardTraverser.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDWildcardTraverser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDWildcardTraverser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDWildcardTraverser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDocumentInfo.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/LSInputListImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/LSInputListImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/LSInputListImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/LSInputListImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/ObjectListImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/ObjectListImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/ObjectListImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/ObjectListImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/ShortListImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/SimpleLocator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/SimpleLocator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/SimpleLocator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/SimpleLocator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/StringListImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/StringListImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/StringListImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/StringListImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XInt.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XInt.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XInt.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XInt.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XIntPool.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XIntPool.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XIntPool.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XIntPool.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSGrammarPool.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSInputSource.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSInputSource.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSInputSource.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSInputSource.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMap4Types.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMap4Types.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMap4Types.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMap4Types.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMapImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMapImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMapImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSNamedMapImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSObjectListImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSObjectListImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/xs/util/XSObjectListImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/util/XSObjectListImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderFactoryImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/JAXPConstants.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/JAXPConstants.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/JAXPConstants.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/jaxp/JAXPConstants.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/JAXPValidatorComponent.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/JAXPValidatorComponent.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/JAXPValidatorComponent.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/jaxp/JAXPValidatorComponent.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserFactoryImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/SchemaValidatorConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SchemaValidatorConfiguration.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/SchemaValidatorConfiguration.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SchemaValidatorConfiguration.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/TeeXMLDocumentFilterImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/TeeXMLDocumentFilterImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/TeeXMLDocumentFilterImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/jaxp/TeeXMLDocumentFilterImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/UnparsedEntityHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/UnparsedEntityHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/UnparsedEntityHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/jaxp/UnparsedEntityHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DatatypeFactoryImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationDayTimeImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationDayTimeImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationDayTimeImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationDayTimeImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationYearMonthImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationYearMonthImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationYearMonthImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/DurationYearMonthImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java
index 3322cd23820..dac7fbf09f2 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java
@@ -39,7 +39,7 @@ import javax.xml.datatype.Duration;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
import com.sun.org.apache.xerces.internal.util.DatatypeMessageFormatter;
-
+import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
/**
* Representation for W3C XML Schema 1.0 date/time datatypes.
@@ -2394,7 +2394,10 @@ public class XMLGregorianCalendarImpl
GregorianCalendar result = null;
final int DEFAULT_TIMEZONE_OFFSET = DatatypeConstants.FIELD_UNDEFINED;
TimeZone tz = getTimeZone(DEFAULT_TIMEZONE_OFFSET);
- Locale locale = Locale.getDefault();
+ /** Use the following instead for JDK7 only:
+ * Locale locale = Locale.getDefault(Locale.Category.FORMAT);
+ */
+ Locale locale = getDefaultLocale();
result = new GregorianCalendar(tz, locale);
result.clear();
@@ -2441,6 +2444,33 @@ public class XMLGregorianCalendarImpl
return result;
}
+ /**
+ *
+ * @return default locale
+ */
+ private Locale getDefaultLocale() {
+
+ String lang = SecuritySupport.getSystemProperty("user.language.format");
+ String country = SecuritySupport.getSystemProperty("user.country.format");
+ String variant = SecuritySupport.getSystemProperty("user.variant.format");
+ Locale locale = null;
+ if (lang != null) {
+ if (country != null) {
+ if (variant != null) {
+ locale = new Locale(lang, country, variant);
+ } else {
+ locale = new Locale(lang, country);
+ }
+ } else {
+ locale = new Locale(lang);
+ }
+ }
+ if (locale == null) {
+ locale = Locale.getDefault();
+ }
+ return locale;
+ }
+
/**
* Convert A validator helper for This class provides an easy way for a user to preparse grammars
@@ -48,7 +49,7 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
*
* @author Neil Graham, IBM
*
- * @version $Id: XMLGrammarPreparser.java,v 1.6 2010/07/23 02:09:28 joehw Exp $
+ * @version $Id: XMLGrammarPreparser.java,v 1.7 2010-11-01 04:40:10 joehw Exp $
*/
public class XMLGrammarPreparser {
@@ -155,8 +156,7 @@ public class XMLGrammarPreparser {
// got one; just instantiate it...
String loaderName = (String)KNOWN_LOADERS.get(grammarType);
try {
- ClassLoader cl = ObjectFactory.findClassLoader();
- XMLGrammarLoader gl = (XMLGrammarLoader)(ObjectFactory.newInstance(loaderName, cl, true));
+ XMLGrammarLoader gl = (XMLGrammarLoader)(ObjectFactory.newInstance(loaderName, true));
fLoaders.put(grammarType, gl);
} catch (Exception e) {
return false;
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/parsers/XMLParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/parsers/XMLParser.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/parsers/XPointerParserConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XPointerParserConfiguration.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/parsers/XPointerParserConfiguration.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/parsers/XPointerParserConfiguration.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.DTDConfiguration b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.DTDConfiguration
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.DTDConfiguration
rename to jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.DTDConfiguration
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XML11Configuration b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XML11Configuration
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XML11Configuration
rename to jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XML11Configuration
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XMLParserConfiguration b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XMLParserConfiguration
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XMLParserConfiguration
rename to jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.apache.xerces.xni.parser.XMLParserConfiguration
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/parsers/org.xml.sax.driver b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.xml.sax.driver
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/parsers/org.xml.sax.driver
rename to jaxp/src/com/sun/org/apache/xerces/internal/parsers/org.xml.sax.driver
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/AttributesProxy.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/AttributesProxy.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/AttributesProxy.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/AttributesProxy.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/AugmentationsImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/AugmentationsImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/AugmentationsImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/AugmentationsImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/DOMEntityResolverWrapper.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/DOMEntityResolverWrapper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/DOMEntityResolverWrapper.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/DOMEntityResolverWrapper.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/DOMErrorHandlerWrapper.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/DOMErrorHandlerWrapper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/DOMErrorHandlerWrapper.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/DOMErrorHandlerWrapper.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/DOMInputSource.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/DOMInputSource.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/DOMInputSource.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/DOMInputSource.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/DOMUtil.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/DOMUtil.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/DOMUtil.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/DOMUtil.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/DatatypeMessageFormatter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/DefaultErrorHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/DefaultErrorHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/DefaultErrorHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/DefaultErrorHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/DraconianErrorHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/DraconianErrorHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/DraconianErrorHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/DraconianErrorHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/EncodingMap.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/EncodingMap.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/EncodingMap.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/EncodingMap.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/EntityResolver2Wrapper.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/EntityResolver2Wrapper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/EntityResolver2Wrapper.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/EntityResolver2Wrapper.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/EntityResolverWrapper.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/EntityResolverWrapper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/EntityResolverWrapper.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/EntityResolverWrapper.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/ErrorHandlerProxy.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/ErrorHandlerProxy.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/ErrorHandlerProxy.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/ErrorHandlerProxy.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/ErrorHandlerWrapper.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/ErrorHandlerWrapper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/ErrorHandlerWrapper.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/ErrorHandlerWrapper.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/FeatureState.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/FeatureState.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/FeatureState.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/FeatureState.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/HTTPInputSource.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/HTTPInputSource.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/HTTPInputSource.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/HTTPInputSource.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/IntStack.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/IntStack.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/IntStack.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/IntStack.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/JAXPNamespaceContextWrapper.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/JAXPNamespaceContextWrapper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/JAXPNamespaceContextWrapper.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/JAXPNamespaceContextWrapper.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/LocatorProxy.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/LocatorProxy.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/LocatorProxy.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/LocatorProxy.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/LocatorWrapper.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/LocatorWrapper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/LocatorWrapper.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/LocatorWrapper.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/MessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/MessageFormatter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/MessageFormatter.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/MessageFormatter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/NamespaceContextWrapper.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/NamespaceContextWrapper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/NamespaceContextWrapper.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/NamespaceContextWrapper.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/NamespaceSupport.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/NamespaceSupport.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/NamespaceSupport.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/NamespaceSupport.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java
similarity index 96%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java
index 13e12309db5..a13d8154c96 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/ParserConfigurationSettings.java
@@ -112,7 +112,16 @@ public class ParserConfigurationSettings
* to be recognized.
*/
public void addRecognizedFeatures(String[] featureIds) {
- fRecognizedFeatures.addAll(Arrays.asList(featureIds));
+
+ // add recognized features
+ int featureIdsCount = featureIds != null ? featureIds.length : 0;
+ for (int i = 0; i < featureIdsCount; i++) {
+ String featureId = featureIds[i];
+ if (!fRecognizedFeatures.contains(featureId)) {
+ fRecognizedFeatures.add(featureId);
+ }
+ }
+
} // addRecognizedFeatures(String[])
/**
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/PropertyState.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/PropertyState.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/PropertyState.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/PropertyState.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SAX2XNI.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SAX2XNI.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SAX2XNI.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/SAX2XNI.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SAXInputSource.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SAXInputSource.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SAXInputSource.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/SAXInputSource.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SAXLocatorWrapper.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SAXLocatorWrapper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SAXLocatorWrapper.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/SAXLocatorWrapper.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/SAXMessageFormatter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SecurityManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SecurityManager.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/ShadowedSymbolTable.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/ShadowedSymbolTable.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/ShadowedSymbolTable.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/ShadowedSymbolTable.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/StAXInputSource.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/StAXInputSource.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/StAXInputSource.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/StAXInputSource.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/StAXLocationWrapper.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/StAXLocationWrapper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/StAXLocationWrapper.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/StAXLocationWrapper.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/Status.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/Status.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/Status.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/Status.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SymbolHash.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolHash.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SymbolHash.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolHash.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SymbolTable.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SymbolTable.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SynchronizedSymbolTable.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SynchronizedSymbolTable.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/SynchronizedSymbolTable.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/SynchronizedSymbolTable.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/TeeXMLDocumentFilterImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/TeeXMLDocumentFilterImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/TeeXMLDocumentFilterImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/TeeXMLDocumentFilterImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/TypeInfoImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/TypeInfoImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/TypeInfoImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/TypeInfoImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/URI.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/URI.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/URI.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/URI.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XML11Char.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XML11Char.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XML11Char.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/XML11Char.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/XMLAttributesImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLAttributesIteratorImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLAttributesIteratorImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLAttributesIteratorImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/XMLAttributesIteratorImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLCatalogResolver.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLCatalogResolver.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLCatalogResolver.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/XMLCatalogResolver.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLChar.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLChar.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLChar.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/XMLChar.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLDocumentFilterImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLDocumentFilterImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLDocumentFilterImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/XMLDocumentFilterImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLEntityDescriptionImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLEntityDescriptionImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLEntityDescriptionImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/XMLEntityDescriptionImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLErrorCode.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLErrorCode.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLErrorCode.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/XMLErrorCode.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLGrammarPoolImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLGrammarPoolImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLGrammarPoolImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/XMLGrammarPoolImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLInputSourceAdaptor.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLInputSourceAdaptor.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLInputSourceAdaptor.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/XMLInputSourceAdaptor.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLResourceIdentifierImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLResourceIdentifierImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLResourceIdentifierImpl.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/XMLResourceIdentifierImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLStringBuffer.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLStringBuffer.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLStringBuffer.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/XMLStringBuffer.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLSymbols.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/XMLSymbols.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/util/XMLSymbols.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/util/XMLSymbols.java
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/utils/ConfigurationError.java b/jaxp/src/com/sun/org/apache/xerces/internal/utils/ConfigurationError.java
new file mode 100644
index 00000000000..9cd86732f32
--- /dev/null
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/ConfigurationError.java
@@ -0,0 +1,58 @@
+/*
+ * reserved comment block
+ * DO NOT REMOVE OR ALTER!
+ */
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed 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.org.apache.xerces.internal.utils;
+
+/**
+ * A configuration error. This was an internal class in ObjectFactory previously
+ */
+public final class ConfigurationError
+ extends Error {
+
+ //
+ // Data
+ //
+
+ /** Exception. */
+ private Exception exception;
+
+ //
+ // Constructors
+ //
+
+ /**
+ * Construct a new instance with the specified detail string and
+ * exception.
+ */
+ ConfigurationError(String msg, Exception x) {
+ super(msg);
+ this.exception = x;
+ } //
*
+ * @version $Id: ObjectFactory.java,v 1.6 2010/04/23 01:44:34 joehw Exp $
*/
-final class ObjectFactory {
+public final class ObjectFactory {
//
// Constants
@@ -52,7 +53,7 @@ final class ObjectFactory {
private static final String DEFAULT_PROPERTIES_FILENAME = "xerces.properties";
/** Set to true for debugging */
- private static final boolean DEBUG = false;
+ private static final boolean DEBUG = isDebugEnabled();
/**
* Default columns per line.
@@ -95,7 +96,7 @@ final class ObjectFactory {
*
* @exception ObjectFactory.ConfigurationError
*/
- static Object createObject(String factoryId, String fallbackClassName)
+ public static Object createObject(String factoryId, String fallbackClassName)
throws ConfigurationError {
return createObject(factoryId, null, fallbackClassName);
} // createObject(String,String):Object
@@ -122,20 +123,19 @@ final class ObjectFactory {
*
* @exception ObjectFactory.ConfigurationError
*/
- static Object createObject(String factoryId,
+ public static Object createObject(String factoryId,
String propertiesFilename,
String fallbackClassName)
throws ConfigurationError
{
if (DEBUG) debugPrintln("debug is on");
- SecuritySupport ss = SecuritySupport.getInstance();
ClassLoader cl = findClassLoader();
// Use the system property first
try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
+ String systemProp = SecuritySupport.getSystemProperty(factoryId);
+ if (systemProp != null && systemProp.length() > 0) {
if (DEBUG) debugPrintln("found system property, value=" + systemProp);
return newInstance(systemProp, cl, true);
}
@@ -147,118 +147,6 @@ final class ObjectFactory {
// always use fallback class to avoid the expense of constantly
// "stat"ing a non-existent "xerces.properties" and jar SPI entry
// see CR 6400863: Expensive creating of SAX parser in Mustang
- if (true) {
- if (fallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- if (DEBUG) debugPrintln("using fallback, value=" + fallbackClassName);
- return newInstance(fallbackClassName, cl, true);
- }
-
- // Try to read from propertiesFilename, or $java.home/lib/xerces.properties
- String factoryClassName = null;
- // no properties file name specified; use $JAVA_HOME/lib/xerces.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXercesProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXercesProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xerces.properties before (or it's outdeated)
- fXercesProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXercesProperties.load(fis);
- }
- } catch (Exception x) {
- fXercesProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXercesProperties != null) {
- factoryClassName = fXercesProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value=" + factoryClassName);
- return newInstance(factoryClassName, cl, true);
- }
-
- // Try Jar Service Provider Mechanism
- Object provider = findJarServiceProvider(factoryId);
- if (provider != null) {
- return provider;
- }
-
if (fallbackClassName == null) {
throw new ConfigurationError(
"Provider for " + factoryId + " cannot be found", null);
@@ -266,16 +154,28 @@ final class ObjectFactory {
if (DEBUG) debugPrintln("using fallback, value=" + fallbackClassName);
return newInstance(fallbackClassName, cl, true);
+
} // createObject(String,String,String):Object
//
// Private static methods
//
+ /** Returns true if debug has been enabled. */
+ private static boolean isDebugEnabled() {
+ try {
+ String val = SecuritySupport.getSystemProperty("xerces.debug");
+ // Allow simply setting the prop to turn on debug
+ return (val != null && (!"false".equals(val)));
+ }
+ catch (SecurityException se) {}
+ return false;
+ } // isDebugEnabled()
+
/** Prints a message to standard error if debugging is enabled. */
private static void debugPrintln(String msg) {
if (DEBUG) {
- System.err.println("JAXP: " + msg);
+ System.err.println("XERCES: " + msg);
}
} // debugPrintln(String)
@@ -283,15 +183,17 @@ final class ObjectFactory {
* Figure out which ClassLoader to use. For JDK 1.2 and later use
* the context ClassLoader.
*/
- static ClassLoader findClassLoader()
+ public static ClassLoader findClassLoader()
throws ConfigurationError
{
- SecuritySupport ss = SecuritySupport.getInstance();
-
+ if (System.getSecurityManager()!=null) {
+ //this will ensure bootclassloader is used
+ return null;
+ }
// Figure out which ClassLoader to use for loading the provider
// class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
+ ClassLoader context = SecuritySupport.getContextClassLoader();
+ ClassLoader system = SecuritySupport.getSystemClassLoader();
ClassLoader chain = system;
while (true) {
@@ -316,7 +218,7 @@ final class ObjectFactory {
if (chain == null) {
break;
}
- chain = ss.getParentClassLoader(chain);
+ chain = SecuritySupport.getParentClassLoader(chain);
}
// Assert: Current ClassLoader not in chain of
@@ -331,7 +233,7 @@ final class ObjectFactory {
// Check for any extension ClassLoaders in chain up to
// boot ClassLoader
- chain = ss.getParentClassLoader(chain);
+ chain = SecuritySupport.getParentClassLoader(chain);
};
// Assert: Context ClassLoader not in chain of
@@ -339,10 +241,25 @@ final class ObjectFactory {
return context;
} // findClassLoader():ClassLoader
+ /**
+ * Create an instance of a class using the same classloader for the ObjectFactory by default
+ * or bootclassloader when Security Manager is in place
+ */
+ public static Object newInstance(String className, boolean doFallback)
+ throws ConfigurationError
+ {
+ if (System.getSecurityManager()!=null) {
+ return newInstance(className, null, doFallback);
+ } else {
+ return newInstance(className,
+ findClassLoader (), doFallback);
+ }
+ }
+
/**
* Create an instance of a class using the specified ClassLoader
*/
- static Object newInstance(String className, ClassLoader cl,
+ public static Object newInstance(String className, ClassLoader cl,
boolean doFallback)
throws ConfigurationError
{
@@ -363,10 +280,24 @@ final class ObjectFactory {
}
}
+ /**
+ * Find a Class using the same classloader for the ObjectFactory by default
+ * or bootclassloader when Security Manager is in place
+ */
+ public static Class findProviderClass(String className, boolean doFallback)
+ throws ClassNotFoundException, ConfigurationError
+ {
+ if (System.getSecurityManager()!=null) {
+ return Class.forName(className);
+ } else {
+ return findProviderClass (className,
+ findClassLoader (), doFallback);
+ }
+ }
/**
* Find a Class using the specified ClassLoader
*/
- static Class findProviderClass(String className, ClassLoader cl,
+ public static Class findProviderClass(String className, ClassLoader cl,
boolean doFallback)
throws ClassNotFoundException, ConfigurationError
{
@@ -381,15 +312,7 @@ final class ObjectFactory {
}
Class providerClass;
if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
+ //use the bootstrap ClassLoader.
providerClass = Class.forName(className);
} else {
try {
@@ -423,21 +346,20 @@ final class ObjectFactory {
private static Object findJarServiceProvider(String factoryId)
throws ConfigurationError
{
- SecuritySupport ss = SecuritySupport.getInstance();
String serviceId = "META-INF/services/" + factoryId;
InputStream is = null;
// First try the Context ClassLoader
ClassLoader cl = findClassLoader();
- is = ss.getResourceAsStream(cl, serviceId);
+ is = SecuritySupport.getResourceAsStream(cl, serviceId);
// If no provider found then try the current ClassLoader
if (is == null) {
ClassLoader current = ObjectFactory.class.getClassLoader();
if (cl != current) {
cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
+ is = SecuritySupport.getResourceAsStream(cl, serviceId);
}
}
@@ -506,48 +428,4 @@ final class ObjectFactory {
return null;
}
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static final class ConfigurationError
- extends Error {
-
- /** Serialization version. */
- static final long serialVersionUID = -7285495612271660427L;
-
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } //
@@ -111,6 +112,7 @@ import com.sun.org.apache.xerces.internal.xpointer.XPointerProcessor;
* @author Peter McCracken, IBM
* @author Michael Glavassevich, IBM
*
+ * @version $Id: XIncludeHandler.java,v 1.7 2010-11-01 04:40:18 joehw Exp $
*
* @see XIncludeNamespaceSupport
*/
@@ -943,7 +945,8 @@ public class XIncludeHandler
setState(STATE_IGNORE);
}
else {
- reportFatalError("NoFallback");
+ reportFatalError("NoFallback",
+ new Object[] { attributes.getValue(null, "href") });
}
}
else if (isFallbackElement(element)) {
@@ -1001,7 +1004,8 @@ public class XIncludeHandler
// we check to see if the children of this include element contained a fallback
if (getState() == STATE_EXPECT_FALLBACK
&& !getSawFallback(fDepth + 1)) {
- reportFatalError("NoFallback");
+ reportFatalError("NoFallback",
+ new Object[] { "unknown" });
}
}
if (isFallbackElement(element)) {
@@ -1567,7 +1571,6 @@ public class XIncludeHandler
fChildConfig =
(XMLParserConfiguration)ObjectFactory.newInstance(
parserName,
- ObjectFactory.findClassLoader(),
true);
// use the same symbol table, error reporter, entity resolver, security manager and buffer size.
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeMessageFormatter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeNamespaceSupport.java b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeNamespaceSupport.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeNamespaceSupport.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeNamespaceSupport.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeTextReader.java b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeTextReader.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeTextReader.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeTextReader.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XPointerElementHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XPointerElementHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XPointerElementHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XPointerElementHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XPointerFramework.java b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XPointerFramework.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XPointerFramework.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XPointerFramework.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XPointerSchema.java b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XPointerSchema.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xinclude/XPointerSchema.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XPointerSchema.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/Augmentations.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/Augmentations.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/Augmentations.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/Augmentations.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/NamespaceContext.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/NamespaceContext.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/NamespaceContext.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/NamespaceContext.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/QName.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/QName.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/QName.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/QName.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLAttributes.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLAttributes.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLAttributes.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLAttributes.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLDTDContentModelHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLDTDContentModelHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLDTDContentModelHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLDTDContentModelHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLDTDHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLDTDHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLDTDHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLDTDHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLDocumentFragmentHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLDocumentFragmentHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLDocumentFragmentHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLDocumentFragmentHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLDocumentHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLDocumentHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLDocumentHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLDocumentHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLLocator.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLLocator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLLocator.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLLocator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLResourceIdentifier.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLResourceIdentifier.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLResourceIdentifier.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLResourceIdentifier.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLString.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLString.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XMLString.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/XMLString.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XNIException.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/XNIException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/XNIException.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/XNIException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/grammars/Grammar.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/grammars/Grammar.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/grammars/Grammar.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/grammars/Grammar.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/grammars/XMLDTDDescription.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLDTDDescription.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/grammars/XMLDTDDescription.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLDTDDescription.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarDescription.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarDescription.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarDescription.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarDescription.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarLoader.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarLoader.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarLoader.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarLoader.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarPool.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarPool.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarPool.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLGrammarPool.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/grammars/XMLSchemaDescription.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLSchemaDescription.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/grammars/XMLSchemaDescription.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/grammars/XMLSchemaDescription.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/grammars/XSGrammar.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/grammars/XSGrammar.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/grammars/XSGrammar.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/grammars/XSGrammar.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLComponent.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponent.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLComponent.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponent.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLComponentManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponentManager.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLComponentManager.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLComponentManager.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLConfigurationException.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLConfigurationException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLConfigurationException.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLConfigurationException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelFilter.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelFilter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelFilter.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelFilter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelSource.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelSource.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelSource.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDContentModelSource.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDFilter.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDFilter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDFilter.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDFilter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDScanner.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDScanner.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDScanner.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDScanner.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDSource.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDSource.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDSource.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDTDSource.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentFilter.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentFilter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentFilter.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentFilter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentScanner.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentScanner.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentScanner.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentScanner.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentSource.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentSource.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentSource.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLDocumentSource.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLEntityResolver.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLEntityResolver.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLEntityResolver.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLEntityResolver.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLErrorHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLErrorHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLErrorHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLErrorHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLInputSource.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLInputSource.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLInputSource.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLInputSource.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLParseException.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLParseException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLParseException.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLParseException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLParserConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLParserConfiguration.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLParserConfiguration.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLParserConfiguration.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLPullParserConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLPullParserConfiguration.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xni/parser/XMLPullParserConfiguration.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xni/parser/XMLPullParserConfiguration.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xpointer/ShortHandPointer.java b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ShortHandPointer.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xpointer/ShortHandPointer.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ShortHandPointer.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xpointer/XPointerErrorHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerErrorHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xpointer/XPointerErrorHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerErrorHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerMessageFormatter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xpointer/XPointerPart.java b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerPart.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xpointer/XPointerPart.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerPart.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xpointer/XPointerProcessor.java b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerProcessor.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xpointer/XPointerProcessor.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerProcessor.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/AttributePSVI.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/AttributePSVI.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/AttributePSVI.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/AttributePSVI.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/ElementPSVI.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/ElementPSVI.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/ElementPSVI.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/ElementPSVI.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/ItemPSVI.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/ItemPSVI.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/ItemPSVI.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/ItemPSVI.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/LSInputList.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/LSInputList.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/LSInputList.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/LSInputList.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/PSVIProvider.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/PSVIProvider.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/PSVIProvider.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/PSVIProvider.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/ShortList.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/ShortList.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/ShortList.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/ShortList.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/StringList.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/StringList.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/StringList.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/StringList.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSAnnotation.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSAnnotation.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSAnnotation.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSAnnotation.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSAttributeDeclaration.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSAttributeDeclaration.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSAttributeDeclaration.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSAttributeDeclaration.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSAttributeGroupDefinition.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSAttributeGroupDefinition.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSAttributeGroupDefinition.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSAttributeGroupDefinition.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSAttributeUse.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSAttributeUse.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSAttributeUse.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSAttributeUse.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSComplexTypeDefinition.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSComplexTypeDefinition.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSComplexTypeDefinition.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSComplexTypeDefinition.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSConstants.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSConstants.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSConstants.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSConstants.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSElementDeclaration.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSElementDeclaration.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSElementDeclaration.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSElementDeclaration.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSException.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSException.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSFacet.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSFacet.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSFacet.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSFacet.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSIDCDefinition.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSIDCDefinition.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSIDCDefinition.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSIDCDefinition.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSImplementation.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSImplementation.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSImplementation.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSImplementation.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSLoader.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSLoader.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSLoader.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSLoader.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSModel.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSModel.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSModel.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSModel.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSModelGroup.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSModelGroup.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSModelGroup.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSModelGroup.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSModelGroupDefinition.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSModelGroupDefinition.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSModelGroupDefinition.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSModelGroupDefinition.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSMultiValueFacet.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSMultiValueFacet.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSMultiValueFacet.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSMultiValueFacet.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSNamedMap.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSNamedMap.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSNamedMap.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSNamedMap.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSNamespaceItem.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSNamespaceItem.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSNamespaceItem.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSNamespaceItem.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSNamespaceItemList.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSNamespaceItemList.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSNamespaceItemList.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSNamespaceItemList.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSNotationDeclaration.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSNotationDeclaration.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSNotationDeclaration.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSNotationDeclaration.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSObject.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSObject.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSObject.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSObject.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSObjectList.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSObjectList.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSObjectList.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSObjectList.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSParticle.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSParticle.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSParticle.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSParticle.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSSimpleTypeDefinition.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSSimpleTypeDefinition.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSSimpleTypeDefinition.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSSimpleTypeDefinition.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSTerm.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSTerm.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSTerm.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSTerm.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSTypeDefinition.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSTypeDefinition.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSTypeDefinition.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSTypeDefinition.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSWildcard.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/XSWildcard.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/XSWildcard.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/XSWildcard.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/ByteList.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/ByteList.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/ByteList.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/ByteList.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/ObjectList.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/ObjectList.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/ObjectList.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/ObjectList.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/XSDateTime.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDateTime.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/XSDateTime.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDateTime.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/XSDecimal.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDecimal.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/XSDecimal.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDecimal.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/XSDouble.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDouble.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/XSDouble.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSDouble.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/XSFloat.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSFloat.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/XSFloat.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSFloat.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/XSQName.java b/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSQName.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/XSQName.java
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/XSQName.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/package.html b/jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/package.html
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xerces/internal/xs/datatypes/package.html
rename to jaxp/src/com/sun/org/apache/xerces/internal/xs/datatypes/package.html
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/Axis.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/Axis.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/Axis.java
rename to jaxp/src/com/sun/org/apache/xml/internal/dtm/Axis.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTM.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTM.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTM.java
rename to jaxp/src/com/sun/org/apache/xml/internal/dtm/DTM.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMAxisIterator.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMAxisIterator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMAxisIterator.java
rename to jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMAxisIterator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMAxisTraverser.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMAxisTraverser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMAxisTraverser.java
rename to jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMAxisTraverser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMConfigurationException.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMConfigurationException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMConfigurationException.java
rename to jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMConfigurationException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMDOMException.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMDOMException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMDOMException.java
rename to jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMDOMException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMException.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMException.java
rename to jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMFilter.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMFilter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMFilter.java
rename to jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMFilter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMIterator.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMIterator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMIterator.java
rename to jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMIterator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMManager.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMManager.java
similarity index 88%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMManager.java
rename to jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMManager.java
index 84908f5eaaa..0c5c0866dcb 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/dtm/DTMManager.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMManager.java
@@ -26,6 +26,7 @@ import com.sun.org.apache.xml.internal.res.XMLErrorResources;
import com.sun.org.apache.xml.internal.res.XMLMessages;
import com.sun.org.apache.xml.internal.utils.PrefixResolver;
import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
/**
* A DTMManager instance can be used to create DTM and
@@ -64,6 +65,7 @@ public abstract class DTMManager
*/
protected XMLStringFactory m_xsf = null;
+ private boolean _useServicesMechanism;
/**
* Default constructor is protected on purpose.
*/
@@ -132,14 +134,24 @@ public abstract class DTMManager
*/
public static DTMManager newInstance(XMLStringFactory xsf)
throws DTMConfigurationException
+ {
+ return newInstance(xsf, true);
+ }
+
+ public static DTMManager newInstance(XMLStringFactory xsf, boolean useServicesMechanism)
+ throws DTMConfigurationException
{
DTMManager factoryImpl = null;
try
{
- factoryImpl = (DTMManager) ObjectFactory
- .createObject(defaultPropName, defaultClassName);
+ if (useServicesMechanism) {
+ factoryImpl = (DTMManager) ObjectFactory
+ .createObject(defaultPropName, defaultClassName);
+ } else {
+ factoryImpl = new com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault();
+ }
}
- catch (ObjectFactory.ConfigurationError e)
+ catch (ConfigurationError e)
{
throw new DTMConfigurationException(XMLMessages.createXMLMessage(
XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException());
@@ -346,6 +358,19 @@ public abstract class DTMManager
m_source_location = sourceLocation;
}
+ /**
+ * Return the state of the services mechanism feature.
+ */
+ public boolean useServicesMechnism() {
+ return _useServicesMechanism;
+ }
+
+ /**
+ * Set the state of the services mechanism feature.
+ */
+ public void setServicesMechnism(boolean flag) {
+ _useServicesMechanism = flag;
+ }
// -------------------- private methods --------------------
@@ -429,4 +454,46 @@ public abstract class DTMManager
return IDENT_NODE_DEFAULT;
}
+ //
+ // Classes
+ //
+
+ /**
+ * A configuration error.
+ * Originally in ObjectFactory. This is the only portion used in this package
+ */
+ static class ConfigurationError
+ extends Error {
+ static final long serialVersionUID = 5122054096615067992L;
+ //
+ // Data
+ //
+
+ /** Exception. */
+ private Exception exception;
+
+ //
+ // Constructors
+ //
+
+ /**
+ * Construct a new instance with the specified detail string and
+ * exception.
+ */
+ ConfigurationError(String msg, Exception x) {
+ super(msg);
+ this.exception = x;
+ } //
+ * m_charToString is not created here only for performance reasons,
+ * to avoid creating a Hashtable that will be replaced when
+ * making a mutable copy, {@link #mutableCopyOf(CharInfo)}.
*
- * Resource files must be encoded in UTF-8 and can either be properties
- * files with a .properties extension assumed. Alternatively, they can
- * have the following form, with no particular extension assumed:
- *
- * Is Standalone Is specified object model supported by this
*
- * REVISIT:
- * This should be done the "right" way by designing a better way to
- * enumerate the declared entities. For now, this method is needed
- * by the constructor that takes an XMLEntityManager parameter.
- * XXX Making this method public, return all the declared entities.
- * @return Hashtable hastable containing all the declared entities.
+ * Returns entity declaration.
+ *
+ * @param name The name of the entity.
+ *
+ * @see SymbolTable
*/
- public Hashtable getDeclaredEntities() {
- return fEntities;
- } // getDeclaredEntities():Hashtable
+ public Entity getEntity(String name) {
+ return (Entity)fEntities.get(name);
+ } // getEntity(String)
+ public boolean hasEntities() {
+ return (fEntities!=null);
+ } // getEntity(String)
+
+ public int getEntitySize() {
+ return fEntities.size();
+ } // getEntity(String)
+
+ public Enumeration getEntityKeys() {
+ return fEntities.keys();
+ }
/**
* Adds an internal entity declaration.
*
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/XMLEventReaderImpl.java b/jaxp/src/com/sun/xml/internal/stream/XMLEventReaderImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/XMLEventReaderImpl.java
rename to jaxp/src/com/sun/xml/internal/stream/XMLEventReaderImpl.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/XMLInputFactoryImpl.java b/jaxp/src/com/sun/xml/internal/stream/XMLInputFactoryImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/XMLInputFactoryImpl.java
rename to jaxp/src/com/sun/xml/internal/stream/XMLInputFactoryImpl.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java b/jaxp/src/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java
rename to jaxp/src/com/sun/xml/internal/stream/XMLOutputFactoryImpl.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/dtd/DTDGrammarUtil.java b/jaxp/src/com/sun/xml/internal/stream/dtd/DTDGrammarUtil.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/dtd/DTDGrammarUtil.java
rename to jaxp/src/com/sun/xml/internal/stream/dtd/DTDGrammarUtil.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/dtd/nonvalidating/DTDGrammar.java b/jaxp/src/com/sun/xml/internal/stream/dtd/nonvalidating/DTDGrammar.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/dtd/nonvalidating/DTDGrammar.java
rename to jaxp/src/com/sun/xml/internal/stream/dtd/nonvalidating/DTDGrammar.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/dtd/nonvalidating/XMLAttributeDecl.java b/jaxp/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLAttributeDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/dtd/nonvalidating/XMLAttributeDecl.java
rename to jaxp/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLAttributeDecl.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/dtd/nonvalidating/XMLElementDecl.java b/jaxp/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLElementDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/dtd/nonvalidating/XMLElementDecl.java
rename to jaxp/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLElementDecl.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/dtd/nonvalidating/XMLNotationDecl.java b/jaxp/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLNotationDecl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/dtd/nonvalidating/XMLNotationDecl.java
rename to jaxp/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLNotationDecl.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/dtd/nonvalidating/XMLSimpleType.java b/jaxp/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLSimpleType.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/dtd/nonvalidating/XMLSimpleType.java
rename to jaxp/src/com/sun/xml/internal/stream/dtd/nonvalidating/XMLSimpleType.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/AttributeImpl.java b/jaxp/src/com/sun/xml/internal/stream/events/AttributeImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/AttributeImpl.java
rename to jaxp/src/com/sun/xml/internal/stream/events/AttributeImpl.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/CharacterEvent.java b/jaxp/src/com/sun/xml/internal/stream/events/CharacterEvent.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/CharacterEvent.java
rename to jaxp/src/com/sun/xml/internal/stream/events/CharacterEvent.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/CommentEvent.java b/jaxp/src/com/sun/xml/internal/stream/events/CommentEvent.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/CommentEvent.java
rename to jaxp/src/com/sun/xml/internal/stream/events/CommentEvent.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/DTDEvent.java b/jaxp/src/com/sun/xml/internal/stream/events/DTDEvent.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/DTDEvent.java
rename to jaxp/src/com/sun/xml/internal/stream/events/DTDEvent.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/DummyEvent.java b/jaxp/src/com/sun/xml/internal/stream/events/DummyEvent.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/DummyEvent.java
rename to jaxp/src/com/sun/xml/internal/stream/events/DummyEvent.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/EndDocumentEvent.java b/jaxp/src/com/sun/xml/internal/stream/events/EndDocumentEvent.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/EndDocumentEvent.java
rename to jaxp/src/com/sun/xml/internal/stream/events/EndDocumentEvent.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/EndElementEvent.java b/jaxp/src/com/sun/xml/internal/stream/events/EndElementEvent.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/EndElementEvent.java
rename to jaxp/src/com/sun/xml/internal/stream/events/EndElementEvent.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/EntityDeclarationImpl.java b/jaxp/src/com/sun/xml/internal/stream/events/EntityDeclarationImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/EntityDeclarationImpl.java
rename to jaxp/src/com/sun/xml/internal/stream/events/EntityDeclarationImpl.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/EntityReferenceEvent.java b/jaxp/src/com/sun/xml/internal/stream/events/EntityReferenceEvent.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/EntityReferenceEvent.java
rename to jaxp/src/com/sun/xml/internal/stream/events/EntityReferenceEvent.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/LocationImpl.java b/jaxp/src/com/sun/xml/internal/stream/events/LocationImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/LocationImpl.java
rename to jaxp/src/com/sun/xml/internal/stream/events/LocationImpl.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/NamedEvent.java b/jaxp/src/com/sun/xml/internal/stream/events/NamedEvent.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/NamedEvent.java
rename to jaxp/src/com/sun/xml/internal/stream/events/NamedEvent.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/NamespaceImpl.java b/jaxp/src/com/sun/xml/internal/stream/events/NamespaceImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/NamespaceImpl.java
rename to jaxp/src/com/sun/xml/internal/stream/events/NamespaceImpl.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/NotationDeclarationImpl.java b/jaxp/src/com/sun/xml/internal/stream/events/NotationDeclarationImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/NotationDeclarationImpl.java
rename to jaxp/src/com/sun/xml/internal/stream/events/NotationDeclarationImpl.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/ProcessingInstructionEvent.java b/jaxp/src/com/sun/xml/internal/stream/events/ProcessingInstructionEvent.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/ProcessingInstructionEvent.java
rename to jaxp/src/com/sun/xml/internal/stream/events/ProcessingInstructionEvent.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/StartDocumentEvent.java b/jaxp/src/com/sun/xml/internal/stream/events/StartDocumentEvent.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/StartDocumentEvent.java
rename to jaxp/src/com/sun/xml/internal/stream/events/StartDocumentEvent.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/StartElementEvent.java b/jaxp/src/com/sun/xml/internal/stream/events/StartElementEvent.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/StartElementEvent.java
rename to jaxp/src/com/sun/xml/internal/stream/events/StartElementEvent.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java b/jaxp/src/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java
rename to jaxp/src/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/events/XMLEventFactoryImpl.java b/jaxp/src/com/sun/xml/internal/stream/events/XMLEventFactoryImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/events/XMLEventFactoryImpl.java
rename to jaxp/src/com/sun/xml/internal/stream/events/XMLEventFactoryImpl.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/javax.xml.stream.XMLEventFactory b/jaxp/src/com/sun/xml/internal/stream/javax.xml.stream.XMLEventFactory
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/javax.xml.stream.XMLEventFactory
rename to jaxp/src/com/sun/xml/internal/stream/javax.xml.stream.XMLEventFactory
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/javax.xml.stream.XMLInputFactory b/jaxp/src/com/sun/xml/internal/stream/javax.xml.stream.XMLInputFactory
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/javax.xml.stream.XMLInputFactory
rename to jaxp/src/com/sun/xml/internal/stream/javax.xml.stream.XMLInputFactory
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/javax.xml.stream.XMLOutputFactory b/jaxp/src/com/sun/xml/internal/stream/javax.xml.stream.XMLOutputFactory
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/javax.xml.stream.XMLOutputFactory
rename to jaxp/src/com/sun/xml/internal/stream/javax.xml.stream.XMLOutputFactory
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/util/BufferAllocator.java b/jaxp/src/com/sun/xml/internal/stream/util/BufferAllocator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/util/BufferAllocator.java
rename to jaxp/src/com/sun/xml/internal/stream/util/BufferAllocator.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/util/ReadOnlyIterator.java b/jaxp/src/com/sun/xml/internal/stream/util/ReadOnlyIterator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/util/ReadOnlyIterator.java
rename to jaxp/src/com/sun/xml/internal/stream/util/ReadOnlyIterator.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java b/jaxp/src/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java
rename to jaxp/src/com/sun/xml/internal/stream/util/ThreadLocalBufferAllocator.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/writers/UTF8OutputStreamWriter.java b/jaxp/src/com/sun/xml/internal/stream/writers/UTF8OutputStreamWriter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/writers/UTF8OutputStreamWriter.java
rename to jaxp/src/com/sun/xml/internal/stream/writers/UTF8OutputStreamWriter.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/writers/WriterUtility.java b/jaxp/src/com/sun/xml/internal/stream/writers/WriterUtility.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/writers/WriterUtility.java
rename to jaxp/src/com/sun/xml/internal/stream/writers/WriterUtility.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/writers/XMLDOMWriterImpl.java b/jaxp/src/com/sun/xml/internal/stream/writers/XMLDOMWriterImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/writers/XMLDOMWriterImpl.java
rename to jaxp/src/com/sun/xml/internal/stream/writers/XMLDOMWriterImpl.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/writers/XMLEventWriterImpl.java b/jaxp/src/com/sun/xml/internal/stream/writers/XMLEventWriterImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/writers/XMLEventWriterImpl.java
rename to jaxp/src/com/sun/xml/internal/stream/writers/XMLEventWriterImpl.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/writers/XMLOutputSource.java b/jaxp/src/com/sun/xml/internal/stream/writers/XMLOutputSource.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/writers/XMLOutputSource.java
rename to jaxp/src/com/sun/xml/internal/stream/writers/XMLOutputSource.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java b/jaxp/src/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java
rename to jaxp/src/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java
index 1aaf5191610..30bee23582c 100644
--- a/jaxp/src/share/classes/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java
+++ b/jaxp/src/com/sun/xml/internal/stream/writers/XMLStreamWriterImpl.java
@@ -233,6 +233,7 @@ public final class XMLStreamWriterImpl extends AbstractMap implements XMLStreamW
fPrefixGen = new Random();
fAttributeCache = new ArrayList();
fInternalNamespaceContext = new NamespaceSupport();
+ fInternalNamespaceContext.reset();
fNamespaceContext = new NamespaceContextImpl();
fNamespaceContext.internalContext = fInternalNamespaceContext;
@@ -383,6 +384,8 @@ public final class XMLStreamWriterImpl extends AbstractMap implements XMLStreamW
fElementStack.clear();
fInternalNamespaceContext.reset();
fReuse = true;
+ fStartTagOpened = false;
+ fNamespaceContext.userContext = null;
}
/**
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/writers/XMLWriter.java b/jaxp/src/com/sun/xml/internal/stream/writers/XMLWriter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/writers/XMLWriter.java
rename to jaxp/src/com/sun/xml/internal/stream/writers/XMLWriter.java
diff --git a/jaxp/src/share/classes/javax/xml/XMLConstants.java b/jaxp/src/javax/xml/XMLConstants.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/XMLConstants.java
rename to jaxp/src/javax/xml/XMLConstants.java
diff --git a/jaxp/src/share/classes/javax/xml/datatype/DatatypeConfigurationException.java b/jaxp/src/javax/xml/datatype/DatatypeConfigurationException.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/datatype/DatatypeConfigurationException.java
rename to jaxp/src/javax/xml/datatype/DatatypeConfigurationException.java
diff --git a/jaxp/src/share/classes/javax/xml/datatype/DatatypeConstants.java b/jaxp/src/javax/xml/datatype/DatatypeConstants.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/datatype/DatatypeConstants.java
rename to jaxp/src/javax/xml/datatype/DatatypeConstants.java
diff --git a/jaxp/src/share/classes/javax/xml/datatype/DatatypeFactory.java b/jaxp/src/javax/xml/datatype/DatatypeFactory.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/datatype/DatatypeFactory.java
rename to jaxp/src/javax/xml/datatype/DatatypeFactory.java
diff --git a/jaxp/src/share/classes/javax/xml/datatype/Duration.java b/jaxp/src/javax/xml/datatype/Duration.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/datatype/Duration.java
rename to jaxp/src/javax/xml/datatype/Duration.java
diff --git a/jaxp/src/share/classes/javax/xml/datatype/FactoryFinder.java b/jaxp/src/javax/xml/datatype/FactoryFinder.java
similarity index 99%
rename from jaxp/src/share/classes/javax/xml/datatype/FactoryFinder.java
rename to jaxp/src/javax/xml/datatype/FactoryFinder.java
index 82bdabf1260..37811e6fad9 100644
--- a/jaxp/src/share/classes/javax/xml/datatype/FactoryFinder.java
+++ b/jaxp/src/javax/xml/datatype/FactoryFinder.java
@@ -59,7 +59,7 @@ class FactoryFinder {
* Flag indicating if properties from java.home/lib/jaxp.properties
* have been cached.
*/
- static boolean firstTime = true;
+ static volatile boolean firstTime = true;
/**
* Security support class use to check access control before
diff --git a/jaxp/src/share/classes/javax/xml/datatype/SecuritySupport.java b/jaxp/src/javax/xml/datatype/SecuritySupport.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/datatype/SecuritySupport.java
rename to jaxp/src/javax/xml/datatype/SecuritySupport.java
diff --git a/jaxp/src/share/classes/javax/xml/datatype/XMLGregorianCalendar.java b/jaxp/src/javax/xml/datatype/XMLGregorianCalendar.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/datatype/XMLGregorianCalendar.java
rename to jaxp/src/javax/xml/datatype/XMLGregorianCalendar.java
diff --git a/jaxp/src/share/classes/javax/xml/datatype/package.html b/jaxp/src/javax/xml/datatype/package.html
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/datatype/package.html
rename to jaxp/src/javax/xml/datatype/package.html
diff --git a/jaxp/src/share/classes/javax/xml/namespace/NamespaceContext.java b/jaxp/src/javax/xml/namespace/NamespaceContext.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/namespace/NamespaceContext.java
rename to jaxp/src/javax/xml/namespace/NamespaceContext.java
diff --git a/jaxp/src/share/classes/javax/xml/namespace/QName.java b/jaxp/src/javax/xml/namespace/QName.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/namespace/QName.java
rename to jaxp/src/javax/xml/namespace/QName.java
diff --git a/jaxp/src/share/classes/javax/xml/namespace/package.html b/jaxp/src/javax/xml/namespace/package.html
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/namespace/package.html
rename to jaxp/src/javax/xml/namespace/package.html
diff --git a/jaxp/src/share/classes/javax/xml/parsers/DocumentBuilder.java b/jaxp/src/javax/xml/parsers/DocumentBuilder.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/parsers/DocumentBuilder.java
rename to jaxp/src/javax/xml/parsers/DocumentBuilder.java
diff --git a/jaxp/src/share/classes/javax/xml/parsers/DocumentBuilderFactory.java b/jaxp/src/javax/xml/parsers/DocumentBuilderFactory.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/parsers/DocumentBuilderFactory.java
rename to jaxp/src/javax/xml/parsers/DocumentBuilderFactory.java
diff --git a/jaxp/src/share/classes/javax/xml/parsers/FactoryConfigurationError.java b/jaxp/src/javax/xml/parsers/FactoryConfigurationError.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/parsers/FactoryConfigurationError.java
rename to jaxp/src/javax/xml/parsers/FactoryConfigurationError.java
diff --git a/jaxp/src/share/classes/javax/xml/parsers/FactoryFinder.java b/jaxp/src/javax/xml/parsers/FactoryFinder.java
similarity index 83%
rename from jaxp/src/share/classes/javax/xml/parsers/FactoryFinder.java
rename to jaxp/src/javax/xml/parsers/FactoryFinder.java
index 8076ad86564..43a6e020ac7 100644
--- a/jaxp/src/share/classes/javax/xml/parsers/FactoryFinder.java
+++ b/jaxp/src/javax/xml/parsers/FactoryFinder.java
@@ -25,15 +25,12 @@
package javax.xml.parsers;
-import java.io.File;
-import java.io.FileInputStream;
-
-import java.util.Properties;
import java.io.BufferedReader;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.net.URL;
+import java.util.Properties;
/**
* Implements pluggable Datatypes. Implements pluggable Datatypes. First time requires initialization overhead. First time requires initialization overhead. Conditional debug printing. Look up a value in a property file.
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- * This class was moved from the
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- * This class was moved from the
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- * This class was moved from the
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- * This class was moved from the
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- * This class was moved from the
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- * This class was moved from the
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- * This class was moved from the
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- * This class was moved from the
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- *
- * @xerces.internal
- *
- */
-final class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME = "xerces.properties";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- /** cache the contents of the xerces.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXercesProperties = null;
-
- /***
- * Cache the time stamp of the xerces.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- *
- * @xerces.internal
- *
- */
-final class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME = "xerces.properties";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- /** cache the contents of the xerces.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXercesProperties = null;
-
- /***
- * Cache the time stamp of the xerces.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- * This class was moved from the
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- * This class was moved from the
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- * This class was moved from the
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- * This class was moved from the
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- * This class was moved from the
- * More specifically, this method makes the following checks, in order.
+ *
+ * More specifically, this method makes the following checks.
* If any fail, it returns false. If they all succeed, it returns true.
- *
- *
* For example, the codesource objects with the following locations
* and null certificates all imply
@@ -369,92 +371,96 @@ public class CodeSource implements java.io.Serializable {
*
* @param that CodeSource to compare against
*/
- private boolean matchLocation(CodeSource that)
- {
- if (location == null) {
- return true;
- }
+ private boolean matchLocation(CodeSource that) {
+ if (location == null)
+ return true;
- if ((that == null) || (that.location == null))
+ if ((that == null) || (that.location == null))
+ return false;
+
+ if (location.equals(that.location))
+ return true;
+
+ if (!location.getProtocol().equalsIgnoreCase(that.location.getProtocol()))
+ return false;
+
+ int thisPort = location.getPort();
+ if (thisPort != -1) {
+ int thatPort = that.location.getPort();
+ int port = thatPort != -1 ? thatPort
+ : that.location.getDefaultPort();
+ if (thisPort != port)
return false;
-
- if (location.equals(that.location))
- return true;
-
- if (!location.getProtocol().equals(that.location.getProtocol()))
- return false;
-
- String thisHost = location.getHost();
- String thatHost = that.location.getHost();
-
- if (thisHost != null) {
- if (("".equals(thisHost) || "localhost".equals(thisHost)) &&
- ("".equals(thatHost) || "localhost".equals(thatHost))) {
- // ok
- } else if (!thisHost.equals(thatHost)) {
- if (thatHost == null) {
- return false;
- }
- if (this.sp == null) {
- this.sp = new SocketPermission(thisHost, "resolve");
- }
- if (that.sp == null) {
- that.sp = new SocketPermission(thatHost, "resolve");
- }
- if (!this.sp.implies(that.sp)) {
- return false;
- }
- }
- }
-
- if (location.getPort() != -1) {
- if (location.getPort() != that.location.getPort())
- return false;
- }
-
- if (location.getFile().endsWith("/-")) {
- // Matches the directory and (recursively) all files
- // and subdirectories contained in that directory.
- // For example, "/a/b/-" implies anything that starts with
- // "/a/b/"
- String thisPath = location.getFile().substring(0,
- location.getFile().length()-1);
- if (!that.location.getFile().startsWith(thisPath))
- return false;
- } else if (location.getFile().endsWith("/*")) {
- // Matches the directory and all the files contained in that
- // directory.
- // For example, "/a/b/*" implies anything that starts with
- // "/a/b/" but has no further slashes
- int last = that.location.getFile().lastIndexOf('/');
- if (last == -1)
- return false;
- String thisPath = location.getFile().substring(0,
- location.getFile().length()-1);
- String thatPath = that.location.getFile().substring(0, last+1);
- if (!thatPath.equals(thisPath))
- return false;
- } else {
- // Exact matches only.
- // For example, "/a/b" and "/a/b/" both imply "/a/b/"
- if ((!that.location.getFile().equals(location.getFile()))
- && (!that.location.getFile().equals(location.getFile()+"/"))) {
- return false;
- }
- }
-
- if (location.getRef() == null)
- return true;
- else
- return location.getRef().equals(that.location.getRef());
}
+ if (location.getFile().endsWith("/-")) {
+ // Matches the directory and (recursively) all files
+ // and subdirectories contained in that directory.
+ // For example, "/a/b/-" implies anything that starts with
+ // "/a/b/"
+ String thisPath = location.getFile().substring(0,
+ location.getFile().length()-1);
+ if (!that.location.getFile().startsWith(thisPath))
+ return false;
+ } else if (location.getFile().endsWith("/*")) {
+ // Matches the directory and all the files contained in that
+ // directory.
+ // For example, "/a/b/*" implies anything that starts with
+ // "/a/b/" but has no further slashes
+ int last = that.location.getFile().lastIndexOf('/');
+ if (last == -1)
+ return false;
+ String thisPath = location.getFile().substring(0,
+ location.getFile().length()-1);
+ String thatPath = that.location.getFile().substring(0, last+1);
+ if (!thatPath.equals(thisPath))
+ return false;
+ } else {
+ // Exact matches only.
+ // For example, "/a/b" and "/a/b/" both imply "/a/b/"
+ if ((!that.location.getFile().equals(location.getFile()))
+ && (!that.location.getFile().equals(location.getFile()+"/"))) {
+ return false;
+ }
+ }
+
+ if (location.getRef() != null
+ && !location.getRef().equals(that.location.getRef())) {
+ return false;
+ }
+
+ String thisHost = location.getHost();
+ String thatHost = that.location.getHost();
+ if (thisHost != null) {
+ if (("".equals(thisHost) || "localhost".equals(thisHost)) &&
+ ("".equals(thatHost) || "localhost".equals(thatHost))) {
+ // ok
+ } else if (!thisHost.equals(thatHost)) {
+ if (thatHost == null) {
+ return false;
+ }
+ if (this.sp == null) {
+ this.sp = new SocketPermission(thisHost, "resolve");
+ }
+ if (that.sp == null) {
+ that.sp = new SocketPermission(thatHost, "resolve");
+ }
+ if (!this.sp.implies(that.sp)) {
+ return false;
+ }
+ }
+ }
+ // everything matches
+ return true;
+ }
+
/**
* Returns a string describing this CodeSource, telling its
* URL and certificates.
*
* @return information about this CodeSource.
*/
+ @Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("(");
diff --git a/jdk/src/share/classes/java/util/AbstractCollection.java b/jdk/src/share/classes/java/util/AbstractCollection.java
index 2ae70f7ec93..3824f390463 100644
--- a/jdk/src/share/classes/java/util/AbstractCollection.java
+++ b/jdk/src/share/classes/java/util/AbstractCollection.java
@@ -170,6 +170,7 @@ public abstract class AbstractCollection
*
@@ -418,12 +418,16 @@ public class Collections {
* @throws UnsupportedOperationException if the specified list or
* its list-iterator does not support the set operation.
*/
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public static void reverse(List> list) {
int size = list.size();
if (size < REVERSE_THRESHOLD || list instanceof RandomAccess) {
for (int i=0, mid=size>>1, j=size-1; ithis
along with provided parameters
* to java.util.GregorianCalendar
instance.DOMSource
s.
- * # First char # is a comment
- * Entity numericValue
- * quot 34
- * amp 38
- *
- *
- * @param entitiesResource Name of properties or resource file that should
- * be loaded, which describes that mapping of characters to entity
- * references.
*/
- private CharInfo(String entitiesResource, String method)
+ private CharInfo()
{
- this(entitiesResource, method, false);
+ this.array_of_bits = createEmptySetOfIntegers(65535);
+ this.firstWordNotUsed = 0;
+ this.shouldMapAttrChar_ASCII = new boolean[ASCII_MAX];
+ this.shouldMapTextChar_ASCII = new boolean[ASCII_MAX];
+ this.m_charKey = new CharKey();
+
+ // Not set here, but in a constructor that uses this one
+ // this.m_charToString = new Hashtable();
+
+ this.onlyQuotAmpLtGt = true;
+
+
+ return;
}
private CharInfo(String entitiesResource, String method, boolean internal)
{
+ // call the default constructor to create the fields
+ this();
+ m_charToString = new HashMap();
+
ResourceBundle entities = null;
boolean noExtraEntities = true;
@@ -189,12 +203,10 @@ final class CharInfo
String name = (String) keys.nextElement();
String value = entities.getString(name);
int code = Integer.parseInt(value);
- defineEntity(name, (char) code);
- if (extraEntity(code))
+ boolean extra = defineEntity(name, (char) code);
+ if (extra)
noExtraEntities = false;
}
- set(S_LINEFEED);
- set(S_CARRIAGERETURN);
} else {
InputStream is = null;
@@ -278,8 +290,8 @@ final class CharInfo
int code = Integer.parseInt(value);
- defineEntity(name, (char) code);
- if (extraEntity(code))
+ boolean extra = defineEntity(name, (char) code);
+ if (extra)
noExtraEntities = false;
}
}
@@ -288,8 +300,6 @@ final class CharInfo
}
is.close();
- set(S_LINEFEED);
- set(S_CARRIAGERETURN);
} catch (Exception e) {
throw new RuntimeException(
Utils.messages.createMessage(
@@ -307,31 +317,8 @@ final class CharInfo
}
}
- /* initialize the array isCleanTextASCII[] with a cache of values
- * for use by ToStream.character(char[], int , int)
- * and the array isSpecialTextASCII[] with the opposite values
- * (all in the name of performance!)
- */
- for (int ch = 0; ch
+ *
*/
- private void defineEntity(String name, char value)
+ private boolean defineEntity(String name, char value)
{
StringBuilder sb = new StringBuilder("&");
sb.append(name);
sb.append(';');
String entityString = sb.toString();
- defineChar2StringMapping(entityString, value);
+ boolean extra = defineChar2StringMapping(entityString, value);
+ return extra;
}
+ /**
+ * A utility object, just used to map characters to output Strings,
+ * needed because a HashMap needs to map an object as a key, not a
+ * Java primitive type, like a char, so this object gets around that
+ * and it is reusable.
+ */
+ private final CharKey m_charKey;
+
/**
* Map a character to a String. For example given
* the character '>' this method would return the fully decorated
@@ -399,21 +413,21 @@ final class CharInfo
/**
* Tell if the character argument that is from
- * an attribute value should have special treatment.
+ * an attribute value has a mapping to a String.
*
* @param value the value of a character that is in an attribute value
* @return true if the character should have any special treatment,
* such as when writing out attribute values,
- * or entity references.
+ * such as when writing out entity references.
* @xsl.usage internal
*/
- final boolean isSpecialAttrChar(int value)
+ final boolean shouldMapAttrChar(int value)
{
// for performance try the values in the boolean array first,
// this is faster access than the BitSet for common ASCII values
if (value < ASCII_MAX)
- return isSpecialAttrASCII[value];
+ return shouldMapAttrChar_ASCII[value];
// rather than java.util.BitSet, our private
// implementation is faster (and less general).
@@ -422,48 +436,27 @@ final class CharInfo
/**
* Tell if the character argument that is from a
- * text node should have special treatment.
+ * text node has a mapping to a String, for example
+ * to map '<' to "<".
*
* @param value the value of a character that is in a text node
- * @return true if the character should have any special treatment,
- * such as when writing out attribute values,
- * or entity references.
+ * @return true if the character has a mapping to a String,
+ * such as when writing out entity references.
* @xsl.usage internal
*/
- final boolean isSpecialTextChar(int value)
+ final boolean shouldMapTextChar(int value)
{
// for performance try the values in the boolean array first,
// this is faster access than the BitSet for common ASCII values
if (value < ASCII_MAX)
- return isSpecialTextASCII[value];
+ return shouldMapTextChar_ASCII[value];
// rather than java.util.BitSet, our private
// implementation is faster (and less general).
return get(value);
}
- /**
- * This method is used to determine if an ASCII character in
- * a text node (not an attribute value) is "clean".
- * @param value the character to check (0 to 127).
- * @return true if the character can go to the writer as-is
- * @xsl.usage internal
- */
- final boolean isTextASCIIClean(int value)
- {
- return isCleanTextASCII[value];
- }
-
-// In the future one might want to use the array directly and avoid
-// the method call, but I think the JIT alreay inlines this well enough
-// so don't do it (for now) - bjm
-// public final boolean[] getASCIIClean()
-// {
-// return isCleanTextASCII;
-// }
-
-
private static CharInfo getCharInfoBasedOnPrivilege(
final String entitiesFileName, final String method,
final boolean internal){
@@ -498,15 +491,17 @@ final class CharInfo
{
CharInfo charInfo = (CharInfo) m_getCharInfoCache.get(entitiesFileName);
if (charInfo != null) {
- return charInfo;
+ return mutableCopyOf(charInfo);
}
// try to load it internally - cache
try {
charInfo = getCharInfoBasedOnPrivilege(entitiesFileName,
method, true);
+ // Put the common copy of charInfo in the cache, but return
+ // a copy of it.
m_getCharInfoCache.put(entitiesFileName, charInfo);
- return charInfo;
+ return mutableCopyOf(charInfo);
} catch (Exception e) {}
// try to load it externally - do not cache
@@ -533,7 +528,41 @@ final class CharInfo
method, false);
}
- /** Table of user-specified char infos. */
+ /**
+ * Create a mutable copy of the cached one.
+ * @param charInfo The cached one.
+ * @return
+ */
+ private static CharInfo mutableCopyOf(CharInfo charInfo) {
+ CharInfo copy = new CharInfo();
+
+ int max = charInfo.array_of_bits.length;
+ System.arraycopy(charInfo.array_of_bits,0,copy.array_of_bits,0,max);
+
+ copy.firstWordNotUsed = charInfo.firstWordNotUsed;
+
+ max = charInfo.shouldMapAttrChar_ASCII.length;
+ System.arraycopy(charInfo.shouldMapAttrChar_ASCII,0,copy.shouldMapAttrChar_ASCII,0,max);
+
+ max = charInfo.shouldMapTextChar_ASCII.length;
+ System.arraycopy(charInfo.shouldMapTextChar_ASCII,0,copy.shouldMapTextChar_ASCII,0,max);
+
+ // utility field copy.m_charKey is already created in the default constructor
+
+ copy.m_charToString = (HashMap) charInfo.m_charToString.clone();
+
+ copy.onlyQuotAmpLtGt = charInfo.onlyQuotAmpLtGt;
+
+ return copy;
+ }
+
+ /**
+ * Table of user-specified char infos.
+ * The table maps entify file names (the name of the
+ * property file without the .properties extension)
+ * to CharInfo objects populated with entities defined in
+ * corresponding property file.
+ */
private static HashMap m_getCharInfoCache = new HashMap();
/**
@@ -575,7 +604,8 @@ final class CharInfo
* the creation of the set.
*/
private final void set(int i) {
- setASCIIdirty(i);
+ setASCIItextDirty(i);
+ setASCIIattrDirty(i);
int j = (i >> SHIFT_PER_WORD); // this word is used
int k = j + 1;
@@ -610,24 +640,43 @@ final class CharInfo
return in_the_set;
}
- // record if there are any entities other than
- // quot, amp, lt, gt (probably user defined)
/**
- * @return true if the entity
- * @param code The value of the character that has an entity defined
- * for it.
+ * This method returns true if there are some non-standard mappings to
+ * entities other than quot, amp, lt, gt, and its only purpose is for
+ * performance.
+ * @param charToMap The value of the character that is mapped to a String
+ * @param outputString The String to which the character is mapped, usually
+ * an entity reference such as "<".
+ * @return true if the mapping is not one of:
+ *
+ *
*/
- private boolean extraEntity(int entityValue)
+ private boolean extraEntity(String outputString, int charToMap)
{
boolean extra = false;
- if (entityValue < 128)
+ if (charToMap < ASCII_MAX)
{
- switch (entityValue)
+ switch (charToMap)
{
- case 34 : // quot
- case 38 : // amp
- case 60 : // lt
- case 62 : // gt
+ case '"' : // quot
+ if (!outputString.equals("""))
+ extra = true;
+ break;
+ case '&' : // amp
+ if (!outputString.equals("&"))
+ extra = true;
+ break;
+ case '<' : // lt
+ if (!outputString.equals("<"))
+ extra = true;
+ break;
+ case '>' : // gt
+ if (!outputString.equals(">"))
+ extra = true;
break;
default : // other entity in range 0 to 127
extra = true;
@@ -637,49 +686,61 @@ final class CharInfo
}
/**
- * If the character is a printable ASCII character then
- * mark it as not clean and needing replacement with
- * a String on output.
+ * If the character is in the ASCII range then
+ * mark it as needing replacement with
+ * a String on output if it occurs in a text node.
* @param ch
*/
- private void setASCIIdirty(int j)
+ private void setASCIItextDirty(int j)
{
if (0 <= j && j < ASCII_MAX)
{
- isCleanTextASCII[j] = false;
- isSpecialTextASCII[j] = true;
+ shouldMapTextChar_ASCII[j] = true;
}
}
/**
- * If the character is a printable ASCII character then
- * mark it as and not needing replacement with
- * a String on output.
+ * If the character is in the ASCII range then
+ * mark it as needing replacement with
+ * a String on output if it occurs in a attribute value.
* @param ch
*/
- private void setASCIIclean(int j)
+ private void setASCIIattrDirty(int j)
{
if (0 <= j && j < ASCII_MAX)
{
- isCleanTextASCII[j] = true;
- isSpecialTextASCII[j] = false;
+ shouldMapAttrChar_ASCII[j] = true;
}
}
- private void defineChar2StringMapping(String outputString, char inputChar)
+ /**
+ * Call this method to register a char to String mapping, for example
+ * to map '<' to "<".
+ * @param outputString The String to map to.
+ * @param inputChar The char to map from.
+ * @return true if the mapping is not one of:
+ *
+ *
+ */
+ boolean defineChar2StringMapping(String outputString, char inputChar)
{
CharKey character = new CharKey(inputChar);
m_charToString.put(character, outputString);
- set(inputChar);
+ set(inputChar); // mark the character has having a mapping to a String
+
+ boolean extraMapping = extraEntity(outputString, inputChar);
+ return extraMapping;
+
}
/**
* Simple class for fast lookup of char values, when used with
* hashtables. You can set the char, then use it as a key.
*
- * This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
- * It exists to cut the serializers dependancy on that package.
- *
* @xsl.usage internal
*/
private static class CharKey extends Object
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/DOMSerializer.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/DOMSerializer.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/DOMSerializer.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/DOMSerializer.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ElemContext.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ElemContext.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ElemContext.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/ElemContext.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ElemDesc.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ElemDesc.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ElemDesc.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/ElemDesc.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java
index 26879702512..d14c2ea00f7 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java
@@ -178,6 +178,13 @@ public class EmptySerializer implements SerializationHandler
{
aMethodIsCalled();
}
+ /**
+ * @see SerializationHandler#setIsStandalone(boolean)
+ */
+ public void setIsStandalone(boolean isStandalone)
+ {
+ aMethodIsCalled();
+ }
/**
* @see SerializationHandler#setOutputFormat(java.util.Properties)
*/
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/EncodingInfo.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/EncodingInfo.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/EncodingInfo.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/EncodingInfo.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/Encodings.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java
similarity index 98%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/Encodings.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java
index 59d1a8222f5..dcb6dc8e077 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/Encodings.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java
@@ -34,6 +34,7 @@ import java.util.HashMap;
import java.util.Properties;
import java.util.StringTokenizer;
+import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
/**
* Provides information about encodings. Depends on the Java runtime
@@ -41,7 +42,7 @@ import java.util.StringTokenizer;
* to override encoding names and provide the last printable character
* for each encoding.
*
- * @version $Revision: 1.9 $ $Date: 2009/12/01 22:17:31 $
+ * @version $Revision: 1.11 $ $Date: 2010-11-01 04:34:44 $
* @author Assaf Arkin
*/
@@ -324,9 +325,7 @@ public final class Encodings extends Object
}
if (is == null) {
- SecuritySupport ss = SecuritySupport.getInstance();
- is = ss.getResourceAsStream(ObjectFactory.findClassLoader(),
- ENCODINGS_FILE);
+ is = SecuritySupport.getResourceAsStream(ENCODINGS_FILE);
}
Properties props = new Properties();
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/Encodings.properties b/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/Encodings.properties
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ExtendedContentHandler.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ExtendedContentHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ExtendedContentHandler.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/ExtendedContentHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ExtendedLexicalHandler.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ExtendedLexicalHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ExtendedLexicalHandler.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/ExtendedLexicalHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/HTMLEntities.properties b/jaxp/src/com/sun/org/apache/xml/internal/serializer/HTMLEntities.properties
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/HTMLEntities.properties
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/HTMLEntities.properties
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/Method.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/Method.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/Method.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/Method.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/NamespaceMappings.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/NamespaceMappings.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/NamespaceMappings.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/NamespaceMappings.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java
similarity index 96%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java
index 72f79c6a777..3daff744064 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/OutputPropertiesFactory.java
@@ -175,6 +175,26 @@ public final class OutputPropertiesFactory
public static final int S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL_LEN =
S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL.length();
+ /**
+ * This non-standard, Oracle-impl only property key is used as if OutputKeys.STANDALONE is specified but
+ * without writing it out in the declaration; It can be used to reverse the change by Xalan patch 1495.
+ * Since Xalan patch 1495 can cause incompatible behavior, this property is add for application to neutralize
+ * the effect of Xalan patch 1495
+ */
+ /**
+ *
+ *
+ */
+ public static final String ORACLE_IS_STANDALONE = "http://www.oracle.com/xml/is-standalone";
+
//************************************************************
//* PRIVATE CONSTANTS
//************************************************************
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/OutputPropertyUtils.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/OutputPropertyUtils.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/OutputPropertyUtils.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/OutputPropertyUtils.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java
similarity index 93%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java
index a4d03791576..1e918553be7 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java
@@ -124,5 +124,11 @@ public interface SerializationHandler
*/
public void setDTDEntityExpansion(boolean expand);
+ /**
+ * Specify if the output will be treated as a standalone property
+ * @param isStandalone true if the http://www.oracle.com/xml/is-standalone is set to yes
+ * @see OutputPropertiesFactory ORACLE_IS_STANDALONE
+ */
+ public void setIsStandalone(boolean b);
}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/Serializer.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/Serializer.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/Serializer.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/Serializer.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerBase.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerBase.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java
index fd324fe8070..a47789037d9 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerBase.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java
@@ -142,6 +142,11 @@ public abstract class SerializerBase
*/
protected boolean m_standaloneWasSpecified = false;
+ /**
+ * Determine if the output is a standalone.
+ */
+ protected boolean m_isStandalone = false;
+
/**
* Flag to tell if indenting (pretty-printing) is on.
*/
@@ -739,6 +744,16 @@ public abstract class SerializerBase
m_doIndent = doIndent;
}
+ /**
+ * Sets the isStandalone property
+ * @param isStandalone true if the ORACLE_IS_STANDALONE is set to yes
+ * @see OutputPropertiesFactory ORACLE_IS_STANDALONE
+ */
+ public void setIsStandalone(boolean isStandalone)
+ {
+ m_isStandalone = isStandalone;
+ }
+
/**
* This method is used when a prefix/uri namespace mapping
* is indicated after the element was started with a
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerConstants.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerConstants.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerConstants.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerConstants.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java
similarity index 97%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java
index 4a8192b4497..358c4f25bb6 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java
@@ -29,6 +29,7 @@ import javax.xml.transform.OutputKeys;
import com.sun.org.apache.xml.internal.serializer.utils.MsgKey;
import com.sun.org.apache.xml.internal.serializer.utils.Utils;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
import org.xml.sax.ContentHandler;
/**
@@ -126,9 +127,7 @@ public final class SerializerFactory
- ClassLoader loader = ObjectFactory.findClassLoader();
-
- Class cls = ObjectFactory.findProviderClass(className, loader, true);
+ Class cls = ObjectFactory.findProviderClass(className, true);
// _serializers.put(method, cls);
@@ -156,7 +155,7 @@ public final class SerializerFactory
* SAX ContentHandler events to the users handler.
*/
className = SerializerConstants.DEFAULT_SAX_SERIALIZER;
- cls = ObjectFactory.findProviderClass(className, loader, true);
+ cls = ObjectFactory.findProviderClass(className, true);
SerializationHandler sh =
(SerializationHandler) cls.newInstance();
sh.setContentHandler( (ContentHandler) obj);
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerTrace.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerTrace.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerTrace.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerTrace.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerTraceWriter.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerTraceWriter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/SerializerTraceWriter.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerTraceWriter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ToHTMLSAXHandler.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToHTMLSAXHandler.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ToHTMLSAXHandler.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/ToHTMLSAXHandler.java
index fd4801e7750..596a6418e53 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ToHTMLSAXHandler.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToHTMLSAXHandler.java
@@ -56,7 +56,7 @@ public final class ToHTMLSAXHandler extends ToSAXHandler
/**
* Keeps track of whether output escaping is currently enabled
*/
- protected boolean m_escapeSetting = false;
+ protected boolean m_escapeSetting = true;
/**
* Returns null.
@@ -742,6 +742,6 @@ public final class ToHTMLSAXHandler extends ToSAXHandler
*/
private void resetToHTMLSAXHandler()
{
- this.m_escapeSetting = false;
+ this.m_escapeSetting = true;
}
}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java
index aa48eaed8b4..94fbce6d64e 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java
@@ -58,7 +58,7 @@ public final class ToHTMLStream extends ToStream
* Map that tells which XML characters should have special treatment, and it
* provides character to entity name lookup.
*/
- private static final CharInfo m_htmlcharInfo =
+ private final CharInfo m_htmlcharInfo =
// new CharInfo(CharInfo.HTML_ENTITIES_RESOURCE);
CharInfo.getCharInfo(CharInfo.HTML_ENTITIES_RESOURCE, Method.HTML);
@@ -1369,7 +1369,7 @@ public final class ToHTMLStream extends ToStream
// System.out.println("ch: "+(int)ch);
// System.out.println("m_maxCharacter: "+(int)m_maxCharacter);
// System.out.println("m_attrCharsMap[ch]: "+(int)m_attrCharsMap[ch]);
- if (escapingNotNeeded(ch) && (!m_charInfo.isSpecialAttrChar(ch)))
+ if (escapingNotNeeded(ch) && (!m_charInfo.shouldMapAttrChar(ch)))
{
cleanLength++;
}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ToSAXHandler.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToSAXHandler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ToSAXHandler.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/ToSAXHandler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ToStream.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java
similarity index 89%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ToStream.java
rename to jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java
index e09f6809555..cf07a695c83 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/serializer/ToStream.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java
@@ -919,7 +919,8 @@ abstract public class ToStream extends SerializerBase
{
// This is the old/fast code here, but is this
// correct for all encodings?
- if (ch >= 0x20 || (0x0A == ch || 0x0D == ch || 0x09 == ch))
+ if (ch >= CharInfo.S_SPACE || (CharInfo.S_LINEFEED == ch ||
+ CharInfo.S_CARRIAGERETURN == ch || CharInfo.S_HORIZONAL_TAB == ch))
ret= true;
else
ret = false;
@@ -1028,7 +1029,7 @@ abstract public class ToStream extends SerializerBase
*
* @throws java.io.IOException
*/
- protected int accumDefaultEntity(
+ int accumDefaultEntity(
java.io.Writer writer,
char ch,
int i,
@@ -1047,7 +1048,7 @@ abstract public class ToStream extends SerializerBase
{
// if this is text node character and a special one of those,
// or if this is a character from attribute value and a special one of those
- if ((fromTextNode && m_charInfo.isSpecialTextChar(ch)) || (!fromTextNode && m_charInfo.isSpecialAttrChar(ch)))
+ if ((fromTextNode && m_charInfo.shouldMapTextChar(ch)) || (!fromTextNode && m_charInfo.shouldMapAttrChar(ch)))
{
String outputStringForChar = m_charInfo.getOutputStringForChar(ch);
@@ -1398,7 +1399,6 @@ abstract public class ToStream extends SerializerBase
if (m_cdataTagOpen)
closeCDATA();
- // the check with _escaping is a bit of a hack for XLSTC
if (m_disableOutputEscapingStates.peekOrFalse() || (!m_escaping))
{
@@ -1421,82 +1421,173 @@ abstract public class ToStream extends SerializerBase
try
{
int i;
- char ch1;
int startClean;
// skip any leading whitspace
// don't go off the end and use a hand inlined version
// of isWhitespace(ch)
final int end = start + length;
- int lastDirty = start - 1; // last character that needed processing
- for (i = start;
- ((i < end)
- && ((ch1 = chars[i]) == 0x20
- || (ch1 == 0xA && m_lineSepUse)
- || ch1 == 0xD
- || ch1 == 0x09));
- i++)
- {
- /*
- * We are processing leading whitespace, but are doing the same
- * processing for dirty characters here as for non-whitespace.
- *
- */
- if (!m_charInfo.isTextASCIIClean(ch1))
- {
- lastDirty = processDirty(chars,end, i,ch1, lastDirty, true);
- i = lastDirty;
+ int lastDirtyCharProcessed = start - 1; // last non-clean character that was processed
+ // that was processed
+ final Writer writer = m_writer;
+ boolean isAllWhitespace = true;
+
+ // process any leading whitspace
+ i = start;
+ while (i < end && isAllWhitespace) {
+ char ch1 = chars[i];
+
+ if (m_charInfo.shouldMapTextChar(ch1)) {
+ // The character is supposed to be replaced by a String
+ // so write out the clean whitespace characters accumulated
+ // so far
+ // then the String.
+ writeOutCleanChars(chars, i, lastDirtyCharProcessed);
+ String outputStringForChar = m_charInfo
+ .getOutputStringForChar(ch1);
+ writer.write(outputStringForChar);
+ // We can't say that everything we are writing out is
+ // all whitespace, we just wrote out a String.
+ isAllWhitespace = false;
+ lastDirtyCharProcessed = i; // mark the last non-clean
+ // character processed
+ i++;
+ } else {
+ // The character is clean, but is it a whitespace ?
+ switch (ch1) {
+ // TODO: Any other whitespace to consider?
+ case CharInfo.S_SPACE:
+ // Just accumulate the clean whitespace
+ i++;
+ break;
+ case CharInfo.S_LINEFEED:
+ lastDirtyCharProcessed = processLineFeed(chars, i,
+ lastDirtyCharProcessed, writer);
+ i++;
+ break;
+ case CharInfo.S_CARRIAGERETURN:
+ writeOutCleanChars(chars, i, lastDirtyCharProcessed);
+ writer.write("
");
+ lastDirtyCharProcessed = i;
+ i++;
+ break;
+ case CharInfo.S_HORIZONAL_TAB:
+ // Just accumulate the clean whitespace
+ i++;
+ break;
+ default:
+ // The character was clean, but not a whitespace
+ // so break the loop to continue with this character
+ // (we don't increment index i !!)
+ isAllWhitespace = false;
+ break;
}
}
+ }
/* If there is some non-whitespace, mark that we may need
* to preserve this. This is only important if we have indentation on.
*/
- if (i < end)
+ if (i < end || !isAllWhitespace)
m_ispreserve = true;
-
-// int lengthClean; // number of clean characters in a row
-// final boolean[] isAsciiClean = m_charInfo.getASCIIClean();
-
- final boolean isXML10 = XMLVERSION10.equals(getVersion());
- // we've skipped the leading whitespace, now deal with the rest
for (; i < end; i++)
{
- {
- // A tight loop to skip over common clean chars
- // This tight loop makes it easier for the JIT
- // to optimize.
- char ch2;
- while (iyes
to indicate the output is intended to be used as standalone
+ * no
has no effect.
+ * true
if and only if the argument is not
- * null
and is a String
object that represents
+ * null
and is an XMLString
object that represents
* the same sequence of characters as this object.
*
* @param anObject the object to compare this String
@@ -139,6 +139,20 @@ public interface XMLString
*/
public abstract boolean equals(XMLString anObject);
+ /**
+ * Compares this string to the specified String
.
+ * The result is true
if and only if the argument is not
+ * null
and is a String
object that represents
+ * the same sequence of characters as this object.
+ *
+ * @param anotherString the object to compare this String
+ * against.
+ * @return true
if the String
s are equal;
+ * false
otherwise.
+ * @see java.lang.String#compareTo(java.lang.String)
+ * @see java.lang.String#equalsIgnoreCase(java.lang.String)
+ */
+ public abstract boolean equals(String anotherString);
/**
* Compares this string to the specified object.
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/XMLStringDefault.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLStringDefault.java
similarity index 97%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/XMLStringDefault.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/XMLStringDefault.java
index e681aeacea9..3953c863cc4 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/XMLStringDefault.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLStringDefault.java
@@ -152,6 +152,22 @@ public class XMLStringDefault implements XMLString
}
}
+ /**
+ * Compares this string to the specified String
.
+ * The result is true
if and only if the argument is not
+ * null
and is a String
object that represents
+ * the same sequence of characters as this object.
+ *
+ * @param obj2 the object to compare this String
against.
+ * @return true
if the String
s are equal;
+ * false
otherwise.
+ * @see java.lang.String#compareTo(java.lang.String)
+ * @see java.lang.String#equalsIgnoreCase(java.lang.String)
+ */
+ public boolean equals(String obj2) {
+ return m_str.equals(obj2);
+ }
+
/**
* Compares this string to the specified object.
* The result is true
if and only if the argument is not
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/XMLStringFactory.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLStringFactory.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/XMLStringFactory.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/XMLStringFactory.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/XMLStringFactoryDefault.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLStringFactoryDefault.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/XMLStringFactoryDefault.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/XMLStringFactoryDefault.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/package.html b/jaxp/src/com/sun/org/apache/xml/internal/utils/package.html
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/package.html
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/package.html
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/CharArrayWrapper.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/CharArrayWrapper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/CharArrayWrapper.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/CharArrayWrapper.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/IntArrayWrapper.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/IntArrayWrapper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/IntArrayWrapper.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/IntArrayWrapper.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/LongArrayWrapper.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/LongArrayWrapper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/LongArrayWrapper.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/LongArrayWrapper.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/StringArrayWrapper.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/StringArrayWrapper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/StringArrayWrapper.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/StringArrayWrapper.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResourceBundle.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResourceBundle.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResourceBundle.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResourceBundle.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResourceBundleBase.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResourceBundleBase.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResourceBundleBase.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResourceBundleBase.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_de.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_de.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_de.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_de.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_en.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_en.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_en.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_en.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_es.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_es.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_es.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_es.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_fr.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_fr.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_fr.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_fr.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_it.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_it.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_it.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_it.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_A.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_A.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_A.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_A.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HA.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HA.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HA.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HA.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HI.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HI.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HI.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_HI.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_I.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_I.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_I.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_ja_JP_I.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_ko.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_ko.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_ko.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_ko.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_sv.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_sv.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_sv.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_sv.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_zh_CN.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_zh_CN.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_zh_CN.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_zh_CN.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_zh_TW.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_zh_TW.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xml/internal/utils/res/XResources_zh_TW.java
rename to jaxp/src/com/sun/org/apache/xml/internal/utils/res/XResources_zh_TW.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/Arg.java b/jaxp/src/com/sun/org/apache/xpath/internal/Arg.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/Arg.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/Arg.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/CachedXPathAPI.java b/jaxp/src/com/sun/org/apache/xpath/internal/CachedXPathAPI.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/CachedXPathAPI.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/CachedXPathAPI.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/Expression.java b/jaxp/src/com/sun/org/apache/xpath/internal/Expression.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/Expression.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/Expression.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/ExpressionNode.java b/jaxp/src/com/sun/org/apache/xpath/internal/ExpressionNode.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/ExpressionNode.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/ExpressionNode.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/ExpressionOwner.java b/jaxp/src/com/sun/org/apache/xpath/internal/ExpressionOwner.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/ExpressionOwner.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/ExpressionOwner.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/ExtensionsProvider.java b/jaxp/src/com/sun/org/apache/xpath/internal/ExtensionsProvider.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/ExtensionsProvider.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/ExtensionsProvider.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/FoundIndex.java b/jaxp/src/com/sun/org/apache/xpath/internal/FoundIndex.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/FoundIndex.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/FoundIndex.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/NodeSet.java b/jaxp/src/com/sun/org/apache/xpath/internal/NodeSet.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/NodeSet.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/NodeSet.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/NodeSetDTM.java b/jaxp/src/com/sun/org/apache/xpath/internal/NodeSetDTM.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/NodeSetDTM.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/NodeSetDTM.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/SourceTree.java b/jaxp/src/com/sun/org/apache/xpath/internal/SourceTree.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/SourceTree.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/SourceTree.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/SourceTreeManager.java b/jaxp/src/com/sun/org/apache/xpath/internal/SourceTreeManager.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/SourceTreeManager.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/SourceTreeManager.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/VariableStack.java b/jaxp/src/com/sun/org/apache/xpath/internal/VariableStack.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/VariableStack.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/VariableStack.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/WhitespaceStrippingElementMatcher.java b/jaxp/src/com/sun/org/apache/xpath/internal/WhitespaceStrippingElementMatcher.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/WhitespaceStrippingElementMatcher.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/WhitespaceStrippingElementMatcher.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPath.java b/jaxp/src/com/sun/org/apache/xpath/internal/XPath.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPath.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/XPath.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPathAPI.java b/jaxp/src/com/sun/org/apache/xpath/internal/XPathAPI.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPathAPI.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/XPathAPI.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java b/jaxp/src/com/sun/org/apache/xpath/internal/XPathContext.java
similarity index 97%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/XPathContext.java
index eef7347d87f..dc1063e8f3d 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPathContext.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/XPathContext.java
@@ -96,6 +96,8 @@ public class XPathContext extends DTMManager // implements ExpressionContext
*/
private boolean m_isSecureProcessing = false;
+ private boolean m_useServicesMechanism = true;
+
/**
* Though XPathContext context extends
* the DTMManager, it really is a proxy for this object, which
@@ -308,13 +310,14 @@ public class XPathContext extends DTMManager // implements ExpressionContext
*/
public XPathContext()
{
- m_prefixResolvers.push(null);
- m_currentNodes.push(DTM.NULL);
- m_currentExpressionNodes.push(DTM.NULL);
- m_saxLocations.push(null);
+ this(true);
}
+ public XPathContext(boolean useServicesMechanism) {
+ init(useServicesMechanism);
+ }
/**
+ **This constructor doesn't seem to be used anywhere -- huizhe wang**
* Create an XPathContext instance.
* @param owner Value that can be retrieved via the getOwnerObject() method.
* @see #getOwnerObject
@@ -326,10 +329,18 @@ public class XPathContext extends DTMManager // implements ExpressionContext
m_ownerGetErrorListener = m_owner.getClass().getMethod("getErrorListener", new Class[] {});
}
catch (NoSuchMethodException nsme) {}
+ init(true);
+ }
+
+ private void init(boolean useServicesMechanism) {
m_prefixResolvers.push(null);
m_currentNodes.push(DTM.NULL);
m_currentExpressionNodes.push(DTM.NULL);
m_saxLocations.push(null);
+ m_useServicesMechanism = useServicesMechanism;
+ m_dtmManager = DTMManager.newInstance(
+ com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory(),
+ m_useServicesMechanism);
}
/**
@@ -352,7 +363,8 @@ public class XPathContext extends DTMManager // implements ExpressionContext
m_dtmManager = DTMManager.newInstance(
- com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory());
+ com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory(),
+ m_useServicesMechanism);
m_saxLocations.removeAllElements();
m_axesIteratorStack.removeAllElements();
@@ -1098,6 +1110,19 @@ public class XPathContext extends DTMManager // implements ExpressionContext
{
return XPathContext.this.getErrorListener();
}
+ /**
+ * Return the state of the services mechanism feature.
+ */
+ public boolean useServicesMechnism() {
+ return m_useServicesMechanism;
+ }
+
+ /**
+ * Set the state of the services mechanism feature.
+ */
+ public void setServicesMechnism(boolean flag) {
+ m_useServicesMechanism = flag;
+ }
/**
* Get the value of a node as a number.
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPathException.java b/jaxp/src/com/sun/org/apache/xpath/internal/XPathException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPathException.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/XPathException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPathFactory.java b/jaxp/src/com/sun/org/apache/xpath/internal/XPathFactory.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPathFactory.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/XPathFactory.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPathProcessorException.java b/jaxp/src/com/sun/org/apache/xpath/internal/XPathProcessorException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPathProcessorException.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/XPathProcessorException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPathVisitable.java b/jaxp/src/com/sun/org/apache/xpath/internal/XPathVisitable.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPathVisitable.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/XPathVisitable.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPathVisitor.java b/jaxp/src/com/sun/org/apache/xpath/internal/XPathVisitor.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/XPathVisitor.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/XPathVisitor.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/AttributeIterator.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/AttributeIterator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/AttributeIterator.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/AttributeIterator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/AxesWalker.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/AxesWalker.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/AxesWalker.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/AxesWalker.java
index 0369779b9f4..1834264de50 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/AxesWalker.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/axes/AxesWalker.java
@@ -427,7 +427,7 @@ public class AxesWalker extends PredicatedNodeTest
return -1;
}
- walker.setPredicateCount(walker.getPredicateCount() - 1);
+ walker.setPredicateCount(m_predicateIndex);
walker.setNextWalker(null);
walker.setPrevWalker(null);
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/BasicTestIterator.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/BasicTestIterator.java
similarity index 98%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/BasicTestIterator.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/BasicTestIterator.java
index 5740affe42f..cbea6db7e0b 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/BasicTestIterator.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/axes/BasicTestIterator.java
@@ -27,6 +27,7 @@ import com.sun.org.apache.xml.internal.dtm.DTMFilter;
import com.sun.org.apache.xml.internal.dtm.DTMIterator;
import com.sun.org.apache.xml.internal.utils.PrefixResolver;
import com.sun.org.apache.xpath.internal.compiler.Compiler;
+import com.sun.org.apache.xpath.internal.compiler.OpMap;
/**
* Base for iterators that handle predicates. Does the basic next
@@ -76,7 +77,7 @@ public abstract class BasicTestIterator extends LocPathIterator
{
super(compiler, opPos, analysis, false);
- int firstStepPos = compiler.getFirstChildPos(opPos);
+ int firstStepPos = OpMap.getFirstChildPos(opPos);
int whatToShow = compiler.getWhatToShow(firstStepPos);
if ((0 == (whatToShow
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/ChildIterator.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/ChildIterator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/ChildIterator.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/ChildIterator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/ChildTestIterator.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/ChildTestIterator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/ChildTestIterator.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/ChildTestIterator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/ContextNodeList.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/ContextNodeList.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/ContextNodeList.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/ContextNodeList.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/DescendantIterator.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/DescendantIterator.java
similarity index 98%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/DescendantIterator.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/DescendantIterator.java
index d8990af21ac..729f89d629f 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/DescendantIterator.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/axes/DescendantIterator.java
@@ -31,7 +31,9 @@ import com.sun.org.apache.xpath.internal.Expression;
import com.sun.org.apache.xpath.internal.XPathContext;
import com.sun.org.apache.xpath.internal.compiler.Compiler;
import com.sun.org.apache.xpath.internal.compiler.OpCodes;
+import com.sun.org.apache.xpath.internal.compiler.OpMap;
import com.sun.org.apache.xpath.internal.patterns.NodeTest;
+import org.w3c.dom.DOMException;
/**
* This class implements an optimized iterator for
@@ -57,7 +59,7 @@ public class DescendantIterator extends LocPathIterator
super(compiler, opPos, analysis, false);
- int firstStepPos = compiler.getFirstChildPos(opPos);
+ int firstStepPos = OpMap.getFirstChildPos(opPos);
int stepType = compiler.getOp(firstStepPos);
boolean orSelf = (OpCodes.FROM_DESCENDANTS_OR_SELF == stepType);
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/FilterExprIterator.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/FilterExprIterator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/FilterExprIterator.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/FilterExprIterator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/FilterExprIteratorSimple.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/FilterExprIteratorSimple.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/FilterExprIteratorSimple.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/FilterExprIteratorSimple.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/FilterExprWalker.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/FilterExprWalker.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/FilterExprWalker.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/FilterExprWalker.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/HasPositionalPredChecker.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/HasPositionalPredChecker.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/HasPositionalPredChecker.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/HasPositionalPredChecker.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/IteratorPool.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/IteratorPool.java
similarity index 81%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/IteratorPool.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/IteratorPool.java
index 4c8094dc7fc..ccaca31daef 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/IteratorPool.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/axes/IteratorPool.java
@@ -22,7 +22,7 @@
*/
package com.sun.org.apache.xpath.internal.axes;
-import java.util.Vector;
+import java.util.ArrayList;
import com.sun.org.apache.xml.internal.dtm.DTMIterator;
import com.sun.org.apache.xml.internal.utils.WrappedRuntimeException;
@@ -31,17 +31,19 @@ import com.sun.org.apache.xml.internal.utils.WrappedRuntimeException;
* Pool of object of a given type to pick from to help memory usage
* @xsl.usage internal
*/
-public class IteratorPool implements java.io.Serializable
+public final class IteratorPool implements java.io.Serializable
{
static final long serialVersionUID = -460927331149566998L;
- /** Type of objects in this pool.
- * @serial */
+ /**
+ * Type of objects in this pool.
+ */
private final DTMIterator m_orig;
- /** Vector of given objects this points to.
- * @serial */
- private final Vector m_freeStack;
+ /**
+ * Stack of given objects this points to.
+ */
+ private final ArrayList m_freeStack;
/**
* Constructor IteratorPool
@@ -51,7 +53,7 @@ public class IteratorPool implements java.io.Serializable
public IteratorPool(DTMIterator original)
{
m_orig = original;
- m_freeStack = new Vector();
+ m_freeStack = new ArrayList();
}
/**
@@ -72,10 +74,7 @@ public class IteratorPool implements java.io.Serializable
else
{
// Remove object from end of free pool.
- DTMIterator result = (DTMIterator)m_freeStack.lastElement();
-
- m_freeStack.setSize(m_freeStack.size() - 1);
-
+ DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
return result;
}
}
@@ -104,10 +103,7 @@ public class IteratorPool implements java.io.Serializable
else
{
// Remove object from end of free pool.
- DTMIterator result = (DTMIterator)m_freeStack.lastElement();
-
- m_freeStack.setSize(m_freeStack.size() - 1);
-
+ DTMIterator result = (DTMIterator)m_freeStack.remove(m_freeStack.size() - 1);
return result;
}
}
@@ -120,6 +116,6 @@ public class IteratorPool implements java.io.Serializable
*/
public synchronized void freeInstance(DTMIterator obj)
{
- m_freeStack.addElement(obj);
+ m_freeStack.add(obj);
}
}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/LocPathIterator.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/LocPathIterator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/LocPathIterator.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/LocPathIterator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/MatchPatternIterator.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/MatchPatternIterator.java
similarity index 98%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/MatchPatternIterator.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/MatchPatternIterator.java
index b7e36493afb..edba3a272a4 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/MatchPatternIterator.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/axes/MatchPatternIterator.java
@@ -28,6 +28,7 @@ import com.sun.org.apache.xml.internal.dtm.DTMAxisTraverser;
import com.sun.org.apache.xml.internal.dtm.DTMIterator;
import com.sun.org.apache.xpath.internal.XPathContext;
import com.sun.org.apache.xpath.internal.compiler.Compiler;
+import com.sun.org.apache.xpath.internal.compiler.OpMap;
import com.sun.org.apache.xpath.internal.objects.XObject;
import com.sun.org.apache.xpath.internal.patterns.NodeTest;
import com.sun.org.apache.xpath.internal.patterns.StepPattern;
@@ -78,7 +79,7 @@ public class MatchPatternIterator extends LocPathIterator
super(compiler, opPos, analysis, false);
- int firstStepPos = compiler.getFirstChildPos(opPos);
+ int firstStepPos = OpMap.getFirstChildPos(opPos);
m_pattern = WalkerFactory.loadSteps(this, compiler, firstStepPos, 0);
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/NodeSequence.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/NodeSequence.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/NodeSequence.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/NodeSequence.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/OneStepIterator.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/OneStepIterator.java
similarity index 98%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/OneStepIterator.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/OneStepIterator.java
index 9ec79e873e8..539068498dc 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/OneStepIterator.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/axes/OneStepIterator.java
@@ -29,6 +29,7 @@ import com.sun.org.apache.xml.internal.dtm.DTMIterator;
import com.sun.org.apache.xpath.internal.Expression;
import com.sun.org.apache.xpath.internal.XPathContext;
import com.sun.org.apache.xpath.internal.compiler.Compiler;
+import com.sun.org.apache.xpath.internal.compiler.OpMap;
/**
* This class implements a general iterator for
@@ -58,7 +59,7 @@ public class OneStepIterator extends ChildTestIterator
throws javax.xml.transform.TransformerException
{
super(compiler, opPos, analysis);
- int firstStepPos = compiler.getFirstChildPos(opPos);
+ int firstStepPos = OpMap.getFirstChildPos(opPos);
m_axis = WalkerFactory.getAxisFromStep(compiler, firstStepPos);
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/OneStepIteratorForward.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/OneStepIteratorForward.java
similarity index 97%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/OneStepIteratorForward.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/OneStepIteratorForward.java
index eb78eee6591..ea1a8291414 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/OneStepIteratorForward.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/axes/OneStepIteratorForward.java
@@ -26,6 +26,7 @@ import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.dtm.DTMFilter;
import com.sun.org.apache.xpath.internal.Expression;
import com.sun.org.apache.xpath.internal.compiler.Compiler;
+import com.sun.org.apache.xpath.internal.compiler.OpMap;
/**
* This class implements a general iterator for
@@ -54,7 +55,7 @@ public class OneStepIteratorForward extends ChildTestIterator
throws javax.xml.transform.TransformerException
{
super(compiler, opPos, analysis);
- int firstStepPos = compiler.getFirstChildPos(opPos);
+ int firstStepPos = OpMap.getFirstChildPos(opPos);
m_axis = WalkerFactory.getAxisFromStep(compiler, firstStepPos);
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/PathComponent.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/PathComponent.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/PathComponent.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/PathComponent.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/PredicatedNodeTest.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/PredicatedNodeTest.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/PredicatedNodeTest.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/PredicatedNodeTest.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/RTFIterator.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/RTFIterator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/RTFIterator.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/RTFIterator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/ReverseAxesWalker.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/ReverseAxesWalker.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/ReverseAxesWalker.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/ReverseAxesWalker.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/SelfIteratorNoPredicate.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/SelfIteratorNoPredicate.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/SelfIteratorNoPredicate.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/SelfIteratorNoPredicate.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/SubContextList.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/SubContextList.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/SubContextList.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/SubContextList.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/UnionChildIterator.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/UnionChildIterator.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/UnionChildIterator.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/UnionChildIterator.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java
index ee448b06bed..c83f4e5ed7b 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/axes/UnionPathIterator.java
@@ -30,6 +30,7 @@ import com.sun.org.apache.xpath.internal.ExpressionOwner;
import com.sun.org.apache.xpath.internal.XPathVisitor;
import com.sun.org.apache.xpath.internal.compiler.Compiler;
import com.sun.org.apache.xpath.internal.compiler.OpCodes;
+import com.sun.org.apache.xpath.internal.compiler.OpMap;
/**
* This class extends NodeSetDTM, which implements DTMIterator,
@@ -160,7 +161,7 @@ public class UnionPathIterator extends LocPathIterator
super();
- opPos = compiler.getFirstChildPos(opPos);
+ opPos = OpMap.getFirstChildPos(opPos);
loadLocationPaths(compiler, opPos, 0);
}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/WalkerFactory.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/WalkerFactory.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/WalkerFactory.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/WalkerFactory.java
index d4066908635..2f055354618 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/WalkerFactory.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/axes/WalkerFactory.java
@@ -30,6 +30,7 @@ import com.sun.org.apache.xpath.internal.Expression;
import com.sun.org.apache.xpath.internal.compiler.Compiler;
import com.sun.org.apache.xpath.internal.compiler.FunctionTable;
import com.sun.org.apache.xpath.internal.compiler.OpCodes;
+import com.sun.org.apache.xpath.internal.compiler.OpMap;
import com.sun.org.apache.xpath.internal.objects.XNumber;
import com.sun.org.apache.xpath.internal.patterns.ContextMatchStepPattern;
import com.sun.org.apache.xpath.internal.patterns.FunctionPattern;
@@ -162,7 +163,7 @@ public class WalkerFactory
throws javax.xml.transform.TransformerException
{
- int firstStepPos = compiler.getFirstChildPos(opPos);
+ int firstStepPos = OpMap.getFirstChildPos(opPos);
int analysis = analyze(compiler, firstStepPos, 0);
boolean isOneStep = isOneStep(analysis);
DTMIterator iter;
@@ -402,7 +403,7 @@ public class WalkerFactory
int opPos)
{
int endFunc = opPos + compiler.getOp(opPos + 1) - 1;
- opPos = compiler.getFirstChildPos(opPos);
+ opPos = OpMap.getFirstChildPos(opPos);
int funcID = compiler.getOp(opPos);
// System.out.println("funcID: "+funcID);
// System.out.println("opPos: "+opPos);
@@ -453,7 +454,7 @@ public class WalkerFactory
case OpCodes.OP_LT:
case OpCodes.OP_LTE:
case OpCodes.OP_EQUALS:
- int leftPos = compiler.getFirstChildPos(op);
+ int leftPos = OpMap.getFirstChildPos(op);
int rightPos = compiler.getNextOpPos(leftPos);
isProx = isProximateInnerExpr(compiler, leftPos);
if(isProx)
@@ -521,7 +522,7 @@ public class WalkerFactory
case OpCodes.OP_LT:
case OpCodes.OP_LTE:
case OpCodes.OP_EQUALS:
- int leftPos = compiler.getFirstChildPos(innerExprOpPos);
+ int leftPos = OpMap.getFirstChildPos(innerExprOpPos);
int rightPos = compiler.getNextOpPos(leftPos);
isProx = isProximateInnerExpr(compiler, leftPos);
if(isProx)
@@ -984,9 +985,7 @@ public class WalkerFactory
int stepType = compiler.getOp(opPos);
boolean simpleInit = false;
- int totalNumberWalkers = (analysis & BITS_COUNT);
boolean prevIsOneStepDown = true;
- int firstStepPos = compiler.getFirstChildPos(opPos);
int whatToShow = compiler.getWhatToShow(opPos);
StepPattern ai = null;
@@ -1286,7 +1285,7 @@ public class WalkerFactory
public static String getAnalysisString(int analysis)
{
StringBuffer buf = new StringBuffer();
- buf.append("count: "+getStepCount(analysis)+" ");
+ buf.append("count: ").append(getStepCount(analysis)).append(' ');
if((analysis & BIT_NODETEST_ANY) != 0)
{
buf.append("NTANY|");
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/WalkingIterator.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/WalkingIterator.java
similarity index 98%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/WalkingIterator.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/WalkingIterator.java
index c78fc96bc9b..08502fe68d2 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/WalkingIterator.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/axes/WalkingIterator.java
@@ -29,6 +29,7 @@ import com.sun.org.apache.xpath.internal.ExpressionOwner;
import com.sun.org.apache.xpath.internal.VariableStack;
import com.sun.org.apache.xpath.internal.XPathVisitor;
import com.sun.org.apache.xpath.internal.compiler.Compiler;
+import com.sun.org.apache.xpath.internal.compiler.OpMap;
/**
* Location path iterator that uses Walkers.
@@ -58,7 +59,7 @@ public class WalkingIterator extends LocPathIterator implements ExpressionOwner
{
super(compiler, opPos, analysis, shouldLoadWalkers);
- int firstStepPos = compiler.getFirstChildPos(opPos);
+ int firstStepPos = OpMap.getFirstChildPos(opPos);
if (shouldLoadWalkers)
{
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/WalkingIteratorSorted.java b/jaxp/src/com/sun/org/apache/xpath/internal/axes/WalkingIteratorSorted.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/WalkingIteratorSorted.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/WalkingIteratorSorted.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/package.html b/jaxp/src/com/sun/org/apache/xpath/internal/axes/package.html
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/axes/package.html
rename to jaxp/src/com/sun/org/apache/xpath/internal/axes/package.html
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/Compiler.java b/jaxp/src/com/sun/org/apache/xpath/internal/compiler/Compiler.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/Compiler.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/compiler/Compiler.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/FuncLoader.java b/jaxp/src/com/sun/org/apache/xpath/internal/compiler/FuncLoader.java
similarity index 93%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/FuncLoader.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/compiler/FuncLoader.java
index 9fa85a59670..683472a423a 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/FuncLoader.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/compiler/FuncLoader.java
@@ -25,6 +25,8 @@ package com.sun.org.apache.xpath.internal.compiler;
import javax.xml.transform.TransformerException;
import com.sun.org.apache.xpath.internal.functions.Function;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
+import com.sun.org.apache.xalan.internal.utils.ConfigurationError;
/**
* Lazy load of functions into the function table as needed, so we don't
@@ -96,11 +98,10 @@ public class FuncLoader
throw new TransformerException("Application can't install his own xpath function.");
}
- return (Function) ObjectFactory.newInstance(
- className, ObjectFactory.findClassLoader(), true);
+ return (Function) ObjectFactory.newInstance(className, true);
}
- catch (ObjectFactory.ConfigurationError e)
+ catch (ConfigurationError e)
{
throw new TransformerException(e.getException());
}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/FunctionTable.java b/jaxp/src/com/sun/org/apache/xpath/internal/compiler/FunctionTable.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/FunctionTable.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/compiler/FunctionTable.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/Keywords.java b/jaxp/src/com/sun/org/apache/xpath/internal/compiler/Keywords.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/Keywords.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/compiler/Keywords.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/Lexer.java b/jaxp/src/com/sun/org/apache/xpath/internal/compiler/Lexer.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/Lexer.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/compiler/Lexer.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/OpCodes.java b/jaxp/src/com/sun/org/apache/xpath/internal/compiler/OpCodes.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/OpCodes.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/compiler/OpCodes.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/OpMap.java b/jaxp/src/com/sun/org/apache/xpath/internal/compiler/OpMap.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/OpMap.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/compiler/OpMap.java
index 88b4c8bbf3f..f0cfa94c20c 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/OpMap.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/compiler/OpMap.java
@@ -242,7 +242,7 @@ public class OpMap
else
{
throw new RuntimeException(
- XSLMessages.createXPATHMessage(XPATHErrorResources.ER_UNKNOWN_STEP, new Object[]{new Integer(stepType).toString()}));
+ XSLMessages.createXPATHMessage(XPATHErrorResources.ER_UNKNOWN_STEP, new Object[]{String.valueOf(stepType)}));
//"Programmer's assertion in getNextStepPos: unknown stepType: " + stepType);
}
}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/OpMapVector.java b/jaxp/src/com/sun/org/apache/xpath/internal/compiler/OpMapVector.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/OpMapVector.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/compiler/OpMapVector.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/PsuedoNames.java b/jaxp/src/com/sun/org/apache/xpath/internal/compiler/PsuedoNames.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/PsuedoNames.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/compiler/PsuedoNames.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/XPathDumper.java b/jaxp/src/com/sun/org/apache/xpath/internal/compiler/XPathDumper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/XPathDumper.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/compiler/XPathDumper.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/XPathParser.java b/jaxp/src/com/sun/org/apache/xpath/internal/compiler/XPathParser.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/XPathParser.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/compiler/XPathParser.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/package.html b/jaxp/src/com/sun/org/apache/xpath/internal/compiler/package.html
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/compiler/package.html
rename to jaxp/src/com/sun/org/apache/xpath/internal/compiler/package.html
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/domapi/XPathEvaluatorImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/domapi/XPathEvaluatorImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/domapi/XPathEvaluatorImpl.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/domapi/XPathEvaluatorImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/domapi/XPathExpressionImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/domapi/XPathExpressionImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/domapi/XPathExpressionImpl.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/domapi/XPathExpressionImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/domapi/XPathNSResolverImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/domapi/XPathNSResolverImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/domapi/XPathNSResolverImpl.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/domapi/XPathNSResolverImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/domapi/XPathNamespaceImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/domapi/XPathNamespaceImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/domapi/XPathNamespaceImpl.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/domapi/XPathNamespaceImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/domapi/XPathResultImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/domapi/XPathResultImpl.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/domapi/XPathResultImpl.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/domapi/XPathResultImpl.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/domapi/XPathStylesheetDOM3Exception.java b/jaxp/src/com/sun/org/apache/xpath/internal/domapi/XPathStylesheetDOM3Exception.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/domapi/XPathStylesheetDOM3Exception.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/domapi/XPathStylesheetDOM3Exception.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/domapi/package.html b/jaxp/src/com/sun/org/apache/xpath/internal/domapi/package.html
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/domapi/package.html
rename to jaxp/src/com/sun/org/apache/xpath/internal/domapi/package.html
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncBoolean.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncBoolean.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncBoolean.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncBoolean.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncCeiling.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncCeiling.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncCeiling.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncCeiling.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncConcat.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncConcat.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncConcat.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncConcat.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncContains.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncContains.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncContains.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncContains.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncCount.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncCount.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncCount.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncCount.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncCurrent.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncCurrent.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncCurrent.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncCurrent.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncDoclocation.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncDoclocation.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncDoclocation.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncDoclocation.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncExtElementAvailable.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncExtElementAvailable.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncExtElementAvailable.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncExtElementAvailable.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncExtFunction.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncExtFunction.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncExtFunction.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncExtFunction.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncExtFunctionAvailable.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncExtFunctionAvailable.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncExtFunctionAvailable.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncExtFunctionAvailable.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncFalse.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncFalse.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncFalse.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncFalse.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncFloor.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncFloor.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncFloor.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncFloor.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncGenerateId.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncGenerateId.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncGenerateId.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncGenerateId.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncId.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncId.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncId.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncId.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncLang.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncLang.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncLang.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncLang.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncLast.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncLast.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncLast.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncLast.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncLocalPart.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncLocalPart.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncLocalPart.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncLocalPart.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncNamespace.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncNamespace.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncNamespace.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncNamespace.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncNormalizeSpace.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncNormalizeSpace.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncNormalizeSpace.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncNormalizeSpace.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncNot.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncNot.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncNot.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncNot.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncNumber.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncNumber.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncNumber.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncNumber.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncPosition.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncPosition.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncPosition.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncPosition.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncQname.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncQname.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncQname.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncQname.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncRound.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncRound.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncRound.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncRound.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncStartsWith.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncStartsWith.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncStartsWith.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncStartsWith.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncString.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncString.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncString.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncString.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncStringLength.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncStringLength.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncStringLength.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncStringLength.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncSubstring.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSubstring.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncSubstring.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSubstring.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncSubstringAfter.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSubstringAfter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncSubstringAfter.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSubstringAfter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncSubstringBefore.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSubstringBefore.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncSubstringBefore.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSubstringBefore.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncSum.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSum.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncSum.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSum.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java
similarity index 96%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java
index cd0ce3bd1a1..316e2a1b3af 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncSystemProperty.java
@@ -31,6 +31,8 @@ import com.sun.org.apache.xpath.internal.objects.XNumber;
import com.sun.org.apache.xpath.internal.objects.XObject;
import com.sun.org.apache.xpath.internal.objects.XString;
import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
+import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
/**
* Execute the SystemProperty() function.
@@ -168,9 +170,8 @@ public class FuncSystemProperty extends FunctionOneArg
try
{
// Use SecuritySupport class to provide priveleged access to property file
- SecuritySupport ss = SecuritySupport.getInstance();
- InputStream is = ss.getResourceAsStream(ObjectFactory.findClassLoader(),
+ InputStream is = SecuritySupport.getResourceAsStream(ObjectFactory.findClassLoader(),
file);
// get a buffered version
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncTranslate.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncTranslate.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncTranslate.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncTranslate.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncTrue.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncTrue.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncTrue.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncTrue.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncUnparsedEntityURI.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncUnparsedEntityURI.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FuncUnparsedEntityURI.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FuncUnparsedEntityURI.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/Function.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/Function.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/Function.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/Function.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/Function2Args.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/Function2Args.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/Function2Args.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/Function2Args.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/Function3Args.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/Function3Args.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/Function3Args.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/Function3Args.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FunctionDef1Arg.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FunctionDef1Arg.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FunctionDef1Arg.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FunctionDef1Arg.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FunctionMultiArgs.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FunctionMultiArgs.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FunctionMultiArgs.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FunctionMultiArgs.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FunctionOneArg.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/FunctionOneArg.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/FunctionOneArg.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/FunctionOneArg.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/WrongNumberArgsException.java b/jaxp/src/com/sun/org/apache/xpath/internal/functions/WrongNumberArgsException.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/WrongNumberArgsException.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/WrongNumberArgsException.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/package.html b/jaxp/src/com/sun/org/apache/xpath/internal/functions/package.html
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/functions/package.html
rename to jaxp/src/com/sun/org/apache/xpath/internal/functions/package.html
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/jaxp/JAXPPrefixResolver.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPPrefixResolver.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/jaxp/JAXPPrefixResolver.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPPrefixResolver.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/jaxp/JAXPVariableStack.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPVariableStack.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/jaxp/JAXPVariableStack.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/jaxp/JAXPVariableStack.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java
similarity index 97%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java
index 2168f5057c9..2d7671ee8c7 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java
@@ -29,6 +29,7 @@ import com.sun.org.apache.xml.internal.dtm.DTM;
import com.sun.org.apache.xml.internal.utils.PrefixResolver;
import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
import com.sun.org.apache.xalan.internal.res.XSLMessages;
+import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
@@ -50,6 +51,7 @@ import org.xml.sax.InputSource;
/**
* The XPathExpression interface encapsulates a (compiled) XPath expression.
*
+ * @version $Revision: 1.10 $
* @author Ramesh Mandava
*/
public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{
@@ -64,6 +66,7 @@ public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{
// extensions function need to throw XPathFunctionException
private boolean featureSecureProcessing = false;
+ private boolean useServicesMechanism = true;
/** Protected constructor to prevent direct instantiation; use compile()
* from the context.
*/
@@ -84,12 +87,13 @@ public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{
JAXPPrefixResolver prefixResolver,
XPathFunctionResolver functionResolver,
XPathVariableResolver variableResolver,
- boolean featureSecureProcessing ) {
+ boolean featureSecureProcessing, boolean useServicesMechanism ) {
this.xpath = xpath;
this.prefixResolver = prefixResolver;
this.functionResolver = functionResolver;
this.variableResolver = variableResolver;
this.featureSecureProcessing = featureSecureProcessing;
+ this.useServicesMechanism = useServicesMechanism;
};
public void setXPath (com.sun.org.apache.xpath.internal.XPath xpath ) {
@@ -286,7 +290,7 @@ public class XPathExpressionImpl implements javax.xml.xpath.XPathExpression{
}
try {
if ( dbf == null ) {
- dbf = DocumentBuilderFactory.newInstance();
+ dbf = FactoryImpl.getDOMFactory(useServicesMechanism);
dbf.setNamespaceAware( true );
dbf.setValidating( false );
}
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java
similarity index 91%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java
index dfe9a5ed448..7159896c27d 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java
@@ -21,6 +21,7 @@
package com.sun.org.apache.xpath.internal.jaxp;
+import com.sun.org.apache.xalan.internal.XalanConstants;
import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
import com.sun.org.apache.xalan.internal.res.XSLMessages;
@@ -33,7 +34,7 @@ import javax.xml.xpath.XPathVariableResolver;
/**
* The XPathFactory builds XPaths.
*
- * @version $Revision: 1.9 $
+ * @version $Revision: 1.11 $
* @author Ramesh Mandava
*/
public class XPathFactoryImpl extends XPathFactory {
@@ -64,13 +65,24 @@ public class XPathFactoryImpl extends XPathFactory {
/**
* javax.xml.xpath.XPathFactory implementation.
*/
+
+ private boolean _useServicesMechanism = true;
+
public XPathFactoryImpl() {
+ this(true);
+ }
+
+ public static XPathFactory newXPathFactoryNoServiceLoader() {
+ return new XPathFactoryImpl(false);
+ }
+
+ public XPathFactoryImpl(boolean useServicesMechanism) {
if (System.getSecurityManager() != null) {
_isSecureMode = true;
_isNotSecureProcessing = false;
}
+ this._useServicesMechanism = useServicesMechanism;
}
-
/**
* XPathFactory
?String
.
+ * The result is true
if and only if the argument is not
+ * null
and is a String
object that represents
+ * the same sequence of characters as this object.
+ *
+ * @param obj2 the object to compare this String
against.
+ * @return true
if the String
s are equal;
+ * false
otherwise.
+ * @see java.lang.String#compareTo(java.lang.String)
+ * @see java.lang.String#equalsIgnoreCase(java.lang.String)
+ */
+ public boolean equals(String obj2) {
+ return str().equals(obj2);
+ }
+
/**
* Compares this string to the specified object.
* The result is true
if and only if the argument is not
@@ -336,11 +352,14 @@ public class XString extends XObject implements XMLString
*/
public boolean equals(XMLString obj2)
{
-
- if (!obj2.hasString())
- return obj2.equals(this);
- else
- return str().equals(obj2.toString());
+ if (obj2 != null) {
+ if (!obj2.hasString()) {
+ return obj2.equals(str());
+ } else {
+ return str().equals(obj2.toString());
+ }
+ }
+ return false;
}
/**
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/objects/XStringForChars.java b/jaxp/src/com/sun/org/apache/xpath/internal/objects/XStringForChars.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/objects/XStringForChars.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/objects/XStringForChars.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/objects/XStringForFSB.java b/jaxp/src/com/sun/org/apache/xpath/internal/objects/XStringForFSB.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/objects/XStringForFSB.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/objects/XStringForFSB.java
index 34535d798c2..d631064576a 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/objects/XStringForFSB.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/objects/XStringForFSB.java
@@ -979,7 +979,7 @@ public class XStringForFSB extends XString
return Double.NaN;
try {
- return new Double(valueString).doubleValue();
+ return Double.parseDouble(valueString);
} catch (NumberFormatException nfe) {
// This should catch double periods, empty strings.
return Double.NaN;
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/objects/package.html b/jaxp/src/com/sun/org/apache/xpath/internal/objects/package.html
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/objects/package.html
rename to jaxp/src/com/sun/org/apache/xpath/internal/objects/package.html
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/And.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/And.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/And.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/And.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Bool.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Bool.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Bool.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Bool.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Div.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Div.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Div.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Div.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Equals.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Equals.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Equals.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Equals.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Gt.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Gt.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Gt.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Gt.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Gte.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Gte.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Gte.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Gte.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Lt.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Lt.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Lt.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Lt.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Lte.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Lte.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Lte.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Lte.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Minus.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Minus.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Minus.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Minus.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Mod.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Mod.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Mod.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Mod.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Mult.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Mult.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Mult.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Mult.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Neg.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Neg.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Neg.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Neg.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/NotEquals.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/NotEquals.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/NotEquals.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/NotEquals.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Number.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Number.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Number.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Number.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Operation.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Operation.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Operation.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Operation.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Or.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Or.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Or.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Or.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Plus.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Plus.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Plus.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Plus.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Quo.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Quo.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Quo.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Quo.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/String.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/String.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/String.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/String.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/UnaryOperation.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/UnaryOperation.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/UnaryOperation.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/UnaryOperation.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Variable.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/Variable.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/Variable.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/Variable.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/VariableSafeAbsRef.java b/jaxp/src/com/sun/org/apache/xpath/internal/operations/VariableSafeAbsRef.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/VariableSafeAbsRef.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/VariableSafeAbsRef.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/package.html b/jaxp/src/com/sun/org/apache/xpath/internal/operations/package.html
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/operations/package.html
rename to jaxp/src/com/sun/org/apache/xpath/internal/operations/package.html
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/package.html b/jaxp/src/com/sun/org/apache/xpath/internal/package.html
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/package.html
rename to jaxp/src/com/sun/org/apache/xpath/internal/package.html
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/patterns/ContextMatchStepPattern.java b/jaxp/src/com/sun/org/apache/xpath/internal/patterns/ContextMatchStepPattern.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/patterns/ContextMatchStepPattern.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/patterns/ContextMatchStepPattern.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/patterns/FunctionPattern.java b/jaxp/src/com/sun/org/apache/xpath/internal/patterns/FunctionPattern.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/patterns/FunctionPattern.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/patterns/FunctionPattern.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/patterns/NodeTest.java b/jaxp/src/com/sun/org/apache/xpath/internal/patterns/NodeTest.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/patterns/NodeTest.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/patterns/NodeTest.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/patterns/NodeTestFilter.java b/jaxp/src/com/sun/org/apache/xpath/internal/patterns/NodeTestFilter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/patterns/NodeTestFilter.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/patterns/NodeTestFilter.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/patterns/StepPattern.java b/jaxp/src/com/sun/org/apache/xpath/internal/patterns/StepPattern.java
similarity index 99%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/patterns/StepPattern.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/patterns/StepPattern.java
index 1290859b8e5..ce4b3af293a 100644
--- a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/patterns/StepPattern.java
+++ b/jaxp/src/com/sun/org/apache/xpath/internal/patterns/StepPattern.java
@@ -857,7 +857,7 @@ public class StepPattern extends NodeTest implements SubContextList, ExpressionO
}
else
{
- buf.append("?" + Integer.toHexString(pat.m_whatToShow));
+ buf.append('?').append(Integer.toHexString(pat.m_whatToShow));
}
if (null != pat.m_predicates)
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/patterns/UnionPattern.java b/jaxp/src/com/sun/org/apache/xpath/internal/patterns/UnionPattern.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/patterns/UnionPattern.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/patterns/UnionPattern.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/patterns/package.html b/jaxp/src/com/sun/org/apache/xpath/internal/patterns/package.html
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/patterns/package.html
rename to jaxp/src/com/sun/org/apache/xpath/internal/patterns/package.html
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_de.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_de.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_de.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_de.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_en.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_en.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_en.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_en.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_es.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_fr.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_fr.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_fr.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_fr.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_it.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_it.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_it.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_it.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ja.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ko.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ko.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ko.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_ko.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_pt_BR.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_sv.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_CN.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_TW.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_TW.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_TW.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHErrorResources_zh_TW.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHMessages.java b/jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHMessages.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/XPATHMessages.java
rename to jaxp/src/com/sun/org/apache/xpath/internal/res/XPATHMessages.java
diff --git a/jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/package.html b/jaxp/src/com/sun/org/apache/xpath/internal/res/package.html
similarity index 100%
rename from jaxp/src/share/classes/com/sun/org/apache/xpath/internal/res/package.html
rename to jaxp/src/com/sun/org/apache/xpath/internal/res/package.html
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/Entity.java b/jaxp/src/com/sun/xml/internal/stream/Entity.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/Entity.java
rename to jaxp/src/com/sun/xml/internal/stream/Entity.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/EventFilterSupport.java b/jaxp/src/com/sun/xml/internal/stream/EventFilterSupport.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/EventFilterSupport.java
rename to jaxp/src/com/sun/xml/internal/stream/EventFilterSupport.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/StaxEntityResolverWrapper.java b/jaxp/src/com/sun/xml/internal/stream/StaxEntityResolverWrapper.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/StaxEntityResolverWrapper.java
rename to jaxp/src/com/sun/xml/internal/stream/StaxEntityResolverWrapper.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/StaxErrorReporter.java b/jaxp/src/com/sun/xml/internal/stream/StaxErrorReporter.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/StaxErrorReporter.java
rename to jaxp/src/com/sun/xml/internal/stream/StaxErrorReporter.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/StaxXMLInputSource.java b/jaxp/src/com/sun/xml/internal/stream/StaxXMLInputSource.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/StaxXMLInputSource.java
rename to jaxp/src/com/sun/xml/internal/stream/StaxXMLInputSource.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/XMLBufferListener.java b/jaxp/src/com/sun/xml/internal/stream/XMLBufferListener.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/XMLBufferListener.java
rename to jaxp/src/com/sun/xml/internal/stream/XMLBufferListener.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/XMLEntityReader.java b/jaxp/src/com/sun/xml/internal/stream/XMLEntityReader.java
similarity index 100%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/XMLEntityReader.java
rename to jaxp/src/com/sun/xml/internal/stream/XMLEntityReader.java
diff --git a/jaxp/src/share/classes/com/sun/xml/internal/stream/XMLEntityStorage.java b/jaxp/src/com/sun/xml/internal/stream/XMLEntityStorage.java
similarity index 97%
rename from jaxp/src/share/classes/com/sun/xml/internal/stream/XMLEntityStorage.java
rename to jaxp/src/com/sun/xml/internal/stream/XMLEntityStorage.java
index fd85c30fdd2..8343d9bba85 100644
--- a/jaxp/src/share/classes/com/sun/xml/internal/stream/XMLEntityStorage.java
+++ b/jaxp/src/com/sun/xml/internal/stream/XMLEntityStorage.java
@@ -36,6 +36,7 @@ import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
import com.sun.org.apache.xerces.internal.impl.PropertyManager;
import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
import com.sun.org.apache.xerces.internal.impl.Constants;
+import java.util.Enumeration;
/**
*
@@ -129,19 +130,27 @@ public class XMLEntityStorage {
} // reset(XMLComponentManager)
/**
- * Returns the hashtable of declared entities.
- * null
, first try using the
* context class loader followed by the current (i.e. bootstrap) class
* loader.
+ *
+ * Use bootstrap classLoader if cl = null and useBSClsLoader is true
*/
static private Class getProviderClass(String className, ClassLoader cl,
- boolean doFallback) throws ClassNotFoundException
+ boolean doFallback, boolean useBSClsLoader) throws ClassNotFoundException
{
try {
if (cl == null) {
- cl = ss.getContextClassLoader();
- if (cl == null) {
- throw new ClassNotFoundException();
- }
- else {
- return cl.loadClass(className);
+ if (useBSClsLoader) {
+ return Class.forName(className, true, FactoryFinder.class.getClassLoader());
+ } else {
+ cl = ss.getContextClassLoader();
+ if (cl == null) {
+ throw new ClassNotFoundException();
+ }
+ else {
+ return cl.loadClass(className);
+ }
}
}
else {
@@ -131,17 +135,39 @@ class FactoryFinder {
* @param className Name of the concrete class corresponding to the
* service provider
*
- * @param cl ClassLoader to use to load the class, null means to use
- * the bootstrap ClassLoader
+ * @param cl ClassLoader
used to load the factory class. If null
+ * current Thread
's context classLoader is used to load the factory class.
*
* @param doFallback True if the current ClassLoader should be tried as
* a fallback if the class is not found using cl
*/
static Object newInstance(String className, ClassLoader cl, boolean doFallback)
throws ConfigurationError
+ {
+ return newInstance(className, cl, doFallback, false);
+ }
+
+ /**
+ * Create an instance of a class. Delegates to method
+ * getProviderClass()
in order to load the class.
+ *
+ * @param className Name of the concrete class corresponding to the
+ * service provider
+ *
+ * @param cl ClassLoader
used to load the factory class. If null
+ * current Thread
's context classLoader is used to load the factory class.
+ *
+ * @param doFallback True if the current ClassLoader should be tried as
+ * a fallback if the class is not found using cl
+ *
+ * @param useBSClsLoader True if cl=null actually meant bootstrap classLoader. This parameter
+ * is needed since DocumentBuilderFactory/SAXParserFactory defined null as context classLoader.
+ */
+ static Object newInstance(String className, ClassLoader cl, boolean doFallback, boolean useBSClsLoader)
+ throws ConfigurationError
{
try {
- Class providerClass = getProviderClass(className, cl, doFallback);
+ Class providerClass = getProviderClass(className, cl, doFallback, useBSClsLoader);
Object instance = providerClass.newInstance();
if (debug) { // Extra check to avoid computing cl strings
dPrint("created new instance of " + providerClass +
@@ -244,6 +270,7 @@ class FactoryFinder {
// First try the Context ClassLoader
ClassLoader cl = ss.getContextClassLoader();
+ boolean useBSClsLoader = false;
if (cl != null) {
is = ss.getResourceAsStream(cl, serviceId);
@@ -251,11 +278,13 @@ class FactoryFinder {
if (is == null) {
cl = FactoryFinder.class.getClassLoader();
is = ss.getResourceAsStream(cl, serviceId);
+ useBSClsLoader = true;
}
} else {
// No Context ClassLoader, try the current ClassLoader
cl = FactoryFinder.class.getClassLoader();
is = ss.getResourceAsStream(cl, serviceId);
+ useBSClsLoader = true;
}
if (is == null) {
@@ -293,7 +322,7 @@ class FactoryFinder {
// ClassLoader because we want to avoid the case where the
// resource file was found using one ClassLoader and the
// provider class was instantiated using a different one.
- return newInstance(factoryClassName, cl, false);
+ return newInstance(factoryClassName, cl, false, useBSClsLoader);
}
// No provider found
diff --git a/jaxp/src/share/classes/javax/xml/parsers/ParserConfigurationException.java b/jaxp/src/javax/xml/parsers/ParserConfigurationException.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/parsers/ParserConfigurationException.java
rename to jaxp/src/javax/xml/parsers/ParserConfigurationException.java
diff --git a/jaxp/src/share/classes/javax/xml/parsers/SAXParser.java b/jaxp/src/javax/xml/parsers/SAXParser.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/parsers/SAXParser.java
rename to jaxp/src/javax/xml/parsers/SAXParser.java
diff --git a/jaxp/src/share/classes/javax/xml/parsers/SAXParserFactory.java b/jaxp/src/javax/xml/parsers/SAXParserFactory.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/parsers/SAXParserFactory.java
rename to jaxp/src/javax/xml/parsers/SAXParserFactory.java
diff --git a/jaxp/src/share/classes/javax/xml/parsers/SecuritySupport.java b/jaxp/src/javax/xml/parsers/SecuritySupport.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/parsers/SecuritySupport.java
rename to jaxp/src/javax/xml/parsers/SecuritySupport.java
diff --git a/jaxp/src/share/classes/javax/xml/parsers/package.html b/jaxp/src/javax/xml/parsers/package.html
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/parsers/package.html
rename to jaxp/src/javax/xml/parsers/package.html
diff --git a/jaxp/src/share/classes/javax/xml/stream/EventFilter.java b/jaxp/src/javax/xml/stream/EventFilter.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/EventFilter.java
rename to jaxp/src/javax/xml/stream/EventFilter.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/FactoryConfigurationError.java b/jaxp/src/javax/xml/stream/FactoryConfigurationError.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/FactoryConfigurationError.java
rename to jaxp/src/javax/xml/stream/FactoryConfigurationError.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/FactoryFinder.java b/jaxp/src/javax/xml/stream/FactoryFinder.java
similarity index 99%
rename from jaxp/src/share/classes/javax/xml/stream/FactoryFinder.java
rename to jaxp/src/javax/xml/stream/FactoryFinder.java
index b35eef8dbe9..a2491ac8c59 100644
--- a/jaxp/src/share/classes/javax/xml/stream/FactoryFinder.java
+++ b/jaxp/src/javax/xml/stream/FactoryFinder.java
@@ -58,7 +58,7 @@ class FactoryFinder {
* Flag indicating if properties from java.home/lib/jaxp.properties
* have been cached.
*/
- static boolean firstTime = true;
+ static volatile boolean firstTime = true;
/**
* Security support class use to check access control before
diff --git a/jaxp/src/share/classes/javax/xml/stream/Location.java b/jaxp/src/javax/xml/stream/Location.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/Location.java
rename to jaxp/src/javax/xml/stream/Location.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/SecuritySupport.java b/jaxp/src/javax/xml/stream/SecuritySupport.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/SecuritySupport.java
rename to jaxp/src/javax/xml/stream/SecuritySupport.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/StreamFilter.java b/jaxp/src/javax/xml/stream/StreamFilter.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/StreamFilter.java
rename to jaxp/src/javax/xml/stream/StreamFilter.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/XMLEventFactory.java b/jaxp/src/javax/xml/stream/XMLEventFactory.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/XMLEventFactory.java
rename to jaxp/src/javax/xml/stream/XMLEventFactory.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/XMLEventReader.java b/jaxp/src/javax/xml/stream/XMLEventReader.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/XMLEventReader.java
rename to jaxp/src/javax/xml/stream/XMLEventReader.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/XMLEventWriter.java b/jaxp/src/javax/xml/stream/XMLEventWriter.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/XMLEventWriter.java
rename to jaxp/src/javax/xml/stream/XMLEventWriter.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/XMLInputFactory.java b/jaxp/src/javax/xml/stream/XMLInputFactory.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/XMLInputFactory.java
rename to jaxp/src/javax/xml/stream/XMLInputFactory.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/XMLOutputFactory.java b/jaxp/src/javax/xml/stream/XMLOutputFactory.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/XMLOutputFactory.java
rename to jaxp/src/javax/xml/stream/XMLOutputFactory.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/XMLReporter.java b/jaxp/src/javax/xml/stream/XMLReporter.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/XMLReporter.java
rename to jaxp/src/javax/xml/stream/XMLReporter.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/XMLResolver.java b/jaxp/src/javax/xml/stream/XMLResolver.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/XMLResolver.java
rename to jaxp/src/javax/xml/stream/XMLResolver.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/XMLStreamConstants.java b/jaxp/src/javax/xml/stream/XMLStreamConstants.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/XMLStreamConstants.java
rename to jaxp/src/javax/xml/stream/XMLStreamConstants.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/XMLStreamException.java b/jaxp/src/javax/xml/stream/XMLStreamException.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/XMLStreamException.java
rename to jaxp/src/javax/xml/stream/XMLStreamException.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/XMLStreamReader.java b/jaxp/src/javax/xml/stream/XMLStreamReader.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/XMLStreamReader.java
rename to jaxp/src/javax/xml/stream/XMLStreamReader.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/XMLStreamWriter.java b/jaxp/src/javax/xml/stream/XMLStreamWriter.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/XMLStreamWriter.java
rename to jaxp/src/javax/xml/stream/XMLStreamWriter.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/events/Attribute.java b/jaxp/src/javax/xml/stream/events/Attribute.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/events/Attribute.java
rename to jaxp/src/javax/xml/stream/events/Attribute.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/events/Characters.java b/jaxp/src/javax/xml/stream/events/Characters.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/events/Characters.java
rename to jaxp/src/javax/xml/stream/events/Characters.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/events/Comment.java b/jaxp/src/javax/xml/stream/events/Comment.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/events/Comment.java
rename to jaxp/src/javax/xml/stream/events/Comment.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/events/DTD.java b/jaxp/src/javax/xml/stream/events/DTD.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/events/DTD.java
rename to jaxp/src/javax/xml/stream/events/DTD.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/events/EndDocument.java b/jaxp/src/javax/xml/stream/events/EndDocument.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/events/EndDocument.java
rename to jaxp/src/javax/xml/stream/events/EndDocument.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/events/EndElement.java b/jaxp/src/javax/xml/stream/events/EndElement.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/events/EndElement.java
rename to jaxp/src/javax/xml/stream/events/EndElement.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/events/EntityDeclaration.java b/jaxp/src/javax/xml/stream/events/EntityDeclaration.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/events/EntityDeclaration.java
rename to jaxp/src/javax/xml/stream/events/EntityDeclaration.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/events/EntityReference.java b/jaxp/src/javax/xml/stream/events/EntityReference.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/events/EntityReference.java
rename to jaxp/src/javax/xml/stream/events/EntityReference.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/events/Namespace.java b/jaxp/src/javax/xml/stream/events/Namespace.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/events/Namespace.java
rename to jaxp/src/javax/xml/stream/events/Namespace.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/events/NotationDeclaration.java b/jaxp/src/javax/xml/stream/events/NotationDeclaration.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/events/NotationDeclaration.java
rename to jaxp/src/javax/xml/stream/events/NotationDeclaration.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/events/ProcessingInstruction.java b/jaxp/src/javax/xml/stream/events/ProcessingInstruction.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/events/ProcessingInstruction.java
rename to jaxp/src/javax/xml/stream/events/ProcessingInstruction.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/events/StartDocument.java b/jaxp/src/javax/xml/stream/events/StartDocument.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/events/StartDocument.java
rename to jaxp/src/javax/xml/stream/events/StartDocument.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/events/StartElement.java b/jaxp/src/javax/xml/stream/events/StartElement.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/events/StartElement.java
rename to jaxp/src/javax/xml/stream/events/StartElement.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/events/XMLEvent.java b/jaxp/src/javax/xml/stream/events/XMLEvent.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/events/XMLEvent.java
rename to jaxp/src/javax/xml/stream/events/XMLEvent.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/util/EventReaderDelegate.java b/jaxp/src/javax/xml/stream/util/EventReaderDelegate.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/util/EventReaderDelegate.java
rename to jaxp/src/javax/xml/stream/util/EventReaderDelegate.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/util/StreamReaderDelegate.java b/jaxp/src/javax/xml/stream/util/StreamReaderDelegate.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/util/StreamReaderDelegate.java
rename to jaxp/src/javax/xml/stream/util/StreamReaderDelegate.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/util/XMLEventAllocator.java b/jaxp/src/javax/xml/stream/util/XMLEventAllocator.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/util/XMLEventAllocator.java
rename to jaxp/src/javax/xml/stream/util/XMLEventAllocator.java
diff --git a/jaxp/src/share/classes/javax/xml/stream/util/XMLEventConsumer.java b/jaxp/src/javax/xml/stream/util/XMLEventConsumer.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/stream/util/XMLEventConsumer.java
rename to jaxp/src/javax/xml/stream/util/XMLEventConsumer.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/ErrorListener.java b/jaxp/src/javax/xml/transform/ErrorListener.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/ErrorListener.java
rename to jaxp/src/javax/xml/transform/ErrorListener.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/FactoryFinder.java b/jaxp/src/javax/xml/transform/FactoryFinder.java
similarity index 74%
rename from jaxp/src/share/classes/javax/xml/transform/FactoryFinder.java
rename to jaxp/src/javax/xml/transform/FactoryFinder.java
index bf3b48d9624..b0c6d9a1e9b 100644
--- a/jaxp/src/share/classes/javax/xml/transform/FactoryFinder.java
+++ b/jaxp/src/javax/xml/transform/FactoryFinder.java
@@ -25,15 +25,13 @@
package javax.xml.transform;
-import java.io.File;
-import java.io.FileInputStream;
-
-import java.util.Properties;
import java.io.BufferedReader;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.net.URL;
+import java.lang.reflect.Method;
+import java.util.Properties;
/**
* null
, first try using the
* context class loader followed by the current (i.e. bootstrap) class
* loader.
+ *
+ * Use bootstrap classLoader if cl = null and useBSClsLoader is true
*/
static private Class getProviderClass(String className, ClassLoader cl,
- boolean doFallback) throws ClassNotFoundException
+ boolean doFallback, boolean useBSClsLoader) throws ClassNotFoundException
{
try {
if (cl == null) {
- cl = ss.getContextClassLoader();
- if (cl == null) {
- throw new ClassNotFoundException();
- }
- else {
- return cl.loadClass(className);
+ if (useBSClsLoader) {
+ return Class.forName(className, true, FactoryFinder.class.getClassLoader());
+ } else {
+ cl = ss.getContextClassLoader();
+ if (cl == null) {
+ throw new ClassNotFoundException();
+ }
+ else {
+ return cl.loadClass(className);
+ }
}
}
else {
@@ -131,18 +136,48 @@ class FactoryFinder {
* @param className Name of the concrete class corresponding to the
* service provider
*
- * @param cl ClassLoader to use to load the class, null means to use
- * the bootstrap ClassLoader
+ * @param cl ClassLoader
used to load the factory class. If null
+ * current Thread
's context classLoader is used to load the factory class.
*
* @param doFallback True if the current ClassLoader should be tried as
* a fallback if the class is not found using cl
*/
static Object newInstance(String className, ClassLoader cl, boolean doFallback)
throws ConfigurationError
+ {
+ return newInstance(className, cl, doFallback, false, false);
+ }
+
+ /**
+ * Create an instance of a class. Delegates to method
+ * getProviderClass()
in order to load the class.
+ *
+ * @param className Name of the concrete class corresponding to the
+ * service provider
+ *
+ * @param cl ClassLoader
used to load the factory class. If null
+ * current Thread
's context classLoader is used to load the factory class.
+ *
+ * @param doFallback True if the current ClassLoader should be tried as
+ * a fallback if the class is not found using cl
+ *
+ * @param useBSClsLoader True if cl=null actually meant bootstrap classLoader. This parameter
+ * is needed since DocumentBuilderFactory/SAXParserFactory defined null as context classLoader.
+ *
+ * @param useServicesMechanism True use services mechanism
+ */
+ static Object newInstance(String className, ClassLoader cl, boolean doFallback, boolean useBSClsLoader, boolean useServicesMechanism)
+ throws ConfigurationError
{
try {
- Class providerClass = getProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
+ Class providerClass = getProviderClass(className, cl, doFallback, useBSClsLoader);
+ Object instance = null;
+ if (!useServicesMechanism) {
+ instance = newInstanceNoServiceLoader(providerClass);
+ }
+ if (instance == null) {
+ instance = providerClass.newInstance();
+ }
if (debug) { // Extra check to avoid computing cl strings
dPrint("created new instance of " + providerClass +
" using ClassLoader: " + cl);
@@ -159,7 +194,29 @@ class FactoryFinder {
x);
}
}
-
+ /**
+ * Try to construct using newTransformerFactoryNoServiceLoader
+ * method if available.
+ */
+ private static Object newInstanceNoServiceLoader(
+ Class> providerClass
+ ) {
+ // Retain maximum compatibility if no security manager.
+ if (System.getSecurityManager() == null) {
+ return null;
+ }
+ try {
+ Method creationMethod =
+ providerClass.getDeclaredMethod(
+ "newTransformerFactoryNoServiceLoader"
+ );
+ return creationMethod.invoke(null, null);
+ } catch (NoSuchMethodException exc) {
+ return null;
+ } catch (Exception exc) {
+ return null;
+ }
+ }
/**
* Finds the implementation Class object in the specified order. Main
* entry point.
@@ -176,13 +233,12 @@ class FactoryFinder {
throws ConfigurationError
{
dPrint("find factoryId =" + factoryId);
-
// Use the system property first
try {
String systemProp = ss.getSystemProperty(factoryId);
if (systemProp != null) {
dPrint("found system property, value=" + systemProp);
- return newInstance(systemProp, null, true);
+ return newInstance(systemProp, null, true, false, true);
}
}
catch (SecurityException se) {
@@ -210,7 +266,7 @@ class FactoryFinder {
if (factoryClassName != null) {
dPrint("found in $java.home/jaxp.properties, value=" + factoryClassName);
- return newInstance(factoryClassName, null, true);
+ return newInstance(factoryClassName, null, true, false, true);
}
}
catch (Exception ex) {
@@ -228,7 +284,7 @@ class FactoryFinder {
}
dPrint("loaded from fallback value: " + fallbackClassName);
- return newInstance(fallbackClassName, null, true);
+ return newInstance(fallbackClassName, null, true, false, true);
}
/*
@@ -244,6 +300,7 @@ class FactoryFinder {
// First try the Context ClassLoader
ClassLoader cl = ss.getContextClassLoader();
+ boolean useBSClsLoader = false;
if (cl != null) {
is = ss.getResourceAsStream(cl, serviceId);
@@ -251,11 +308,13 @@ class FactoryFinder {
if (is == null) {
cl = FactoryFinder.class.getClassLoader();
is = ss.getResourceAsStream(cl, serviceId);
- }
+ useBSClsLoader = true;
+ }
} else {
// No Context ClassLoader, try the current ClassLoader
cl = FactoryFinder.class.getClassLoader();
is = ss.getResourceAsStream(cl, serviceId);
+ useBSClsLoader = true;
}
if (is == null) {
@@ -293,7 +352,7 @@ class FactoryFinder {
// ClassLoader because we want to avoid the case where the
// resource file was found using one ClassLoader and the
// provider class was instantiated using a different one.
- return newInstance(factoryClassName, cl, false);
+ return newInstance(factoryClassName, cl, false, useBSClsLoader, true);
}
// No provider found
diff --git a/jaxp/src/share/classes/javax/xml/transform/OutputKeys.java b/jaxp/src/javax/xml/transform/OutputKeys.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/OutputKeys.java
rename to jaxp/src/javax/xml/transform/OutputKeys.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/Result.java b/jaxp/src/javax/xml/transform/Result.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/Result.java
rename to jaxp/src/javax/xml/transform/Result.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/SecuritySupport.java b/jaxp/src/javax/xml/transform/SecuritySupport.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/SecuritySupport.java
rename to jaxp/src/javax/xml/transform/SecuritySupport.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/Source.java b/jaxp/src/javax/xml/transform/Source.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/Source.java
rename to jaxp/src/javax/xml/transform/Source.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/SourceLocator.java b/jaxp/src/javax/xml/transform/SourceLocator.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/SourceLocator.java
rename to jaxp/src/javax/xml/transform/SourceLocator.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/Templates.java b/jaxp/src/javax/xml/transform/Templates.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/Templates.java
rename to jaxp/src/javax/xml/transform/Templates.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/Transformer.java b/jaxp/src/javax/xml/transform/Transformer.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/Transformer.java
rename to jaxp/src/javax/xml/transform/Transformer.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/TransformerConfigurationException.java b/jaxp/src/javax/xml/transform/TransformerConfigurationException.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/TransformerConfigurationException.java
rename to jaxp/src/javax/xml/transform/TransformerConfigurationException.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/TransformerException.java b/jaxp/src/javax/xml/transform/TransformerException.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/TransformerException.java
rename to jaxp/src/javax/xml/transform/TransformerException.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/TransformerFactory.java b/jaxp/src/javax/xml/transform/TransformerFactory.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/TransformerFactory.java
rename to jaxp/src/javax/xml/transform/TransformerFactory.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/TransformerFactoryConfigurationError.java b/jaxp/src/javax/xml/transform/TransformerFactoryConfigurationError.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/TransformerFactoryConfigurationError.java
rename to jaxp/src/javax/xml/transform/TransformerFactoryConfigurationError.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/URIResolver.java b/jaxp/src/javax/xml/transform/URIResolver.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/URIResolver.java
rename to jaxp/src/javax/xml/transform/URIResolver.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/dom/DOMLocator.java b/jaxp/src/javax/xml/transform/dom/DOMLocator.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/dom/DOMLocator.java
rename to jaxp/src/javax/xml/transform/dom/DOMLocator.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/dom/DOMResult.java b/jaxp/src/javax/xml/transform/dom/DOMResult.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/dom/DOMResult.java
rename to jaxp/src/javax/xml/transform/dom/DOMResult.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/dom/DOMSource.java b/jaxp/src/javax/xml/transform/dom/DOMSource.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/dom/DOMSource.java
rename to jaxp/src/javax/xml/transform/dom/DOMSource.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/dom/package.html b/jaxp/src/javax/xml/transform/dom/package.html
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/dom/package.html
rename to jaxp/src/javax/xml/transform/dom/package.html
diff --git a/jaxp/src/share/classes/javax/xml/transform/overview.html b/jaxp/src/javax/xml/transform/overview.html
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/overview.html
rename to jaxp/src/javax/xml/transform/overview.html
diff --git a/jaxp/src/share/classes/javax/xml/transform/package.html b/jaxp/src/javax/xml/transform/package.html
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/package.html
rename to jaxp/src/javax/xml/transform/package.html
diff --git a/jaxp/src/share/classes/javax/xml/transform/sax/SAXResult.java b/jaxp/src/javax/xml/transform/sax/SAXResult.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/sax/SAXResult.java
rename to jaxp/src/javax/xml/transform/sax/SAXResult.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/sax/SAXSource.java b/jaxp/src/javax/xml/transform/sax/SAXSource.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/sax/SAXSource.java
rename to jaxp/src/javax/xml/transform/sax/SAXSource.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/sax/SAXTransformerFactory.java b/jaxp/src/javax/xml/transform/sax/SAXTransformerFactory.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/sax/SAXTransformerFactory.java
rename to jaxp/src/javax/xml/transform/sax/SAXTransformerFactory.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/sax/TemplatesHandler.java b/jaxp/src/javax/xml/transform/sax/TemplatesHandler.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/sax/TemplatesHandler.java
rename to jaxp/src/javax/xml/transform/sax/TemplatesHandler.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/sax/TransformerHandler.java b/jaxp/src/javax/xml/transform/sax/TransformerHandler.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/sax/TransformerHandler.java
rename to jaxp/src/javax/xml/transform/sax/TransformerHandler.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/sax/package.html b/jaxp/src/javax/xml/transform/sax/package.html
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/sax/package.html
rename to jaxp/src/javax/xml/transform/sax/package.html
diff --git a/jaxp/src/share/classes/javax/xml/transform/stax/StAXResult.java b/jaxp/src/javax/xml/transform/stax/StAXResult.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/stax/StAXResult.java
rename to jaxp/src/javax/xml/transform/stax/StAXResult.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/stax/StAXSource.java b/jaxp/src/javax/xml/transform/stax/StAXSource.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/stax/StAXSource.java
rename to jaxp/src/javax/xml/transform/stax/StAXSource.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/stax/package.html b/jaxp/src/javax/xml/transform/stax/package.html
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/stax/package.html
rename to jaxp/src/javax/xml/transform/stax/package.html
diff --git a/jaxp/src/share/classes/javax/xml/transform/stream/StreamResult.java b/jaxp/src/javax/xml/transform/stream/StreamResult.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/stream/StreamResult.java
rename to jaxp/src/javax/xml/transform/stream/StreamResult.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/stream/StreamSource.java b/jaxp/src/javax/xml/transform/stream/StreamSource.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/stream/StreamSource.java
rename to jaxp/src/javax/xml/transform/stream/StreamSource.java
diff --git a/jaxp/src/share/classes/javax/xml/transform/stream/package.html b/jaxp/src/javax/xml/transform/stream/package.html
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/transform/stream/package.html
rename to jaxp/src/javax/xml/transform/stream/package.html
diff --git a/jaxp/src/share/classes/javax/xml/validation/Schema.java b/jaxp/src/javax/xml/validation/Schema.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/validation/Schema.java
rename to jaxp/src/javax/xml/validation/Schema.java
diff --git a/jaxp/src/share/classes/javax/xml/validation/SchemaFactory.java b/jaxp/src/javax/xml/validation/SchemaFactory.java
similarity index 100%
rename from jaxp/src/share/classes/javax/xml/validation/SchemaFactory.java
rename to jaxp/src/javax/xml/validation/SchemaFactory.java
diff --git a/jaxp/src/share/classes/javax/xml/validation/SchemaFactoryFinder.java b/jaxp/src/javax/xml/validation/SchemaFactoryFinder.java
similarity index 93%
rename from jaxp/src/share/classes/javax/xml/validation/SchemaFactoryFinder.java
rename to jaxp/src/javax/xml/validation/SchemaFactoryFinder.java
index e30f22c9373..8157b6bd8dd 100644
--- a/jaxp/src/share/classes/javax/xml/validation/SchemaFactoryFinder.java
+++ b/jaxp/src/javax/xml/validation/SchemaFactoryFinder.java
@@ -43,6 +43,7 @@ import java.util.Properties;
* Implementation of {@link SchemaFactory#newInstance(String)}.
*
* @author Kohsuke Kawaguchi
+ * @version $Revision: 1.8 $, $Date: 2010-11-01 04:36:13 $
* @since 1.5
*/
class SchemaFactoryFinder {
@@ -61,7 +62,7 @@ class SchemaFactoryFinder {
/**
* javax.xml.parsers.ObjectFactory
- * class and modified to be used as a general utility for creating objects
- * dynamically.
- *
- * @version $Id: ObjectFactory.java,v 1.9 2008/04/02 00:40:59 joehw Exp $
- */
-class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME =
- "xalan.properties";
-
- private static final String SERVICES_PATH = "META-INF/services/";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /** cache the contents of the xalan.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXalanProperties = null;
-
- /***
- * Cache the time stamp of the xalan.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // Public static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- Class factoryClass = lookUpFactoryClass(factoryId,
- propertiesFilename,
- fallbackClassName);
-
- if (factoryClass == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- try{
- Object instance = factoryClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of factory " + factoryId);
- return instance;
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider for factory " + factoryId
- + " could not be instantiated: " + x, x);
- }
- } // createObject(String,String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId)
- throws ConfigurationError
- {
- return lookUpFactoryClass(factoryId, null, null);
- } // lookUpFactoryClass(String):Class
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- String factoryClassName = lookUpFactoryClassName(factoryId,
- propertiesFilename,
- fallbackClassName);
- ClassLoader cl = findClassLoader();
-
- if (factoryClassName == null) {
- factoryClassName = fallbackClassName;
- }
-
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(factoryClassName,
- cl,
- true);
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return providerClass;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + factoryClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider "+factoryClassName+" could not be instantiated: "+x,
- x);
- }
- } // lookUpFactoryClass(String,String,String):Class
-
- /**
- * Finds the name of the required implementation class in the specified
- * order. The specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return name of class that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static String lookUpFactoryClassName(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return systemProp;
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // Try to read from propertiesFilename, or
- // $java.home/lib/xalan.properties
- String factoryClassName = null;
- // no properties file name specified; use
- // $JAVA_HOME/lib/xalan.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXalanProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXalanProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xalan.properties
- // before (or it's outdeated)
- fXalanProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXalanProperties.load(fis);
- }
- } catch (Exception x) {
- fXalanProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXalanProperties != null) {
- factoryClassName = fXalanProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value="
- + factoryClassName);
- return factoryClassName;
- }
-
- // Try Jar Service Provider Mechanism
- return findJarServiceProviderName(factoryId);
- } // lookUpFactoryClass(String,String):String
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- System.err.println("JAXP: " + msg);
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xalan
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the
- //class. Restrict the access to the package classes as specified in java.security policy.
- SecurityManager security = System.getSecurityManager();
- try{
- if (security != null){
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- }catch(SecurityException e){
- throw e;
- }
-
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /**
- * Find the name of service provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static String findJarServiceProviderName(String factoryId)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = SERVICES_PATH + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is));
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return factoryClassName;
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static class ConfigurationError
- extends Error {
- static final long serialVersionUID = -7640369932165775029L;
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * javax.xml.parsers.ObjectFactory
- * class and modified to be used as a general utility for creating objects
- * dynamically.
- *
- * @version $Id: ObjectFactory.java,v 1.9 2008/04/02 00:41:00 joehw Exp $
- */
-class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME =
- "xalan.properties";
-
- private static final String SERVICES_PATH = "META-INF/services/";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /** cache the contents of the xalan.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXalanProperties = null;
-
- /***
- * Cache the time stamp of the xalan.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // Public static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- Class factoryClass = lookUpFactoryClass(factoryId,
- propertiesFilename,
- fallbackClassName);
-
- if (factoryClass == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- try{
- Object instance = factoryClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of factory " + factoryId);
- return instance;
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider for factory " + factoryId
- + " could not be instantiated: " + x, x);
- }
- } // createObject(String,String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId)
- throws ConfigurationError
- {
- return lookUpFactoryClass(factoryId, null, null);
- } // lookUpFactoryClass(String):Class
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- String factoryClassName = lookUpFactoryClassName(factoryId,
- propertiesFilename,
- fallbackClassName);
- ClassLoader cl = findClassLoader();
-
- if (factoryClassName == null) {
- factoryClassName = fallbackClassName;
- }
-
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(factoryClassName,
- cl,
- true);
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return providerClass;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + factoryClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider "+factoryClassName+" could not be instantiated: "+x,
- x);
- }
- } // lookUpFactoryClass(String,String,String):Class
-
- /**
- * Finds the name of the required implementation class in the specified
- * order. The specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return name of class that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static String lookUpFactoryClassName(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return systemProp;
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // Try to read from propertiesFilename, or
- // $java.home/lib/xalan.properties
- String factoryClassName = null;
- // no properties file name specified; use
- // $JAVA_HOME/lib/xalan.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXalanProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXalanProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xalan.properties
- // before (or it's outdeated)
- fXalanProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXalanProperties.load(fis);
- }
- } catch (Exception x) {
- fXalanProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXalanProperties != null) {
- factoryClassName = fXalanProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value="
- + factoryClassName);
- return factoryClassName;
- }
-
- // Try Jar Service Provider Mechanism
- return findJarServiceProviderName(factoryId);
- } // lookUpFactoryClass(String,String):String
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xalan
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the
- //class. Restrict the access to the package classes as specified in java.security policy.
- SecurityManager security = System.getSecurityManager();
- try{
- if (security != null){
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- }catch(SecurityException e){
- throw e;
- }
-
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /**
- * Find the name of service provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static String findJarServiceProviderName(String factoryId)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = SERVICES_PATH + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is));
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return factoryClassName;
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static class ConfigurationError
- extends Error {
- static final long serialVersionUID = 2276082712114762609L;
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * javax.xml.parsers.ObjectFactory
- * class and modified to be used as a general utility for creating objects
- * dynamically.
- *
- * @version $Id: ObjectFactory.java,v 1.9 2008/04/02 00:41:02 joehw Exp $
- */
-class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME =
- "xalan.properties";
-
- private static final String SERVICES_PATH = "META-INF/services/";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /** cache the contents of the xalan.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXalanProperties = null;
-
- /***
- * Cache the time stamp of the xalan.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // Public static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- Class factoryClass = lookUpFactoryClass(factoryId,
- propertiesFilename,
- fallbackClassName);
-
- if (factoryClass == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- try{
- Object instance = factoryClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of factory " + factoryId);
- return instance;
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider for factory " + factoryId
- + " could not be instantiated: " + x, x);
- }
- } // createObject(String,String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId)
- throws ConfigurationError
- {
- return lookUpFactoryClass(factoryId, null, null);
- } // lookUpFactoryClass(String):Class
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- String factoryClassName = lookUpFactoryClassName(factoryId,
- propertiesFilename,
- fallbackClassName);
- ClassLoader cl = findClassLoader();
-
- if (factoryClassName == null) {
- factoryClassName = fallbackClassName;
- }
-
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(factoryClassName,
- cl,
- true);
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return providerClass;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + factoryClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider "+factoryClassName+" could not be instantiated: "+x,
- x);
- }
- } // lookUpFactoryClass(String,String,String):Class
-
- /**
- * Finds the name of the required implementation class in the specified
- * order. The specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return name of class that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static String lookUpFactoryClassName(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return systemProp;
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // Try to read from propertiesFilename, or
- // $java.home/lib/xalan.properties
- String factoryClassName = null;
- // no properties file name specified; use
- // $JAVA_HOME/lib/xalan.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXalanProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXalanProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xalan.properties
- // before (or it's outdeated)
- fXalanProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXalanProperties.load(fis);
- }
- } catch (Exception x) {
- fXalanProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXalanProperties != null) {
- factoryClassName = fXalanProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value="
- + factoryClassName);
- return factoryClassName;
- }
-
- // Try Jar Service Provider Mechanism
- return findJarServiceProviderName(factoryId);
- } // lookUpFactoryClass(String,String):String
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xalan
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the
- //class. Restrict the access to the package classes as specified in java.security policy.
- SecurityManager security = System.getSecurityManager();
- try{
- if (security != null){
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- }catch(SecurityException e){
- throw e;
- }
-
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /**
- * Find the name of service provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static String findJarServiceProviderName(String factoryId)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = SERVICES_PATH + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is));
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return factoryClassName;
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static class ConfigurationError
- extends Error {
- static final long serialVersionUID = -6072257854297546607L;
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * javax.xml.parsers.ObjectFactory
- * class and modified to be used as a general utility for creating objects
- * dynamically.
- *
- * @version $Id: ObjectFactory.java,v 1.9 2008/04/02 00:41:01 joehw Exp $
- */
-class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME =
- "xalan.properties";
-
- private static final String SERVICES_PATH = "META-INF/services/";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /** cache the contents of the xalan.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXalanProperties = null;
-
- /***
- * Cache the time stamp of the xalan.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // Public static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- Class factoryClass = lookUpFactoryClass(factoryId,
- propertiesFilename,
- fallbackClassName);
-
- if (factoryClass == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- try{
- Object instance = factoryClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of factory " + factoryId);
- return instance;
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider for factory " + factoryId
- + " could not be instantiated: " + x, x);
- }
- } // createObject(String,String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId)
- throws ConfigurationError
- {
- return lookUpFactoryClass(factoryId, null, null);
- } // lookUpFactoryClass(String):Class
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- String factoryClassName = lookUpFactoryClassName(factoryId,
- propertiesFilename,
- fallbackClassName);
- ClassLoader cl = findClassLoader();
-
- if (factoryClassName == null) {
- factoryClassName = fallbackClassName;
- }
-
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(factoryClassName,
- cl,
- true);
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return providerClass;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + factoryClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider "+factoryClassName+" could not be instantiated: "+x,
- x);
- }
- } // lookUpFactoryClass(String,String,String):Class
-
- /**
- * Finds the name of the required implementation class in the specified
- * order. The specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return name of class that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static String lookUpFactoryClassName(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return systemProp;
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // Try to read from propertiesFilename, or
- // $java.home/lib/xalan.properties
- String factoryClassName = null;
- // no properties file name specified; use
- // $JAVA_HOME/lib/xalan.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXalanProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXalanProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xalan.properties
- // before (or it's outdeated)
- fXalanProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXalanProperties.load(fis);
- }
- } catch (Exception x) {
- fXalanProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXalanProperties != null) {
- factoryClassName = fXalanProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value="
- + factoryClassName);
- return factoryClassName;
- }
-
- // Try Jar Service Provider Mechanism
- return findJarServiceProviderName(factoryId);
- } // lookUpFactoryClass(String,String):String
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xalan
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the
- //class. Restrict the access to the package classes as specified in java.security policy.
- SecurityManager security = System.getSecurityManager();
- try{
- if (security != null){
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- }catch(SecurityException e){
- throw e;
- }
-
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /**
- * Find the name of service provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static String findJarServiceProviderName(String factoryId)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = SERVICES_PATH + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is));
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return factoryClassName;
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static class ConfigurationError
- extends Error {
- static final long serialVersionUID = 3326843611085065902L;
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * javax.xml.parsers.ObjectFactory
- * class and modified to be used as a general utility for creating objects
- * dynamically.
- *
- * @version $Id: ObjectFactory.java,v 1.9 2008/04/02 00:40:59 joehw Exp $
- */
-class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME =
- "xalan.properties";
-
- private static final String SERVICES_PATH = "META-INF/services/";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /** cache the contents of the xalan.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXalanProperties = null;
-
- /***
- * Cache the time stamp of the xalan.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // Public static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- Class factoryClass = lookUpFactoryClass(factoryId,
- propertiesFilename,
- fallbackClassName);
-
- if (factoryClass == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- try{
- Object instance = factoryClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of factory " + factoryId);
- return instance;
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider for factory " + factoryId
- + " could not be instantiated: " + x, x);
- }
- } // createObject(String,String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId)
- throws ConfigurationError
- {
- return lookUpFactoryClass(factoryId, null, null);
- } // lookUpFactoryClass(String):Class
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- String factoryClassName = lookUpFactoryClassName(factoryId,
- propertiesFilename,
- fallbackClassName);
- ClassLoader cl = findClassLoader();
-
- if (factoryClassName == null) {
- factoryClassName = fallbackClassName;
- }
-
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(factoryClassName,
- cl,
- true);
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return providerClass;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + factoryClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider "+factoryClassName+" could not be instantiated: "+x,
- x);
- }
- } // lookUpFactoryClass(String,String,String):Class
-
- /**
- * Finds the name of the required implementation class in the specified
- * order. The specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return name of class that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static String lookUpFactoryClassName(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return systemProp;
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // Try to read from propertiesFilename, or
- // $java.home/lib/xalan.properties
- String factoryClassName = null;
- // no properties file name specified; use
- // $JAVA_HOME/lib/xalan.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXalanProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXalanProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xalan.properties
- // before (or it's outdeated)
- fXalanProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXalanProperties.load(fis);
- }
- } catch (Exception x) {
- fXalanProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXalanProperties != null) {
- factoryClassName = fXalanProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value="
- + factoryClassName);
- return factoryClassName;
- }
-
- // Try Jar Service Provider Mechanism
- return findJarServiceProviderName(factoryId);
- } // lookUpFactoryClass(String,String):String
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xalan
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the
- //class. Restrict the access to the package classes as specified in java.security policy.
- SecurityManager security = System.getSecurityManager();
- try{
- if (security != null){
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- }catch(SecurityException e){
- throw e;
- }
-
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /**
- * Find the name of service provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static String findJarServiceProviderName(String factoryId)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = SERVICES_PATH + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is));
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return factoryClassName;
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static class ConfigurationError
- extends Error {
- static final long serialVersionUID = -4417969773510154215L;
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * javax.xml.parsers.ObjectFactory
- * class and modified to be used as a general utility for creating objects
- * dynamically.
- *
- * @version $Id: ObjectFactory.java,v 1.9 2008/04/02 00:41:00 joehw Exp $
- */
-class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME =
- "xalan.properties";
-
- private static final String SERVICES_PATH = "META-INF/services/";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /** cache the contents of the xalan.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXalanProperties = null;
-
- /***
- * Cache the time stamp of the xalan.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // Public static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- Class factoryClass = lookUpFactoryClass(factoryId,
- propertiesFilename,
- fallbackClassName);
-
- if (factoryClass == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- try{
- Object instance = factoryClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of factory " + factoryId);
- return instance;
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider for factory " + factoryId
- + " could not be instantiated: " + x, x);
- }
- } // createObject(String,String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId)
- throws ConfigurationError
- {
- return lookUpFactoryClass(factoryId, null, null);
- } // lookUpFactoryClass(String):Class
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- String factoryClassName = lookUpFactoryClassName(factoryId,
- propertiesFilename,
- fallbackClassName);
- ClassLoader cl = findClassLoader();
-
- if (factoryClassName == null) {
- factoryClassName = fallbackClassName;
- }
-
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(factoryClassName,
- cl,
- true);
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return providerClass;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + factoryClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider "+factoryClassName+" could not be instantiated: "+x,
- x);
- }
- } // lookUpFactoryClass(String,String,String):Class
-
- /**
- * Finds the name of the required implementation class in the specified
- * order. The specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return name of class that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static String lookUpFactoryClassName(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return systemProp;
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // Try to read from propertiesFilename, or
- // $java.home/lib/xalan.properties
- String factoryClassName = null;
- // no properties file name specified; use
- // $JAVA_HOME/lib/xalan.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXalanProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXalanProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xalan.properties
- // before (or it's outdeated)
- fXalanProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXalanProperties.load(fis);
- }
- } catch (Exception x) {
- fXalanProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXalanProperties != null) {
- factoryClassName = fXalanProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value="
- + factoryClassName);
- return factoryClassName;
- }
-
- // Try Jar Service Provider Mechanism
- return findJarServiceProviderName(factoryId);
- } // lookUpFactoryClass(String,String):String
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xalan
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the
- //class. Restrict the access to the package classes as specified in java.security policy.
- SecurityManager security = System.getSecurityManager();
- try{
- if (security != null){
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- }catch(SecurityException e){
- throw e;
- }
-
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /**
- * Find the name of service provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static String findJarServiceProviderName(String factoryId)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = SERVICES_PATH + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is));
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return factoryClassName;
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static class ConfigurationError
- extends Error {
- static final long serialVersionUID = -5948733402959678002L;
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * javax.xml.parsers.ObjectFactory
- * class and modified to be used as a general utility for creating objects
- * dynamically.
- *
- * @version $Id: ObjectFactory.java,v 1.9 2008/04/02 00:40:59 joehw Exp $
- */
-class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME =
- "xalan.properties";
-
- private static final String SERVICES_PATH = "META-INF/services/";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /** cache the contents of the xalan.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXalanProperties = null;
-
- /***
- * Cache the time stamp of the xalan.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // Public static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- Class factoryClass = lookUpFactoryClass(factoryId,
- propertiesFilename,
- fallbackClassName);
-
- if (factoryClass == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- try{
- Object instance = factoryClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of factory " + factoryId);
- return instance;
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider for factory " + factoryId
- + " could not be instantiated: " + x, x);
- }
- } // createObject(String,String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId)
- throws ConfigurationError
- {
- return lookUpFactoryClass(factoryId, null, null);
- } // lookUpFactoryClass(String):Class
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- String factoryClassName = lookUpFactoryClassName(factoryId,
- propertiesFilename,
- fallbackClassName);
- ClassLoader cl = findClassLoader();
-
- if (factoryClassName == null) {
- factoryClassName = fallbackClassName;
- }
-
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(factoryClassName,
- cl,
- true);
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return providerClass;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + factoryClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider "+factoryClassName+" could not be instantiated: "+x,
- x);
- }
- } // lookUpFactoryClass(String,String,String):Class
-
- /**
- * Finds the name of the required implementation class in the specified
- * order. The specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return name of class that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static String lookUpFactoryClassName(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return systemProp;
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // Try to read from propertiesFilename, or
- // $java.home/lib/xalan.properties
- String factoryClassName = null;
- // no properties file name specified; use
- // $JAVA_HOME/lib/xalan.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXalanProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXalanProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xalan.properties
- // before (or it's outdeated)
- fXalanProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXalanProperties.load(fis);
- }
- } catch (Exception x) {
- fXalanProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXalanProperties != null) {
- factoryClassName = fXalanProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value="
- + factoryClassName);
- return factoryClassName;
- }
-
- // Try Jar Service Provider Mechanism
- return findJarServiceProviderName(factoryId);
- } // lookUpFactoryClass(String,String):String
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xalan
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the
- //class. Restrict the access to the package classes as specified in java.security policy.
- SecurityManager security = System.getSecurityManager();
- try{
- if (security != null){
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- }catch(SecurityException e){
- throw e;
- }
-
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /**
- * Find the name of service provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static String findJarServiceProviderName(String factoryId)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = SERVICES_PATH + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is));
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return factoryClassName;
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static class ConfigurationError
- extends Error {
- static final long serialVersionUID = -2293620736651286953L;
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * javax.xml.parsers.ObjectFactory
- * class and modified to be used as a general utility for creating objects
- * dynamically.
- *
- * @version $Id: ObjectFactory.java,v 1.9 2008/04/02 00:41:02 joehw Exp $
- */
-class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME =
- "xalan.properties";
-
- private static final String SERVICES_PATH = "META-INF/services/";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /** cache the contents of the xalan.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXalanProperties = null;
-
- /***
- * Cache the time stamp of the xalan.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // Public static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- Class factoryClass = lookUpFactoryClass(factoryId,
- propertiesFilename,
- fallbackClassName);
-
- if (factoryClass == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- try{
- Object instance = factoryClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of factory " + factoryId);
- return instance;
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider for factory " + factoryId
- + " could not be instantiated: " + x, x);
- }
- } // createObject(String,String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId)
- throws ConfigurationError
- {
- return lookUpFactoryClass(factoryId, null, null);
- } // lookUpFactoryClass(String):Class
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- String factoryClassName = lookUpFactoryClassName(factoryId,
- propertiesFilename,
- fallbackClassName);
- ClassLoader cl = findClassLoader();
-
- if (factoryClassName == null) {
- factoryClassName = fallbackClassName;
- }
-
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(factoryClassName,
- cl,
- true);
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return providerClass;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + factoryClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider "+factoryClassName+" could not be instantiated: "+x,
- x);
- }
- } // lookUpFactoryClass(String,String,String):Class
-
- /**
- * Finds the name of the required implementation class in the specified
- * order. The specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return name of class that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static String lookUpFactoryClassName(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return systemProp;
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // Try to read from propertiesFilename, or
- // $java.home/lib/xalan.properties
- String factoryClassName = null;
- // no properties file name specified; use
- // $JAVA_HOME/lib/xalan.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXalanProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXalanProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xalan.properties
- // before (or it's outdeated)
- fXalanProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXalanProperties.load(fis);
- }
- } catch (Exception x) {
- fXalanProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXalanProperties != null) {
- factoryClassName = fXalanProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value="
- + factoryClassName);
- return factoryClassName;
- }
-
- // Try Jar Service Provider Mechanism
- return findJarServiceProviderName(factoryId);
- } // lookUpFactoryClass(String,String):String
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xalan
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the
- //class. Restrict the access to the package classes as specified in java.security policy.
- SecurityManager security = System.getSecurityManager();
- try{
- if (security != null){
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- }catch(SecurityException e){
- throw e;
- }
-
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /**
- * Find the name of service provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static String findJarServiceProviderName(String factoryId)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = SERVICES_PATH + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is));
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return factoryClassName;
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static class ConfigurationError
- extends Error {
- static final long serialVersionUID = -1877553852268428278L;
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xerces.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- if (DEBUG) debugPrintln("debug is on");
-
- SecuritySupport ss = SecuritySupport.getInstance();
- ClassLoader cl = findClassLoader();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return newInstance(systemProp, cl, true);
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // JAXP specific change
- // always use fallback class to avoid the expense of constantly
- // "stat"ing a non-existent "xerces.properties" and jar SPI entry
- // see CR 6400863: Expensive creating of SAX parser in Mustang
- if (true) {
- if (fallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- if (DEBUG) debugPrintln("using fallback, value=" + fallbackClassName);
- return newInstance(fallbackClassName, cl, true);
- }
-
- // Try to read from propertiesFilename, or $java.home/lib/xerces.properties
- String factoryClassName = null;
- // no properties file name specified; use $JAVA_HOME/lib/xerces.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXercesProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXercesProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xerces.properties before (or it's outdeated)
- fXercesProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXercesProperties.load(fis);
- }
- } catch (Exception x) {
- fXercesProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXercesProperties != null) {
- factoryClassName = fXercesProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value=" + factoryClassName);
- return newInstance(factoryClassName, cl, true);
- }
-
- // Try Jar Service Provider Mechanism
- Object provider = findJarServiceProvider(factoryId);
- if (provider != null) {
- return provider;
- }
-
- if (fallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- if (DEBUG) debugPrintln("using fallback, value=" + fallbackClassName);
- return newInstance(fallbackClassName, cl, true);
- } // createObject(String,String,String):Object
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xerces
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the package
- //restrict the access to package as speicified in java.security policy
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /*
- * Try to find provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static Object findJarServiceProvider(String factoryId)
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = "META-INF/services/" + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH);
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return newInstance(factoryClassName, cl, false);
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static final class ConfigurationError
- extends Error {
-
- /** Serialization version. */
- static final long serialVersionUID = 1914065341994951202L;
-
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xerces.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- if (DEBUG) debugPrintln("debug is on");
-
- SecuritySupport ss = SecuritySupport.getInstance();
- ClassLoader cl = findClassLoader();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return newInstance(systemProp, cl, true);
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // JAXP specific change
- // always use fallback class to avoid the expense of constantly
- // "stat"ing a non-existent "xerces.properties" and jar SPI entry
- // see CR 6400863: Expensive creating of SAX parser in Mustang
- if (true) {
- if (fallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- if (DEBUG) debugPrintln("using fallback, value=" + fallbackClassName);
- return newInstance(fallbackClassName, cl, true);
- }
-
- // Try to read from propertiesFilename, or $java.home/lib/xerces.properties
- String factoryClassName = null;
- // no properties file name specified; use $JAVA_HOME/lib/xerces.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXercesProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXercesProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xerces.properties before (or it's outdeated)
- fXercesProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXercesProperties.load(fis);
- }
- } catch (Exception x) {
- fXercesProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXercesProperties != null) {
- factoryClassName = fXercesProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value=" + factoryClassName);
- return newInstance(factoryClassName, cl, true);
- }
-
- // Try Jar Service Provider Mechanism
- Object provider = findJarServiceProvider(factoryId);
- if (provider != null) {
- return provider;
- }
-
- if (fallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- if (DEBUG) debugPrintln("using fallback, value=" + fallbackClassName);
- return newInstance(fallbackClassName, cl, true);
- } // createObject(String,String,String):Object
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xerces
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the package
- //restrict the access to package as speicified in java.security policy
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /*
- * Try to find provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static Object findJarServiceProvider(String factoryId)
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = "META-INF/services/" + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH);
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return newInstance(factoryClassName, cl, false);
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static final class ConfigurationError
- extends Error {
-
- /** Serialization version. */
- static final long serialVersionUID = 8521878292694272124L;
-
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * javax.xml.parsers.ObjectFactory
- * class and modified to be used as a general utility for creating objects
- * dynamically.
- *
- * @version $Id: ObjectFactory.java,v 1.7 2008/04/02 00:41:00 joehw Exp $
- */
-class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME =
- "xalan.properties";
-
- private static final String SERVICES_PATH = "META-INF/services/";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /** cache the contents of the xalan.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXalanProperties = null;
-
- /***
- * Cache the time stamp of the xalan.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // Public static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- Class factoryClass = lookUpFactoryClass(factoryId,
- propertiesFilename,
- fallbackClassName);
-
- if (factoryClass == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- try{
- Object instance = factoryClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of factory " + factoryId);
- return instance;
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider for factory " + factoryId
- + " could not be instantiated: " + x, x);
- }
- } // createObject(String,String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId)
- throws ConfigurationError
- {
- return lookUpFactoryClass(factoryId, null, null);
- } // lookUpFactoryClass(String):Class
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- String factoryClassName = lookUpFactoryClassName(factoryId,
- propertiesFilename,
- fallbackClassName);
- ClassLoader cl = findClassLoader();
-
- if (factoryClassName == null) {
- factoryClassName = fallbackClassName;
- }
-
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(factoryClassName,
- cl,
- true);
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return providerClass;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + factoryClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider "+factoryClassName+" could not be instantiated: "+x,
- x);
- }
- } // lookUpFactoryClass(String,String,String):Class
-
- /**
- * Finds the name of the required implementation class in the specified
- * order. The specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return name of class that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static String lookUpFactoryClassName(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return systemProp;
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // Try to read from propertiesFilename, or
- // $java.home/lib/xalan.properties
- String factoryClassName = null;
- // no properties file name specified; use
- // $JAVA_HOME/lib/xalan.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXalanProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXalanProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xalan.properties
- // before (or it's outdeated)
- fXalanProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXalanProperties.load(fis);
- }
- } catch (Exception x) {
- fXalanProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXalanProperties != null) {
- factoryClassName = fXalanProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value="
- + factoryClassName);
- return factoryClassName;
- }
-
- // Try Jar Service Provider Mechanism
- return findJarServiceProviderName(factoryId);
- } // lookUpFactoryClass(String,String):String
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xalan
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the
- //class. Restrict the access to the package classes as specified in java.security policy.
- SecurityManager security = System.getSecurityManager();
- try{
- if (security != null){
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- }catch(SecurityException e){
- throw e;
- }
-
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /**
- * Find the name of service provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static String findJarServiceProviderName(String factoryId)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = SERVICES_PATH + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is));
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return factoryClassName;
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static class ConfigurationError
- extends Error {
- static final long serialVersionUID = 5122054096615067992L;
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * javax.xml.parsers.ObjectFactory
- * class and modified to be used as a general utility for creating objects
- * dynamically.
- *
- * @version $Id: ObjectFactory.java,v 1.7 2008/04/02 00:41:01 joehw Exp $
- */
-class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME =
- "xalan.properties";
-
- private static final String SERVICES_PATH = "META-INF/services/";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /** cache the contents of the xalan.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXalanProperties = null;
-
- /***
- * Cache the time stamp of the xalan.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // Public static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- Class factoryClass = lookUpFactoryClass(factoryId,
- propertiesFilename,
- fallbackClassName);
-
- if (factoryClass == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- try{
- Object instance = factoryClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of factory " + factoryId);
- return instance;
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider for factory " + factoryId
- + " could not be instantiated: " + x, x);
- }
- } // createObject(String,String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId)
- throws ConfigurationError
- {
- return lookUpFactoryClass(factoryId, null, null);
- } // lookUpFactoryClass(String):Class
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- String factoryClassName = lookUpFactoryClassName(factoryId,
- propertiesFilename,
- fallbackClassName);
- ClassLoader cl = findClassLoader();
-
- if (factoryClassName == null) {
- factoryClassName = fallbackClassName;
- }
-
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(factoryClassName,
- cl,
- true);
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return providerClass;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + factoryClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider "+factoryClassName+" could not be instantiated: "+x,
- x);
- }
- } // lookUpFactoryClass(String,String,String):Class
-
- /**
- * Finds the name of the required implementation class in the specified
- * order. The specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return name of class that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static String lookUpFactoryClassName(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return systemProp;
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // Try to read from propertiesFilename, or
- // $java.home/lib/xalan.properties
- String factoryClassName = null;
- // no properties file name specified; use
- // $JAVA_HOME/lib/xalan.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXalanProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXalanProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xalan.properties
- // before (or it's outdeated)
- fXalanProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXalanProperties.load(fis);
- }
- } catch (Exception x) {
- fXalanProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXalanProperties != null) {
- factoryClassName = fXalanProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value="
- + factoryClassName);
- return factoryClassName;
- }
-
- // Try Jar Service Provider Mechanism
- return findJarServiceProviderName(factoryId);
- } // lookUpFactoryClass(String,String):String
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xalan
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the
- //class. Restrict the access to the package classes as specified in java.security policy.
- SecurityManager security = System.getSecurityManager();
- try{
- if (security != null){
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- }catch(SecurityException e){
- throw e;
- }
-
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /**
- * Find the name of service provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static String findJarServiceProviderName(String factoryId)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = SERVICES_PATH + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is));
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return factoryClassName;
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static class ConfigurationError
- extends Error {
- static final long serialVersionUID = 7772782876036961354L;
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * javax.xml.parsers.ObjectFactory
- * class and modified to be used as a general utility for creating objects
- * dynamically.
- *
- * @xsl.usage internal
- */
-class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME =
- "xalan.properties";
-
- private static final String SERVICES_PATH = "META-INF/services/";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /** cache the contents of the xalan.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXalanProperties = null;
-
- /***
- * Cache the time stamp of the xalan.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // Public static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- Class factoryClass = lookUpFactoryClass(factoryId,
- propertiesFilename,
- fallbackClassName);
-
- if (factoryClass == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- try{
- Object instance = factoryClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of factory " + factoryId);
- return instance;
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider for factory " + factoryId
- + " could not be instantiated: " + x, x);
- }
- } // createObject(String,String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId)
- throws ConfigurationError
- {
- return lookUpFactoryClass(factoryId, null, null);
- } // lookUpFactoryClass(String):Class
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- String factoryClassName = lookUpFactoryClassName(factoryId,
- propertiesFilename,
- fallbackClassName);
- ClassLoader cl = findClassLoader();
-
- if (factoryClassName == null) {
- factoryClassName = fallbackClassName;
- }
-
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(factoryClassName,
- cl,
- true);
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return providerClass;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + factoryClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider "+factoryClassName+" could not be instantiated: "+x,
- x);
- }
- } // lookUpFactoryClass(String,String,String):Class
-
- /**
- * Finds the name of the required implementation class in the specified
- * order. The specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return name of class that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static String lookUpFactoryClassName(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return systemProp;
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // Try to read from propertiesFilename, or
- // $java.home/lib/xalan.properties
- String factoryClassName = null;
- // no properties file name specified; use
- // $JAVA_HOME/lib/xalan.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXalanProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXalanProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xalan.properties
- // before (or it's outdeated)
- fXalanProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXalanProperties.load(fis);
- }
- } catch (Exception x) {
- fXalanProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXalanProperties != null) {
- factoryClassName = fXalanProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value="
- + factoryClassName);
- return factoryClassName;
- }
-
- // Try Jar Service Provider Mechanism
- return findJarServiceProviderName(factoryId);
- } // lookUpFactoryClass(String,String):String
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xalan
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the
- //class. Restrict the access to the package classes as specified in java.security policy.
- SecurityManager security = System.getSecurityManager();
- try{
- if (security != null){
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- }catch(SecurityException e){
- throw e;
- }
-
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /**
- * Find the name of service provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static String findJarServiceProviderName(String factoryId)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = SERVICES_PATH + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is));
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return factoryClassName;
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static class ConfigurationError
- extends Error {
- static final long serialVersionUID = 8859254254255146542L;
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * javax.xml.parsers.ObjectFactory
- * class and modified to be used as a general utility for creating objects
- * dynamically.
- *
- * @version $Id: ObjectFactory.java,v 1.8 2008/04/02 00:41:01 joehw Exp $
- */
-class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME =
- "xalan.properties";
-
- private static final String SERVICES_PATH = "META-INF/services/";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /** cache the contents of the xalan.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXalanProperties = null;
-
- /***
- * Cache the time stamp of the xalan.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // Public static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- Class factoryClass = lookUpFactoryClass(factoryId,
- propertiesFilename,
- fallbackClassName);
-
- if (factoryClass == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- try{
- Object instance = factoryClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of factory " + factoryId);
- return instance;
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider for factory " + factoryId
- + " could not be instantiated: " + x, x);
- }
- } // createObject(String,String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId)
- throws ConfigurationError
- {
- return lookUpFactoryClass(factoryId, null, null);
- } // lookUpFactoryClass(String):Class
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- String factoryClassName = lookUpFactoryClassName(factoryId,
- propertiesFilename,
- fallbackClassName);
- ClassLoader cl = findClassLoader();
-
- if (factoryClassName == null) {
- factoryClassName = fallbackClassName;
- }
-
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(factoryClassName,
- cl,
- true);
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return providerClass;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + factoryClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider "+factoryClassName+" could not be instantiated: "+x,
- x);
- }
- } // lookUpFactoryClass(String,String,String):Class
-
- /**
- * Finds the name of the required implementation class in the specified
- * order. The specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return name of class that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static String lookUpFactoryClassName(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return systemProp;
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // Try to read from propertiesFilename, or
- // $java.home/lib/xalan.properties
- String factoryClassName = null;
- // no properties file name specified; use
- // $JAVA_HOME/lib/xalan.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXalanProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXalanProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xalan.properties
- // before (or it's outdeated)
- fXalanProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXalanProperties.load(fis);
- }
- } catch (Exception x) {
- fXalanProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXalanProperties != null) {
- factoryClassName = fXalanProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value="
- + factoryClassName);
- return factoryClassName;
- }
-
- // Try Jar Service Provider Mechanism
- return findJarServiceProviderName(factoryId);
- } // lookUpFactoryClass(String,String):String
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xalan
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the
- //class. Restrict the access to the package classes as specified in java.security policy.
- SecurityManager security = System.getSecurityManager();
- try{
- if (security != null){
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- }catch(SecurityException e){
- throw e;
- }
-
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /**
- * Find the name of service provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static String findJarServiceProviderName(String factoryId)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = SERVICES_PATH + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is));
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return factoryClassName;
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static class ConfigurationError
- extends Error {
- static final long serialVersionUID = 2036619216663421552L;
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- * javax.xml.parsers.ObjectFactory
- * class and modified to be used as a general utility for creating objects
- * dynamically.
- *
- * @version $Id: ObjectFactory.java,v 1.6 2008/04/02 00:41:02 joehw Exp $
- */
-class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME =
- "xalan.properties";
-
- private static final String SERVICES_PATH = "META-INF/services/";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /** cache the contents of the xalan.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXalanProperties = null;
-
- /***
- * Cache the time stamp of the xalan.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // Public static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return instance of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- Class factoryClass = lookUpFactoryClass(factoryId,
- propertiesFilename,
- fallbackClassName);
-
- if (factoryClass == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- try{
- Object instance = factoryClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of factory " + factoryId);
- return instance;
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider for factory " + factoryId
- + " could not be instantiated: " + x, x);
- }
- } // createObject(String,String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId)
- throws ConfigurationError
- {
- return lookUpFactoryClass(factoryId, null, null);
- } // lookUpFactoryClass(String):Class
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Class lookUpFactoryClass(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- String factoryClassName = lookUpFactoryClassName(factoryId,
- propertiesFilename,
- fallbackClassName);
- ClassLoader cl = findClassLoader();
-
- if (factoryClassName == null) {
- factoryClassName = fallbackClassName;
- }
-
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(factoryClassName,
- cl,
- true);
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return providerClass;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + factoryClassName + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider "+factoryClassName+" could not be instantiated: "+x,
- x);
- }
- } // lookUpFactoryClass(String,String,String):Class
-
- /**
- * Finds the name of the required implementation class in the specified
- * order. The specified order is the following:
- * System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return name of class that provides factory service, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xalan.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static String lookUpFactoryClassName(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return systemProp;
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // Try to read from propertiesFilename, or
- // $java.home/lib/xalan.properties
- String factoryClassName = null;
- // no properties file name specified; use
- // $JAVA_HOME/lib/xalan.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXalanProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXalanProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xalan.properties
- // before (or it's outdeated)
- fXalanProperties = new Properties();
- FileInputStream fis =
- ss.getFileInputStream(propertiesFile);
- fXalanProperties.load(fis);
- fis.close();
- }
- } catch (Exception x) {
- fXalanProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- }
- if(fXalanProperties != null) {
- factoryClassName = fXalanProperties.getProperty(factoryId);
- }
- } else {
- try {
- FileInputStream fis =
- ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- fis.close();
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value="
- + factoryClassName);
- return factoryClassName;
- }
-
- // Try Jar Service Provider Mechanism
- return findJarServiceProviderName(factoryId);
- } // lookUpFactoryClass(String,String):String
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xalan
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the
- //class. Restrict the access to the package classes as specified in java.security policy.
- SecurityManager security = System.getSecurityManager();
- if (security != null){
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1)
- packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
-
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /**
- * Find the name of service provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static String findJarServiceProviderName(String factoryId)
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = SERVICES_PATH + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"));
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is));
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- rd.close();
- } catch (IOException x) {
- // No provider found
- return null;
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return factoryClassName;
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static class ConfigurationError
- extends Error {
-
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
+ *
+ *
+ *
*
*
+ *
- *
*