This commit is contained in:
Phil Race 2017-07-17 09:14:23 -07:00
commit eae603822b
292 changed files with 5669 additions and 3715 deletions

View File

@ -1,3 +1,6 @@
43bf6f30fcba031ecf0cc7e511efe3a8179d0f77 jdk-9+176
d9f6bc6ba599d0487dc18b2fbdb6c34eedf6f958 jdk-9+177
bc9df7dd63ec76f50fafeb4acc44465044662f0a jdk-9+178
994036e74ab805bcc09afa0646be17a725bec42f jdk-9+175
94680c6d60ecd9ed3ffd1847706efde7eb947afc jdk-9+174
6dd7fda42bab7ecf648cafb0a4e9b4ca11b3094f jdk-9+173
@ -432,3 +435,4 @@ b0f2b8ff25a2209b2c807785d75f20e5086bbfc2 jdk-10+10
036dbf8b381798e5d31065109714d04d97bf98a4 jdk-10+11
e6d70017f5b9adbb2ec82d826973d0251800a3c3 jdk-10+12
9927a9f16738e240ab7014f0118f41e314ef8f99 jdk-10+13
9ef5029b247b4d940080417a287440bbdbab995b jdk-10+14

View File

@ -432,3 +432,6 @@ b94be69cbb1d2943b886bf2d458745756df146e4 jdk-10+9
8d4ed1e06fe184c9cb08c5b708e7d6f5c066644f jdk-10+12
8f7227c6012b0051ea4e0bcee040c627bf699b88 jdk-9+175
d67a3f1f057f7e31e12f33ebe3667cb73d252268 jdk-10+13
1fd5901544acc50bb30fde9388c8e53cb7c449e4 jdk-10+14
84777531d994ef70163d35078ec9c4127f2eadb5 jdk-9+176
a4371edb589c60db01142e45c317adb9ccbcb083 jdk-9+177

View File

@ -615,6 +615,8 @@ var getJibProfilesProfiles = function (input, common, data) {
}
var testOnlyProfilesPrebuilt = {
"run-test-prebuilt": {
target_os: input.build_os,
target_cpu: input.build_cpu,
src: "src.conf",
dependencies: [ "jtreg", "gnumake", "boot_jdk", testedProfile + ".jdk",
testedProfile + ".test", "src.full"
@ -635,13 +637,14 @@ var getJibProfilesProfiles = function (input, common, data) {
if (input.profile == "run-test-prebuilt") {
if (profiles[testedProfile] == null) {
error("testedProfile is not defined: " + testedProfile);
} else {
}
}
if (profiles[testedProfile] != null) {
testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_os"]
= profiles[testedProfile]["target_os"];
testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_cpu"]
= profiles[testedProfile]["target_cpu"];
}
}
profiles = concatObjects(profiles, testOnlyProfilesPrebuilt);
// On macosx add the devkit bin dir to the path in all the run-test profiles.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Testing OpenJDK</title>
<style type="text/css">code{white-space: pre;}</style>
<link rel="stylesheet" href="../../jdk/make/data/docs-resources/specs/resources/jdk-default.css">
<link rel="stylesheet" href="../../jdk/make/data/docs-resources/resources/jdk-default.css">
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->

View File

@ -432,3 +432,6 @@ c62e5964cfcf144d8f72e9ba69757897785349a9 jdk-9+171
00ae6307d78bac49883ddc85d687aa88c49f3971 jdk-10+12
dc78a3dd6b3a4f11cdae8a3e3d160e6a78bc7838 jdk-9+175
564fced058bd2c8375e9104aa8f9494642cd7bdd jdk-10+13
25d991a67cba240eeaf15c19c5857b40fdd71561 jdk-10+14
40fb9f229471ef357d493813d34b15afcce9f32b jdk-9+176
c72e9d3823f04cb3ef3166646dfea9e4c2769133 jdk-9+177

View File

@ -26,7 +26,7 @@
/**
* Defines the Java binding of the OMG CORBA APIs, and the RMI-IIOP API.
*
* <p> This module is upgradeble.
* <p> This module is upgradeable.
*
* @moduleGraph
* @since 9

View File

@ -592,3 +592,6 @@ e64b1cb48d6e7703928a9d1da106fc27f8cb65fd jdk-9+173
070aa7a2eb14c4645f7eb31384cba0a2ba72a4b5 jdk-10+12
8f04d457168b9f1f4a1b2c37f49e0513ca9d33a7 jdk-9+175
a9da03357f190807591177fe9846d6e68ad64fc0 jdk-10+13
e920b4d008d914f3414bd4630b58837cf0b7f08d jdk-10+14
2ab74e5dbdc2b6a962c865500cafd23cf387dc60 jdk-9+176
1ca8f038fceb88c640badf9bd18905205bc63b43 jdk-9+177

View File

@ -748,41 +748,3 @@ bool ArrayCopyNode::modifies(intptr_t offset_lo, intptr_t offset_hi, PhaseTransf
return false;
}
// We try to replace a load from the destination of an arraycopy with
// a load from the source so the arraycopy has a chance to be
// eliminated. It's only valid if the arraycopy doesn't change the
// element that would be loaded from the source array.
bool ArrayCopyNode::can_replace_dest_load_with_src_load(intptr_t offset_lo, intptr_t offset_hi, PhaseTransform* phase) const {
assert(_kind == ArrayCopy || _kind == CopyOf || _kind == CopyOfRange, "only for real array copies");
Node* src = in(Src);
Node* dest = in(Dest);
// Check whether, assuming source and destination are the same
// array, the arraycopy modifies the element from the source we
// would load.
if ((src != dest && in(SrcPos) == in(DestPos)) || !modifies(offset_lo, offset_hi, phase, false)) {
// if not the transformation is legal
return true;
}
AllocateNode* src_alloc = AllocateNode::Ideal_allocation(src, phase);
AllocateNode* dest_alloc = AllocateNode::Ideal_allocation(dest, phase);
// Check whether source and destination can be proved to be
// different arrays
const TypeOopPtr* t_src = phase->type(src)->isa_oopptr();
const TypeOopPtr* t_dest = phase->type(dest)->isa_oopptr();
if (t_src != NULL && t_dest != NULL &&
(t_src->is_known_instance() || t_dest->is_known_instance()) &&
t_src->instance_id() != t_dest->instance_id()) {
return true;
}
if (MemNode::detect_ptr_independence(src->uncast(), src_alloc, dest->uncast(), dest_alloc, phase)) {
return true;
}
return false;
}

View File

@ -168,7 +168,6 @@ public:
static bool may_modify(const TypeOopPtr *t_oop, MemBarNode* mb, PhaseTransform *phase, ArrayCopyNode*& ac);
bool modifies(intptr_t offset_lo, intptr_t offset_hi, PhaseTransform* phase, bool must_modify) const;
bool can_replace_dest_load_with_src_load(intptr_t offset_lo, intptr_t offset_hi, PhaseTransform* phase) const;
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;

View File

@ -5171,6 +5171,10 @@ bool LibraryCallKit::inline_arraycopy() {
Deoptimization::Action_make_not_entrant);
assert(stopped(), "Should be stopped");
}
const TypeKlassPtr* dest_klass_t = _gvn.type(dest_klass)->is_klassptr();
const Type *toop = TypeOopPtr::make_from_klass(dest_klass_t->klass());
src = _gvn.transform(new CheckCastPPNode(control(), src, toop));
}
arraycopy_move_allocation_here(alloc, dest, saved_jvms, saved_reexecute_sp, new_idx);

View File

@ -885,7 +885,7 @@ static bool skip_through_membars(Compile::AliasType* atp, const TypeInstPtr* tp,
// Is the value loaded previously stored by an arraycopy? If so return
// a load node that reads from the source array so we may be able to
// optimize out the ArrayCopy node later.
Node* LoadNode::can_see_arraycopy_value(Node* st, PhaseTransform* phase) const {
Node* LoadNode::can_see_arraycopy_value(Node* st, PhaseGVN* phase) const {
Node* ld_adr = in(MemNode::Address);
intptr_t ld_off = 0;
AllocateNode* ld_alloc = AllocateNode::Ideal_allocation(ld_adr, phase, ld_off);
@ -893,23 +893,27 @@ Node* LoadNode::can_see_arraycopy_value(Node* st, PhaseTransform* phase) const {
if (ac != NULL) {
assert(ac->is_ArrayCopy(), "what kind of node can this be?");
Node* ld = clone();
Node* mem = ac->in(TypeFunc::Memory);
Node* ctl = ac->in(0);
Node* src = ac->in(ArrayCopyNode::Src);
if (!ac->as_ArrayCopy()->is_clonebasic() && !phase->type(src)->isa_aryptr()) {
return NULL;
}
LoadNode* ld = clone()->as_Load();
Node* addp = in(MemNode::Address)->clone();
if (ac->as_ArrayCopy()->is_clonebasic()) {
assert(ld_alloc != NULL, "need an alloc");
Node* addp = in(MemNode::Address)->clone();
assert(addp->is_AddP(), "address must be addp");
assert(addp->in(AddPNode::Base) == ac->in(ArrayCopyNode::Dest)->in(AddPNode::Base), "strange pattern");
assert(addp->in(AddPNode::Address) == ac->in(ArrayCopyNode::Dest)->in(AddPNode::Address), "strange pattern");
addp->set_req(AddPNode::Base, ac->in(ArrayCopyNode::Src)->in(AddPNode::Base));
addp->set_req(AddPNode::Address, ac->in(ArrayCopyNode::Src)->in(AddPNode::Address));
ld->set_req(MemNode::Address, phase->transform(addp));
if (in(0) != NULL) {
assert(ld_alloc->in(0) != NULL, "alloc must have control");
ld->set_req(0, ld_alloc->in(0));
}
addp->set_req(AddPNode::Base, src->in(AddPNode::Base));
addp->set_req(AddPNode::Address, src->in(AddPNode::Address));
} else {
Node* src = ac->in(ArrayCopyNode::Src);
Node* addp = in(MemNode::Address)->clone();
assert(ac->as_ArrayCopy()->is_arraycopy_validated() ||
ac->as_ArrayCopy()->is_copyof_validated() ||
ac->as_ArrayCopy()->is_copyofrange_validated(), "only supported cases");
assert(addp->in(AddPNode::Base) == addp->in(AddPNode::Address), "should be");
addp->set_req(AddPNode::Base, src);
addp->set_req(AddPNode::Address, src);
@ -927,21 +931,17 @@ Node* LoadNode::can_see_arraycopy_value(Node* st, PhaseTransform* phase) const {
Node* offset = phase->transform(new AddXNode(addp->in(AddPNode::Offset), diff));
addp->set_req(AddPNode::Offset, offset);
ld->set_req(MemNode::Address, phase->transform(addp));
const TypeX *ld_offs_t = phase->type(offset)->isa_intptr_t();
if (!ac->as_ArrayCopy()->can_replace_dest_load_with_src_load(ld_offs_t->_lo, ld_offs_t->_hi, phase)) {
return NULL;
}
if (in(0) != NULL) {
assert(ac->in(0) != NULL, "alloc must have control");
ld->set_req(0, ac->in(0));
}
}
addp = phase->transform(addp);
#ifdef ASSERT
const TypePtr* adr_type = phase->type(addp)->is_ptr();
ld->_adr_type = adr_type;
#endif
ld->set_req(MemNode::Address, addp);
ld->set_req(0, ctl);
ld->set_req(MemNode::Memory, mem);
// load depends on the tests that validate the arraycopy
ld->as_Load()->_control_dependency = Pinned;
ld->_control_dependency = Pinned;
return ld;
}
return NULL;

View File

@ -270,7 +270,7 @@ protected:
const Type* load_array_final_field(const TypeKlassPtr *tkls,
ciKlass* klass) const;
Node* can_see_arraycopy_value(Node* st, PhaseTransform* phase) const;
Node* can_see_arraycopy_value(Node* st, PhaseGVN* phase) const;
// depends_only_on_test is almost always true, and needs to be almost always
// true to enable key hoisting & commoning optimizations. However, for the

View File

@ -0,0 +1,86 @@
/*
* Copyright (c) 2017, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 8181742
* @summary Loads that bypass arraycopy ends up with wrong memory state
*
* @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+StressGCM -XX:+StressLCM TestLoadBypassACWithWrongMem
*
*/
import java.util.Arrays;
public class TestLoadBypassACWithWrongMem {
static int test1(int[] src) {
int[] dst = new int[10];
System.arraycopy(src, 0, dst, 0, 10);
src[1] = 0x42;
// dst[1] is transformed to src[1], src[1] must use the
// correct memory state (not the store above).
return dst[1];
}
static int test2(int[] src) {
int[] dst = (int[])src.clone();
src[1] = 0x42;
// Same as above for clone
return dst[1];
}
static Object test5_src = null;
static int test3() {
int[] dst = new int[10];
System.arraycopy(test5_src, 0, dst, 0, 10);
((int[])test5_src)[1] = 0x42;
System.arraycopy(test5_src, 0, dst, 0, 10);
// dst[1] is transformed to test5_src[1]. test5_src is Object
// but test5_src[1] must be on the slice for int[] not
// Object+some offset.
return dst[1];
}
static public void main(String[] args) {
int[] src = new int[10];
for (int i = 0; i < 20000; i++) {
Arrays.fill(src, 0);
int res = test1(src);
if (res != 0) {
throw new RuntimeException("bad result: " + res + " != " + 0);
}
Arrays.fill(src, 0);
res = test2(src);
if (res != 0) {
throw new RuntimeException("bad result: " + res + " != " + 0);
}
Arrays.fill(src, 0);
test5_src = src;
res = test3();
if (res != 0x42) {
throw new RuntimeException("bad result: " + res + " != " + 0x42);
}
}
}
}

View File

@ -108,8 +108,8 @@ public class TestAnonymousClassUnloading {
*/
static public void main(String[] args) throws Exception {
// (1) Load an anonymous version of this class using the corresponding Unsafe method
URL classUrl = TestAnonymousClassUnloading.class.getResource(
TestAnonymousClassUnloading.class.getName().replace('.', '/') + ".class");
String rn = TestAnonymousClassUnloading.class.getSimpleName() + ".class";
URL classUrl = TestAnonymousClassUnloading.class.getResource(rn);
URLConnection connection = classUrl.openConnection();
int length = connection.getContentLength();

View File

@ -74,7 +74,7 @@ public class ClassLoadUnloadTest {
List<String> argsList = new ArrayList<>();
Collections.addAll(argsList, args);
Collections.addAll(argsList, "-Xmn8m");
Collections.addAll(argsList, "-Dtest.classes=" + System.getProperty("test.classes","."));
Collections.addAll(argsList, "-Dtest.class.path=" + System.getProperty("test.class.path", "."));
Collections.addAll(argsList, ClassUnloadTestMain.class.getName());
return ProcessTools.createJavaProcessBuilder(argsList.toArray(new String[argsList.size()]));
}

View File

@ -31,8 +31,10 @@ import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.stream.Stream;
public class ClassUnloadCommon {
public static class TestFailure extends RuntimeException {
@ -61,14 +63,45 @@ public class ClassUnloadCommon {
System.gc();
}
/**
* Creates a class loader that loads classes from {@code ${test.class.path}}
* before delegating to the system class loader.
*/
public static ClassLoader newClassLoader() {
String cp = System.getProperty("test.class.path", ".");
URL[] urls = Stream.of(cp.split(File.pathSeparator))
.map(Paths::get)
.map(ClassUnloadCommon::toURL)
.toArray(URL[]::new);
return new URLClassLoader(urls) {
@Override
public Class<?> loadClass(String cn, boolean resolve)
throws ClassNotFoundException
{
synchronized (getClassLoadingLock(cn)) {
Class<?> c = findLoadedClass(cn);
if (c == null) {
try {
return new URLClassLoader(new URL[] {
Paths.get(System.getProperty("test.classes",".") + File.separatorChar + "classes").toUri().toURL(),
}, null);
} catch (MalformedURLException e){
throw new RuntimeException("Unexpected URL conversion failure", e);
}
c = findClass(cn);
} catch (ClassNotFoundException e) {
c = getParent().loadClass(cn);
}
}
if (resolve) {
resolveClass(c);
}
return c;
}
}
};
}
static URL toURL(Path path) {
try {
return path.toUri().toURL();
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
}
}

View File

@ -432,3 +432,6 @@ b9c0b105002272d7414c8b34af9aded151f9cad6 jdk-9+174
ff293e39e83366c40a5687dacd1ccb2305ed2c1e jdk-10+12
736412a8dccee9d439044e6b1af2e7470d0a3563 jdk-9+175
5d374af9e78d02976e0e7f8dc2706f91a020f025 jdk-10+13
4d05f673cf773f1c20e8f5a879d64115d2f741d9 jdk-10+14
38cf34e2328070cc691c4f136e6dde1a44c04171 jdk-9+176
332ad9f92632f56f337b8c40edef9a95a42b26bc jdk-9+177

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2017, 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
@ -114,7 +114,7 @@ public class virtual_parse_stack {
real_next++;
/* put the state number from the Symbol onto the virtual stack */
vstack.push(new Integer(stack_sym.parse_state));
vstack.push(stack_sym.parse_state);
}
/*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
@ -161,7 +161,7 @@ public class virtual_parse_stack {
/** Push a state number onto the stack. */
public void push(int state_num)
{
vstack.push(new Integer(state_num));
vstack.push(state_num);
}
/*-----------------------------------------------------------*/

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -104,6 +103,6 @@ public final class ConstantDouble extends Constant implements ConstantObject {
/** @return Double object
*/
public Object getConstantValue(ConstantPool cp) {
return new Double(bytes);
return bytes;
}
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -103,6 +102,6 @@ public final class ConstantFloat extends Constant implements ConstantObject {
/** @return Float object
*/
public Object getConstantValue(ConstantPool cp) {
return new Float(bytes);
return bytes;
}
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -109,6 +108,6 @@ public final class ConstantInteger extends Constant implements ConstantObject {
/** @return Integer object
*/
public Object getConstantValue(ConstantPool cp) {
return new Integer(bytes);
return bytes;
}
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -101,6 +100,6 @@ public final class ConstantLong extends Constant implements ConstantObject {
/** @return Long object
*/
public Object getConstantValue(ConstantPool cp) {
return new Long(bytes);
return bytes;
}
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -425,7 +424,7 @@ public class JavaClass extends AccessFlags implements Cloneable, Node {
}
if(debug != null)
JavaClass.debug = new Boolean(debug).booleanValue();
JavaClass.debug = Boolean.valueOf(debug);
if(sep != null)
try {

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -72,7 +71,7 @@ public class BIPUSH extends Instruction implements ConstantPushInstruction {
b = bytes.readByte();
}
public Number getValue() { return new Integer(b); }
public Number getValue() { return Integer.valueOf(b); }
/** @return Type.BYTE
*/

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -52,7 +51,7 @@ public class DCONST extends Instruction
value = f;
}
public Number getValue() { return new Double(value); }
public Number getValue() { return Double.valueOf(value); }
/** @return Type.DOUBLE
*/

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -54,7 +53,7 @@ public class FCONST extends Instruction
value = f;
}
public Number getValue() { return new Float(value); }
public Number getValue() { return Float.valueOf(value); }
/** @return Type.FLOAT
*/

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -95,56 +94,56 @@ public class FieldGen extends FieldGenOrMethodGen {
checkType(Type.LONG);
if(l != 0L)
value = new Long(l);
value = Long.valueOf(l);
}
public void setInitValue(int i) {
checkType(Type.INT);
if(i != 0)
value = new Integer(i);
value = Integer.valueOf(i);
}
public void setInitValue(short s) {
checkType(Type.SHORT);
if(s != 0)
value = new Integer(s);
value = Integer.valueOf(s);
}
public void setInitValue(char c) {
checkType(Type.CHAR);
if(c != 0)
value = new Integer(c);
value = Integer.valueOf(c);
}
public void setInitValue(byte b) {
checkType(Type.BYTE);
if(b != 0)
value = new Integer(b);
value = Integer.valueOf(b);
}
public void setInitValue(boolean b) {
checkType(Type.BOOLEAN);
if(b)
value = new Integer(1);
value = Integer.valueOf(1);
}
public void setInitValue(float f) {
checkType(Type.FLOAT);
if(f != 0.0)
value = new Float(f);
value = Float.valueOf(f);
}
public void setInitValue(double d) {
checkType(Type.DOUBLE);
if(d != 0.0)
value = new Double(d);
value = Double.valueOf(d);
}
/** Remove any initial value.

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -50,7 +49,7 @@ public class ICONST extends Instruction
value = i;
}
public Number getValue() { return new Integer(value); }
public Number getValue() { return Integer.valueOf(value); }
/** @return Type.INT
*/

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -23,7 +22,6 @@ package com.sun.org.apache.bcel.internal.generic;
import com.sun.org.apache.bcel.internal.Constants;
import com.sun.org.apache.bcel.internal.classfile.Utility;
import com.sun.org.apache.bcel.internal.classfile.ConstantPool;
import java.io.*;
import com.sun.org.apache.bcel.internal.util.ByteSequence;
@ -165,7 +163,7 @@ public abstract class Instruction implements Cloneable, Serializable {
}
try {
obj = (Instruction)clazz.newInstance();
obj = (Instruction)clazz.getConstructor().newInstance();
if(wide && !((obj instanceof LocalVariableInstruction) ||
(obj instanceof IINC) ||

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -455,7 +454,7 @@ public class InstructionFactory
Instruction i = null;
try {
i = (Instruction)java.lang.Class.forName(name).newInstance();
i = (Instruction)java.lang.Class.forName(name).getConstructor().newInstance();
} catch(Exception e) {
throw new RuntimeException("Could not find instruction: " + name);
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -52,7 +51,7 @@ public class LCONST extends Instruction
value = l;
}
public Number getValue() { return new Long(value); }
public Number getValue() { return Long.valueOf(value); }
/** @return Type.LONG
*/

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -96,10 +95,10 @@ public class LDC extends CPInstruction
return ((com.sun.org.apache.bcel.internal.classfile.ConstantUtf8)c).getBytes();
case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Float:
return new Float(((com.sun.org.apache.bcel.internal.classfile.ConstantFloat)c).getBytes());
return Float.valueOf(((com.sun.org.apache.bcel.internal.classfile.ConstantFloat)c).getBytes());
case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Integer:
return new Integer(((com.sun.org.apache.bcel.internal.classfile.ConstantInteger)c).getBytes());
return Integer.valueOf(((com.sun.org.apache.bcel.internal.classfile.ConstantInteger)c).getBytes());
default: // Never reached
throw new RuntimeException("Unknown or invalid constant type at " + index);

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -55,10 +54,10 @@ public class LDC2_W extends CPInstruction
switch(c.getTag()) {
case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Long:
return new Long(((com.sun.org.apache.bcel.internal.classfile.ConstantLong)c).getBytes());
return Long.valueOf(((com.sun.org.apache.bcel.internal.classfile.ConstantLong)c).getBytes());
case com.sun.org.apache.bcel.internal.Constants.CONSTANT_Double:
return new Double(((com.sun.org.apache.bcel.internal.classfile.ConstantDouble)c).getBytes());
return Double.valueOf(((com.sun.org.apache.bcel.internal.classfile.ConstantDouble)c).getBytes());
default: // Never reached
throw new RuntimeException("Unknown or invalid constant type at " + index);

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -69,7 +68,7 @@ public class SIPUSH extends Instruction implements ConstantPushInstruction {
b = bytes.readShort();
}
public Number getValue() { return new Integer(b); }
public Number getValue() { return Integer.valueOf(b); }
/** @return Type.SHORT
*/

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -172,7 +171,7 @@ public final class SecuritySupport {
static long getLastModified(final File f) {
return ((Long) AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return new Long(f.lastModified());
return f.lastModified();
}
})).longValue();
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -375,7 +374,7 @@ public class ExsltMath extends ExsltBase
if (value != null)
{
int bits = new Double(precision).intValue();
int bits = (int)precision;
if (bits <= value.length())
value = value.substring(0, bits);

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -124,7 +123,7 @@ public class ObjectFactory {
ClassLoader cl = System.getSecurityManager()!=null ? null : findClassLoader();
try{
Class providerClass = findProviderClass(className, cl, doFallback);
Object instance = providerClass.newInstance();
Object instance = providerClass.getConstructor().newInstance();
debugPrintln(()->"created new instance of " + providerClass +
" using ClassLoader: " + cl);
return instance;

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -177,7 +176,7 @@ public final class SecuritySupport {
static long getLastModified(final File f) {
return ((Long) AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return new Long(f.lastModified());
return f.lastModified();
}
})).longValue();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -1005,7 +1005,7 @@ public class Parser implements Constants, ContentHandler {
if (className != null) {
try {
final Class<?> clazz = ObjectFactory.findProviderClass(className, true);
node = (SyntaxTreeNode)clazz.newInstance();
node = (SyntaxTreeNode)clazz.getDeclaredConstructor().newInstance();
node.setQName(qname);
node.setParser(this);
if (_locator != null) {

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -875,7 +874,7 @@ return newSymbol(sym.EOF);
case -21:
break;
case 21:
{ return newSymbol(sym.INT, new Long(yytext())); }
{ return newSymbol(sym.INT, Long.valueOf(yytext())); }
case -22:
break;
case 22:
@ -903,7 +902,7 @@ return newSymbol(sym.EOF);
case -28:
break;
case 28:
{ return newSymbol(sym.REAL, new Double(yytext())); }
{ return newSymbol(sym.REAL, Double.valueOf(yytext())); }
case -29:
break;
case 29:
@ -929,7 +928,7 @@ return newSymbol(sym.EOF);
case -34:
break;
case 34:
{ return newSymbol(sym.REAL, new Double(yytext())); }
{ return newSymbol(sym.REAL, Double.valueOf(yytext())); }
case -35:
break;
case 35:
@ -1057,11 +1056,11 @@ return newSymbol(sym.EOF);
case -66:
break;
case 67:
{ return newSymbol(sym.INT, new Long(yytext())); }
{ return newSymbol(sym.INT, Long.valueOf(yytext())); }
case -67:
break;
case 68:
{ return newSymbol(sym.REAL, new Double(yytext())); }
{ return newSymbol(sym.REAL, Double.valueOf(yytext())); }
case -68:
break;
case 70:

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2017, 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
@ -1342,7 +1342,7 @@ class CUP$XPathParser$actions {
case 120: // NodeTest ::= PI
{
Object RESULT = null;
RESULT = new Integer(NodeTest.PI);
RESULT = Integer.valueOf(NodeTest.PI);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1371,7 +1371,7 @@ class CUP$XPathParser$actions {
case 118: // NodeTest ::= COMMENT
{
Object RESULT = null;
RESULT = new Integer(NodeTest.COMMENT);
RESULT = Integer.valueOf(NodeTest.COMMENT);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1380,7 +1380,7 @@ class CUP$XPathParser$actions {
case 117: // NodeTest ::= TEXT
{
Object RESULT = null;
RESULT = new Integer(NodeTest.TEXT);
RESULT = Integer.valueOf(NodeTest.TEXT);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1389,7 +1389,7 @@ class CUP$XPathParser$actions {
case 116: // NodeTest ::= NODE
{
Object RESULT = null;
RESULT = new Integer(NodeTest.ANODE);
RESULT = Integer.valueOf(NodeTest.ANODE);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(25/*NodeTest*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1815,7 +1815,7 @@ class CUP$XPathParser$actions {
case 96: // AxisName ::= SELF
{
Integer RESULT = null;
RESULT = new Integer(Axis.SELF);
RESULT = Integer.valueOf(Axis.SELF);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1824,7 +1824,7 @@ class CUP$XPathParser$actions {
case 95: // AxisName ::= PRECEDINGSIBLING
{
Integer RESULT = null;
RESULT = new Integer(Axis.PRECEDINGSIBLING);
RESULT = Integer.valueOf(Axis.PRECEDINGSIBLING);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1833,7 +1833,7 @@ class CUP$XPathParser$actions {
case 94: // AxisName ::= PRECEDING
{
Integer RESULT = null;
RESULT = new Integer(Axis.PRECEDING);
RESULT = Integer.valueOf(Axis.PRECEDING);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1842,7 +1842,7 @@ class CUP$XPathParser$actions {
case 93: // AxisName ::= PARENT
{
Integer RESULT = null;
RESULT = new Integer(Axis.PARENT);
RESULT = Integer.valueOf(Axis.PARENT);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1851,7 +1851,7 @@ class CUP$XPathParser$actions {
case 92: // AxisName ::= NAMESPACE
{
Integer RESULT = null;
RESULT = new Integer(Axis.NAMESPACE);
RESULT = Integer.valueOf(Axis.NAMESPACE);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1860,7 +1860,7 @@ class CUP$XPathParser$actions {
case 91: // AxisName ::= FOLLOWINGSIBLING
{
Integer RESULT = null;
RESULT = new Integer(Axis.FOLLOWINGSIBLING);
RESULT = Integer.valueOf(Axis.FOLLOWINGSIBLING);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1869,7 +1869,7 @@ class CUP$XPathParser$actions {
case 90: // AxisName ::= FOLLOWING
{
Integer RESULT = null;
RESULT = new Integer(Axis.FOLLOWING);
RESULT = Integer.valueOf(Axis.FOLLOWING);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1878,7 +1878,7 @@ class CUP$XPathParser$actions {
case 89: // AxisName ::= DESCENDANTORSELF
{
Integer RESULT = null;
RESULT = new Integer(Axis.DESCENDANTORSELF);
RESULT = Integer.valueOf(Axis.DESCENDANTORSELF);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1887,7 +1887,7 @@ class CUP$XPathParser$actions {
case 88: // AxisName ::= DESCENDANT
{
Integer RESULT = null;
RESULT = new Integer(Axis.DESCENDANT);
RESULT = Integer.valueOf(Axis.DESCENDANT);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1896,7 +1896,7 @@ class CUP$XPathParser$actions {
case 87: // AxisName ::= CHILD
{
Integer RESULT = null;
RESULT = new Integer(Axis.CHILD);
RESULT = Integer.valueOf(Axis.CHILD);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1905,7 +1905,7 @@ class CUP$XPathParser$actions {
case 86: // AxisName ::= ATTRIBUTE
{
Integer RESULT = null;
RESULT = new Integer(Axis.ATTRIBUTE);
RESULT = Integer.valueOf(Axis.ATTRIBUTE);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1914,7 +1914,7 @@ class CUP$XPathParser$actions {
case 85: // AxisName ::= ANCESTORORSELF
{
Integer RESULT = null;
RESULT = new Integer(Axis.ANCESTORORSELF);
RESULT = Integer.valueOf(Axis.ANCESTORORSELF);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1923,7 +1923,7 @@ class CUP$XPathParser$actions {
case 84: // AxisName ::= ANCESTOR
{
Integer RESULT = null;
RESULT = new Integer(Axis.ANCESTOR);
RESULT = Integer.valueOf(Axis.ANCESTOR);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(40/*AxisName*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -1932,7 +1932,7 @@ class CUP$XPathParser$actions {
case 83: // AxisSpecifier ::= ATSIGN
{
Integer RESULT = null;
RESULT = new Integer(Axis.ATTRIBUTE);
RESULT = Integer.valueOf(Axis.ATTRIBUTE);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(41/*AxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -2697,7 +2697,7 @@ class CUP$XPathParser$actions {
case 35: // ChildOrAttributeAxisSpecifier ::= ATTRIBUTE DCOLON
{
Integer RESULT = null;
RESULT = new Integer(Axis.ATTRIBUTE);
RESULT = Integer.valueOf(Axis.ATTRIBUTE);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(42/*ChildOrAttributeAxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -2706,7 +2706,7 @@ class CUP$XPathParser$actions {
case 34: // ChildOrAttributeAxisSpecifier ::= CHILD DCOLON
{
Integer RESULT = null;
RESULT = new Integer(Axis.CHILD);
RESULT = Integer.valueOf(Axis.CHILD);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(42/*ChildOrAttributeAxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-1)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -2715,7 +2715,7 @@ class CUP$XPathParser$actions {
case 33: // ChildOrAttributeAxisSpecifier ::= ATSIGN
{
Integer RESULT = null;
RESULT = new Integer(Axis.ATTRIBUTE);
RESULT = Integer.valueOf(Axis.ATTRIBUTE);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(42/*ChildOrAttributeAxisSpecifier*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -2745,7 +2745,7 @@ class CUP$XPathParser$actions {
case 30: // NodeTestPattern ::= PI
{
Object RESULT = null;
RESULT = new Integer(NodeTest.PI);
RESULT = Integer.valueOf(NodeTest.PI);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -2754,7 +2754,7 @@ class CUP$XPathParser$actions {
case 29: // NodeTestPattern ::= COMMENT
{
Object RESULT = null;
RESULT = new Integer(NodeTest.COMMENT);
RESULT = Integer.valueOf(NodeTest.COMMENT);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -2763,7 +2763,7 @@ class CUP$XPathParser$actions {
case 28: // NodeTestPattern ::= TEXT
{
Object RESULT = null;
RESULT = new Integer(NodeTest.TEXT);
RESULT = Integer.valueOf(NodeTest.TEXT);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;
@ -2772,7 +2772,7 @@ class CUP$XPathParser$actions {
case 27: // NodeTestPattern ::= NODE
{
Object RESULT = null;
RESULT = new Integer(NodeTest.ANODE);
RESULT = Integer.valueOf(NodeTest.ANODE);
CUP$XPathParser$result = new com.sun.java_cup.internal.runtime.Symbol(33/*NodeTestPattern*/, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).left, ((com.sun.java_cup.internal.runtime.Symbol)CUP$XPathParser$stack.elementAt(CUP$XPathParser$top-0)).right, RESULT);
}
return CUP$XPathParser$result;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -342,7 +342,7 @@ public final class XSLTC {
_elements = new HashMap<>();
_attributes = new HashMap<>();
_namespaces = new HashMap<>();
_namespaces.put("",new Integer(_nextNSType));
_namespaces.put("", _nextNSType);
_namesIndex = new Vector(128);
_namespaceIndex = new Vector(32);
_namespacePrefixes = new HashMap<>();
@ -852,7 +852,7 @@ public final class XSLTC {
_namespaces.put(namespaceURI,code);
_namespaceIndex.addElement(namespaceURI);
}
return code.intValue();
return code;
}
public int nextModeSerial() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -35,7 +35,7 @@ import java.io.File;
import java.io.PrintWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLDecoder;
import java.nio.file.Paths;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@ -199,7 +199,7 @@ public final class DocumentCache implements DOMCache {
// Check for a "file:" URI (courtesy of Brian Ewins)
if (timestamp == 0){ // get 0 for local URI
if ("file".equals(url.getProtocol())){
File localfile = new File(URLDecoder.decode(url.getFile()));
File localfile = Paths.get(url.toURI()).toFile();
timestamp = localfile.lastModified();
}
}

View File

@ -94,7 +94,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
if (_currentDocumentNode != rootNode) {
_currentDocumentNode = rootNode;
_index = new HashMap<>();
_rootToIndexMap.put(new Integer(rootNode), _index);
_rootToIndexMap.put(rootNode, _index);
}
IntegerArray nodes = _index.get(value);
@ -178,7 +178,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
int ident = _enhancedDOM.getElementById(id);
if (ident != DTM.NULL) {
Integer root = new Integer(_enhancedDOM.getDocument());
Integer root = _enhancedDOM.getDocument();
Map<String, IntegerArray> index = _rootToIndexMap.get(root);
if (index == null) {
@ -247,7 +247,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
// Get the mapping table for the document containing the context node
Map<String, IntegerArray> index =
_rootToIndexMap.get(new Integer(rootHandle));
_rootToIndexMap.get(rootHandle);
// Split argument to id function into XML whitespace separated tokens
final StringTokenizer values = new StringTokenizer(string, " \n\t");
@ -298,7 +298,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
// Get the mapping table for the document containing the context node
Map<String,IntegerArray> index =
_rootToIndexMap.get(new Integer(rootHandle));
_rootToIndexMap.get(rootHandle);
// Check whether the context node is present in the set of nodes
// returned by the key function
@ -701,7 +701,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
IntegerArray result = null;
// Get mapping from key values/IDs to DTM nodes for this document
Map<String, IntegerArray> index = _rootToIndexMap.get(new Integer(root));
Map<String, IntegerArray> index = _rootToIndexMap.get(root);
if (!_isKeyIterator) {
// For id function, tokenize argument as whitespace separated

View File

@ -187,11 +187,11 @@ public abstract class NodeSortRecord {
translet, _last);
Double num;
try {
num = new Double(str);
num = Double.parseDouble(str);
}
// Treat number as NaN if it cannot be parsed as a double
catch (NumberFormatException e) {
num = new Double(Double.NEGATIVE_INFINITY);
num = Double.NEGATIVE_INFINITY;
}
_values[_scanned++] = num;
return(num);

View File

@ -26,6 +26,7 @@ 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.lang.reflect.InvocationTargetException;
import java.util.Locale;
import java.text.Collator;
@ -148,10 +149,17 @@ public class NodeSortRecordFactory {
SecurityException,
TransletException {
final NodeSortRecord sortRecord =
(NodeSortRecord)_class.newInstance();
try {
final NodeSortRecord sortRecord;
//NodeSortRecord subclasses are generated with a public empty constructor
// refer to com.sun.org.apache.xalan.internal.xsltc.compiler.Sort::compileInit
sortRecord = (NodeSortRecord)_class.getConstructor().newInstance();
sortRecord.initialize(node, last, _dom, _sortSettings);
return sortRecord;
} catch (NoSuchMethodException | IllegalArgumentException |
InvocationTargetException ex) {
throw new InstantiationException(ex.getMessage());
}
}
public String getClassName() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -471,7 +471,7 @@ public final class SAXImpl extends SAX2DTM2
return 0;
}
int eType = getIdForNamespace(s);
return _nsIndex.get(new Integer(eType));
return _nsIndex.get(eType);
}
@ -672,7 +672,7 @@ public final class SAXImpl extends SAX2DTM2
for (i=0; i<nsLength; i++) {
int eType = getIdForNamespace(namespaces[i]);
Integer type = _nsIndex.get(new Integer(eType));
Integer type = _nsIndex.get(eType);
if (type != null) {
result[type] = (short)i;
}
@ -692,7 +692,7 @@ public final class SAXImpl extends SAX2DTM2
for (i = 0; i < length; i++) {
int eType = getIdForNamespace(namespaces[i]);
Integer type = _nsIndex.get(new Integer(eType));
Integer type = _nsIndex.get(eType);
result[i] = (type == null) ? -1 : type.shortValue();
}
@ -900,7 +900,7 @@ public final class SAXImpl extends SAX2DTM2
this.startElement(uri, localName, qname, attributes);
if (m_buildIdIndex) {
_node2Ids.put(node, new Integer(m_parents.peek()));
_node2Ids.put(node, m_parents.peek());
}
}
@ -979,7 +979,7 @@ public final class SAXImpl extends SAX2DTM2
throws SAXException
{
// Check if the URI already exists before pushing on stack
Integer eType = new Integer(getIdForNamespace(uri));
Integer eType = getIdForNamespace(uri);
if (_nsIndex.get(eType) == null) {
_nsIndex.put(eType, _uriCount++);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -155,7 +155,7 @@ public abstract class AbstractTranslet implements Translet {
* Push a new parameter frame.
*/
public final void pushParamFrame() {
paramsStack.add(pframe, new Integer(pbase));
paramsStack.add(pframe, pbase);
pbase = ++pframe;
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -28,6 +27,7 @@ import org.xml.sax.AttributeList;
* @author Jacek Ambroziak
* @author Santiago Pericas-Geertsen
*/
@SuppressWarnings("deprecation")
public final class Attributes implements AttributeList {
private int _element;
private DOM _document;

View File

@ -746,11 +746,11 @@ public final class BasisLibrary {
// If node-boolean comparison -> convert node to boolean
if (left instanceof Node || right instanceof Node) {
if (left instanceof Boolean) {
right = new Boolean(booleanF(right));
right = booleanF(right);
hasSimpleArgs = true;
}
if (right instanceof Boolean) {
left = new Boolean(booleanF(left));
left = booleanF(left);
hasSimpleArgs = true;
}
}

View File

@ -43,6 +43,7 @@ import java.lang.module.ModuleDescriptor;
import java.lang.module.ModuleFinder;
import java.lang.module.ModuleReference;
import java.lang.module.ModuleReader;
import java.lang.reflect.InvocationTargetException;
import java.security.AccessController;
import java.security.CodeSigner;
import java.security.CodeSource;
@ -549,7 +550,8 @@ public final class TemplatesImpl implements Templates, Serializable {
// The translet needs to keep a reference to all its auxiliary
// class to prevent the GC from collecting them
AbstractTranslet translet = (AbstractTranslet) _class[_transletIndex].newInstance();
AbstractTranslet translet = (AbstractTranslet)
_class[_transletIndex].getConstructor().newInstance();
translet.postInitialization();
translet.setTemplates(this);
translet.setServicesMechnism(_useServicesMechanism);
@ -560,13 +562,10 @@ public final class TemplatesImpl implements Templates, Serializable {
return translet;
}
catch (InstantiationException e) {
catch (InstantiationException | IllegalAccessException |
NoSuchMethodException | InvocationTargetException e) {
ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name);
throw new TransformerConfigurationException(err.toString());
}
catch (IllegalAccessException e) {
ErrorMsg err = new ErrorMsg(ErrorMsg.TRANSLET_OBJECT_ERR, _name);
throw new TransformerConfigurationException(err.toString());
throw new TransformerConfigurationException(err.toString(), e);
}
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -49,6 +48,7 @@ import org.xml.sax.helpers.XMLReaderFactory;
* @author Santiago Pericas-Geertsen
* @author G. Todd Miller
*/
@SuppressWarnings("deprecation") //org.xml.sax.helpers.XMLReaderFactory
public class TrAXFilter extends XMLFilterImpl {
private Templates _templates;
private TransformerImpl _transformer;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -55,6 +55,7 @@ import org.xml.sax.helpers.XMLReaderFactory;
*
* Added Catalog Support for URI resolution
*/
@SuppressWarnings("deprecation") //org.xml.sax.helpers.XMLReaderFactory
public final class Util {
public static String baseName(String name) {

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -25,9 +24,7 @@ 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;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;
@ -345,14 +342,8 @@ public class CoreDOMImplementationImpl
* reference to the default error handler.
*/
public LSSerializer createLSSerializer() {
try {
return new com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl();
}
catch (Exception e) {}
// Fall back to Xerces' deprecated serializer if
// the Xalan based serializer is unavailable.
return new DOMSerializerImpl();
}
/**
* DOM Level 3 LS CR - Experimental.

View File

@ -1473,12 +1473,12 @@ public class CoreDocumentImpl
if (nodeTable == null) {
nodeTable = new HashMap<>();
num = --nodeCounter;
nodeTable.put(node, new Integer(num));
nodeTable.put(node, num);
} else {
Integer n = (Integer) nodeTable.get(node);
if (n == null) {
num = --nodeCounter;
nodeTable.put(node, new Integer(num));
nodeTable.put(node, num);
} else {
num = n.intValue();
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -1831,7 +1830,7 @@ public class DOMNormalizer implements XMLDocumentHandler {
// flag to "true" which may overwrite a "false"
// value from the attribute list.
boolean specified = attr.getSpecified();
attr.setValue(attrPSVI.getSchemaNormalizedValue());
attr.setValue(attrPSVI.getSchemaValue().getNormalizedValue());
if (!specified) {
((AttrImpl) attr).setSpecified(specified);
}
@ -1972,7 +1971,7 @@ public class DOMNormalizer implements XMLDocumentHandler {
((PSVIElementNSImpl) fCurrentNode).setPSVI(elementPSVI);
}
// include element default content (if one is available)
String normalizedValue = elementPSVI.getSchemaNormalizedValue();
String normalizedValue = elementPSVI.getSchemaValue().getNormalizedValue();
if ((fConfiguration.features & DOMConfigurationImpl.DTNORMALIZATION) != 0) {
if (normalizedValue !=null)
elementNode.setTextContent(normalizedValue);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -472,42 +472,6 @@ public class DeferredDocumentImpl
return attrNodeIndex;
}
/**
* Sets an attribute on an element node.
* @deprecated
*/
@Deprecated
public int setDeferredAttribute(int elementNodeIndex,
String attrName, String attrURI,
String attrValue, boolean specified) {
// create attribute
int attrNodeIndex = createDeferredAttribute(attrName, attrURI,
attrValue, specified);
int attrChunk = attrNodeIndex >> CHUNK_SHIFT;
int attrIndex = attrNodeIndex & CHUNK_MASK;
// set attribute's parent to element
setChunkIndex(fNodeParent, elementNodeIndex, attrChunk, attrIndex);
int elementChunk = elementNodeIndex >> CHUNK_SHIFT;
int elementIndex = elementNodeIndex & CHUNK_MASK;
// get element's last attribute
int lastAttrNodeIndex = getChunkIndex(fNodeExtra,
elementChunk, elementIndex);
if (lastAttrNodeIndex != 0) {
// add link from new attribute to last attribute
setChunkIndex(fNodePrevSib, lastAttrNodeIndex,
attrChunk, attrIndex);
}
// add link from element to new last attribute
setChunkIndex(fNodeExtra, attrNodeIndex,
elementChunk, elementIndex);
// return node index
return attrNodeIndex;
} // setDeferredAttribute(int,String,String,String,boolean):int
/** Creates an attribute in the table. */
public int createDeferredAttribute(String attrName, String attrValue,
boolean specified) {

View File

@ -1,3 +1,6 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -108,6 +111,7 @@ public class PSVIAttrNSImpl extends AttrNSImpl implements AttributePSVI {
* @return The canonical lexical representation of the declaration's {value constraint} value.
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_default>XML Schema Part 1: Structures [schema default]</a>
*/
@SuppressWarnings("deprecation")
public String getSchemaDefault() {
return fDeclaration == null ? null : fDeclaration.getConstraintValue();
}
@ -119,6 +123,7 @@ public class PSVIAttrNSImpl extends AttrNSImpl implements AttributePSVI {
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_normalized_value>XML Schema Part 1: Structures [schema normalized value]</a>
* @return the normalized value of this item after validation
*/
@Deprecated
public String getSchemaNormalizedValue() {
return fValue.getNormalizedValue();
}
@ -237,6 +242,7 @@ public class PSVIAttrNSImpl extends AttrNSImpl implements AttributePSVI {
/* (non-Javadoc)
* @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValue()
*/
@Deprecated
public Object getActualNormalizedValue() {
return fValue.getActualValue();
}
@ -244,6 +250,7 @@ public class PSVIAttrNSImpl extends AttrNSImpl implements AttributePSVI {
/* (non-Javadoc)
* @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValueType()
*/
@Deprecated
public short getActualNormalizedValueType() {
return fValue.getActualValueType();
}
@ -251,6 +258,7 @@ public class PSVIAttrNSImpl extends AttrNSImpl implements AttributePSVI {
/* (non-Javadoc)
* @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getItemValueTypes()
*/
@Deprecated
public ShortList getItemValueTypes() {
return fValue.getListValueTypes();
}

View File

@ -1,3 +1,6 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@ -119,6 +122,7 @@ public class PSVIElementNSImpl extends ElementNSImpl implements ElementPSVI {
* @return The canonical lexical representation of the declaration's {value constraint} value.
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_default>XML Schema Part 1: Structures [schema default]</a>
*/
@SuppressWarnings("deprecation")
public String getSchemaDefault() {
return fDeclaration == null ? null : fDeclaration.getConstraintValue();
}
@ -130,6 +134,7 @@ public class PSVIElementNSImpl extends ElementNSImpl implements ElementPSVI {
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_normalized_value>XML Schema Part 1: Structures [schema normalized value]</a>
* @return the normalized value of this item after validation
*/
@Deprecated
public String getSchemaNormalizedValue() {
return fValue.getNormalizedValue();
}
@ -285,6 +290,7 @@ public class PSVIElementNSImpl extends ElementNSImpl implements ElementPSVI {
/* (non-Javadoc)
* @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValue()
*/
@Deprecated
public Object getActualNormalizedValue() {
return fValue.getActualValue();
}
@ -292,6 +298,7 @@ public class PSVIElementNSImpl extends ElementNSImpl implements ElementPSVI {
/* (non-Javadoc)
* @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValueType()
*/
@Deprecated
public short getActualNormalizedValueType() {
return fValue.getActualValueType();
}
@ -299,6 +306,7 @@ public class PSVIElementNSImpl extends ElementNSImpl implements ElementPSVI {
/* (non-Javadoc)
* @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getItemValueTypes()
*/
@Deprecated
public ShortList getItemValueTypes() {
return fValue.getListValueTypes();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -201,7 +201,7 @@ public class XML11NSDocumentScannerImpl extends XML11DocumentScannerImpl {
fAttributes.getLength() > fElementAttributeLimit){
fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
"ElementAttributeLimit",
new Object[]{rawname, new Integer(fElementAttributeLimit) },
new Object[]{rawname, fElementAttributeLimit },
XMLErrorReporter.SEVERITY_FATAL_ERROR );
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -2427,11 +2427,11 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver {
int b1 = b4[1] & 0xFF;
if (b0 == 0xFE && b1 == 0xFF) {
// UTF-16, big-endian
return new Object [] {"UTF-16BE", new Boolean(true)};
return new Object [] {"UTF-16BE", true};
}
if (b0 == 0xFF && b1 == 0xFE) {
// UTF-16, little-endian
return new Object [] {"UTF-16LE", new Boolean(false)};
return new Object [] {"UTF-16LE", false};
}
// default to UTF-8 if we don't have enough bytes to make a
@ -2456,11 +2456,11 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver {
int b3 = b4[3] & 0xFF;
if (b0 == 0x00 && b1 == 0x00 && b2 == 0x00 && b3 == 0x3C) {
// UCS-4, big endian (1234)
return new Object [] {"ISO-10646-UCS-4", new Boolean(true)};
return new Object [] {"ISO-10646-UCS-4", true};
}
if (b0 == 0x3C && b1 == 0x00 && b2 == 0x00 && b3 == 0x00) {
// UCS-4, little endian (4321)
return new Object [] {"ISO-10646-UCS-4", new Boolean(false)};
return new Object [] {"ISO-10646-UCS-4", false};
}
if (b0 == 0x00 && b1 == 0x00 && b2 == 0x3C && b3 == 0x00) {
// UCS-4, unusual octet order (2143)
@ -2476,12 +2476,12 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver {
// UTF-16, big-endian, no BOM
// (or could turn out to be UCS-2...
// REVISIT: What should this be?
return new Object [] {"UTF-16BE", new Boolean(true)};
return new Object [] {"UTF-16BE", true};
}
if (b0 == 0x3C && b1 == 0x00 && b2 == 0x3F && b3 == 0x00) {
// UTF-16, little-endian, no BOM
// (or could turn out to be UCS-2...
return new Object [] {"UTF-16LE", new Boolean(false)};
return new Object [] {"UTF-16LE", false};
}
if (b0 == 0x4C && b1 == 0x6F && b2 == 0xA7 && b3 == 0x94) {
// EBCDIC

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
@ -2085,11 +2085,11 @@ public class XMLEntityScanner implements XMLLocator {
int b1 = b4[1] & 0xFF;
if (b0 == 0xFE && b1 == 0xFF) {
// UTF-16, big-endian
return new Object [] {"UTF-16BE", new Boolean(true)};
return new Object [] {"UTF-16BE", true};
}
if (b0 == 0xFF && b1 == 0xFE) {
// UTF-16, little-endian
return new Object [] {"UTF-16LE", new Boolean(false)};
return new Object [] {"UTF-16LE", false};
}
// default to UTF-8 if we don't have enough bytes to make a
@ -2114,11 +2114,11 @@ public class XMLEntityScanner implements XMLLocator {
int b3 = b4[3] & 0xFF;
if (b0 == 0x00 && b1 == 0x00 && b2 == 0x00 && b3 == 0x3C) {
// UCS-4, big endian (1234)
return new Object [] {"ISO-10646-UCS-4", new Boolean(true)};
return new Object [] {"ISO-10646-UCS-4", true};
}
if (b0 == 0x3C && b1 == 0x00 && b2 == 0x00 && b3 == 0x00) {
// UCS-4, little endian (4321)
return new Object [] {"ISO-10646-UCS-4", new Boolean(false)};
return new Object [] {"ISO-10646-UCS-4", false};
}
if (b0 == 0x00 && b1 == 0x00 && b2 == 0x3C && b3 == 0x00) {
// UCS-4, unusual octet order (2143)
@ -2134,12 +2134,12 @@ public class XMLEntityScanner implements XMLLocator {
// UTF-16, big-endian, no BOM
// (or could turn out to be UCS-2...
// REVISIT: What should this be?
return new Object [] {"UTF-16BE", new Boolean(true)};
return new Object [] {"UTF-16BE", true};
}
if (b0 == 0x3C && b1 == 0x00 && b2 == 0x3F && b3 == 0x00) {
// UTF-16, little-endian, no BOM
// (or could turn out to be UCS-2...
return new Object [] {"UTF-16LE", new Boolean(false)};
return new Object [] {"UTF-16LE", false};
}
if (b0 == 0x4C && b1 == 0x6F && b2 == 0xA7 && b3 == 0x94) {
// EBCDIC

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -108,7 +107,7 @@ public class CMAny
public String toString()
{
StringBuffer strRet = new StringBuffer();
StringBuilder strRet = new StringBuilder();
strRet.append("(");
strRet.append("##any:uri=");
strRet.append(fURI);
@ -118,7 +117,7 @@ public class CMAny
strRet.append
(
" (Pos:"
+ new Integer(fPosition).toString()
+ fPosition
+ ")"
);
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -101,7 +100,7 @@ public class CMLeaf
public String toString()
{
StringBuffer strRet = new StringBuffer(fElement.toString());
StringBuilder strRet = new StringBuilder(fElement.toString());
strRet.append(" (");
strRet.append(fElement.uri);
strRet.append(',');
@ -112,7 +111,7 @@ public class CMLeaf
strRet.append
(
" (Pos:"
+ new Integer(fPosition).toString()
+ fPosition
+ ")"
);
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -684,7 +683,7 @@ public class DFAContentModel
fTransTable[curState] = makeDefStateList();
/* Optimization(Jan, 2001) */
stateTable.put(newSet, new Integer(curState));
stateTable.put(newSet, curState);
/* Optimization(Jan, 2001) */
// We now have a new state to do so bump the count

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -96,7 +95,7 @@ public class ByteListImpl extends AbstractList implements ByteList {
public Object get(int index) {
if (index >= 0 && index < data.length) {
return new Byte(data[index]);
return data[index];
}
throw new IndexOutOfBoundsException("Index: " + index);
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -129,6 +128,7 @@ public class AttributePSVImpl implements AttributePSVI {
* @return The canonical lexical representation of the declaration's {value constraint} value.
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_default>XML Schema Part 1: Structures [schema default]</a>
*/
@SuppressWarnings("deprecation")
public String getSchemaDefault() {
return fDeclaration == null ? null : fDeclaration.getConstraintValue();
}
@ -140,6 +140,7 @@ public class AttributePSVImpl implements AttributePSVI {
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_normalized_value>XML Schema Part 1: Structures [schema normalized value]</a>
* @return the normalized value of this item after validation
*/
@Deprecated
public String getSchemaNormalizedValue() {
return fValue.getNormalizedValue();
}
@ -241,6 +242,7 @@ public class AttributePSVImpl implements AttributePSVI {
/* (non-Javadoc)
* @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValue()
*/
@Deprecated
public Object getActualNormalizedValue() {
return fValue.getActualValue();
}
@ -248,6 +250,7 @@ public class AttributePSVImpl implements AttributePSVI {
/* (non-Javadoc)
* @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValueType()
*/
@Deprecated
public short getActualNormalizedValueType() {
return fValue.getActualValueType();
}
@ -255,6 +258,7 @@ public class AttributePSVImpl implements AttributePSVI {
/* (non-Javadoc)
* @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getItemValueTypes()
*/
@Deprecated
public ShortList getItemValueTypes() {
return fValue.getListValueTypes();
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -154,6 +153,7 @@ public class ElementPSVImpl implements ElementPSVI {
* @return The canonical lexical representation of the declaration's {value constraint} value.
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_default>XML Schema Part 1: Structures [schema default]</a>
*/
@SuppressWarnings("deprecation")
public String getSchemaDefault() {
return fDeclaration == null ? null : fDeclaration.getConstraintValue();
}
@ -165,6 +165,7 @@ public class ElementPSVImpl implements ElementPSVI {
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_normalized_value>XML Schema Part 1: Structures [schema normalized value]</a>
* @return the normalized value of this item after validation
*/
@Deprecated
public String getSchemaNormalizedValue() {
return fValue.getNormalizedValue();
}
@ -296,6 +297,7 @@ public class ElementPSVImpl implements ElementPSVI {
/* (non-Javadoc)
* @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValue()
*/
@Deprecated
public Object getActualNormalizedValue() {
return fValue.getActualValue();
}
@ -303,6 +305,7 @@ public class ElementPSVImpl implements ElementPSVI {
/* (non-Javadoc)
* @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getActualNormalizedValueType()
*/
@Deprecated
public short getActualNormalizedValueType() {
return fValue.getActualValueType();
}
@ -310,6 +313,7 @@ public class ElementPSVImpl implements ElementPSVI {
/* (non-Javadoc)
* @see com.sun.org.apache.xerces.internal.xs.ItemPSVI#getItemValueTypes()
*/
@Deprecated
public ShortList getItemValueTypes() {
return fValue.getListValueTypes();
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -159,6 +158,7 @@ public class XSAttributeDecl implements XSAttributeDeclaration {
* Value constraint: The actual value (with respect to the {type
* definition}) Should we return Object instead of DOMString?
*/
@Deprecated
public String getConstraintValue() {
// REVISIT: SCAPI: what's the proper representation
return getConstraintType() == XSConstants.VC_NONE ?
@ -195,18 +195,21 @@ public class XSAttributeDecl implements XSAttributeDeclaration {
fNamespaceItem = namespaceItem;
}
@Deprecated
public Object getActualVC() {
return getConstraintType() == XSConstants.VC_NONE ?
null :
fDefault.actualValue;
}
@Deprecated
public short getActualVCType() {
return getConstraintType() == XSConstants.VC_NONE ?
XSConstants.UNAVAILABLE_DT :
fDefault.actualValueType;
}
@Deprecated
public ShortList getItemValueTypes() {
return getConstraintType() == XSConstants.VC_NONE ?
null :

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -112,6 +111,7 @@ public class XSAttributeUseImpl implements XSAttributeUse {
* Value Constraint: The actual value (with respect to the {type
* definition}).
*/
@Deprecated
public String getConstraintValue() {
// REVISIT: SCAPI: what's the proper representation
return getConstraintType() == XSConstants.VC_NONE ?
@ -126,18 +126,21 @@ public class XSAttributeUseImpl implements XSAttributeUse {
return null;
}
@Deprecated
public Object getActualVC() {
return getConstraintType() == XSConstants.VC_NONE ?
null :
fDefault.actualValue;
}
@Deprecated
public short getActualVCType() {
return getConstraintType() == XSConstants.VC_NONE ?
XSConstants.UNAVAILABLE_DT :
fDefault.actualValueType;
}
@Deprecated
public ShortList getItemValueTypes() {
return getConstraintType() == XSConstants.VC_NONE ?
null :

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -257,6 +256,7 @@ public class XSElementDecl implements XSElementDeclaration {
* A value constraint: The actual value (with respect to the {type
* definition})
*/
@Deprecated
public String getConstraintValue() {
// REVISIT: SCAPI: what's the proper representation
return getConstraintType() == XSConstants.VC_NONE ?
@ -368,18 +368,21 @@ public class XSElementDecl implements XSElementDeclaration {
fNamespaceItem = namespaceItem;
}
@Deprecated
public Object getActualVC() {
return getConstraintType() == XSConstants.VC_NONE ?
null :
fDefault.actualValue;
}
@Deprecated
public short getActualVCType() {
return getConstraintType() == XSConstants.VC_NONE ?
XSConstants.UNAVAILABLE_DT :
fDefault.actualValueType;
}
@Deprecated
public ShortList getItemValueTypes() {
return getConstraintType() == XSConstants.VC_NONE ?
null :

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -157,7 +156,8 @@ public class XPathMatcher {
// a place-holder method; to be overridden by subclasses
// that care about matching element content.
protected void handleContent(XSTypeDefinition type, boolean nillable, Object value, short valueType, ShortList itemValueType) {
protected void handleContent(XSTypeDefinition type, boolean nillable,
Object value, short valueType, ShortList itemValueType) {
}
/**
@ -165,7 +165,8 @@ public class XPathMatcher {
* XPath expression. Subclasses can override this method to
* provide default handling upon a match.
*/
protected void matched(Object actualValue, short valueType, ShortList itemValueType, boolean isNil) {
protected void matched(Object actualValue, short valueType,
ShortList itemValueType, boolean isNil) {
if (DEBUG_METHODS3) {
System.out.println(toString()+"#matched(\""+actualValue+"\")");
}
@ -255,7 +256,8 @@ public class XPathMatcher {
// to look at this step for next time we're called.
// so first consume all descendants:
int descendantStep = fCurrentStep[i];
while(fCurrentStep[i] < steps.length && steps[fCurrentStep[i]].axis.type == XPath.Axis.DESCENDANT) {
while(fCurrentStep[i] < steps.length &&
steps[fCurrentStep[i]].axis.type == XPath.Axis.DESCENDANT) {
if (DEBUG_MATCH) {
XPath.Step step = steps[fCurrentStep[i]];
System.out.println(toString()+" [DESCENDANT] MATCHED!");
@ -330,9 +332,11 @@ public class XPathMatcher {
int j=0;
for(; j<i && ((fMatched[j] & MATCHED) != MATCHED); j++);
if(j==i) {
AttributePSVI attrPSVI = (AttributePSVI)attributes.getAugmentations(aIndex).getItem(Constants.ATTRIBUTE_PSVI);
fMatchedString = attrPSVI.getActualNormalizedValue();
matched(fMatchedString, attrPSVI.getActualNormalizedValueType(), attrPSVI.getItemValueTypes(), false);
AttributePSVI attrPSVI = (AttributePSVI)attributes.
getAugmentations(aIndex).getItem(Constants.ATTRIBUTE_PSVI);
fMatchedString = attrPSVI.getSchemaValue().getActualValue();
matched(fMatchedString, attrPSVI.getSchemaValue().getActualValueType(),
attrPSVI.getSchemaValue().getListValueTypes(), false);
}
}
break;
@ -373,7 +377,8 @@ public class XPathMatcher {
* @param value - actual value
* the typed value of the content of this element.
*/
public void endElement(QName element, XSTypeDefinition type, boolean nillable, Object value, short valueType, ShortList itemValueType) {
public void endElement(QName element, XSTypeDefinition type, boolean nillable,
Object value, short valueType, ShortList itemValueType) {
if (DEBUG_METHODS2) {
System.out.println(toString()+"#endElement("+
"element={"+element+"},"+

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -118,7 +118,7 @@ public class CMNodeFactory {
System.out.println("nodeCount = " + nodeCount ) ;
System.out.println("nodeLimit = " + maxNodeLimit ) ;
}
fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN, "MaxOccurLimit", new Object[]{ new Integer(maxNodeLimit) }, XMLErrorReporter.SEVERITY_FATAL_ERROR);
fErrorReporter.reportError(XSMessageFormatter.SCHEMA_DOMAIN, "MaxOccurLimit", new Object[]{ maxNodeLimit }, XMLErrorReporter.SEVERITY_FATAL_ERROR);
// similarly to entity manager behaviour, take into accont
// behaviour if continue-after-fatal-error is set.
nodeCount = 0;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -804,7 +804,7 @@ public class XSDFACM
fTransTable[curState] = makeDefStateList();
/* Optimization(Jan, 2001) */
stateTable.put(newSet, new Integer(curState));
stateTable.put(newSet, curState);
/* Optimization(Jan, 2001) */
// We now have a new state to do so bump the count

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -1161,7 +1161,7 @@ public class XSAttributeChecker {
}
}
attrValues[ATTIDX_FROMDEFAULT] = new Long(fromDefault);
attrValues[ATTIDX_FROMDEFAULT] = fromDefault;
//attrValues[ATTIDX_OTHERVALUES] = otherValues;
// Check that minOccurs isn't greater than maxOccurs.
@ -1193,7 +1193,7 @@ public class XSAttributeChecker {
// maxOccurNodeLimit.
int maxOccurNodeLimit = fSchemaHandler.fSecurityManager.getLimit(XMLSecurityManager.Limit.MAX_OCCUR_NODE_LIMIT);
if (max > maxOccurNodeLimit && !fSchemaHandler.fSecurityManager.isNoLimit(maxOccurNodeLimit)) {
reportSchemaFatalError("MaxOccurLimit", new Object[] {new Integer(maxOccurNodeLimit)}, element);
reportSchemaFatalError("MaxOccurLimit", new Object[] {maxOccurNodeLimit}, element);
// reset max values in case processing continues on error
attrValues[ATTIDX_MAXOCCURS] = fXIntPool.getXInt(maxOccurNodeLimit);

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -1214,8 +1213,8 @@ class XSDComplexTypeTraverser extends XSDAbstractParticleTraverser {
fGlobalStore[fGlobalStorePos++] = fName ;
fGlobalStore[fGlobalStorePos++] = fTargetNamespace;
// let's save ourselves a couple of objects...
fGlobalStore[fGlobalStorePos++] = new Integer((fDerivedBy << 16) + fFinal);
fGlobalStore[fGlobalStorePos++] = new Integer((fBlock << 16) + fContentType);
fGlobalStore[fGlobalStorePos++] = (fDerivedBy << 16) + fFinal;
fGlobalStore[fGlobalStorePos++] = (fBlock << 16) + fContentType;
fGlobalStore[fGlobalStorePos++] = fBaseType;
fGlobalStore[fGlobalStorePos++] = fAttrGrp;
fGlobalStore[fGlobalStorePos++] = fParticle;
@ -1229,15 +1228,15 @@ class XSDComplexTypeTraverser extends XSDAbstractParticleTraverser {
fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
int i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
int i = ((Integer)(fGlobalStore[--fGlobalStorePos]));
fBlock = (short)(i >> 16);
fContentType = (short)i;
i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
i = ((Integer)(fGlobalStore[--fGlobalStorePos]));
fDerivedBy = (short)(i >> 16);
fFinal = (short)i;
fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
fName = (String)fGlobalStore[--fGlobalStorePos];
fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]).booleanValue();
fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]);
fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -131,6 +131,7 @@ import org.xml.sax.helpers.XMLReaderFactory;
* @author Pavani Mukthipudi, Sun Microsystems
*
*/
@SuppressWarnings("deprecation") //org.xml.sax.helpers.XMLReaderFactory
public class XSDHandler {
/** Feature identifier: validation. */

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -112,7 +111,7 @@ public final class ShortListImpl extends AbstractList implements ShortList {
public Object get(int index) {
if (index >= 0 && index < fLength) {
return new Short(fArray[index]);
return fArray[index];
}
throw new IndexOutOfBoundsException("Index: " + index);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -63,6 +63,7 @@ import org.xml.sax.helpers.DefaultHandler;
* @author Edwin Goei
*
*/
@SuppressWarnings("deprecation")
public class SAXParserImpl extends javax.xml.parsers.SAXParser
implements JAXPConstants, PSVIProvider {

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -27,6 +26,7 @@ import java.io.ObjectStreamException;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
@ -1399,7 +1399,7 @@ class DurationImpl
BigDecimal bd = getFieldAsBigDecimal(FIELDS[i]);
bd = bd.multiply(factor).add(carry);
buf[i] = bd.setScale(0, BigDecimal.ROUND_DOWN);
buf[i] = bd.setScale(0, RoundingMode.DOWN);
bd = bd.subtract(buf[i]);
if (i == 1) {
@ -1607,7 +1607,7 @@ class DurationImpl
BigDecimal borrow =
buf[i].abs().divide(
FACTORS[i - 1],
BigDecimal.ROUND_UP);
RoundingMode.UP);
if (buf[i].signum() > 0) {
borrow = borrow.negate();
}
@ -1796,7 +1796,7 @@ class DurationImpl
if (seconds != null) {
BigDecimal fraction =
seconds.subtract(seconds.setScale(0, BigDecimal.ROUND_DOWN));
seconds.subtract(seconds.setScale(0, RoundingMode.DOWN));
int millisec = fraction.movePointRight(3).intValue();
calendar.add(Calendar.MILLISECOND, millisec * signum);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2017, 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
@ -25,23 +25,23 @@
package com.sun.org.apache.xerces.internal.jaxp.datatype;
import com.sun.org.apache.xerces.internal.util.DatatypeMessageFormatter;
import com.sun.org.apache.xerces.internal.utils.SecuritySupport;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.TimeZone;
import java.math.RoundingMode;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.TimeZone;
import javax.xml.datatype.DatatypeConstants;
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;
/**
* <p>Representation for W3C XML Schema 1.0 date/time datatypes.
@ -379,7 +379,7 @@ public class XMLGregorianCalendarImpl
throws IllegalArgumentException {
// compute format string for this lexical representation.
String format = null;
String format;
String lexRep = lexicalRepresentation;
final int NOT_FOUND = -1;
int lexRepLength = lexRep.length();
@ -525,34 +525,10 @@ public class XMLGregorianCalendarImpl
throw new IllegalArgumentException(
DatatypeMessageFormatter.formatMessage(null,
"InvalidXGCValue-fractional",
new Object[] { year, new Integer(month), new Integer(day),
new Integer(hour), new Integer(minute), new Integer(second),
fractionalSecond, new Integer(timezone)})
new Object[] { year, month, day,
hour, minute, second,
fractionalSecond, timezone})
);
/**
String yearString = "null";
if (year != null) {
yearString = year.toString();
}
String fractionalSecondString = "null";
if (fractionalSecond != null) {
fractionalSecondString = fractionalSecond.toString();
}
throw new IllegalArgumentException(
"year = " + yearString
+ ", month = " + month
+ ", day = " + day
+ ", hour = " + hour
+ ", minute = " + minute
+ ", second = " + second
+ ", fractionalSecond = " + fractionalSecondString
+ ", timezone = " + timezone
+ ", is not a valid representation of an XML Gregorian Calendar value."
);
*/
}
save();
@ -601,24 +577,10 @@ public class XMLGregorianCalendarImpl
throw new IllegalArgumentException(
DatatypeMessageFormatter.formatMessage(null,
"InvalidXGCValue-milli",
new Object[] { new Integer(year), new Integer(month), new Integer(day),
new Integer(hour), new Integer(minute), new Integer(second),
new Integer(millisecond), new Integer(timezone)})
new Object[] { year, month, day,
hour, minute, second,
millisecond, timezone})
);
/*
throw new IllegalArgumentException(
"year = " + year
+ ", month = " + month
+ ", day = " + day
+ ", hour = " + hour
+ ", minute = " + minute
+ ", second = " + second
+ ", millisecond = " + millisecond
+ ", timezone = " + timezone
+ ", is not a valid representation of an XML Gregorian Calendar value."
);
*/
}
save();
@ -683,11 +645,11 @@ public class XMLGregorianCalendarImpl
*/
public XMLGregorianCalendarImpl(GregorianCalendar cal) {
int year = cal.get(Calendar.YEAR);
int year1 = cal.get(Calendar.YEAR);
if (cal.get(Calendar.ERA) == GregorianCalendar.BC) {
year = -year;
year1 = -year1;
}
this.setYear(year);
this.setYear(year1);
// Calendar.MONTH is zero based, XSD Date datatype's month field starts
// with JANUARY as 1.
@ -1201,7 +1163,7 @@ public class XMLGregorianCalendarImpl
* outside value constraints for the field as specified in
* <a href="#datetimefieldmapping">date/time field mapping table</a>.
*/
public void setYear(BigInteger year) {
public final void setYear(BigInteger year) {
if (year == null) {
this.eon = null;
this.year = DatatypeConstants.FIELD_UNDEFINED;
@ -1225,7 +1187,7 @@ public class XMLGregorianCalendarImpl
* @param year value constraints are summarized in <a href="#datetimefield-year">year field of date/time field mapping table</a>.
* If year is {@link DatatypeConstants#FIELD_UNDEFINED}, then eon is set to <code>null</code>.
*/
public void setYear(int year) {
public final void setYear(int year) {
if (year == DatatypeConstants.FIELD_UNDEFINED) {
this.year = DatatypeConstants.FIELD_UNDEFINED;
this.eon = null;
@ -1269,7 +1231,7 @@ public class XMLGregorianCalendarImpl
* outside value constraints for the field as specified in
* <a href="#datetimefieldmapping">date/time field mapping table</a>.
*/
public void setMonth(int month) {
public final void setMonth(int month) {
if(month<DatatypeConstants.JANUARY || DatatypeConstants.DECEMBER<month)
if(month!=DatatypeConstants.FIELD_UNDEFINED)
invalidFieldValue(MONTH, month);
@ -1287,7 +1249,7 @@ public class XMLGregorianCalendarImpl
* outside value constraints for the field as specified in
* <a href="#datetimefieldmapping">date/time field mapping table</a>.
*/
public void setDay(int day) {
public final void setDay(int day) {
if(day<1 || 31<day)
if(day!=DatatypeConstants.FIELD_UNDEFINED)
invalidFieldValue(DAY,day);
@ -1306,7 +1268,7 @@ public class XMLGregorianCalendarImpl
* outside value constraints for the field as specified in
* <a href="#datetimefieldmapping">date/time field mapping table</a>.
*/
public void setTimezone(int offset) {
public final void setTimezone(int offset) {
if(offset<-14*60 || 14*60<offset)
if(offset!=DatatypeConstants.FIELD_UNDEFINED)
invalidFieldValue(TIMEZONE,offset);
@ -1329,14 +1291,14 @@ public class XMLGregorianCalendarImpl
* outside value constraints for the field as specified in
* <a href="#datetimefieldmapping">date/time field mapping table</a>.
*/
public void setTime(int hour, int minute, int second) {
public final void setTime(int hour, int minute, int second) {
setTime(hour, minute, second, null);
}
private void invalidFieldValue(int field, int value) {
throw new IllegalArgumentException(
DatatypeMessageFormatter.formatMessage(null, "InvalidFieldValue",
new Object[]{ new Integer(value), FIELD_NAME[field]})
new Object[]{ value, FIELD_NAME[field]})
);
}
@ -1406,7 +1368,7 @@ public class XMLGregorianCalendarImpl
* outside value constraints for the field as specified in
* <a href="#datetimefieldmapping">date/time field mapping table</a>.
*/
public void setTime(
public final void setTime(
int hour,
int minute,
int second,
@ -1446,7 +1408,7 @@ public class XMLGregorianCalendarImpl
* outside value constraints for the field as specified in
* <a href="#datetimefieldmapping">date/time field mapping table</a>.
*/
public void setTime(int hour, int minute, int second, int millisecond) {
public final void setTime(int hour, int minute, int second, int millisecond) {
setHour(hour, false);
@ -1990,7 +1952,7 @@ public class XMLGregorianCalendarImpl
* Validate instance by <code>getXMLSchemaType()</code> constraints.
* @return true if data values are valid.
*/
public boolean isValid() {
public final boolean isValid() {
// since setters do not allow for invalid values,
// (except for exceptional case of year field of zero),
// no need to check for anything except for constraints
@ -2091,7 +2053,8 @@ public class XMLGregorianCalendarImpl
BigInteger temp = BigInteger.valueOf((long) startMonth).add(dMonths);
setMonth(temp.subtract(BigInteger.ONE).mod(TWELVE).intValue() + 1);
BigInteger carry =
new BigDecimal(temp.subtract(BigInteger.ONE)).divide(new BigDecimal(TWELVE), BigDecimal.ROUND_FLOOR).toBigInteger();
new BigDecimal(temp.subtract(BigInteger.ONE))
.divide(DECIMAL_TWELVE, RoundingMode.FLOOR).toBigInteger();
/* Years (may be modified additionally below)
* E[year] := S[year] + D[year] + carry
@ -2129,7 +2092,7 @@ public class XMLGregorianCalendarImpl
BigDecimal dSeconds = DurationImpl.sanitize((BigDecimal) duration.getField(DatatypeConstants.SECONDS), signum);
BigDecimal tempBD = startSeconds.add(dSeconds);
BigDecimal fQuotient =
new BigDecimal(new BigDecimal(tempBD.toBigInteger()).divide(DECIMAL_SIXTY, BigDecimal.ROUND_FLOOR).toBigInteger());
new BigDecimal(new BigDecimal(tempBD.toBigInteger()).divide(DECIMAL_SIXTY, RoundingMode.FLOOR).toBigInteger());
BigDecimal endSeconds = tempBD.subtract(fQuotient.multiply(DECIMAL_SIXTY));
carry = fQuotient.toBigInteger();
@ -2161,7 +2124,7 @@ public class XMLGregorianCalendarImpl
temp = BigInteger.valueOf(startMinutes).add(dMinutes).add(carry);
setMinute(temp.mod(SIXTY).intValue());
carry = new BigDecimal(temp).divide(DECIMAL_SIXTY, BigDecimal.ROUND_FLOOR).toBigInteger();
carry = new BigDecimal(temp).divide(DECIMAL_SIXTY, RoundingMode.FLOOR).toBigInteger();
/* Hours
* temp := S[hour] + D[hour] + carry
@ -2177,7 +2140,8 @@ public class XMLGregorianCalendarImpl
temp = BigInteger.valueOf(startHours).add(dHours).add(carry);
setHour(temp.mod(TWENTY_FOUR).intValue(), false);
carry = new BigDecimal(temp).divide(new BigDecimal(TWENTY_FOUR), BigDecimal.ROUND_FLOOR).toBigInteger();
carry = new BigDecimal(temp).divide(DECIMAL_TWENTY_FOUR,
RoundingMode.FLOOR).toBigInteger();
/* Days
* if S[day] > maximumDayInMonthFor(E[year], E[month])
@ -2225,15 +2189,19 @@ public class XMLGregorianCalendarImpl
// calculate days in previous month, watch for month roll over
BigInteger mdimf = null;
if (month >= 2) {
mdimf = BigInteger.valueOf(maximumDayInMonthFor(getEonAndYear(), getMonth() - 1));
mdimf = BigInteger.valueOf(maximumDayInMonthFor(getEonAndYear(),
getMonth() - 1));
} else {
// roll over to December of previous year
mdimf = BigInteger.valueOf(maximumDayInMonthFor(getEonAndYear().subtract(BigInteger.valueOf((long) 1)), 12));
mdimf = BigInteger.valueOf(maximumDayInMonthFor(getEonAndYear()
.subtract(BigInteger.ONE), 12));
}
endDays = endDays.add(mdimf);
monthCarry = -1;
} else if (endDays.compareTo(BigInteger.valueOf(maximumDayInMonthFor(getEonAndYear(), getMonth()))) > 0) {
endDays = endDays.add(BigInteger.valueOf(-maximumDayInMonthFor(getEonAndYear(), getMonth())));
} else if (endDays.compareTo(BigInteger.valueOf(
maximumDayInMonthFor(getEonAndYear(), getMonth()))) > 0) {
endDays = endDays.add(BigInteger.valueOf(
-maximumDayInMonthFor(getEonAndYear(), getMonth())));
monthCarry = 1;
} else {
break;
@ -2244,7 +2212,8 @@ public class XMLGregorianCalendarImpl
int quotient;
if (endMonth < 0) {
endMonth = (13 - 1) + endMonth + 1;
quotient = BigDecimal.valueOf(intTemp - 1).divide(new BigDecimal(TWELVE), BigDecimal.ROUND_UP).intValue();
quotient = BigDecimal.valueOf(intTemp - 1)
.divide(DECIMAL_TWELVE, RoundingMode.UP).intValue();
} else {
quotient = (intTemp - 1) / (13 - 1);
endMonth += 1;
@ -2292,6 +2261,8 @@ public class XMLGregorianCalendarImpl
private static final BigInteger TWELVE = BigInteger.valueOf(12);
private static final BigDecimal DECIMAL_ZERO = BigDecimal.valueOf(0);
private static final BigDecimal DECIMAL_ONE = BigDecimal.valueOf(1);
private static final BigDecimal DECIMAL_TWELVE = BigDecimal.valueOf(12);
private static final BigDecimal DECIMAL_TWENTY_FOUR = BigDecimal.valueOf(24);
private static final BigDecimal DECIMAL_SIXTY = BigDecimal.valueOf(60);
@ -2779,7 +2750,7 @@ public class XMLGregorianCalendarImpl
}
}
public void setFractionalSecond(BigDecimal fractional) {
public final void setFractionalSecond(BigDecimal fractional) {
if (fractional != null) {
if ((fractional.compareTo(DECIMAL_ZERO) < 0) ||
(fractional.compareTo(DECIMAL_ONE) > 0)) {

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -790,7 +789,7 @@ public class AbstractDOMParser extends AbstractXMLDocumentParser {
// use specified document class
try {
Class documentClass = ObjectFactory.findProviderClass (fDocumentClassName, true);
fDocument = (Document)documentClass.newInstance ();
fDocument = (Document)documentClass.getConstructor().newInstance();
// if subclass of our own class that's cool too
Class defaultDocClass =
@ -1750,7 +1749,9 @@ public class AbstractDOMParser extends AbstractXMLDocumentParser {
"xml:base",
"http://www.w3.org/XML/1998/namespace",
baseURI,
true);
true,
false,
null);
}
}
else if (nodeType == Node.PROCESSING_INSTRUCTION_NODE) {

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -79,6 +78,7 @@ import org.xml.sax.helpers.LocatorImpl;
* @author Andy Clark, IBM
*
*/
@SuppressWarnings("deprecation")
public abstract class AbstractSAXParser
extends AbstractXMLDocumentParser
implements PSVIProvider, // PSVI

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -34,6 +33,7 @@ import org.xml.sax.ext.Attributes2;
* @author Andy Clark, IBM
*
*/
@SuppressWarnings("deprecation")
public final class AttributesProxy
implements AttributeList, Attributes2 {

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -157,7 +156,7 @@ public final class ObjectFactory {
// assert(className != null);
try{
Class providerClass = findProviderClass(className, cl, doFallback);
Object instance = providerClass.newInstance();
Object instance = providerClass.getConstructor().newInstance();
debugPrintln(()->"created new instance of " + providerClass +
" using ClassLoader: " + cl);
return instance;

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -117,7 +116,7 @@ final class SecuritySupport {
return ((Boolean)
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return new Boolean(f.exists());
return f.exists();
}
})).booleanValue();
}
@ -126,7 +125,7 @@ final class SecuritySupport {
return ((Long)
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return new Long(f.lastModified());
return f.lastModified();
}
})).longValue();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -1702,7 +1702,7 @@ public class XIncludeHandler
if (fEntityResolver != null) fChildConfig.setProperty(ENTITY_RESOLVER, fEntityResolver);
fChildConfig.setProperty(SECURITY_MANAGER, fSecurityManager);
fChildConfig.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr);
fChildConfig.setProperty(BUFFER_SIZE, new Integer(fBufferSize));
fChildConfig.setProperty(BUFFER_SIZE, fBufferSize);
// features must be copied to child configuration
fNeedCopyFeatures = true;

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -536,9 +535,9 @@ final class ElementSchemePointer implements XPointerPart {
private Tokens(SymbolTable symbolTable) {
fSymbolTable = symbolTable;
fTokenNames.put(new Integer(XPTRTOKEN_ELEM_NCNAME),
fTokenNames.put(XPTRTOKEN_ELEM_NCNAME,
"XPTRTOKEN_ELEM_NCNAME");
fTokenNames.put(new Integer(XPTRTOKEN_ELEM_CHILD),
fTokenNames.put(XPTRTOKEN_ELEM_CHILD,
"XPTRTOKEN_ELEM_CHILD");
}
@ -548,7 +547,7 @@ final class ElementSchemePointer implements XPointerPart {
* @return String The token string
*/
private String getTokenString(int token) {
return fTokenNames.get(new Integer(token));
return fTokenNames.get(token);
}
/**
@ -560,7 +559,7 @@ final class ElementSchemePointer implements XPointerPart {
String str = fTokenNames.get(tokenStr);
Integer tokenInt = str == null ? null : Integer.parseInt(str);
if (tokenInt == null) {
tokenInt = new Integer(fTokenNames.size());
tokenInt = fTokenNames.size();
fTokenNames.put(tokenInt, tokenStr);
}
addToken(tokenInt.intValue());
@ -763,7 +762,7 @@ final class ElementSchemePointer implements XPointerPart {
// An invalid child sequence character
if (child == 0) {
reportError("InvalidChildSequenceCharacter",
new Object[] { new Character((char) ch) });
new Object[] { (char) ch });
return false;
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -227,7 +226,7 @@ final class ShortHandPointer implements XPointerPart {
//
if (typeDef != null && ((XSSimpleType) typeDef).isIDType()) {
return attrPSVI.getSchemaNormalizedValue();
return attrPSVI.getSchemaValue().getNormalizedValue();
}
// 4 & 5 NA

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -249,8 +248,8 @@ public final class XPointerHandler extends XIncludeHandler implements
if (openParenCount != closeParenCount) {
reportError("UnbalancedParenthesisInXPointerExpression",
new Object[] { xpointer,
new Integer(openParenCount),
new Integer(closeParenCount) });
openParenCount,
closeParenCount });
}
// Perform scheme specific parsing of the pointer part
@ -497,15 +496,15 @@ public final class XPointerHandler extends XIncludeHandler implements
private Tokens(SymbolTable symbolTable) {
fSymbolTable = symbolTable;
fTokenNames.put(new Integer(XPTRTOKEN_OPEN_PAREN),
fTokenNames.put(XPTRTOKEN_OPEN_PAREN,
"XPTRTOKEN_OPEN_PAREN");
fTokenNames.put(new Integer(XPTRTOKEN_CLOSE_PAREN),
fTokenNames.put(XPTRTOKEN_CLOSE_PAREN,
"XPTRTOKEN_CLOSE_PAREN");
fTokenNames.put(new Integer(XPTRTOKEN_SHORTHAND),
fTokenNames.put(XPTRTOKEN_SHORTHAND,
"XPTRTOKEN_SHORTHAND");
fTokenNames.put(new Integer(XPTRTOKEN_SCHEMENAME),
fTokenNames.put(XPTRTOKEN_SCHEMENAME,
"XPTRTOKEN_SCHEMENAME");
fTokenNames.put(new Integer(XPTRTOKEN_SCHEMEDATA),
fTokenNames.put(XPTRTOKEN_SCHEMEDATA,
"XPTRTOKEN_SCHEMEDATA");
}
@ -515,7 +514,7 @@ public final class XPointerHandler extends XIncludeHandler implements
* @return String The token string
*/
private String getTokenString(int token) {
return fTokenNames.get(new Integer(token));
return fTokenNames.get(token);
}
/**
@ -527,7 +526,7 @@ public final class XPointerHandler extends XIncludeHandler implements
String str = fTokenNames.get(tokenStr);
Integer tokenInt = str == null ? null : Integer.parseInt(str);
if (tokenInt == null) {
tokenInt = new Integer(fTokenNames.size());
tokenInt = fTokenNames.size();
fTokenNames.put(tokenInt, tokenStr);
}
addToken(tokenInt.intValue());

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -113,7 +112,7 @@ public class IncrementalSAXSource_Xerces
Class xniStdConfigClass=ObjectFactory.findProviderClass(
"com.sun.org.apache.xerces.internal.parsers.StandardParserConfiguration",
true);
fPullParserConfig=xniStdConfigClass.newInstance();
fPullParserConfig=xniStdConfigClass.getConstructor().newInstance();
Object[] args2={fPullParserConfig};
fIncrementalParser = (SAXParser)ctor.newInstance(args2);
@ -386,6 +385,7 @@ public class IncrementalSAXSource_Xerces
/** Simple unit test. Attempt coroutine parsing of document indicated
* by first argument (as a URI), report progress.
*/
@Deprecated
public static void _main(String args[])
{
System.out.println("Starting...");

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -117,7 +116,7 @@ final class SecuritySupport {
return ((Boolean)
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return new Boolean(f.exists());
return f.exists();
}
})).booleanValue();
}
@ -126,7 +125,7 @@ final class SecuritySupport {
return ((Long)
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return new Long(f.lastModified());
return f.lastModified();
}
})).longValue();
}

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -205,7 +204,7 @@ public final class OutputPropertiesFactory
private static final int S_XALAN_PREFIX_LEN = S_XALAN_PREFIX.length();
/** Synchronization object for lazy initialization of the above tables. */
private static Integer m_synch_object = new Integer(1);
private static final Object m_synch_object = new Object();
/** the directory in which the various method property files are located */
private static final String PROP_DIR = "com/sun/org/apache/xml/internal/serializer/";

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -125,7 +124,7 @@ public final class SerializerFactory
// _serializers.put(method, cls);
Object obj = cls.newInstance();
Object obj = cls.getConstructor().newInstance();
if (obj instanceof SerializationHandler)
{
@ -151,7 +150,7 @@ public final class SerializerFactory
className = SerializerConstants.DEFAULT_SAX_SERIALIZER;
cls = ObjectFactory.findProviderClass(className, true);
SerializationHandler sh =
(SerializationHandler) cls.newInstance();
(SerializationHandler) cls.getConstructor().newInstance();
sh.setContentHandler( (ContentHandler) obj);
sh.setOutputFormat(format);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -1170,7 +1170,7 @@ final class DOM3TreeWalker {
}
}
// Reference to invalid character which is returned
refInvalidChar = new Character(ch);
refInvalidChar = ch;
return false;
}
}
@ -1191,7 +1191,7 @@ final class DOM3TreeWalker {
}
}
// Reference to invalid character which is returned
refInvalidChar = new Character(ch);
refInvalidChar = ch;
return false;
}
}
@ -1233,7 +1233,7 @@ final class DOM3TreeWalker {
}
}
// Reference to invalid character which is returned
refInvalidChar = new Character(ch);
refInvalidChar = ch;
return refInvalidChar;
}
}
@ -1254,7 +1254,7 @@ final class DOM3TreeWalker {
}
}
// Reference to invalid character which is returned
refInvalidChar = new Character(ch);
refInvalidChar = ch;
return refInvalidChar;
}
}
@ -1296,7 +1296,7 @@ final class DOM3TreeWalker {
String msg =
Utils.messages.createMessage(
MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
new Object[] { new Character(c)});
new Object[] { c});
if (fErrorHandler != null) {
fErrorHandler.handleError(
@ -1345,7 +1345,7 @@ final class DOM3TreeWalker {
String msg =
Utils.messages.createMessage(
MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
new Object[] { new Character(c)});
new Object[] { c});
if (fErrorHandler != null) {
fErrorHandler.handleError(

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -26,6 +25,7 @@ import java.util.ArrayList;
import com.sun.org.apache.xml.internal.res.XMLErrorResources;
import com.sun.org.apache.xml.internal.res.XMLMessages;
import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
import java.lang.reflect.InvocationTargetException;
/**
@ -134,13 +134,14 @@ public class ObjectPool implements java.io.Serializable
// Create a new object if so.
try
{
return objectType.newInstance();
return objectType.getConstructor().newInstance();
}
catch (InstantiationException ex){}
catch (IllegalAccessException ex){}
catch (InstantiationException | IllegalAccessException | SecurityException |
IllegalArgumentException | InvocationTargetException | NoSuchMethodException ex){}
// Throw unchecked exception for error in pool configuration.
throw new RuntimeException(XMLMessages.createXMLMessage(XMLErrorResources.ER_EXCEPTION_CREATING_POOL, null)); //"exception creating new instance for pool");
throw new RuntimeException(XMLMessages.createXMLMessage(
XMLErrorResources.ER_EXCEPTION_CREATING_POOL, null));
}
else
{

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -42,6 +41,7 @@ import org.xml.sax.helpers.XMLReaderFactory;
* in this class should allow easy garbage collection of source
* trees (not yet!), and should centralize parsing for those source trees.
*/
@SuppressWarnings("deprecation")
public class SourceTreeManager
{

View File

@ -1,6 +1,5 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -1295,11 +1294,11 @@ public class XPathContext extends DTMManager // implements ExpressionContext
m_DTMXRTreeFrags = new HashMap();
}
if(m_DTMXRTreeFrags.containsKey(new Integer(dtmIdentity))){
return (DTMXRTreeFrag)m_DTMXRTreeFrags.get(new Integer(dtmIdentity));
if(m_DTMXRTreeFrags.containsKey(dtmIdentity)){
return (DTMXRTreeFrag)m_DTMXRTreeFrags.get(dtmIdentity);
}else{
final DTMXRTreeFrag frag = new DTMXRTreeFrag(dtmIdentity,this);
m_DTMXRTreeFrags.put(new Integer(dtmIdentity),frag);
m_DTMXRTreeFrags.put(dtmIdentity,frag);
return frag ;
}
}

Some files were not shown because too many files have changed in this diff Show More