diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 519f598b86e..fe5540a5d8e 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -267,3 +267,4 @@ ee4fd72b2ec3d92497f37163352f294aa695c6fb jdk9-b20 8e4bdab4c362aadde2d321f968cd503a2f779e2f jdk9-b22 88567461a2cd9b7fb431fee6440005a694df1f47 jdk9-b23 1d4a293fbec19dc2d5790bbb2c7dd0ed8f265484 jdk9-b24 +aefd8899a8d6615fb34ba99b2e38996a7145baa8 jdk9-b25 diff --git a/corba/.hgtags b/corba/.hgtags index 25bbe5d05c0..80f38489230 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -267,3 +267,4 @@ eecc1b6adc7e193d00a0641eb0963add5a4c06e8 jdk9-b19 ddc07abf4307855c0dc904cc5c96cc764023a930 jdk9-b22 57735d66face054440a63ce99789eac5a5ee1dfd jdk9-b23 8a44142bb7fc8118f70f91a1b97c12dfc50563ee jdk9-b24 +da08cca6b97f41b7081a3e176dcb400af6e4bb26 jdk9-b25 diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 63e06453ec9..a39d162f8d8 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -427,3 +427,4 @@ c1af79d122ec9f715fa29312b5e91763f3a4dfc4 jdk9-b20 518d1fcc0799494f013e00e0a94a91b6f212d54f jdk9-b22 dd472cdacc32e3afc7c5bfa7ef16ea0e0befb7fa jdk9-b23 dde2d03b0ea46a27650839e3a1d212c7c1f7b4c8 jdk9-b24 +6de94e8693240cec8aae11f6b42f43433456a733 jdk9-b25 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java index c3f7b8cb88b..3fe93b7fc6b 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java @@ -55,7 +55,10 @@ public class Klass extends Metadata implements ClassConstants { layoutHelper = new IntField(type.getJIntField("_layout_helper"), 0); name = type.getAddressField("_name"); accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0); - traceIDField = type.getField("_trace_id"); + try { + traceIDField = type.getField("_trace_id"); + } catch(Exception e) { + } subklass = new MetadataField(type.getAddressField("_subklass"), 0); nextSibling = new MetadataField(type.getAddressField("_next_sibling"), 0); @@ -108,7 +111,11 @@ public class Klass extends Metadata implements ClassConstants { public AccessFlags getAccessFlagsObj(){ return new AccessFlags(getAccessFlags()); } public Klass getSubklassKlass() { return (Klass) subklass.getValue(this); } public Klass getNextSiblingKlass() { return (Klass) nextSibling.getValue(this); } - public long traceID() { return traceIDField.getJLong(addr); } + + public long traceID() { + if (traceIDField == null) return 0; + return traceIDField.getJLong(addr); + } // computed access flags - takes care of inner classes etc. // This is closer to actual source level than getAccessFlags() etc. diff --git a/hotspot/make/jprt.properties b/hotspot/make/jprt.properties index 22c7b05ad6d..a6ff452c2ce 100644 --- a/hotspot/make/jprt.properties +++ b/hotspot/make/jprt.properties @@ -126,7 +126,7 @@ jprt.my.solaris.sparcv9.test.targets= \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98_nontiered, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-scimark, \ - ${jprt.my.solaris.sparcv9}-product-c2-runThese, \ + ${jprt.my.solaris.sparcv9}-product-c2-runThese8, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_SerialGC, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ @@ -150,8 +150,9 @@ jprt.my.solaris.x64.test.targets= \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jvm98, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jvm98_nontiered, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-scimark, \ - ${jprt.my.solaris.x64}-product-c2-runThese, \ - ${jprt.my.solaris.x64}-product-c2-runThese_Xcomp, \ + ${jprt.my.solaris.x64}-product-c2-runThese8, \ + ${jprt.my.solaris.x64}-product-c2-runThese8_Xcomp_lang, \ + ${jprt.my.solaris.x64}-product-c2-runThese8_Xcomp_vm, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ @@ -175,9 +176,11 @@ jprt.my.linux.i586.test.targets = \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-jvm98, \ ${jprt.my.linux.i586}-{product|fastdebug}-c2-jvm98_nontiered, \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-scimark, \ - ${jprt.my.linux.i586}-product-c1-runThese_Xcomp, \ - ${jprt.my.linux.i586}-fastdebug-c1-runThese_Xshare, \ - ${jprt.my.linux.i586}-fastdebug-c2-runThese_Xcomp, \ + ${jprt.my.linux.i586}-product-c1-runThese8_Xcomp_lang, \ + ${jprt.my.linux.i586}-product-c1-runThese8_Xcomp_vm, \ + ${jprt.my.linux.i586}-fastdebug-c1-runThese8_Xshare, \ + ${jprt.my.linux.i586}-fastdebug-c2-runThese8_Xcomp_lang, \ + ${jprt.my.linux.i586}-fastdebug-c2-runThese8_Xcomp_vm, \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \ @@ -243,9 +246,10 @@ jprt.my.windows.i586.test.targets = \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-jvm98, \ ${jprt.my.windows.i586}-{product|fastdebug}-c2-jvm98_nontiered, \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-scimark, \ - ${jprt.my.windows.i586}-product-{c1|c2}-runThese, \ - ${jprt.my.windows.i586}-product-{c1|c2}-runThese_Xcomp, \ - ${jprt.my.windows.i586}-fastdebug-c1-runThese_Xshare, \ + ${jprt.my.windows.i586}-product-{c1|c2}-runThese8, \ + ${jprt.my.windows.i586}-product-{c1|c2}-runThese8_Xcomp_lang, \ + ${jprt.my.windows.i586}-product-{c1|c2}-runThese8_Xcomp_vm, \ + ${jprt.my.windows.i586}-fastdebug-c1-runThese8_Xshare, \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \ @@ -269,8 +273,9 @@ jprt.my.windows.x64.test.targets = \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-jvm98, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-jvm98_nontiered, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-scimark, \ - ${jprt.my.windows.x64}-product-c2-runThese, \ - ${jprt.my.windows.x64}-product-c2-runThese_Xcomp, \ + ${jprt.my.windows.x64}-product-c2-runThese8, \ + ${jprt.my.windows.x64}-product-c2-runThese8_Xcomp_lang, \ + ${jprt.my.windows.x64}-product-c2-runThese8_Xcomp_vm, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp index ff177e6231a..496197e9290 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp @@ -36,7 +36,6 @@ #include "runtime/signature.hpp" #include "runtime/stubCodeGenerator.hpp" #include "runtime/stubRoutines.hpp" -#include "vmreg_ppc.inline.hpp" #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #include "runtime/vframeArray.hpp" @@ -155,15 +154,6 @@ void frame::patch_pc(Thread* thread, address pc) { } } -void frame::pd_gc_epilog() { - if (is_interpreted_frame()) { - // Set constant pool cache entry for interpreter. - Method* m = interpreter_frame_method(); - - *interpreter_frame_cpoolcache_addr() = m->constants()->cache(); - } -} - bool frame::is_interpreted_frame_valid(JavaThread* thread) const { // Is there anything to do? assert(is_interpreted_frame(), "Not an interpreted frame"); diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp index 6186906a860..457b9cb59d9 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,6 +27,7 @@ #define CPU_PPC_VM_FRAME_PPC_INLINE_HPP #include "code/codeCache.hpp" +#include "code/vmreg.inline.hpp" // Inline functions for ppc64 frames: @@ -134,12 +135,12 @@ inline intptr_t** frame::interpreter_frame_locals_addr() const { return (intptr_t**)&istate->_locals; } -inline intptr_t* frame::interpreter_frame_bcx_addr() const { +inline intptr_t* frame::interpreter_frame_bcp_addr() const { interpreterState istate = get_interpreterState(); return (intptr_t*)&istate->_bcp; } -inline intptr_t* frame::interpreter_frame_mdx_addr() const { +inline intptr_t* frame::interpreter_frame_mdp_addr() const { interpreterState istate = get_interpreterState(); return (intptr_t*)&istate->_mdx; } @@ -209,10 +210,10 @@ inline frame::ijava_state* frame::get_ijava_state() const { inline intptr_t** frame::interpreter_frame_locals_addr() const { return (intptr_t**) &(get_ijava_state()->locals); } -inline intptr_t* frame::interpreter_frame_bcx_addr() const { +inline intptr_t* frame::interpreter_frame_bcp_addr() const { return (intptr_t*) &(get_ijava_state()->bcp); } -inline intptr_t* frame::interpreter_frame_mdx_addr() const { +inline intptr_t* frame::interpreter_frame_mdp_addr() const { return (intptr_t*) &(get_ijava_state()->mdx); } // Pointer beyond the "oldest/deepest" BasicObjectLock on stack. diff --git a/hotspot/src/cpu/ppc/vm/icache_ppc.cpp b/hotspot/src/cpu/ppc/vm/icache_ppc.cpp index 20b11455bf6..641841b9463 100644 --- a/hotspot/src/cpu/ppc/vm/icache_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/icache_ppc.cpp @@ -68,7 +68,6 @@ int ICache::ppc64_flush_icache(address start, int lines, int magic) { } void ICacheStubGenerator::generate_icache_flush(ICache::flush_icache_stub_t* flush_icache_stub) { - StubCodeMark mark(this, "ICache", "flush_icache_stub"); *flush_icache_stub = (ICache::flush_icache_stub_t)ICache::ppc64_flush_icache; diff --git a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp index 144ef50bfa8..da98715a102 100644 --- a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2014 SAP AG. 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 @@ -26,6 +26,7 @@ #ifndef CPU_PPC_VM_INTERPRETERRT_PPC_HPP #define CPU_PPC_VM_INTERPRETERRT_PPC_HPP +#include "asm/macroAssembler.hpp" #include "memory/allocation.hpp" // native method calls diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp index a35b1ebb7a1..96814188f03 100644 --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp @@ -30,6 +30,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp index ce10145ed90..4366af19626 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp @@ -32,6 +32,7 @@ #include "memory/resourceArea.hpp" #include "prims/methodHandles.hpp" #include "runtime/biasedLocking.hpp" +#include "runtime/icache.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/objectMonitor.hpp" #include "runtime/os.hpp" diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index 9087959fe1e..18870359ad9 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -267,7 +267,7 @@ register %{ // It's worth about 1% on SPEC geomean to get this right. // Chunk0, chunk1, and chunk2 form the MachRegisterNumbers enumeration -// in adGlobals_ppc64.hpp which defines the _num values, e.g. +// in adGlobals_ppc.hpp which defines the _num values, e.g. // R3_num. Therefore, R3_num may not be (and in reality is not) // the same as R3->encoding()! Furthermore, we cannot make any // assumptions on ordering, e.g. R3_num may be less than R2_num. @@ -1632,7 +1632,7 @@ enum RC { rc_bad, rc_int, rc_float, rc_stack }; static enum RC rc_class(OptoReg::Name reg) { // Return the register class for the given register. The given register // reg is a _num value, which is an index into the MachRegisterNumbers - // enumeration in adGlobals_ppc64.hpp. + // enumeration in adGlobals_ppc.hpp. if (reg == OptoReg::Bad) return rc_bad; diff --git a/hotspot/src/cpu/ppc/vm/register_ppc.hpp b/hotspot/src/cpu/ppc/vm/register_ppc.hpp index 107c5bab8b8..9dc765ab4a2 100644 --- a/hotspot/src/cpu/ppc/vm/register_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/register_ppc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,7 +27,6 @@ #define CPU_PPC_VM_REGISTER_PPC_HPP #include "asm/register.hpp" -#include "vm_version_ppc.hpp" // forward declaration class Address; @@ -92,8 +91,8 @@ class RegisterImpl: public AbstractRegisterImpl { inline friend Register as_Register(int encoding); // accessors - int encoding() const { assert(is_valid(), "invalid register"); return value(); } - VMReg as_VMReg(); + int encoding() const { assert(is_valid(), "invalid register"); return value(); } + inline VMReg as_VMReg(); Register successor() const { return as_Register(encoding() + 1); } // testers @@ -208,8 +207,8 @@ class ConditionRegisterImpl: public AbstractRegisterImpl { inline friend ConditionRegister as_ConditionRegister(int encoding); // accessors - int encoding() const { assert(is_valid(), "invalid register"); return value(); } - VMReg as_VMReg(); + int encoding() const { assert(is_valid(), "invalid register"); return value(); } + inline VMReg as_VMReg(); // testers bool is_valid() const { return (0 <= value() && value() < number_of_registers); } @@ -264,7 +263,7 @@ class FloatRegisterImpl: public AbstractRegisterImpl { // accessors int encoding() const { assert(is_valid(), "invalid register"); return value(); } - VMReg as_VMReg(); + inline VMReg as_VMReg(); FloatRegister successor() const { return as_FloatRegister(encoding() + 1); } // testers @@ -365,7 +364,7 @@ class SpecialRegisterImpl: public AbstractRegisterImpl { // accessors int encoding() const { assert(is_valid(), "invalid register"); return value(); } - VMReg as_VMReg(); + inline VMReg as_VMReg(); // testers bool is_valid() const { return 0 <= value() && value() < number_of_registers; } diff --git a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp index 0e5898381c2..404df938777 100644 --- a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ #include "classfile/systemDictionary.hpp" #include "code/vmreg.hpp" #include "interpreter/interpreter.hpp" +#include "interpreter/interp_masm.hpp" #include "nativeInst_ppc.hpp" #include "opto/runtime.hpp" #include "runtime/interfaceSupport.hpp" @@ -37,7 +38,6 @@ #include "runtime/stubRoutines.hpp" #include "runtime/vframeArray.hpp" #include "utilities/globalDefinitions.hpp" -#include "vmreg_ppc.inline.hpp" #endif #define __ masm-> diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp index 15a5812e881..68dda7d3e2b 100644 --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -29,16 +29,17 @@ #include "code/icBuffer.hpp" #include "code/vtableStubs.hpp" #include "interpreter/interpreter.hpp" +#include "interpreter/interp_masm.hpp" #include "oops/compiledICHolder.hpp" #include "prims/jvmtiRedefineClassesTrace.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/vframeArray.hpp" #include "vmreg_ppc.inline.hpp" -#include "adfiles/ad_ppc_64.hpp" #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif #ifdef COMPILER2 +#include "adfiles/ad_ppc_64.hpp" #include "opto/runtime.hpp" #endif diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp index d452b27038c..290a4be01b0 100644 --- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -401,11 +401,11 @@ class StubGenerator: public StubCodeGenerator { __ load_const(exception_file, (void*)__FILE__); __ load_const(exception_line, (void*)__LINE__); - __ std(R3_ARG1, thread_(pending_exception)); + __ std(R3_ARG1, in_bytes(JavaThread::pending_exception_offset()), R16_thread); // store into `char *' - __ std(exception_file, thread_(exception_file)); + __ std(exception_file, in_bytes(JavaThread::exception_file_offset()), R16_thread); // store into `int' - __ stw(exception_line, thread_(exception_line)); + __ stw(exception_line, in_bytes(JavaThread::exception_line_offset()), R16_thread); // complete return to VM assert(StubRoutines::_call_stub_return_address != NULL, "must have been generated before"); @@ -524,8 +524,6 @@ class StubGenerator: public StubCodeGenerator { int frame_size_in_bytes = frame::abi_reg_args_size; OopMap* map = new OopMap(frame_size_in_bytes / sizeof(jint), 0); - StubCodeMark mark(this, "StubRoutines", "throw_exception"); - address start = __ pc(); __ save_LR_CR(R11_scratch1); @@ -846,8 +844,6 @@ class StubGenerator: public StubCodeGenerator { // // Don't generate, rather use C++ code. address generate_verify_oop() { - StubCodeMark mark(this, "StubRoutines", "verify_oop"); - // this is actually a `FunctionDescriptor*'. address start = 0; diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp index 8a9fae04770..b787fecc7d5 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp @@ -30,6 +30,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp index 367e8fef7d7..0b375da582e 100644 --- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp @@ -27,6 +27,7 @@ #include "asm/macroAssembler.inline.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateInterpreter.hpp" #include "interpreter/templateTable.hpp" #include "memory/universe.inline.hpp" diff --git a/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp b/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp index 92c4d088de8..4fe7bdb62e1 100644 --- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp @@ -26,10 +26,28 @@ #ifndef CPU_PPC_VM_VMREG_PPC_HPP #define CPU_PPC_VM_VMREG_PPC_HPP - bool is_Register(); - Register as_Register(); +inline bool is_Register() { + return (unsigned int)value() < (unsigned int)ConcreteRegisterImpl::max_gpr; +} - bool is_FloatRegister(); - FloatRegister as_FloatRegister(); +inline bool is_FloatRegister() { + return value() >= ConcreteRegisterImpl::max_gpr && + value() < ConcreteRegisterImpl::max_fpr; +} + +inline Register as_Register() { + assert(is_Register() && is_even(value()), "even-aligned GPR name"); + return ::as_Register(value()>>1); +} + +inline FloatRegister as_FloatRegister() { + assert(is_FloatRegister() && is_even(value()), "must be"); + return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); +} + +inline bool is_concrete() { + assert(is_reg(), "must be"); + return is_even(value()); +} #endif // CPU_PPC_VM_VMREG_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp index d097c5bc5cb..16e5e5d8fd7 100644 --- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp @@ -44,28 +44,5 @@ inline VMReg SpecialRegisterImpl::as_VMReg() { return VMRegImpl::as_VMReg((encoding()) + ConcreteRegisterImpl::max_cnd); } -inline bool VMRegImpl::is_Register() { - return (unsigned int)value() < (unsigned int)ConcreteRegisterImpl::max_gpr; -} - -inline bool VMRegImpl::is_FloatRegister() { - return value() >= ConcreteRegisterImpl::max_gpr && - value() < ConcreteRegisterImpl::max_fpr; -} - -inline Register VMRegImpl::as_Register() { - assert(is_Register() && is_even(value()), "even-aligned GPR name"); - return ::as_Register(value()>>1); -} - -inline FloatRegister VMRegImpl::as_FloatRegister() { - assert(is_FloatRegister() && is_even(value()), "must be"); - return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); -} - -inline bool VMRegImpl::is_concrete() { - assert(is_reg(), "must be"); - return is_even(value()); -} #endif // CPU_PPC_VM_VMREG_PPC_INLINE_HPP diff --git a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp index 1eeca870804..9f9fc75bd1b 100644 --- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ #include "oops/compiledICHolder.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp" -#include "register_sparc.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/signature.hpp" #include "runtime/vframeArray.hpp" diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp index 17b4d9e05ac..2b3bd2dc108 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" #include "interpreter/interpreter.hpp" #include "memory/resourceArea.hpp" #include "oops/markOop.hpp" @@ -593,17 +594,6 @@ bool frame::interpreter_frame_equals_unpacked_fp(intptr_t* fp) { return this->fp() == fp; } - -void frame::pd_gc_epilog() { - if (is_interpreted_frame()) { - // set constant pool cache entry for interpreter - Method* m = interpreter_frame_method(); - - *interpreter_frame_cpoolcache_addr() = m->constants()->cache(); - } -} - - bool frame::is_interpreted_frame_valid(JavaThread* thread) const { #ifdef CC_INTERP // Is there anything to do? @@ -641,10 +631,10 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { return false; } - // validate bci/bcx + // validate bci/bcp - intptr_t bcx = interpreter_frame_bcx(); - if (m->validate_bci_from_bcx(bcx) < 0) { + address bcp = interpreter_frame_bcp(); + if (m->validate_bci_from_bcp(bcp) < 0) { return false; } diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp index 51a014872d5..5c0c7492509 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -78,7 +78,6 @@ // Lesp first free element of expression stack // (which grows towards __higher__ addresses) // Lbcp is set to address of bytecode to execute -// It is accessed in the frame under the name "bcx". // It may at times (during GC) be an index instead. // Lmethod the method being interpreted // Llocals the base pointer for accessing the locals array diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp index 8aa0105bf0d..72346c6ded6 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -26,6 +26,7 @@ #define CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP #include "asm/macroAssembler.hpp" +#include "code/vmreg.inline.hpp" // Inline functions for SPARC frames: @@ -98,12 +99,12 @@ inline intptr_t** frame::interpreter_frame_locals_addr() const { return (intptr_t**) &istate->_locals; } -inline intptr_t* frame::interpreter_frame_bcx_addr() const { +inline intptr_t* frame::interpreter_frame_bcp_addr() const { interpreterState istate = get_interpreterState(); return (intptr_t*) &istate->_bcp; } -inline intptr_t* frame::interpreter_frame_mdx_addr() const { +inline intptr_t* frame::interpreter_frame_mdp_addr() const { interpreterState istate = get_interpreterState(); return (intptr_t*) &istate->_mdx; } @@ -165,12 +166,11 @@ inline intptr_t** frame::interpreter_frame_locals_addr() const { return (intptr_t**) sp_addr_at( Llocals->sp_offset_in_saved_window()); } -inline intptr_t* frame::interpreter_frame_bcx_addr() const { - // %%%%% reinterpreting Lbcp as a bcx +inline intptr_t* frame::interpreter_frame_bcp_addr() const { return (intptr_t*) sp_addr_at( Lbcp->sp_offset_in_saved_window()); } -inline intptr_t* frame::interpreter_frame_mdx_addr() const { +inline intptr_t* frame::interpreter_frame_mdp_addr() const { // %%%%% reinterpreting ImethodDataPtr as a mdx return (intptr_t*) sp_addr_at( ImethodDataPtr->sp_offset_in_saved_window()); } diff --git a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp index 41bdd88f7f5..8cbe422a4af 100644 --- a/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "asm/macroAssembler.inline.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" diff --git a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp index 132c5292a06..debdaeae7a4 100644 --- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index e43d77665ac..79ca56aecd3 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -23,7 +23,7 @@ */ #include "precompiled.hpp" -#include "asm/assembler.inline.hpp" +#include "asm/macroAssembler.inline.hpp" #include "compiler/disassembler.hpp" #include "gc_interface/collectedHeap.inline.hpp" #include "interpreter/interpreter.hpp" diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp index f03dc8e5e72..5fc0dd0632c 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -186,8 +186,7 @@ REGISTER_DECLARATION(Register, ImethodDataPtr , I2); // Pointer to the current // the interpreter to work right // (These assignments must be compatible with L7_thread_cache; see above.) -// Since Lbcp points into the middle of the method object, -// it is temporarily converted into a "bcx" during GC. +// Lbcp points into the middle of the method object. // Exception processing // These registers are passed into exception handlers. diff --git a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp index af2e4e1e96c..4cd5b2a93c3 100644 --- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2014, 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,6 +25,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" #include "interpreter/interpreter.hpp" +#include "interpreter/interp_masm.hpp" #include "memory/allocation.inline.hpp" #include "prims/methodHandles.hpp" diff --git a/hotspot/src/cpu/sparc/vm/register_sparc.hpp b/hotspot/src/cpu/sparc/vm/register_sparc.hpp index 7d0096ccf59..22cb0283825 100644 --- a/hotspot/src/cpu/sparc/vm/register_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/register_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -26,7 +26,6 @@ #define CPU_SPARC_VM_REGISTER_SPARC_HPP #include "asm/register.hpp" -#include "vm_version_sparc.hpp" // forward declaration class Address; @@ -65,7 +64,7 @@ class RegisterImpl: public AbstractRegisterImpl { friend Register as_oRegister(int number); friend Register as_gRegister(int number); - VMReg as_VMReg(); + inline VMReg as_VMReg(); // accessors int encoding() const { assert(is_valid(), "invalid register"); return value(); } @@ -234,7 +233,7 @@ class FloatRegisterImpl: public AbstractRegisterImpl { }; // construction - VMReg as_VMReg( ); + inline VMReg as_VMReg( ); // accessors int encoding() const { assert(is_valid(), "invalid register"); return value(); } diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad index ca1d7137db5..c261900003b 100644 --- a/hotspot/src/cpu/sparc/vm/sparc.ad +++ b/hotspot/src/cpu/sparc/vm/sparc.ad @@ -9728,7 +9728,7 @@ instruct cmpN_reg_branch_short(cmpOp cmp, iRegN op1, iRegN op2, label labl, flag size(4); ins_cost(BRANCH_COST); - format %{ "CWB$cmp $op1,op2,$labl\t! compressed ptr" %} + format %{ "CWB$cmp $op1,$op2,$labl\t! compressed ptr" %} ins_encode %{ Label* L = $labl$$label; assert(__ use_cbcond(*L), "back to back cbcond"); diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp index c281e3bc005..1f8503161cc 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -1785,7 +1786,7 @@ void TemplateInterpreterGenerator::generate_throw_exception() { __ verify_thread(); // expression stack is undefined here // O0: exception, i.e. Oexception - // Lbcp: exception bcx + // Lbcp: exception bcp __ verify_oop(Oexception); diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index d4eb74f3204..f85864df878 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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,6 +25,7 @@ #include "precompiled.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "memory/universe.inline.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp b/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp index ce8cb4c3d3a..29f38a8d8ca 100644 --- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp @@ -25,10 +25,35 @@ #ifndef CPU_SPARC_VM_VMREG_SPARC_HPP #define CPU_SPARC_VM_VMREG_SPARC_HPP - bool is_Register(); - Register as_Register(); +inline bool is_Register() { return value() >= 0 && value() < ConcreteRegisterImpl::max_gpr; } +inline bool is_FloatRegister() { return value() >= ConcreteRegisterImpl::max_gpr && + value() < ConcreteRegisterImpl::max_fpr; } +inline Register as_Register() { - bool is_FloatRegister(); - FloatRegister as_FloatRegister(); + assert( is_Register() && is_even(value()), "even-aligned GPR name" ); + // Yuk + return ::as_Register(value()>>1); +} + +inline FloatRegister as_FloatRegister() { + assert( is_FloatRegister(), "must be" ); + // Yuk + return ::as_FloatRegister( value() - ConcreteRegisterImpl::max_gpr ); +} + +inline bool is_concrete() { + assert(is_reg(), "must be"); + int v = value(); + if ( v < ConcreteRegisterImpl::max_gpr ) { + return is_even(v); + } + // F0..F31 + if ( v <= ConcreteRegisterImpl::max_gpr + 31) return true; + if ( v < ConcreteRegisterImpl::max_fpr) { + return is_even(v); + } + assert(false, "what register?"); + return false; +} #endif // CPU_SPARC_VM_VMREG_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp index 993216fc12d..936d39db68b 100644 --- a/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp @@ -33,35 +33,5 @@ inline VMReg RegisterImpl::as_VMReg() { inline VMReg FloatRegisterImpl::as_VMReg() { return VMRegImpl::as_VMReg( ConcreteRegisterImpl::max_gpr + encoding() ); } -inline bool VMRegImpl::is_Register() { return value() >= 0 && value() < ConcreteRegisterImpl::max_gpr; } -inline bool VMRegImpl::is_FloatRegister() { return value() >= ConcreteRegisterImpl::max_gpr && - value() < ConcreteRegisterImpl::max_fpr; } -inline Register VMRegImpl::as_Register() { - - assert( is_Register() && is_even(value()), "even-aligned GPR name" ); - // Yuk - return ::as_Register(value()>>1); -} - -inline FloatRegister VMRegImpl::as_FloatRegister() { - assert( is_FloatRegister(), "must be" ); - // Yuk - return ::as_FloatRegister( value() - ConcreteRegisterImpl::max_gpr ); -} - -inline bool VMRegImpl::is_concrete() { - assert(is_reg(), "must be"); - int v = value(); - if ( v < ConcreteRegisterImpl::max_gpr ) { - return is_even(v); - } - // F0..F31 - if ( v <= ConcreteRegisterImpl::max_gpr + 31) return true; - if ( v < ConcreteRegisterImpl::max_fpr) { - return is_even(v); - } - assert(false, "what register?"); - return false; -} #endif // CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp index 1b16153e255..ad15c864453 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.cpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp @@ -537,10 +537,6 @@ bool frame::interpreter_frame_equals_unpacked_fp(intptr_t* fp) { return _fp == (fp - diff); } -void frame::pd_gc_epilog() { - // nothing done here now -} - bool frame::is_interpreted_frame_valid(JavaThread* thread) const { // QQQ #ifdef CC_INTERP @@ -577,10 +573,10 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { return false; } - // validate bci/bcx + // validate bci/bcp - intptr_t bcx = interpreter_frame_bcx(); - if (m->validate_bci_from_bcx(bcx) < 0) { + address bcp = interpreter_frame_bcp(); + if (m->validate_bci_from_bcp(bcp) < 0) { return false; } @@ -692,10 +688,10 @@ void frame::describe_pd(FrameValues& values, int frame_no) { DESCRIBE_FP_OFFSET(interpreter_frame_sender_sp); DESCRIBE_FP_OFFSET(interpreter_frame_last_sp); DESCRIBE_FP_OFFSET(interpreter_frame_method); - DESCRIBE_FP_OFFSET(interpreter_frame_mdx); + DESCRIBE_FP_OFFSET(interpreter_frame_mdp); DESCRIBE_FP_OFFSET(interpreter_frame_cache); DESCRIBE_FP_OFFSET(interpreter_frame_locals); - DESCRIBE_FP_OFFSET(interpreter_frame_bcx); + DESCRIBE_FP_OFFSET(interpreter_frame_bcp); DESCRIBE_FP_OFFSET(interpreter_frame_initial_sp); #endif } diff --git a/hotspot/src/cpu/x86/vm/frame_x86.hpp b/hotspot/src/cpu/x86/vm/frame_x86.hpp index 8c6a72c2e97..890e1d1aa05 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -40,7 +40,7 @@ // ... | monitor block size // [monitors ] / // [monitor block size ] -// [byte code index/pointr] = bcx() bcx_offset +// [byte code pointer ] = bcp() bcp_offset // [pointer to locals ] = locals() locals_offset // [constant pool cache ] = cache() cache_offset // [methodData ] = mdp() mdx_offset @@ -111,11 +111,11 @@ // outgoing sp before a call to an invoked method interpreter_frame_last_sp_offset = interpreter_frame_sender_sp_offset - 1, interpreter_frame_method_offset = interpreter_frame_last_sp_offset - 1, - interpreter_frame_mdx_offset = interpreter_frame_method_offset - 1, - interpreter_frame_cache_offset = interpreter_frame_mdx_offset - 1, + interpreter_frame_mdp_offset = interpreter_frame_method_offset - 1, + interpreter_frame_cache_offset = interpreter_frame_mdp_offset - 1, interpreter_frame_locals_offset = interpreter_frame_cache_offset - 1, - interpreter_frame_bcx_offset = interpreter_frame_locals_offset - 1, - interpreter_frame_initial_sp_offset = interpreter_frame_bcx_offset - 1, + interpreter_frame_bcp_offset = interpreter_frame_locals_offset - 1, + interpreter_frame_initial_sp_offset = interpreter_frame_bcp_offset - 1, interpreter_frame_monitor_block_top_offset = interpreter_frame_initial_sp_offset, interpreter_frame_monitor_block_bottom_offset = interpreter_frame_initial_sp_offset, diff --git a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp index 9b875b83499..a3f44363a17 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -26,6 +26,7 @@ #define CPU_X86_VM_FRAME_X86_INLINE_HPP #include "code/codeCache.hpp" +#include "code/vmreg.inline.hpp" // Inline functions for Intel frames: @@ -168,7 +169,7 @@ inline intptr_t** frame::interpreter_frame_locals_addr() const { return &(get_interpreterState()->_locals); } -inline intptr_t* frame::interpreter_frame_bcx_addr() const { +inline intptr_t* frame::interpreter_frame_bcp_addr() const { assert(is_interpreted_frame(), "must be interpreted"); return (intptr_t*) &(get_interpreterState()->_bcp); } @@ -188,7 +189,7 @@ inline Method** frame::interpreter_frame_method_addr() const { return &(get_interpreterState()->_method); } -inline intptr_t* frame::interpreter_frame_mdx_addr() const { +inline intptr_t* frame::interpreter_frame_mdp_addr() const { assert(is_interpreted_frame(), "must be interpreted"); return (intptr_t*) &(get_interpreterState()->_mdx); } @@ -210,13 +211,13 @@ inline intptr_t* frame::interpreter_frame_last_sp() const { return *(intptr_t**)addr_at(interpreter_frame_last_sp_offset); } -inline intptr_t* frame::interpreter_frame_bcx_addr() const { - return (intptr_t*)addr_at(interpreter_frame_bcx_offset); +inline intptr_t* frame::interpreter_frame_bcp_addr() const { + return (intptr_t*)addr_at(interpreter_frame_bcp_offset); } -inline intptr_t* frame::interpreter_frame_mdx_addr() const { - return (intptr_t*)addr_at(interpreter_frame_mdx_offset); +inline intptr_t* frame::interpreter_frame_mdp_addr() const { + return (intptr_t*)addr_at(interpreter_frame_mdp_offset); } diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp index 42a826d7710..34d0d8061d0 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -134,7 +134,7 @@ void InterpreterMacroAssembler::profile_arguments_type(Register mdp, Register ca shll(tmp, exact_log2(DataLayout::cell_size)); addptr(mdp, tmp); } - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp); } else { assert(MethodData::profile_return(), "either profile call args or call ret"); update_mdp_by_constant(mdp, in_bytes(TypeEntriesAtCall::return_only_size())); diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp index d9ba3389967..181ee15251b 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -826,7 +826,7 @@ void InterpreterMacroAssembler::unlock_object(Register lock_reg) { // Test ImethodDataPtr. If it is null, continue at the specified label void InterpreterMacroAssembler::test_method_data_pointer(Register mdp, Label& zero_continue) { assert(ProfileInterpreter, "must be profiling interpreter"); - movptr(mdp, Address(rbp, frame::interpreter_frame_mdx_offset * wordSize)); + movptr(mdp, Address(rbp, frame::interpreter_frame_mdp_offset * wordSize)); testptr(mdp, mdp); jcc(Assembler::zero, zero_continue); } @@ -853,7 +853,7 @@ void InterpreterMacroAssembler::set_method_data_pointer_for_bcp() { addptr(rbx, in_bytes(MethodData::data_offset())); addptr(rax, rbx); bind(set_mdp); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rax); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), rax); pop(rbx); pop(rax); } @@ -975,7 +975,7 @@ void InterpreterMacroAssembler::update_mdp_by_offset(Register mdp_in, int offset assert(ProfileInterpreter, "must be profiling interpreter"); Address disp_address(mdp_in, offset_of_disp); addptr(mdp_in,disp_address); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in); } @@ -983,14 +983,14 @@ void InterpreterMacroAssembler::update_mdp_by_offset(Register mdp_in, Register r assert(ProfileInterpreter, "must be profiling interpreter"); Address disp_address(mdp_in, reg, Address::times_1, offset_of_disp); addptr(mdp_in, disp_address); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in); } void InterpreterMacroAssembler::update_mdp_by_constant(Register mdp_in, int constant) { assert(ProfileInterpreter, "must be profiling interpreter"); addptr(mdp_in, constant); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in); } diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp index 88f01fc5852..e4d61364de4 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_32.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -61,8 +61,8 @@ #else - void save_bcp() { movptr(Address(rbp, frame::interpreter_frame_bcx_offset * wordSize), rsi); } - void restore_bcp() { movptr(rsi, Address(rbp, frame::interpreter_frame_bcx_offset * wordSize)); } + void save_bcp() { movptr(Address(rbp, frame::interpreter_frame_bcp_offset * wordSize), rsi); } + void restore_bcp() { movptr(rsi, Address(rbp, frame::interpreter_frame_bcp_offset * wordSize)); } void restore_locals() { movptr(rdi, Address(rbp, frame::interpreter_frame_locals_offset * wordSize)); } // Helpers for runtime call arguments/results diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp index c5969601333..23e3b973041 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -841,7 +841,7 @@ void InterpreterMacroAssembler::unlock_object(Register lock_reg) { void InterpreterMacroAssembler::test_method_data_pointer(Register mdp, Label& zero_continue) { assert(ProfileInterpreter, "must be profiling interpreter"); - movptr(mdp, Address(rbp, frame::interpreter_frame_mdx_offset * wordSize)); + movptr(mdp, Address(rbp, frame::interpreter_frame_mdp_offset * wordSize)); testptr(mdp, mdp); jcc(Assembler::zero, zero_continue); } @@ -868,7 +868,7 @@ void InterpreterMacroAssembler::set_method_data_pointer_for_bcp() { addptr(rbx, in_bytes(MethodData::data_offset())); addptr(rax, rbx); bind(set_mdp); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), rax); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), rax); pop(rbx); pop(rax); } @@ -991,7 +991,7 @@ void InterpreterMacroAssembler::update_mdp_by_offset(Register mdp_in, assert(ProfileInterpreter, "must be profiling interpreter"); Address disp_address(mdp_in, offset_of_disp); addptr(mdp_in, disp_address); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in); } @@ -1001,7 +1001,7 @@ void InterpreterMacroAssembler::update_mdp_by_offset(Register mdp_in, assert(ProfileInterpreter, "must be profiling interpreter"); Address disp_address(mdp_in, reg, Address::times_1, offset_of_disp); addptr(mdp_in, disp_address); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in); } @@ -1009,7 +1009,7 @@ void InterpreterMacroAssembler::update_mdp_by_constant(Register mdp_in, int constant) { assert(ProfileInterpreter, "must be profiling interpreter"); addptr(mdp_in, constant); - movptr(Address(rbp, frame::interpreter_frame_mdx_offset * wordSize), mdp_in); + movptr(Address(rbp, frame::interpreter_frame_mdp_offset * wordSize), mdp_in); } diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp index 9186009fa9a..a1cd4466bb9 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86_64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -58,11 +58,11 @@ // Interpreter-specific registers void save_bcp() { - movptr(Address(rbp, frame::interpreter_frame_bcx_offset * wordSize), r13); + movptr(Address(rbp, frame::interpreter_frame_bcp_offset * wordSize), r13); } void restore_bcp() { - movptr(r13, Address(rbp, frame::interpreter_frame_bcx_offset * wordSize)); + movptr(r13, Address(rbp, frame::interpreter_frame_bcp_offset * wordSize)); } void restore_locals() { diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp index 3c66bf4fb45..abe354360ff 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp index e9c1ef782d8..65ffc6d2e97 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/x86/vm/register_x86.hpp b/hotspot/src/cpu/x86/vm/register_x86.hpp index 680dd900a48..b5e6989d5d9 100644 --- a/hotspot/src/cpu/x86/vm/register_x86.hpp +++ b/hotspot/src/cpu/x86/vm/register_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -26,7 +26,6 @@ #define CPU_X86_VM_REGISTER_X86_HPP #include "asm/register.hpp" -#include "vm_version_x86.hpp" class VMRegImpl; typedef VMRegImpl* VMReg; @@ -59,7 +58,7 @@ class RegisterImpl: public AbstractRegisterImpl { // construction inline friend Register as_Register(int encoding); - VMReg as_VMReg(); + inline VMReg as_VMReg(); // accessors int encoding() const { assert(is_valid(), "invalid register"); return (intptr_t)this; } @@ -110,9 +109,10 @@ class FloatRegisterImpl: public AbstractRegisterImpl { // construction inline friend FloatRegister as_FloatRegister(int encoding); - VMReg as_VMReg(); + inline VMReg as_VMReg(); // derived registers, offsets, and addresses + FloatRegister successor() const { return as_FloatRegister(encoding() + 1); } // accessors @@ -152,7 +152,7 @@ class XMMRegisterImpl: public AbstractRegisterImpl { // construction friend XMMRegister as_XMMRegister(int encoding); - VMReg as_VMReg(); + inline VMReg as_VMReg(); // derived registers, offsets, and addresses XMMRegister successor() const { return as_XMMRegister(encoding() + 1); } diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp index 1e49ce1c6a4..e705dfbe0ce 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -51,7 +52,7 @@ #ifndef CC_INTERP const int method_offset = frame::interpreter_frame_method_offset * wordSize; -const int bci_offset = frame::interpreter_frame_bcx_offset * wordSize; +const int bcp_offset = frame::interpreter_frame_bcp_offset * wordSize; const int locals_offset = frame::interpreter_frame_locals_offset * wordSize; //------------------------------------------------------------------------------------------------------------------------ diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp index 12b0d0568f9..9c81d6787a1 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -28,6 +28,7 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -51,7 +52,7 @@ #ifndef CC_INTERP const int method_offset = frame::interpreter_frame_method_offset * wordSize; -const int bci_offset = frame::interpreter_frame_bcx_offset * wordSize; +const int bcp_offset = frame::interpreter_frame_bcp_offset * wordSize; const int locals_offset = frame::interpreter_frame_locals_offset * wordSize; //----------------------------------------------------------------------------- diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp index 7fc8d33c42f..da56c1449cd 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -26,6 +26,7 @@ #include "asm/macroAssembler.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "memory/universe.inline.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp index 60f62077e55..00d2d58cdfb 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -26,6 +26,7 @@ #include "asm/macroAssembler.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "memory/universe.inline.hpp" #include "oops/methodData.hpp" diff --git a/hotspot/src/cpu/x86/vm/vmreg_x86.hpp b/hotspot/src/cpu/x86/vm/vmreg_x86.hpp index 38d47dccfc3..f31e1c5c9fd 100644 --- a/hotspot/src/cpu/x86/vm/vmreg_x86.hpp +++ b/hotspot/src/cpu/x86/vm/vmreg_x86.hpp @@ -25,13 +25,49 @@ #ifndef CPU_X86_VM_VMREG_X86_HPP #define CPU_X86_VM_VMREG_X86_HPP - bool is_Register(); - Register as_Register(); - bool is_FloatRegister(); - FloatRegister as_FloatRegister(); - bool is_XMMRegister(); - XMMRegister as_XMMRegister(); +inline bool is_Register() { + return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr; +} + +inline bool is_FloatRegister() { + return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr; +} + +inline bool is_XMMRegister() { + return value() >= ConcreteRegisterImpl::max_fpr && value() < ConcreteRegisterImpl::max_xmm; +} + +inline Register as_Register() { + + assert( is_Register(), "must be"); + // Yuk +#ifdef AMD64 + return ::as_Register(value() >> 1); +#else + return ::as_Register(value()); +#endif // AMD64 +} + +inline FloatRegister as_FloatRegister() { + assert( is_FloatRegister() && is_even(value()), "must be" ); + // Yuk + return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); +} + +inline XMMRegister as_XMMRegister() { + assert( is_XMMRegister() && is_even(value()), "must be" ); + // Yuk + return ::as_XMMRegister((value() - ConcreteRegisterImpl::max_fpr) >> 3); +} + +inline bool is_concrete() { + assert(is_reg(), "must be"); +#ifndef AMD64 + if (is_Register()) return true; +#endif // AMD64 + return is_even(value()); +} #endif // CPU_X86_VM_VMREG_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp b/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp index 0608d3edbff..bc94e4839af 100644 --- a/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/vmreg_x86.inline.hpp @@ -42,48 +42,4 @@ inline VMReg XMMRegisterImpl::as_VMReg() { return VMRegImpl::as_VMReg((encoding() << 3) + ConcreteRegisterImpl::max_fpr); } - -inline bool VMRegImpl::is_Register() { - return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr; -} - -inline bool VMRegImpl::is_FloatRegister() { - return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr; -} - -inline bool VMRegImpl::is_XMMRegister() { - return value() >= ConcreteRegisterImpl::max_fpr && value() < ConcreteRegisterImpl::max_xmm; -} - -inline Register VMRegImpl::as_Register() { - - assert( is_Register(), "must be"); - // Yuk -#ifdef AMD64 - return ::as_Register(value() >> 1); -#else - return ::as_Register(value()); -#endif // AMD64 -} - -inline FloatRegister VMRegImpl::as_FloatRegister() { - assert( is_FloatRegister() && is_even(value()), "must be" ); - // Yuk - return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); -} - -inline XMMRegister VMRegImpl::as_XMMRegister() { - assert( is_XMMRegister() && is_even(value()), "must be" ); - // Yuk - return ::as_XMMRegister((value() - ConcreteRegisterImpl::max_fpr) >> 3); -} - -inline bool VMRegImpl::is_concrete() { - assert(is_reg(), "must be"); -#ifndef AMD64 - if (is_Register()) return true; -#endif // AMD64 - return is_even(value()); -} - #endif // CPU_X86_VM_VMREG_X86_INLINE_HPP diff --git a/hotspot/src/cpu/x86/vm/x86.ad b/hotspot/src/cpu/x86/vm/x86.ad index b575a98a816..42cc708a610 100644 --- a/hotspot/src/cpu/x86/vm/x86.ad +++ b/hotspot/src/cpu/x86/vm/x86.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2011, 2014, 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 @@ -487,6 +487,8 @@ source_hpp %{ // To keep related declarations/definitions/uses close together, // we switch between source %{ }% and source_hpp %{ }% freely as needed. +class NativeJump; + class CallStubImpl { //-------------------------------------------------------------- diff --git a/hotspot/src/cpu/zero/vm/frame_zero.cpp b/hotspot/src/cpu/zero/vm/frame_zero.cpp index 4be75fdc3b3..a1be88d81c8 100644 --- a/hotspot/src/cpu/zero/vm/frame_zero.cpp +++ b/hotspot/src/cpu/zero/vm/frame_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -119,9 +119,6 @@ bool frame::safe_for_sender(JavaThread *thread) { return false; } -void frame::pd_gc_epilog() { -} - bool frame::is_interpreted_frame_valid(JavaThread *thread) const { ShouldNotCallThis(); return false; diff --git a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp index 8c968599864..64e7f5fdf1f 100644 --- a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp +++ b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -101,7 +101,7 @@ inline intptr_t** frame::interpreter_frame_locals_addr() const { return &(get_interpreterState()->_locals); } -inline intptr_t* frame::interpreter_frame_bcx_addr() const { +inline intptr_t* frame::interpreter_frame_bcp_addr() const { return (intptr_t*) &(get_interpreterState()->_bcp); } @@ -113,7 +113,7 @@ inline Method** frame::interpreter_frame_method_addr() const { return &(get_interpreterState()->_method); } -inline intptr_t* frame::interpreter_frame_mdx_addr() const { +inline intptr_t* frame::interpreter_frame_mdp_addr() const { return (intptr_t*) &(get_interpreterState()->_mdx); } diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index d0888881639..70ca91a62ce 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -66,6 +66,7 @@ #include "runtime/thread.inline.hpp" #include "runtime/threadCritical.hpp" #include "runtime/timer.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/runtimeService.hpp" #include "utilities/decoder.hpp" @@ -1213,10 +1214,6 @@ void os::die() { ::abort(); } -// Unused on Aix for now. -void os::set_error_file(const char *logfile) {} - - // This method is a copy of JDK's sysGetLastErrorString // from src/solaris/hpi/src/system_md.c diff --git a/hotspot/src/os/aix/vm/os_aix.inline.hpp b/hotspot/src/os/aix/vm/os_aix.inline.hpp index 85d8bd87810..b6a20fedd14 100644 --- a/hotspot/src/os/aix/vm/os_aix.inline.hpp +++ b/hotspot/src/os/aix/vm/os_aix.inline.hpp @@ -36,9 +36,6 @@ #include #include -// Defined in the system headers included above. -#undef rem_size - inline void* os::thread_local_storage_at(int index) { return pthread_getspecific((pthread_key_t)index); } diff --git a/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp b/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp index 21d979f3efb..4912e8e36a5 100644 --- a/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp +++ b/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -202,11 +202,11 @@ int generateJvmOffsets(GEN_variant gen_variant) { GEN_VALUE(OFFSET_interpreter_frame_method, 2 * pointer_size); /* L2 in saved window */ GEN_VALUE(OFFSET_interpreter_frame_sender_sp, 13 * pointer_size); /* I5 in saved window */ // Fake value for consistency. It is not going to be used. - GEN_VALUE(OFFSET_interpreter_frame_bcx_offset, 0xFFFF); + GEN_VALUE(OFFSET_interpreter_frame_bcp_offset, 0xFFFF); #elif defined(i386) || defined(__i386) || defined(__amd64) GEN_VALUE(OFFSET_interpreter_frame_sender_sp, -1 * pointer_size); GEN_VALUE(OFFSET_interpreter_frame_method, -3 * pointer_size); - GEN_VALUE(OFFSET_interpreter_frame_bcx_offset, -7 * pointer_size); + GEN_VALUE(OFFSET_interpreter_frame_bcp_offset, -7 * pointer_size); #endif GEN_OFFS(Klass, _name); diff --git a/hotspot/src/os/bsd/dtrace/libjvm_db.c b/hotspot/src/os/bsd/dtrace/libjvm_db.c index c51441e59ff..cf133b4589a 100644 --- a/hotspot/src/os/bsd/dtrace/libjvm_db.c +++ b/hotspot/src/os/bsd/dtrace/libjvm_db.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -164,7 +164,7 @@ struct jvm_agent { int32_t SIZE_CodeCache_log2_segment; uint64_t methodPtr; - uint64_t bcx; + uint64_t bcp; Nmethod_t *N; /*Inlined methods support */ Frame_t prev_fr; @@ -260,6 +260,9 @@ static int parse_vmstructs(jvm_agent_t* J) { uint64_t base; int err; + /* Clear *vmp now in case we jump to fail: */ + memset(vmp, 0, sizeof(VMStructEntry)); + err = ps_pglobal_lookup(J->P, LIBJVM_SO, "gHotSpotVMStructs", &sym_addr); CHECK_FAIL(err); err = read_pointer(J, sym_addr, &gHotSpotVMStructs); @@ -1068,19 +1071,9 @@ name_for_nmethod(jvm_agent_t* J, return err; } -int is_bci(intptr_t bcx) { - switch (DATA_MODEL) { - case PR_MODEL_LP64: - return ((uintptr_t) bcx) <= ((uintptr_t) MAX_METHOD_CODE_SIZE) ; - case PR_MODEL_ILP32: - default: - return 0 <= bcx && bcx <= MAX_METHOD_CODE_SIZE; - } -} - static int name_for_imethod(jvm_agent_t* J, - uint64_t bcx, + uint64_t bcp, uint64_t method, char *result, size_t size, @@ -1095,7 +1088,7 @@ name_for_imethod(jvm_agent_t* J, err = read_pointer(J, method + OFFSET_Method_constMethod, &constMethod); CHECK_FAIL(err); - bci = is_bci(bcx) ? bcx : bcx - (constMethod + (uint64_t) SIZE_ConstMethod); + bci = bcp - (constMethod + (uint64_t) SIZE_ConstMethod); if (debug) fprintf(stderr, "\t name_for_imethod: BEGIN: method: %#llx\n", method); @@ -1169,7 +1162,7 @@ name_for_codecache(jvm_agent_t* J, uint64_t fp, uint64_t pc, char * result, if (err == PS_OK && strncmp(name, "Interpreter", 11) == 0) { *is_interpreted = 1; if (is_method(J, J->methodPtr)) { - return name_for_imethod(J, J->bcx, J->methodPtr, result, size, jframe); + return name_for_imethod(J, J->bcp, J->methodPtr, result, size, jframe); } } @@ -1326,7 +1319,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, /* arguments given to read_pointer need to be worst case sized */ uint64_t methodPtr = 0; uint64_t sender_sp; - uint64_t bcx = 0; + uint64_t bcp = 0; int is_interpreted = 0; int result = PS_OK; int err = PS_OK; @@ -1357,7 +1350,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, * regs[R_PC] contains a CALL instruction pc offset. */ pc += 8; - bcx = (uintptr_t) regs[R_L1]; + bcp = (uintptr_t) regs[R_L1]; methodPtr = (uintptr_t) regs[R_L2]; sender_sp = regs[R_I5]; if (debug > 2) { @@ -1385,13 +1378,13 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, if (read_pointer(J, fp + OFFSET_interpreter_frame_sender_sp, &sender_sp) != PS_OK) { sender_sp = 0; } - if (read_pointer(J, fp + OFFSET_interpreter_frame_bcx_offset, &bcx) != PS_OK) { - bcx = 0; + if (read_pointer(J, fp + OFFSET_interpreter_frame_bcp_offset, &bcp) != PS_OK) { + bcp = 0; } #endif /* i386 */ J->methodPtr = methodPtr; - J->bcx = bcx; + J->bcp = bcp; /* On x86 with C2 JVM: native frame may have wrong regs[R_FP] * For example: JVM_SuspendThread frame poins to the top interpreted frame. @@ -1402,7 +1395,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, */ #ifndef X86_COMPILER2 if (is_method(J, J->methodPtr)) { - result = name_for_imethod(J, bcx, J->methodPtr, name, size, jframe); + result = name_for_imethod(J, bcp, J->methodPtr, name, size, jframe); /* If the methodPtr is a method then this is highly likely to be an interpreter frame */ if (result >= 0) { @@ -1416,7 +1409,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, } #ifdef X86_COMPILER2 else if (is_method(J, J->methodPtr)) { - result = name_for_imethod(J, bcx, J->methodPtr, name, size, jframe); + result = name_for_imethod(J, bcp, J->methodPtr, name, size, jframe); /* If the methodPtr is a method then this is highly likely to be an interpreter frame */ if (result >= 0) { diff --git a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp index 3fb13e5e97c..c5e8b3461e8 100644 --- a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp +++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -197,11 +197,11 @@ int generateJvmOffsets(GEN_variant gen_variant) { GEN_VALUE(OFFSET_interpreter_frame_method, 2 * pointer_size); /* L2 in saved window */ GEN_VALUE(OFFSET_interpreter_frame_sender_sp, 13 * pointer_size); /* I5 in saved window */ // Fake value for consistency. It is not going to be used. - GEN_VALUE(OFFSET_interpreter_frame_bcx_offset, 0xFFFF); + GEN_VALUE(OFFSET_interpreter_frame_bcp_offset, 0xFFFF); #elif defined(i386) || defined(__i386) || defined(__amd64) GEN_VALUE(OFFSET_interpreter_frame_sender_sp, -1 * pointer_size); GEN_VALUE(OFFSET_interpreter_frame_method, -3 * pointer_size); - GEN_VALUE(OFFSET_interpreter_frame_bcx_offset, -7 * pointer_size); + GEN_VALUE(OFFSET_interpreter_frame_bcp_offset, -7 * pointer_size); #endif GEN_OFFS(Klass, _name); diff --git a/hotspot/src/os/solaris/dtrace/libjvm_db.c b/hotspot/src/os/solaris/dtrace/libjvm_db.c index b15c187da76..40dada151eb 100644 --- a/hotspot/src/os/solaris/dtrace/libjvm_db.c +++ b/hotspot/src/os/solaris/dtrace/libjvm_db.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -164,7 +164,7 @@ struct jvm_agent { int32_t SIZE_CodeCache_log2_segment; uint64_t methodPtr; - uint64_t bcx; + uint64_t bcp; Nmethod_t *N; /*Inlined methods support */ Frame_t prev_fr; @@ -260,6 +260,9 @@ static int parse_vmstructs(jvm_agent_t* J) { uint64_t base; int err; + /* Clear *vmp now in case we jump to fail: */ + memset(vmp, 0, sizeof(VMStructEntry)); + err = ps_pglobal_lookup(J->P, LIBJVM_SO, "gHotSpotVMStructs", &sym_addr); CHECK_FAIL(err); err = read_pointer(J, sym_addr, &gHotSpotVMStructs); @@ -1068,19 +1071,9 @@ name_for_nmethod(jvm_agent_t* J, return err; } -int is_bci(intptr_t bcx) { - switch (DATA_MODEL) { - case PR_MODEL_LP64: - return ((uintptr_t) bcx) <= ((uintptr_t) MAX_METHOD_CODE_SIZE) ; - case PR_MODEL_ILP32: - default: - return 0 <= bcx && bcx <= MAX_METHOD_CODE_SIZE; - } -} - static int name_for_imethod(jvm_agent_t* J, - uint64_t bcx, + uint64_t bcp, uint64_t method, char *result, size_t size, @@ -1095,7 +1088,7 @@ name_for_imethod(jvm_agent_t* J, err = read_pointer(J, method + OFFSET_Method_constMethod, &constMethod); CHECK_FAIL(err); - bci = is_bci(bcx) ? bcx : bcx - (constMethod + (uint64_t) SIZE_ConstMethod); + bci = bcp - (constMethod + (uint64_t) SIZE_ConstMethod); if (debug) fprintf(stderr, "\t name_for_imethod: BEGIN: method: %#llx\n", method); @@ -1169,7 +1162,7 @@ name_for_codecache(jvm_agent_t* J, uint64_t fp, uint64_t pc, char * result, if (err == PS_OK && strncmp(name, "Interpreter", 11) == 0) { *is_interpreted = 1; if (is_method(J, J->methodPtr)) { - return name_for_imethod(J, J->bcx, J->methodPtr, result, size, jframe); + return name_for_imethod(J, J->bcp, J->methodPtr, result, size, jframe); } } @@ -1326,7 +1319,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, /* arguments given to read_pointer need to be worst case sized */ uint64_t methodPtr = 0; uint64_t sender_sp; - uint64_t bcx = 0; + uint64_t bcp = 0; int is_interpreted = 0; int result = PS_OK; int err = PS_OK; @@ -1357,7 +1350,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, * regs[R_PC] contains a CALL instruction pc offset. */ pc += 8; - bcx = (uintptr_t) regs[R_L1]; + bcp = (uintptr_t) regs[R_L1]; methodPtr = (uintptr_t) regs[R_L2]; sender_sp = regs[R_I5]; if (debug > 2) { @@ -1385,13 +1378,13 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, if (read_pointer(J, fp + OFFSET_interpreter_frame_sender_sp, &sender_sp) != PS_OK) { sender_sp = 0; } - if (read_pointer(J, fp + OFFSET_interpreter_frame_bcx_offset, &bcx) != PS_OK) { - bcx = 0; + if (read_pointer(J, fp + OFFSET_interpreter_frame_bcp_offset, &bcp) != PS_OK) { + bcp = 0; } #endif /* i386 */ J->methodPtr = methodPtr; - J->bcx = bcx; + J->bcp = bcp; /* On x86 with C2 JVM: native frame may have wrong regs[R_FP] * For example: JVM_SuspendThread frame poins to the top interpreted frame. @@ -1402,7 +1395,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, */ #ifndef X86_COMPILER2 if (is_method(J, J->methodPtr)) { - result = name_for_imethod(J, bcx, J->methodPtr, name, size, jframe); + result = name_for_imethod(J, bcp, J->methodPtr, name, size, jframe); /* If the methodPtr is a method then this is highly likely to be an interpreter frame */ if (result >= 0) { @@ -1416,7 +1409,7 @@ int Jlookup_by_regs(jvm_agent_t* J, const prgregset_t regs, char *name, } #ifdef X86_COMPILER2 else if (is_method(J, J->methodPtr)) { - result = name_for_imethod(J, bcx, J->methodPtr, name, size, jframe); + result = name_for_imethod(J, bcp, J->methodPtr, name, size, jframe); /* If the methodPtr is a method then this is highly likely to be an interpreter frame */ if (result >= 0) { diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 29d8154ece2..21cb27a3c0e 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -59,6 +59,7 @@ #include "runtime/thread.inline.hpp" #include "runtime/threadCritical.hpp" #include "runtime/timer.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/memTracker.hpp" #include "services/runtimeService.hpp" diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index c8a15526f7e..d312b975abc 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -62,6 +62,7 @@ #include "runtime/thread.inline.hpp" #include "runtime/threadCritical.hpp" #include "runtime/timer.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/memTracker.hpp" #include "services/runtimeService.hpp" diff --git a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp index 744bb7c38d4..046912a2c24 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, SAP AG. 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 @@ -28,7 +28,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_ppc.hpp" #ifndef _LP64 #error "Atomic currently only impleneted for PPC64" diff --git a/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp index 93e5ed159cd..36ca820a6bd 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #define OS_CPU_AIX_OJDKPPC_VM_ORDERACCESS_AIX_PPC_INLINE_HPP #include "runtime/orderAccess.hpp" -#include "vm_version_ppc.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp b/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp index ab7fab3dd13..0a9feddfec4 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp b/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp index c7459d5a514..834efd2bbf7 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -28,7 +28,6 @@ #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp b/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp index 4ed2934463b..60969caa962 100644 --- a/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp +++ b/hotspot/src/os_cpu/bsd_zero/vm/atomic_bsd_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -28,7 +28,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_zero.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp b/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp index 7f8e78bbff8..ecc4c752777 100644 --- a/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp +++ b/hotspot/src/os_cpu/bsd_zero/vm/orderAccess_bsd_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,7 +27,6 @@ #define OS_CPU_BSD_ZERO_VM_ORDERACCESS_BSD_ZERO_INLINE_HPP #include "runtime/orderAccess.hpp" -#include "vm_version_zero.hpp" #ifdef ARM diff --git a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp index c8fcf1f64d2..39ed85ea361 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, SAP AG. 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 @@ -28,7 +28,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_ppc.hpp" #ifndef PPC64 #error "Atomic currently only implemented for PPC64" diff --git a/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp index dcc2375f878..dff21c6bf6a 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #define OS_CPU_LINUX_PPC_VM_ORDERACCESS_LINUX_PPC_INLINE_HPP #include "runtime/orderAccess.hpp" -#include "vm_version_ppc.hpp" #ifndef PPC64 #error "OrderAccess currently only implemented for PPC64" diff --git a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp index 331eed7a67f..29b51d70f7f 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_sparc.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp index 6833c1f4e61..f5215f187e8 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -26,7 +26,6 @@ #define OS_CPU_LINUX_SPARC_VM_ORDERACCESS_LINUX_SPARC_INLINE_HPP #include "runtime/orderAccess.hpp" -#include "vm_version_sparc.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp index 6e364f4087a..14194e44947 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp @@ -118,7 +118,7 @@ ExtendedPC os::fetch_frame_from_context(void* ucVoid, *ret_sp = os::Linux::ucontext_get_sp(uc); } if (ret_fp) { - *ret_fp = os::Linux::ucontext_get_fp(uc); + *ret_fp = (intptr_t*)NULL; } } else { // construct empty ExtendedPC for return value checking @@ -136,18 +136,15 @@ ExtendedPC os::fetch_frame_from_context(void* ucVoid, frame os::fetch_frame_from_context(void* ucVoid) { intptr_t* sp; - intptr_t* fp; - ExtendedPC epc = fetch_frame_from_context(ucVoid, &sp, &fp); - return frame(sp, fp, epc.pc()); + ExtendedPC epc = fetch_frame_from_context(ucVoid, &sp, NULL); + return frame(sp, frame::unpatchable, epc.pc()); } frame os::get_sender_for_C_frame(frame* fr) { - return frame(fr->sender_sp(), fr->link(), fr->sender_pc()); + return frame(fr->sender_sp(), frame::unpatchable, fr->sender_pc()); } frame os::current_frame() { - fprintf(stderr, "current_frame()"); - intptr_t* sp = StubRoutines::Sparc::flush_callers_register_windows_func()(); frame myframe(sp, frame::unpatchable, CAST_FROM_FN_PTR(address, os::current_frame)); diff --git a/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp index 2d0d5197344..679dd614523 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp index 10240a0b1c2..a71a53cfa8c 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -28,7 +28,6 @@ #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp index 33ce50dc73f..d9df41034d4 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -28,7 +28,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_zero.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp b/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp index 773fd643ab7..e15041e76a7 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp +++ b/hotspot/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -27,7 +27,6 @@ #define OS_CPU_LINUX_ZERO_VM_ORDERACCESS_LINUX_ZERO_INLINE_HPP #include "runtime/orderAccess.hpp" -#include "vm_version_zero.hpp" #ifdef ARM diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp index 7d17fdf39cd..83a07ce3fe5 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/atomic_solaris_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_sparc.hpp" // Implementation of class atomic diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp index 7e633fd95cb..f9321f2bac2 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/orderAccess_solaris_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.hpp" -#include "vm_version_sparc.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp index ed7b2538280..f22bdcb923e 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp @@ -27,6 +27,7 @@ #include "classfile/classLoader.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "code/icBuffer.hpp" #include "code/vtableStubs.hpp" #include "interpreter/interpreter.hpp" diff --git a/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp index 27c0d396b72..e00d5be1ff0 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; } inline void Atomic::store (jshort store_value, jshort* dest) { *dest = store_value; } diff --git a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp index e7238c27549..e211c060552 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/orderAccess_solaris_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -28,7 +28,6 @@ #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp index 7ba00f7aaeb..072b61f07d3 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/atomic_windows_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,6 @@ #include "runtime/atomic.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // The following alternative implementations are needed because // Windows 95 doesn't support (some of) the corresponding Windows NT diff --git a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp index ea0ed143e98..37e5126e066 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp +++ b/hotspot/src/os_cpu/windows_x86/vm/orderAccess_windows_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -28,7 +28,6 @@ #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.hpp" #include "runtime/os.hpp" -#include "vm_version_x86.hpp" // Implementation of class OrderAccess. diff --git a/hotspot/src/share/vm/adlc/main.cpp b/hotspot/src/share/vm/adlc/main.cpp index 614f0d43f10..6c4553f4b8f 100644 --- a/hotspot/src/share/vm/adlc/main.cpp +++ b/hotspot/src/share/vm/adlc/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -213,7 +213,8 @@ int main(int argc, char *argv[]) AD.addInclude(AD._CPP_file, "memory/allocation.inline.hpp"); AD.addInclude(AD._CPP_file, "asm/macroAssembler.inline.hpp"); AD.addInclude(AD._CPP_file, "code/compiledIC.hpp"); - AD.addInclude(AD._CPP_file, "code/vmreg.hpp"); + AD.addInclude(AD._CPP_file, "code/nativeInst.hpp"); + AD.addInclude(AD._CPP_file, "code/vmreg.inline.hpp"); AD.addInclude(AD._CPP_file, "gc_interface/collectedHeap.inline.hpp"); AD.addInclude(AD._CPP_file, "oops/compiledICHolder.hpp"); AD.addInclude(AD._CPP_file, "oops/markOop.hpp"); @@ -230,23 +231,8 @@ int main(int argc, char *argv[]) AD.addInclude(AD._CPP_file, "runtime/sharedRuntime.hpp"); AD.addInclude(AD._CPP_file, "runtime/stubRoutines.hpp"); AD.addInclude(AD._CPP_file, "utilities/growableArray.hpp"); -#ifdef TARGET_ARCH_x86 - AD.addInclude(AD._CPP_file, "nativeInst_x86.hpp"); - AD.addInclude(AD._CPP_file, "vmreg_x86.inline.hpp"); -#endif -#ifdef TARGET_ARCH_sparc - AD.addInclude(AD._CPP_file, "nativeInst_sparc.hpp"); - AD.addInclude(AD._CPP_file, "vmreg_sparc.inline.hpp"); -#endif -#ifdef TARGET_ARCH_arm - AD.addInclude(AD._CPP_file, "nativeInst_arm.hpp"); - AD.addInclude(AD._CPP_file, "vmreg_arm.inline.hpp"); -#endif -#ifdef TARGET_ARCH_ppc - AD.addInclude(AD._CPP_file, "nativeInst_ppc.hpp"); - AD.addInclude(AD._CPP_file, "vmreg_ppc.inline.hpp"); -#endif AD.addInclude(AD._HPP_file, "memory/allocation.hpp"); + AD.addInclude(AD._HPP_file, "code/nativeInst.hpp"); AD.addInclude(AD._HPP_file, "opto/machnode.hpp"); AD.addInclude(AD._HPP_file, "opto/node.hpp"); AD.addInclude(AD._HPP_file, "opto/regalloc.hpp"); diff --git a/hotspot/src/share/vm/asm/assembler.hpp b/hotspot/src/share/vm/asm/assembler.hpp index ec8ec5eb435..3b9c012e02f 100644 --- a/hotspot/src/share/vm/asm/assembler.hpp +++ b/hotspot/src/share/vm/asm/assembler.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -26,34 +26,15 @@ #define SHARE_VM_ASM_ASSEMBLER_HPP #include "asm/codeBuffer.hpp" +#include "asm/register.hpp" #include "code/oopRecorder.hpp" #include "code/relocInfo.hpp" #include "memory/allocation.hpp" +#include "runtime/vm_version.hpp" #include "utilities/debug.hpp" #include "utilities/growableArray.hpp" #include "utilities/top.hpp" -#ifdef TARGET_ARCH_x86 -# include "register_x86.hpp" -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "register_sparc.hpp" -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "register_zero.hpp" -# include "vm_version_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "register_arm.hpp" -# include "vm_version_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "register_ppc.hpp" -# include "vm_version_ppc.hpp" -#endif - // This file contains platform-independent assembler declarations. class MacroAssembler; diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp index 60d405b35f4..9c4bc206158 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.cpp +++ b/hotspot/src/share/vm/asm/codeBuffer.cpp @@ -28,6 +28,7 @@ #include "memory/gcLocker.hpp" #include "oops/methodData.hpp" #include "oops/oop.inline.hpp" +#include "runtime/icache.hpp" #include "utilities/copy.hpp" #include "utilities/xmlstream.hpp" diff --git a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp index 2d0c31e2afe..e3a4f4d5680 100644 --- a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp +++ b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ #include "c1/c1_Instruction.hpp" #include "c1/c1_LIR.hpp" #include "c1/c1_Runtime1.hpp" +#include "code/nativeInst.hpp" #include "utilities/array.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/c1/c1_Defs.hpp b/hotspot/src/share/vm/c1/c1_Defs.hpp index bebb3b0bebe..7504bbf7ce7 100644 --- a/hotspot/src/share/vm/c1/c1_Defs.hpp +++ b/hotspot/src/share/vm/c1/c1_Defs.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -26,21 +26,7 @@ #define SHARE_VM_C1_C1_DEFS_HPP #include "utilities/globalDefinitions.hpp" -#ifdef TARGET_ARCH_x86 -# include "register_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "register_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "register_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "register_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "register_ppc.hpp" -#endif +#include "asm/register.hpp" // set frame size and return address offset to these values in blobs // (if the compiled frame uses ebp as link pointer on IA; otherwise, diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.cpp b/hotspot/src/share/vm/c1/c1_FrameMap.cpp index f9e46f30132..a164d8ccb00 100644 --- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp +++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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,24 +25,8 @@ #include "precompiled.hpp" #include "c1/c1_FrameMap.hpp" #include "c1/c1_LIR.hpp" +#include "code/vmreg.inline.hpp" #include "runtime/sharedRuntime.hpp" -#ifdef TARGET_ARCH_x86 -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vmreg_ppc.inline.hpp" -#endif - - //----------------------------------------------------- diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index 838e08d799c..351e410aa15 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,7 @@ #include "interpreter/bytecode.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/compilationPolicy.hpp" +#include "runtime/vm_version.hpp" #include "utilities/bitMap.inline.hpp" class BlockListBuilder VALUE_OBJ_CLASS_SPEC { diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp index 5697e9046aa..48b560840e3 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,27 +30,6 @@ #include "c1/c1_MacroAssembler.hpp" #include "c1/c1_ValueStack.hpp" #include "ci/ciInstance.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -# include "vmreg_ppc.inline.hpp" -#endif - void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) { // we must have enough patching space so that call can be inserted diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index bf0b6f2f1ea..57b76803b42 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ #include "ci/ciObjArray.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" +#include "runtime/vm_version.hpp" #include "utilities/bitMap.inline.hpp" #include "utilities/macros.hpp" #if INCLUDE_ALL_GCS diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp index 91bef59ef17..afed1de995f 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,23 +31,8 @@ #include "c1/c1_LIRGenerator.hpp" #include "c1/c1_LinearScan.hpp" #include "c1/c1_ValueStack.hpp" +#include "code/vmreg.inline.hpp" #include "utilities/bitMap.inline.hpp" -#ifdef TARGET_ARCH_x86 -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vmreg_ppc.inline.hpp" -#endif - #ifndef PRODUCT diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index 00696f15542..b8dd1bbfb83 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -56,6 +56,7 @@ #include "runtime/threadCritical.hpp" #include "runtime/vframe.hpp" #include "runtime/vframeArray.hpp" +#include "runtime/vm_version.hpp" #include "utilities/copy.hpp" #include "utilities/events.hpp" diff --git a/hotspot/src/share/vm/ci/ciField.cpp b/hotspot/src/share/vm/ci/ciField.cpp index cd04c9ff135..7eb2119444e 100644 --- a/hotspot/src/share/vm/ci/ciField.cpp +++ b/hotspot/src/share/vm/ci/ciField.cpp @@ -138,6 +138,17 @@ ciField::ciField(ciInstanceKlass* klass, int index): _known_to_link_with_put(NUL return; } + // Access check based on declared_holder. canonical_holder should not be used + // to check access because it can erroneously succeed. If this check fails, + // propagate the declared holder to will_link() which in turn will bail out + // compilation for this field access. + if (!Reflection::verify_field_access(klass->get_Klass(), declared_holder->get_Klass(), canonical_holder, field_desc.access_flags(), true)) { + _holder = declared_holder; + _offset = -1; + _is_constant = false; + return; + } + assert(canonical_holder == field_desc.field_holder(), "just checking"); initialize_from(&field_desc); } diff --git a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp index cbf3baf7945..0d8cfc7878a 100644 --- a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp +++ b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, 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 @@ -28,22 +28,7 @@ #include "interpreter/bytecodes.hpp" #include "memory/oopFactory.hpp" #include "oops/constantPool.hpp" - -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" u2 BytecodeConstantPool::find_or_add(BytecodeCPEntry const& bcpe) { u2 index; diff --git a/hotspot/src/share/vm/classfile/classFileStream.hpp b/hotspot/src/share/vm/classfile/classFileStream.hpp index 691ed808fec..de392e7fa13 100644 --- a/hotspot/src/share/vm/classfile/classFileStream.hpp +++ b/hotspot/src/share/vm/classfile/classFileStream.hpp @@ -25,22 +25,8 @@ #ifndef SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP #define SHARE_VM_CLASSFILE_CLASSFILESTREAM_HPP +#include "utilities/bytes.hpp" #include "utilities/top.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif // Input stream for reading .class file // diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp index cd313d27757..cfd3a68356c 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -1639,9 +1639,9 @@ void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle met if (fr.is_first_frame()) break; address pc = fr.pc(); if (fr.is_interpreted_frame()) { - intptr_t bcx = fr.interpreter_frame_bcx(); + address bcp = fr.interpreter_frame_bcp(); method = fr.interpreter_frame_method(); - bci = fr.is_bci(bcx) ? bcx : method->bci_from((address)bcx); + bci = method->bci_from(bcp); fr = fr.sender(&map); } else { CodeBlob* cb = fr.cb(); diff --git a/hotspot/src/share/vm/classfile/stackMapTable.hpp b/hotspot/src/share/vm/classfile/stackMapTable.hpp index ee8b33f6219..385aef3a7e6 100644 --- a/hotspot/src/share/vm/classfile/stackMapTable.hpp +++ b/hotspot/src/share/vm/classfile/stackMapTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,22 +30,8 @@ #include "memory/allocation.hpp" #include "oops/constantPool.hpp" #include "oops/method.hpp" +#include "utilities/bytes.hpp" #include "utilities/globalDefinitions.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif class StackMapReader; diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index c0183cfe1cc..6fc9ed239af 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -45,21 +45,7 @@ #include "runtime/javaCalls.hpp" #include "runtime/orderAccess.inline.hpp" #include "runtime/os.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" #define NOFAILOVER_MAJOR_VERSION 51 #define NONZERO_PADDING_BYTES_IN_SWITCH_MAJOR_VERSION 51 @@ -439,7 +425,7 @@ void ErrorContext::location_details(outputStream* ss, const Method* method) cons if (_bci != -1 && method != NULL) { streamIndentor si(ss); const char* bytecode_name = ""; - if (method->validate_bci_from_bcx(_bci) != -1) { + if (method->validate_bci(_bci) != -1) { Bytecodes::Code code = Bytecodes::code_or_bp_at(method->bcp_from(_bci)); if (Bytecodes::is_defined(code)) { bytecode_name = Bytecodes::name(code); diff --git a/hotspot/src/share/vm/code/codeBlob.cpp b/hotspot/src/share/vm/code/codeBlob.cpp index f9e78bfb9e2..710ca948ddc 100644 --- a/hotspot/src/share/vm/code/codeBlob.cpp +++ b/hotspot/src/share/vm/code/codeBlob.cpp @@ -39,21 +39,6 @@ #include "runtime/sharedRuntime.hpp" #include "runtime/vframe.hpp" #include "services/memoryService.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -#endif #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif diff --git a/hotspot/src/share/vm/code/compiledIC.hpp b/hotspot/src/share/vm/code/compiledIC.hpp index f2207cc2ec1..d1e9b9a2bce 100644 --- a/hotspot/src/share/vm/code/compiledIC.hpp +++ b/hotspot/src/share/vm/code/compiledIC.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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,9 @@ #ifndef SHARE_VM_CODE_COMPILEDIC_HPP #define SHARE_VM_CODE_COMPILEDIC_HPP +#include "code/nativeInst.hpp" #include "interpreter/linkResolver.hpp" #include "oops/compiledICHolder.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -#endif //----------------------------------------------------------------------------- // The CompiledIC represents a compiled inline cache. diff --git a/jdk/src/share/classes/sun/audio/AudioSecurityExceptionAction.java b/hotspot/src/share/vm/code/nativeInst.hpp similarity index 62% rename from jdk/src/share/classes/sun/audio/AudioSecurityExceptionAction.java rename to hotspot/src/share/vm/code/nativeInst.hpp index ed174c0f3a1..6e4ece7d01a 100644 --- a/jdk/src/share/classes/sun/audio/AudioSecurityExceptionAction.java +++ b/hotspot/src/share/vm/code/nativeInst.hpp @@ -1,12 +1,10 @@ /* - * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * 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 @@ -21,10 +19,26 @@ * 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. + * */ -package sun.audio; +#ifndef SHARE_VM_CODE_NATIVEINST_HPP +#define SHARE_VM_CODE_NATIVEINST_HPP -public interface AudioSecurityExceptionAction { - Object run() throws Exception; -} +#ifdef TARGET_ARCH_x86 +# include "nativeInst_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "nativeInst_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "nativeInst_zero.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +#endif + +#endif // SHARE_VM_CODE_NATIVEINST_HPP diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index 5ea2ca8891d..10fe4d8e575 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -69,7 +69,12 @@ class PcDescCache VALUE_OBJ_CLASS_SPEC { friend class VMStructs; private: enum { cache_size = 4 }; - PcDesc* _pc_descs[cache_size]; // last cache_size pc_descs found + // The array elements MUST be volatile! Several threads may modify + // and read from the cache concurrently. find_pc_desc_internal has + // returned wrong results. C++ compiler (namely xlC12) may duplicate + // C++ field accesses if the elements are not volatile. + typedef PcDesc* PcDescPtr; + volatile PcDescPtr _pc_descs[cache_size]; // last cache_size pc_descs found public: PcDescCache() { debug_only(_pc_descs[0] = NULL); } void reset_to(PcDesc* initial_pc_desc); diff --git a/hotspot/src/share/vm/code/vmreg.hpp b/hotspot/src/share/vm/code/vmreg.hpp index 1ef07ec199c..0b2edd19fd9 100644 --- a/hotspot/src/share/vm/code/vmreg.hpp +++ b/hotspot/src/share/vm/code/vmreg.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, 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,34 +25,13 @@ #ifndef SHARE_VM_CODE_VMREG_HPP #define SHARE_VM_CODE_VMREG_HPP +#include "asm/register.hpp" #include "memory/allocation.hpp" #include "utilities/globalDefinitions.hpp" -#include "asm/register.hpp" #ifdef COMPILER2 #include "opto/adlcVMDeps.hpp" #include "utilities/ostream.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/adGlobals_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/adGlobals_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/adGlobals_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/adGlobals_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/adGlobals_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/adGlobals_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/adGlobals_ppc_64.hpp" -#endif #endif //------------------------------VMReg------------------------------------------ @@ -107,7 +86,7 @@ public: // also a register you could use in the assembler. On machines with // 64bit registers only one half of the VMReg (and OptoReg) is considered // concrete. - bool is_concrete(); + // bool is_concrete(); // VMRegs are 4 bytes wide on all platforms static const int stack_slot_size; diff --git a/hotspot/src/share/vm/code/vmreg.inline.hpp b/hotspot/src/share/vm/code/vmreg.inline.hpp new file mode 100644 index 00000000000..6204f9df39f --- /dev/null +++ b/hotspot/src/share/vm/code/vmreg.inline.hpp @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2014, 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 + * 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. + * + */ + +#ifndef SHARE_VM_CODE_VMREG_INLINE_HPP +#define SHARE_VM_CODE_VMREG_INLINE_HPP + +#include "asm/register.hpp" +#include "code/vmreg.hpp" +#ifdef TARGET_ARCH_x86 +# include "vmreg_x86.inline.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "vmreg_sparc.inline.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "vmreg_zero.inline.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vmreg_ppc.inline.hpp" +#endif + +#endif // SHARE_VM_CODE_VMREG_INLINE_HPP diff --git a/hotspot/src/share/vm/compiler/compileLog.cpp b/hotspot/src/share/vm/compiler/compileLog.cpp index f2c04b6e4ff..340251f3265 100644 --- a/hotspot/src/share/vm/compiler/compileLog.cpp +++ b/hotspot/src/share/vm/compiler/compileLog.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "ci/ciMethod.hpp" +#include "code/codeCache.hpp" #include "compiler/compileLog.hpp" #include "memory/allocation.inline.hpp" #include "oops/method.hpp" diff --git a/hotspot/src/share/vm/compiler/oopMap.cpp b/hotspot/src/share/vm/compiler/oopMap.cpp index 5e1801584c2..556966bc9bf 100644 --- a/hotspot/src/share/vm/compiler/oopMap.cpp +++ b/hotspot/src/share/vm/compiler/oopMap.cpp @@ -36,6 +36,9 @@ #ifdef COMPILER1 #include "c1/c1_Defs.hpp" #endif +#ifdef COMPILER2 +#include "opto/optoreg.hpp" +#endif // OopMapStream diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp index 640265fbf56..2164628a77f 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp @@ -1904,12 +1904,12 @@ CompactibleFreeListSpace::splitChunkAndReturnRemainder(FreeChunk* chunk, assert(size > new_size, "Split from a smaller block?"); assert(is_aligned(chunk), "alignment problem"); assert(size == adjustObjectSize(size), "alignment problem"); - size_t rem_size = size - new_size; - assert(rem_size == adjustObjectSize(rem_size), "alignment problem"); - assert(rem_size >= MinChunkSize, "Free chunk smaller than minimum"); + size_t rem_sz = size - new_size; + assert(rem_sz == adjustObjectSize(rem_sz), "alignment problem"); + assert(rem_sz >= MinChunkSize, "Free chunk smaller than minimum"); FreeChunk* ffc = (FreeChunk*)((HeapWord*)chunk + new_size); assert(is_aligned(ffc), "alignment problem"); - ffc->set_size(rem_size); + ffc->set_size(rem_sz); ffc->link_next(NULL); ffc->link_prev(NULL); // Mark as a free block for other (parallel) GC threads. // Above must occur before BOT is updated below. @@ -1917,18 +1917,18 @@ CompactibleFreeListSpace::splitChunkAndReturnRemainder(FreeChunk* chunk, OrderAccess::storestore(); assert(chunk->is_free() && ffc->is_free(), "Error"); _bt.split_block((HeapWord*)chunk, chunk->size(), new_size); - if (rem_size < SmallForDictionary) { + if (rem_sz < SmallForDictionary) { bool is_par = (SharedHeap::heap()->n_par_threads() > 0); - if (is_par) _indexedFreeListParLocks[rem_size]->lock(); + if (is_par) _indexedFreeListParLocks[rem_sz]->lock(); assert(!is_par || (SharedHeap::heap()->n_par_threads() == SharedHeap::heap()->workers()->active_workers()), "Mismatch"); returnChunkToFreeList(ffc); - split(size, rem_size); - if (is_par) _indexedFreeListParLocks[rem_size]->unlock(); + split(size, rem_sz); + if (is_par) _indexedFreeListParLocks[rem_sz]->unlock(); } else { returnChunkToDictionary(ffc); - split(size ,rem_size); + split(size, rem_sz); } chunk->set_size(new_size); return chunk; diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp index 74c079d8ccf..3b9c0aa1906 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -891,6 +891,10 @@ void ConcurrentMark::clearNextBitmap() { guarantee(!g1h->mark_in_progress(), "invariant"); } +bool ConcurrentMark::nextMarkBitmapIsClear() { + return _nextMarkBitMap->getNextMarkedWordAddress(_heap_start, _heap_end) == _heap_end; +} + class NoteStartOfMarkHRClosure: public HeapRegionClosure { public: bool doHeapRegion(HeapRegion* r) { @@ -3358,7 +3362,8 @@ void ConcurrentMark::print_stats() { // abandon current marking iteration due to a Full GC void ConcurrentMark::abort() { - // Clear all marks to force marking thread to do nothing + // Clear all marks in the next bitmap for the next marking cycle. This will allow us to skip the next + // concurrent bitmap clearing. _nextMarkBitMap->clearAll(); // Note we cannot clear the previous marking bitmap here diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp index d0b67b39f97..a564855277b 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp @@ -736,6 +736,9 @@ public: // Clear the next marking bitmap (will be called concurrently). void clearNextBitmap(); + // Return whether the next mark bitmap has no marks set. + bool nextMarkBitmapIsClear(); + // These two do the work that needs to be done before and after the // initial root checkpoint. Since this checkpoint can be done at two // different points (i.e. an explicit pause or piggy-backed on a diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp index f8392143db8..1f9f0661779 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp @@ -277,9 +277,13 @@ void ConcurrentMarkThread::run() { // We now want to allow clearing of the marking bitmap to be // suspended by a collection pause. - { + // We may have aborted just before the remark. Do not bother clearing the + // bitmap then, as it has been done during mark abort. + if (!cm()->has_aborted()) { SuspendibleThreadSetJoiner sts; _cm->clearNextBitmap(); + } else { + assert(!G1VerifyBitmaps || _cm->nextMarkBitmapIsClear(), "Next mark bitmap must be clear"); } } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index aca5699351b..db56c33b91a 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -2950,11 +2950,18 @@ void G1CollectedHeap::collection_set_iterate_from(HeapRegion* r, } } -CompactibleSpace* G1CollectedHeap::first_compactible_space() { - return n_regions() > 0 ? region_at(0) : NULL; +HeapRegion* G1CollectedHeap::next_compaction_region(const HeapRegion* from) const { + // We're not using an iterator given that it will wrap around when + // it reaches the last region and this is not what we want here. + for (uint index = from->hrs_index() + 1; index < n_regions(); index++) { + HeapRegion* hr = region_at(index); + if (!hr->isHumongous()) { + return hr; + } + } + return NULL; } - Space* G1CollectedHeap::space_containing(const void* addr) const { return heap_region_containing(addr); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp index 30a3d7ebcb8..9f51eafa1ed 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @@ -1158,19 +1158,19 @@ public: } // The total number of regions in the heap. - uint n_regions() { return _hrs.length(); } + uint n_regions() const { return _hrs.length(); } // The max number of regions in the heap. - uint max_regions() { return _hrs.max_length(); } + uint max_regions() const { return _hrs.max_length(); } // The number of regions that are completely free. - uint free_regions() { return _free_list.length(); } + uint free_regions() const { return _free_list.length(); } // The number of regions that are not completely free. - uint used_regions() { return n_regions() - free_regions(); } + uint used_regions() const { return n_regions() - free_regions(); } // The number of regions available for "regular" expansion. - uint expansion_regions() { return _expansion_regions; } + uint expansion_regions() const { return _expansion_regions; } // Factory method for HeapRegion instances. It will return NULL if // the allocation fails. @@ -1392,8 +1392,7 @@ public: // As above but starting from region r void collection_set_iterate_from(HeapRegion* r, HeapRegionClosure *blk); - // Returns the first (lowest address) compactible space in the heap. - virtual CompactibleSpace* first_compactible_space(); + HeapRegion* next_compaction_region(const HeapRegion* from) const; // A CollectedHeap will contain some number of spaces. This finds the // space containing a given address, or else returns NULL. diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp index 1c805c634b3..eba482046fd 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @@ -1047,7 +1047,7 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, Evacua bool new_in_marking_window = _in_marking_window; bool new_in_marking_window_im = false; - if (during_initial_mark_pause()) { + if (last_pause_included_initial_mark) { new_in_marking_window = true; new_in_marking_window_im = true; } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp index 6a2627d10fc..dbd9e523ba6 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp @@ -76,7 +76,6 @@ void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, // When collecting the permanent generation Method*s may be moving, // so we either have to flush all bcp data or convert it into bci. CodeCache::gc_prologue(); - Threads::gc_prologue(); bool marked_for_unloading = false; @@ -106,7 +105,6 @@ void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, // Universe::set_heap_capacity_at_last_gc(Universe::heap()->capacity()); // Universe::set_heap_used_at_last_gc(Universe::heap()->used()); - Threads::gc_epilogue(); CodeCache::gc_epilogue(); JvmtiExport::gc_epilogue(); @@ -201,6 +199,23 @@ class G1PrepareCompactClosure: public HeapRegionClosure { CompactPoint _cp; HeapRegionSetCount _humongous_regions_removed; + bool is_cp_initialized() const { + return _cp.space != NULL; + } + + void prepare_for_compaction(HeapRegion* hr, HeapWord* end) { + // If this is the first live region that we came across which we can compact, + // initialize the CompactPoint. + if (!is_cp_initialized()) { + _cp.space = hr; + _cp.threshold = hr->initialize_threshold(); + } + hr->prepare_for_compaction(&_cp); + // Also clear the part of the card table that will be unused after + // compaction. + _mrbs->clear(MemRegion(hr->compaction_top(), end)); + } + void free_humongous_region(HeapRegion* hr) { HeapWord* end = hr->end(); FreeRegionList dummy_free_list("Dummy Free List for G1MarkSweep"); @@ -212,18 +227,15 @@ class G1PrepareCompactClosure: public HeapRegionClosure { _humongous_regions_removed.increment(1u, hr->capacity()); _g1h->free_humongous_region(hr, &dummy_free_list, false /* par */); - hr->prepare_for_compaction(&_cp); - // Also clear the part of the card table that will be unused after - // compaction. - _mrbs->clear(MemRegion(hr->compaction_top(), end)); + prepare_for_compaction(hr, end); dummy_free_list.remove_all(); } public: - G1PrepareCompactClosure(CompactibleSpace* cs) + G1PrepareCompactClosure() : _g1h(G1CollectedHeap::heap()), _mrbs(_g1h->g1_barrier_set()), - _cp(NULL, cs, cs->initialize_threshold()), + _cp(NULL), _humongous_regions_removed() { } void update_sets() { @@ -246,10 +258,7 @@ public: assert(hr->continuesHumongous(), "Invalid humongous."); } } else { - hr->prepare_for_compaction(&_cp); - // Also clear the part of the card table that will be unused after - // compaction. - _mrbs->clear(MemRegion(hr->compaction_top(), hr->end())); + prepare_for_compaction(hr, hr->end()); } return false; } @@ -267,14 +276,7 @@ void G1MarkSweep::mark_sweep_phase2() { GCTraceTime tm("phase 2", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id()); GenMarkSweep::trace("2"); - // find the first region - HeapRegion* r = g1h->region_at(0); - CompactibleSpace* sp = r; - if (r->isHumongous() && oop(r->bottom())->is_gc_marked()) { - sp = r->next_compaction_space(); - } - - G1PrepareCompactClosure blk(sp); + G1PrepareCompactClosure blk; g1h->heap_region_iterate(&blk); blk.update_sets(); } diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp index cecf891306a..524f2f315fb 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp @@ -381,18 +381,7 @@ HeapRegion::HeapRegion(uint hrs_index, } CompactibleSpace* HeapRegion::next_compaction_space() const { - // We're not using an iterator given that it will wrap around when - // it reaches the last region and this is not what we want here. - G1CollectedHeap* g1h = G1CollectedHeap::heap(); - uint index = hrs_index() + 1; - while (index < g1h->n_regions()) { - HeapRegion* hr = g1h->region_at(index); - if (!hr->isHumongous()) { - return hr; - } - index += 1; - } - return NULL; + return G1CollectedHeap::heap()->next_compaction_region(this); } void HeapRegion::note_self_forwarding_removal_start(bool during_initial_mark, diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp index 222fc694f4c..8502763ccf1 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSet.hpp @@ -119,7 +119,7 @@ protected: public: const char* name() { return _name; } - uint length() { return _count.length(); } + uint length() const { return _count.length(); } bool is_empty() { return _count.length() == 0; } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp index 647ed85ecdb..a0b2cb96048 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp @@ -180,7 +180,6 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { size_policy->major_collection_begin(); CodeCache::gc_prologue(); - Threads::gc_prologue(); BiasedLocking::preserve_marks(); // Capture heap size before collection for printing. @@ -251,7 +250,6 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { MetaspaceAux::verify_metrics(); BiasedLocking::restore_marks(); - Threads::gc_epilogue(); CodeCache::gc_epilogue(); JvmtiExport::gc_epilogue(); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp index 7246a61b634..1a2fd30c6ce 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp @@ -1066,7 +1066,6 @@ void PSParallelCompact::post_compact() ClassLoaderDataGraph::purge(); MetaspaceAux::verify_metrics(); - Threads::gc_epilogue(); CodeCache::gc_epilogue(); JvmtiExport::gc_epilogue(); @@ -2068,7 +2067,6 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { size_policy->major_collection_begin(); CodeCache::gc_prologue(); - Threads::gc_prologue(); COMPILER2_PRESENT(DerivedPointerTable::clear()); diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp index d5d1b150134..783066e0adb 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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,29 +25,12 @@ #ifndef SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP #define SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP +#include "asm/macroAssembler.hpp" #include "code/stubs.hpp" #include "interpreter/bytecodes.hpp" #include "runtime/thread.inline.hpp" #include "runtime/vmThread.hpp" #include "utilities/top.hpp" -#ifdef TARGET_ARCH_x86 -# include "interp_masm_x86.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "interp_masm_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "interp_masm_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "interp_masm_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "interp_masm_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "interp_masm_ppc_64.hpp" -#endif // This file contains the platform-independent parts // of the abstract interpreter and the abstract interpreter generator. @@ -75,6 +58,8 @@ //------------------------------------------------------------------------------------------------------------------------ // The C++ interface to the bytecode interpreter(s). +class InterpreterMacroAssembler; + class AbstractInterpreter: AllStatic { friend class VMStructs; friend class Interpreter; diff --git a/hotspot/src/share/vm/interpreter/bytecode.hpp b/hotspot/src/share/vm/interpreter/bytecode.hpp index 10b5a567b24..0708816ff51 100644 --- a/hotspot/src/share/vm/interpreter/bytecode.hpp +++ b/hotspot/src/share/vm/interpreter/bytecode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -28,21 +28,7 @@ #include "interpreter/bytecodes.hpp" #include "memory/allocation.hpp" #include "oops/method.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" class ciBytecodeStream; diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp index b2a1c49683f..49fc1703d50 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, 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 @@ -32,21 +32,6 @@ #include "runtime/frame.hpp" #include "runtime/globals.hpp" #include "utilities/globalDefinitions.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif #ifdef CC_INTERP @@ -56,6 +41,8 @@ // CVM definitions find hotspot equivalents... +class InterpreterMacroAssembler; + union VMJavaVal64 { jlong l; jdouble d; diff --git a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp index cf5500a7e33..1f657b98bc2 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -29,21 +29,7 @@ #include "memory/allocation.hpp" #include "oops/method.hpp" #include "runtime/handles.inline.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" // A BytecodeStream is used for fast iteration over the bytecodes // of a Method*. diff --git a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp index 5c26a4a751f..7fcd6543984 100644 --- a/hotspot/src/share/vm/interpreter/bytecodes.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -26,21 +26,7 @@ #include "interpreter/bytecodes.hpp" #include "memory/resourceArea.hpp" #include "oops/method.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" #if defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER < 1600)) diff --git a/jdk/src/share/classes/sun/audio/AudioDataStream.java b/hotspot/src/share/vm/interpreter/interp_masm.hpp similarity index 57% rename from jdk/src/share/classes/sun/audio/AudioDataStream.java rename to hotspot/src/share/vm/interpreter/interp_masm.hpp index dcc21a88233..6e647835448 100644 --- a/jdk/src/share/classes/sun/audio/AudioDataStream.java +++ b/hotspot/src/share/vm/interpreter/interp_masm.hpp @@ -1,12 +1,10 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * 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 @@ -21,34 +19,31 @@ * 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. - */ - -package sun.audio; - -import java.io.*; - -/** - * An input stream to play AudioData. * - * @see AudioPlayer - * @see AudioData - * @author Arthur van Hoff - * @author Kara Kytle */ -public class AudioDataStream extends ByteArrayInputStream { - private final AudioData ad; +#ifndef SHARE_VM_INTERPRETER_INTERP_MASM_HPP +#define SHARE_VM_INTERPRETER_INTERP_MASM_HPP - /** - * Constructor - */ - public AudioDataStream(final AudioData data) { +#include "asm/macroAssembler.hpp" - super(data.buffer); - this.ad = data; - } +#ifdef TARGET_ARCH_x86 +# include "interp_masm_x86.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_sparc +# include "interp_masm_sparc.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_zero +# include "interp_masm_zero.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_arm +# include "interp_masm_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_32 +# include "interp_masm_ppc_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_64 +# include "interp_masm_ppc_64.hpp" +#endif - final AudioData getAudioData() { - return ad; - } -} +#endif // SHARE_VM_INTERPRETER_INTERP_MASM_HPP diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp index 7ce4bdbb3ec..4807cd08398 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.cpp +++ b/hotspot/src/share/vm/interpreter/interpreter.cpp @@ -30,6 +30,7 @@ #include "interpreter/bytecodeInterpreter.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" @@ -80,9 +81,35 @@ void InterpreterCodelet::print_on(outputStream* st) const { } } +CodeletMark::CodeletMark(InterpreterMacroAssembler*& masm, + const char* description, + Bytecodes::Code bytecode) : + _clet((InterpreterCodelet*)AbstractInterpreter::code()->request(codelet_size())), + _cb(_clet->code_begin(), _clet->code_size()) { + // Request all space (add some slack for Codelet data). + assert(_clet != NULL, "we checked not enough space already"); + + // Initialize Codelet attributes. + _clet->initialize(description, bytecode); + // Create assembler for code generation. + masm = new InterpreterMacroAssembler(&_cb); + _masm = &masm; +} + +CodeletMark::~CodeletMark() { + // Align so printing shows nop's instead of random code at the end (Codelets are aligned). + (*_masm)->align(wordSize); + // Make sure all code is in code buffer. + (*_masm)->flush(); + + // Commit Codelet. + AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size(), (*_masm)->code()->strings()); + // Make sure nobody can use _masm outside a CodeletMark lifespan. + *_masm = NULL; +} //------------------------------------------------------------------------------------------------------------------------ -// Implementation of platform independent aspects of Interpreter +// Implementation of platform independent aspects of Interpreter void AbstractInterpreter::initialize() { if (_code != NULL) return; diff --git a/hotspot/src/share/vm/interpreter/interpreter.hpp b/hotspot/src/share/vm/interpreter/interpreter.hpp index cc26b378d73..2a81daf205d 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.hpp +++ b/hotspot/src/share/vm/interpreter/interpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,6 +37,8 @@ // This file contains the platform-independent parts // of the interpreter and the interpreter generator. +class InterpreterMacroAssembler; + //------------------------------------------------------------------------------------------------------------------------ // An InterpreterCodelet is a piece of interpreter code. All // interpreter code is generated into little codelets which @@ -99,42 +101,17 @@ class CodeletMark: ResourceMark { int codelet_size = AbstractInterpreter::code()->available_space() - 2*K; // Guarantee there's a little bit of code space left. - guarantee (codelet_size > 0 && (size_t)codelet_size > 2*K, - "not enough space for interpreter generation"); + guarantee(codelet_size > 0 && (size_t)codelet_size > 2*K, + "not enough space for interpreter generation"); return codelet_size; } public: - CodeletMark( - InterpreterMacroAssembler*& masm, - const char* description, - Bytecodes::Code bytecode = Bytecodes::_illegal): - _clet((InterpreterCodelet*)AbstractInterpreter::code()->request(codelet_size())), - _cb(_clet->code_begin(), _clet->code_size()) - - { // request all space (add some slack for Codelet data) - assert (_clet != NULL, "we checked not enough space already"); - - // initialize Codelet attributes - _clet->initialize(description, bytecode); - // create assembler for code generation - masm = new InterpreterMacroAssembler(&_cb); - _masm = &masm; - } - - ~CodeletMark() { - // align so printing shows nop's instead of random code at the end (Codelets are aligned) - (*_masm)->align(wordSize); - // make sure all code is in code buffer - (*_masm)->flush(); - - - // commit Codelet - AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size(), (*_masm)->code()->strings()); - // make sure nobody can use _masm outside a CodeletMark lifespan - *_masm = NULL; - } + CodeletMark(InterpreterMacroAssembler*& masm, + const char* description, + Bytecodes::Code bytecode = Bytecodes::_illegal); + ~CodeletMark(); }; // Wrapper classes to produce Interpreter/InterpreterGenerator from either @@ -142,9 +119,10 @@ class CodeletMark: ResourceMark { class Interpreter: public CC_INTERP_ONLY(CppInterpreter) NOT_CC_INTERP(TemplateInterpreter) { - public: + public: // Debugging/printing - static InterpreterCodelet* codelet_containing(address pc) { return (InterpreterCodelet*)_code->stub_containing(pc); } + static InterpreterCodelet* codelet_containing(address pc) { return (InterpreterCodelet*)_code->stub_containing(pc); } + #ifdef TARGET_ARCH_x86 # include "interpreter_x86.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index 5f1894033de..23d4bddca1b 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -48,6 +48,7 @@ #include "runtime/deoptimization.hpp" #include "runtime/fieldDescriptor.hpp" #include "runtime/handles.inline.hpp" +#include "runtime/icache.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/java.hpp" #include "runtime/jfieldIDWorkaround.hpp" @@ -57,21 +58,6 @@ #include "runtime/synchronizer.hpp" #include "runtime/threadCritical.hpp" #include "utilities/events.hpp" -#ifdef TARGET_ARCH_x86 -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vm_version_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vm_version_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vm_version_ppc.hpp" -#endif #ifdef COMPILER2 #include "opto/runtime.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp index 66eb63eafb6..9f28e20f9b7 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp @@ -26,6 +26,8 @@ #include "interpreter/interpreter.hpp" #include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreter.hpp" #include "interpreter/templateTable.hpp" #ifndef CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp index 48e0e217091..c72fafdbada 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,8 @@ #ifndef CC_INTERP +class InterpreterMacroAssembler; + //------------------------------------------------------------------------------------------------------------------------ // A little wrapper class to group tosca-specific entry points into a unit. // (tosca = Top-Of-Stack CAche) diff --git a/hotspot/src/share/vm/interpreter/templateTable.cpp b/hotspot/src/share/vm/interpreter/templateTable.cpp index 05b8a069691..8449321d9f3 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.cpp +++ b/hotspot/src/share/vm/interpreter/templateTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "gc_interface/collectedHeap.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" #include "runtime/timer.hpp" diff --git a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp index c6ea51537a2..e6d334005e1 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.hpp +++ b/hotspot/src/share/vm/interpreter/templateTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -28,24 +28,6 @@ #include "interpreter/bytecodes.hpp" #include "memory/allocation.hpp" #include "runtime/frame.hpp" -#ifdef TARGET_ARCH_x86 -# include "interp_masm_x86.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "interp_masm_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "interp_masm_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "interp_masm_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "interp_masm_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "interp_masm_ppc_64.hpp" -#endif #ifndef CC_INTERP // All the necessary definitions used for (bytecode) template generation. Instead of @@ -53,6 +35,7 @@ // and the snippet generator, a template is assigned to each bytecode which can be // used to generate the bytecode's implementation if needed. +class InterpreterMacroAssembler; // A Template describes the properties of a code template for a given bytecode // and provides a generator to generate the code template. diff --git a/hotspot/src/share/vm/memory/filemap.cpp b/hotspot/src/share/vm/memory/filemap.cpp index 47527f21e9f..2f5c0165893 100644 --- a/hotspot/src/share/vm/memory/filemap.cpp +++ b/hotspot/src/share/vm/memory/filemap.cpp @@ -30,6 +30,7 @@ #include "runtime/arguments.hpp" #include "runtime/java.hpp" #include "runtime/os.hpp" +#include "runtime/vm_version.hpp" #include "services/memTracker.hpp" #include "utilities/defaultStream.hpp" diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.cpp b/hotspot/src/share/vm/memory/genCollectedHeap.cpp index bbca44a36f6..4b5deb03c05 100644 --- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp +++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp @@ -1088,7 +1088,7 @@ void GenCollectedHeap::prepare_for_compaction() { guarantee(_n_gens = 2, "Wrong number of generations"); Generation* old_gen = _gens[1]; // Start by compacting into same gen. - CompactPoint cp(old_gen, NULL, NULL); + CompactPoint cp(old_gen); old_gen->prepare_for_compaction(&cp); Generation* young_gen = _gens[0]; young_gen->prepare_for_compaction(&cp); diff --git a/hotspot/src/share/vm/memory/genMarkSweep.cpp b/hotspot/src/share/vm/memory/genMarkSweep.cpp index 5faab645408..823b0a196bf 100644 --- a/hotspot/src/share/vm/memory/genMarkSweep.cpp +++ b/hotspot/src/share/vm/memory/genMarkSweep.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, 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 @@ -76,7 +76,6 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp, bool c // When collecting the permanent generation Method*s may be moving, // so we either have to flush all bcp data or convert it into bci. CodeCache::gc_prologue(); - Threads::gc_prologue(); // Increment the invocation count _total_invocations++; @@ -132,7 +131,6 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp, bool c rs->invalidate_or_clear(old_gen); } - Threads::gc_epilogue(); CodeCache::gc_epilogue(); JvmtiExport::gc_epilogue(); diff --git a/hotspot/src/share/vm/memory/space.hpp b/hotspot/src/share/vm/memory/space.hpp index 4c2974dcdab..0653884e043 100644 --- a/hotspot/src/share/vm/memory/space.hpp +++ b/hotspot/src/share/vm/memory/space.hpp @@ -330,9 +330,9 @@ public: Generation* gen; CompactibleSpace* space; HeapWord* threshold; - CompactPoint(Generation* _gen, CompactibleSpace* _space, - HeapWord* _threshold) : - gen(_gen), space(_space), threshold(_threshold) {} + + CompactPoint(Generation* _gen) : + gen(_gen), space(NULL), threshold(0) {} }; diff --git a/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp index e0dc61a73f6..a54de2bf0a3 100644 --- a/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp +++ b/hotspot/src/share/vm/memory/threadLocalAllocBuffer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, 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 @@ -28,6 +28,7 @@ #include "gc_implementation/shared/gcUtil.hpp" #include "oops/typeArrayOop.hpp" #include "runtime/perfData.hpp" +#include "runtime/vm_version.hpp" class GlobalTLABStats; diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp index 5c5ea1c76e2..5e26ec5e622 100644 --- a/hotspot/src/share/vm/oops/constantPool.hpp +++ b/hotspot/src/share/vm/oops/constantPool.hpp @@ -31,22 +31,8 @@ #include "oops/symbol.hpp" #include "oops/typeArrayOop.hpp" #include "runtime/handles.hpp" +#include "utilities/bytes.hpp" #include "utilities/constantTag.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif // A ConstantPool is an array containing class constants as described in the // class file. diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp index 83ac9591aa2..54fa43a7212 100644 --- a/hotspot/src/share/vm/oops/method.cpp +++ b/hotspot/src/share/vm/oops/method.cpp @@ -240,6 +240,9 @@ void Method::mask_for(int bci, InterpreterOopMap* mask) { int Method::bci_from(address bcp) const { + if (is_native() && bcp == 0) { + return 0; + } #ifdef ASSERT { ResourceMark rm; assert(is_native() && bcp == code_base() || contains(bcp) || is_error_reported(), @@ -250,24 +253,23 @@ int Method::bci_from(address bcp) const { } -// Return (int)bcx if it appears to be a valid BCI. -// Return bci_from((address)bcx) if it appears to be a valid BCP. +int Method::validate_bci(int bci) const { + return (bci == 0 || bci < code_size()) ? bci : -1; +} + +// Return bci if it appears to be a valid bcp // Return -1 otherwise. // Used by profiling code, when invalid data is a possibility. // The caller is responsible for validating the Method* itself. -int Method::validate_bci_from_bcx(intptr_t bcx) const { +int Method::validate_bci_from_bcp(address bcp) const { // keep bci as -1 if not a valid bci int bci = -1; - if (bcx == 0 || (address)bcx == code_base()) { + if (bcp == 0 || bcp == code_base()) { // code_size() may return 0 and we allow 0 here // the method may be native bci = 0; - } else if (frame::is_bci(bcx)) { - if (bcx < code_size()) { - bci = (int)bcx; - } - } else if (contains((address)bcx)) { - bci = (address)bcx - code_base(); + } else if (contains(bcp)) { + bci = bcp - code_base(); } // Assert that if we have dodged any asserts, bci is negative. assert(bci == -1 || bci == bci_from(bcp_from(bci)), "sane bci if >=0"); diff --git a/hotspot/src/share/vm/oops/method.hpp b/hotspot/src/share/vm/oops/method.hpp index a2c36db39f4..23752b4f8f5 100644 --- a/hotspot/src/share/vm/oops/method.hpp +++ b/hotspot/src/share/vm/oops/method.hpp @@ -649,7 +649,8 @@ class Method : public Metadata { // Returns the byte code index from the byte code pointer int bci_from(address bcp) const; address bcp_from(int bci) const; - int validate_bci_from_bcx(intptr_t bcx) const; + int validate_bci_from_bcp(address bcp) const; + int validate_bci(int bci) const; // Returns the line number for a bci if debugging information for the method is prowided, // -1 is returned otherwise. diff --git a/hotspot/src/share/vm/oops/methodData.hpp b/hotspot/src/share/vm/oops/methodData.hpp index 1c88ac55ffa..ad290402d90 100644 --- a/hotspot/src/share/vm/oops/methodData.hpp +++ b/hotspot/src/share/vm/oops/methodData.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -2338,10 +2338,6 @@ public: return dp - ((address)_data); } - address di_to_dp(int di) { - return (address)data_layout_at(di); - } - // bci to di/dp conversion. address bci_to_dp(int bci); int bci_to_di(int bci) { diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp index 0dc0db8e946..08839267e01 100644 --- a/hotspot/src/share/vm/oops/oop.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.inline.hpp @@ -42,21 +42,6 @@ #include "runtime/orderAccess.inline.hpp" #include "runtime/os.hpp" #include "utilities/macros.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif // Implementation of all inlined member functions defined in oop.hpp // We need a separate file to avoid circular references diff --git a/hotspot/src/share/vm/opto/ad.hpp b/hotspot/src/share/vm/opto/ad.hpp new file mode 100644 index 00000000000..29308f8b10c --- /dev/null +++ b/hotspot/src/share/vm/opto/ad.hpp @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014, 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 + * 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. + * + */ + +#ifndef SHARE_VM_OPTO_AD_HPP +#define SHARE_VM_OPTO_AD_HPP + +#ifdef TARGET_ARCH_MODEL_x86_32 +# include "adfiles/ad_x86_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_x86_64 +# include "adfiles/ad_x86_64.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_sparc +# include "adfiles/ad_sparc.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_zero +# include "adfiles/ad_zero.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_32 +# include "adfiles/ad_ppc_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_64 +# include "adfiles/ad_ppc_64.hpp" +#endif + +#endif // SHARE_VM_OPTO_AD_HPP diff --git a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp index 9f2dd674e2f..1fa98978f26 100644 --- a/hotspot/src/share/vm/opto/buildOopMap.cpp +++ b/hotspot/src/share/vm/opto/buildOopMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, 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 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "code/vmreg.inline.hpp" #include "compiler/oopMap.hpp" #include "opto/addnode.hpp" #include "opto/callnode.hpp" @@ -32,21 +33,6 @@ #include "opto/phase.hpp" #include "opto/regalloc.hpp" #include "opto/rootnode.hpp" -#ifdef TARGET_ARCH_x86 -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vmreg_ppc.inline.hpp" -#endif // The functions in this file builds OopMaps after all scheduling is done. // diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp index dced2e00f34..795b0ec1fe5 100644 --- a/hotspot/src/share/vm/opto/c2compiler.cpp +++ b/hotspot/src/share/vm/opto/c2compiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, 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 @@ -24,28 +24,8 @@ #include "precompiled.hpp" #include "opto/c2compiler.hpp" +#include "opto/optoreg.hpp" #include "opto/runtime.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif // register information defined by ADLC extern const char register_save_policy[]; diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index bd122ddb139..585f9315241 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -69,27 +69,6 @@ #include "runtime/timer.hpp" #include "trace/tracing.hpp" #include "utilities/copy.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif // -------------------- Compile::mach_constant_base_node ----------------------- diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp index 4aa770d5af5..0486bf6885b 100644 --- a/hotspot/src/share/vm/opto/gcm.cpp +++ b/hotspot/src/share/vm/opto/gcm.cpp @@ -35,28 +35,6 @@ #include "opto/rootnode.hpp" #include "opto/runtime.hpp" #include "runtime/deoptimization.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif - // Portions of code courtesy of Clifford Click diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp index 10daf5694f9..a601752d4cd 100644 --- a/hotspot/src/share/vm/opto/lcm.cpp +++ b/hotspot/src/share/vm/opto/lcm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, 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 @@ -24,33 +24,13 @@ #include "precompiled.hpp" #include "memory/allocation.inline.hpp" +#include "opto/ad.hpp" #include "opto/block.hpp" #include "opto/c2compiler.hpp" #include "opto/callnode.hpp" #include "opto/cfgnode.hpp" #include "opto/machnode.hpp" #include "opto/runtime.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif // Optimization - Graph Style diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index e0a09d27ff1..8e01709fcda 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "asm/macroAssembler.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "compiler/compileBroker.hpp" diff --git a/hotspot/src/share/vm/opto/locknode.hpp b/hotspot/src/share/vm/opto/locknode.hpp index 8bd6f35afd8..515a40c4663 100644 --- a/hotspot/src/share/vm/opto/locknode.hpp +++ b/hotspot/src/share/vm/opto/locknode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, 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 @@ -28,27 +28,9 @@ #include "opto/node.hpp" #include "opto/opcodes.hpp" #include "opto/subnode.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif + +class BiasedLockingCounters; +class RTMLockingCounters; //------------------------------BoxLockNode------------------------------------ class BoxLockNode : public Node { diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp index a8321b07753..cce4a739473 100644 --- a/hotspot/src/share/vm/opto/matcher.cpp +++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "memory/allocation.inline.hpp" +#include "opto/ad.hpp" #include "opto/addnode.hpp" #include "opto/callnode.hpp" #include "opto/idealGraphPrinter.hpp" @@ -37,27 +38,6 @@ #include "opto/type.hpp" #include "opto/vectornode.hpp" #include "runtime/os.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif OptoReg::Name OptoReg::c_frame_pointer; diff --git a/hotspot/src/share/vm/opto/optoreg.hpp b/hotspot/src/share/vm/opto/optoreg.hpp index 0d45c7a50ab..cc383393946 100644 --- a/hotspot/src/share/vm/opto/optoreg.hpp +++ b/hotspot/src/share/vm/opto/optoreg.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2014, 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,6 +25,30 @@ #ifndef SHARE_VM_OPTO_OPTOREG_HPP #define SHARE_VM_OPTO_OPTOREG_HPP +// AdGlobals contains c2 specific register handling code as specified +// in the .ad files. +#ifdef TARGET_ARCH_MODEL_x86_32 +# include "adfiles/adGlobals_x86_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_x86_64 +# include "adfiles/adGlobals_x86_64.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_sparc +# include "adfiles/adGlobals_sparc.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_zero +# include "adfiles/adGlobals_zero.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/adGlobals_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_32 +# include "adfiles/adGlobals_ppc_32.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc_64 +# include "adfiles/adGlobals_ppc_64.hpp" +#endif + //------------------------------OptoReg---------------------------------------- // We eventually need Registers for the Real World. Registers are essentially // non-SSA names. A Register is represented as a number. Non-regular values diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp index c8e6b9736c2..15bf30b393a 100644 --- a/hotspot/src/share/vm/opto/output.cpp +++ b/hotspot/src/share/vm/opto/output.cpp @@ -30,10 +30,12 @@ #include "compiler/compileBroker.hpp" #include "compiler/oopMap.hpp" #include "memory/allocation.inline.hpp" +#include "opto/ad.hpp" #include "opto/callnode.hpp" #include "opto/cfgnode.hpp" #include "opto/locknode.hpp" #include "opto/machnode.hpp" +#include "opto/optoreg.hpp" #include "opto/output.hpp" #include "opto/regalloc.hpp" #include "opto/runtime.hpp" diff --git a/hotspot/src/share/vm/opto/output.hpp b/hotspot/src/share/vm/opto/output.hpp index 298de0fec67..ab3c1a30457 100644 --- a/hotspot/src/share/vm/opto/output.hpp +++ b/hotspot/src/share/vm/opto/output.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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,29 +25,9 @@ #ifndef SHARE_VM_OPTO_OUTPUT_HPP #define SHARE_VM_OPTO_OUTPUT_HPP +#include "opto/ad.hpp" #include "opto/block.hpp" #include "opto/node.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif class Arena; class Bundle; diff --git a/hotspot/src/share/vm/opto/phaseX.cpp b/hotspot/src/share/vm/opto/phaseX.cpp index 5b2771e83ef..b4470dcef53 100644 --- a/hotspot/src/share/vm/opto/phaseX.cpp +++ b/hotspot/src/share/vm/opto/phaseX.cpp @@ -1089,7 +1089,7 @@ Node *PhaseIterGVN::transform_old(Node* n) { #endif while (i != NULL) { -#ifndef PRODUCT +#ifdef ASSERT if (loop_count >= K) { dump_infinite_loop_info(i); } diff --git a/hotspot/src/share/vm/opto/regmask.cpp b/hotspot/src/share/vm/opto/regmask.cpp index a30678dadf2..06a245a12f0 100644 --- a/hotspot/src/share/vm/opto/regmask.cpp +++ b/hotspot/src/share/vm/opto/regmask.cpp @@ -23,29 +23,9 @@ */ #include "precompiled.hpp" +#include "opto/ad.hpp" #include "opto/compile.hpp" #include "opto/regmask.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif #define RM_SIZE _RM_SIZE /* a constant private to the class RegMask */ diff --git a/hotspot/src/share/vm/opto/regmask.hpp b/hotspot/src/share/vm/opto/regmask.hpp index ff0d0b96dc2..15f687ac38e 100644 --- a/hotspot/src/share/vm/opto/regmask.hpp +++ b/hotspot/src/share/vm/opto/regmask.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,27 +27,6 @@ #include "code/vmreg.hpp" #include "opto/optoreg.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/adGlobals_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/adGlobals_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/adGlobals_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/adGlobals_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/adGlobals_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/adGlobals_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/adGlobals_ppc_64.hpp" -#endif // Some fun naming (textual) substitutions: // diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index dba4f047b5a..2a2fb131dfd 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "code/compiledIC.hpp" #include "code/icBuffer.hpp" #include "code/nmethod.hpp" @@ -45,6 +46,7 @@ #include "memory/oopFactory.hpp" #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" +#include "opto/ad.hpp" #include "opto/addnode.hpp" #include "opto/callnode.hpp" #include "opto/cfgnode.hpp" @@ -68,27 +70,6 @@ #include "runtime/vframe_hp.hpp" #include "utilities/copy.hpp" #include "utilities/preserveException.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif // For debugging purposes: diff --git a/hotspot/src/share/vm/opto/runtime.hpp b/hotspot/src/share/vm/opto/runtime.hpp index b8ad0105dfc..b5e8bc34d98 100644 --- a/hotspot/src/share/vm/opto/runtime.hpp +++ b/hotspot/src/share/vm/opto/runtime.hpp @@ -27,6 +27,7 @@ #include "code/codeBlob.hpp" #include "opto/machnode.hpp" +#include "opto/optoreg.hpp" #include "opto/type.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/rtmLocking.hpp" diff --git a/hotspot/src/share/vm/precompiled/precompiled.hpp b/hotspot/src/share/vm/precompiled/precompiled.hpp index e8d014430df..be70cfffd6e 100644 --- a/hotspot/src/share/vm/precompiled/precompiled.hpp +++ b/hotspot/src/share/vm/precompiled/precompiled.hpp @@ -70,6 +70,7 @@ # include "code/exceptionHandlerTable.hpp" # include "code/jvmticmlr.h" # include "code/location.hpp" +# include "code/nativeInst.hpp" # include "code/nmethod.hpp" # include "code/oopRecorder.hpp" # include "code/pcDesc.hpp" @@ -106,6 +107,7 @@ # include "interpreter/bytecodes.hpp" # include "interpreter/cppInterpreter.hpp" # include "interpreter/interpreter.hpp" +# include "interpreter/interp_masm.hpp" # include "interpreter/invocationCounter.hpp" # include "interpreter/linkResolver.hpp" # include "interpreter/templateInterpreter.hpp" @@ -228,6 +230,7 @@ # include "utilities/array.hpp" # include "utilities/bitMap.hpp" # include "utilities/bitMap.inline.hpp" +# include "utilities/bytes.hpp" # include "utilities/constantTag.hpp" # include "utilities/copy.hpp" # include "utilities/debug.hpp" @@ -250,6 +253,7 @@ # include "libadt/dict.hpp" # include "libadt/set.hpp" # include "libadt/vectset.hpp" +# include "opto/ad.hpp" # include "opto/addnode.hpp" # include "opto/adlcVMDeps.hpp" # include "opto/block.hpp" diff --git a/hotspot/src/share/vm/prims/forte.cpp b/hotspot/src/share/vm/prims/forte.cpp index f6af607c4ee..eee24dfc999 100644 --- a/hotspot/src/share/vm/prims/forte.cpp +++ b/hotspot/src/share/vm/prims/forte.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -234,9 +234,8 @@ static bool is_decipherable_interpreted_frame(JavaThread* thread, *method_p = method; if (!method->is_valid_method()) return false; - intptr_t bcx = fr->interpreter_frame_bcx(); - - int bci = method->validate_bci_from_bcx(bcx); + address bcp = fr->interpreter_frame_bcp(); + int bci = method->validate_bci_from_bcp(bcp); // note: bci is set to -1 if not a valid bci *bci_p = bci; diff --git a/hotspot/src/share/vm/prims/jniCheck.cpp b/hotspot/src/share/vm/prims/jniCheck.cpp index 4ffa3d491d0..1de4f021017 100644 --- a/hotspot/src/share/vm/prims/jniCheck.cpp +++ b/hotspot/src/share/vm/prims/jniCheck.cpp @@ -37,21 +37,6 @@ #include "runtime/interfaceSupport.hpp" #include "runtime/jfieldIDWorkaround.hpp" #include "runtime/thread.inline.hpp" -#ifdef TARGET_ARCH_x86 -# include "jniTypes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "jniTypes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "jniTypes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "jniTypes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "jniTypes_ppc.hpp" -#endif // Complain every extra number of unplanned local refs #define CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD 32 diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index 4f292216473..1970d715ebc 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -59,6 +59,7 @@ #include "runtime/thread.inline.hpp" #include "runtime/vframe.hpp" #include "runtime/vm_operations.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/management.hpp" #include "services/threadService.hpp" diff --git a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp index 92ff86fcd6d..c6633bf34a9 100644 --- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp +++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -28,21 +28,8 @@ #include "oops/fieldStreams.hpp" #include "prims/jvmtiClassFileReconstituter.hpp" #include "runtime/signature.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" + // FIXME: add Deprecated attribute // FIXME: fix Synthetic attribute // FIXME: per Serguei, add error return handling for ConstantPool::copy_cpool_bytes() diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp index eca5cc1eb1f..89680d13ea6 100644 --- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp +++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -26,6 +26,7 @@ #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "jvmtifiles/jvmtiEnv.hpp" #include "oops/instanceMirrorKlass.hpp" #include "oops/objArrayKlass.hpp" diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp index 955e34d5034..c0e4f30d2a2 100644 --- a/hotspot/src/share/vm/prims/unsafe.cpp +++ b/hotspot/src/share/vm/prims/unsafe.cpp @@ -38,6 +38,7 @@ #include "runtime/orderAccess.inline.hpp" #include "runtime/reflection.hpp" #include "runtime/synchronizer.hpp" +#include "runtime/vm_version.hpp" #include "services/threadService.hpp" #include "trace/tracing.hpp" #include "utilities/copy.hpp" diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 694ecbd685d..e6805b12e5b 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" +#include "code/codeCache.hpp" #include "memory/metadataFactory.hpp" #include "memory/universe.hpp" #include "oops/oop.inline.hpp" @@ -38,6 +39,7 @@ #include "runtime/arguments.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/os.hpp" +#include "runtime/vm_version.hpp" #include "utilities/array.hpp" #include "utilities/debug.hpp" diff --git a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp index 1b97c18b7f7..5c765ec21b8 100644 --- a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp +++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2014, 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 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" #include "runtime/advancedThresholdPolicy.hpp" #include "runtime/simpleThresholdPolicy.inline.hpp" diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 7accd0c0b18..3f0bff025ec 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -38,6 +38,7 @@ #include "runtime/globals_extension.hpp" #include "runtime/java.hpp" #include "runtime/os.hpp" +#include "runtime/vm_version.hpp" #include "services/management.hpp" #include "services/memTracker.hpp" #include "utilities/defaultStream.hpp" @@ -1537,8 +1538,10 @@ void Arguments::set_conservative_max_heap_alignment() { heap_alignment = G1CollectedHeap::conservative_max_heap_alignment(); } #endif // INCLUDE_ALL_GCS - _conservative_max_heap_alignment = MAX3(heap_alignment, os::max_page_size(), - CollectorPolicy::compute_heap_alignment()); + _conservative_max_heap_alignment = MAX4(heap_alignment, + (size_t)os::vm_allocation_granularity(), + os::max_page_size(), + CollectorPolicy::compute_heap_alignment()); } void Arguments::set_ergonomics_flags() { diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp index b15664f4b52..a7ad943cf7c 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" +#include "code/codeCache.hpp" #include "code/debugInfoRec.hpp" #include "code/nmethod.hpp" #include "code/pcDesc.hpp" @@ -50,44 +51,6 @@ #include "runtime/vframe_hp.hpp" #include "utilities/events.hpp" #include "utilities/xmlstream.hpp" -#ifdef TARGET_ARCH_x86 -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vmreg_ppc.inline.hpp" -#endif -#ifdef COMPILER2 -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/ad_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/ad_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/ad_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/ad_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/ad_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/ad_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/ad_ppc_64.hpp" -#endif -#endif // COMPILER2 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC diff --git a/hotspot/src/share/vm/runtime/dtraceJSDT.cpp b/hotspot/src/share/vm/runtime/dtraceJSDT.cpp index 1a5f4fe5286..51ae25d0c34 100644 --- a/hotspot/src/share/vm/runtime/dtraceJSDT.cpp +++ b/hotspot/src/share/vm/runtime/dtraceJSDT.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/javaClasses.hpp" #include "code/codeBlob.hpp" +#include "code/nativeInst.hpp" #include "memory/allocation.hpp" #include "prims/jvm.h" #include "runtime/dtraceJSDT.hpp" diff --git a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp index 67b766ae944..7e7592a5406 100644 --- a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp +++ b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -26,21 +26,6 @@ #define SHARE_VM_RUNTIME_DTRACEJSDT_HPP #include "code/nmethod.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -#endif class RegisteredProbes; typedef jlong OpaqueProbes; diff --git a/hotspot/src/share/vm/runtime/fprofiler.cpp b/hotspot/src/share/vm/runtime/fprofiler.cpp index 58cb6e89daa..aec76268824 100644 --- a/hotspot/src/share/vm/runtime/fprofiler.cpp +++ b/hotspot/src/share/vm/runtime/fprofiler.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/classLoader.hpp" +#include "code/codeCache.hpp" #include "code/vtableStubs.hpp" #include "gc_interface/collectedHeap.inline.hpp" #include "interpreter/interpreter.hpp" diff --git a/hotspot/src/share/vm/runtime/frame.cpp b/hotspot/src/share/vm/runtime/frame.cpp index 0e6d22eb01f..d076896f0aa 100644 --- a/hotspot/src/share/vm/runtime/frame.cpp +++ b/hotspot/src/share/vm/runtime/frame.cpp @@ -23,6 +23,8 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" +#include "code/vmreg.inline.hpp" #include "compiler/abstractCompiler.hpp" #include "compiler/disassembler.hpp" #include "gc_interface/collectedHeap.inline.hpp" @@ -48,21 +50,6 @@ #include "runtime/thread.inline.hpp" #include "utilities/decoder.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -#endif PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC @@ -412,91 +399,32 @@ void frame::interpreter_frame_set_method(Method* method) { *interpreter_frame_method_addr() = method; } -void frame::interpreter_frame_set_bcx(intptr_t bcx) { - assert(is_interpreted_frame(), "Not an interpreted frame"); - if (ProfileInterpreter) { - bool formerly_bci = is_bci(interpreter_frame_bcx()); - bool is_now_bci = is_bci(bcx); - *interpreter_frame_bcx_addr() = bcx; - - intptr_t mdx = interpreter_frame_mdx(); - - if (mdx != 0) { - if (formerly_bci) { - if (!is_now_bci) { - // The bcx was just converted from bci to bcp. - // Convert the mdx in parallel. - MethodData* mdo = interpreter_frame_method()->method_data(); - assert(mdo != NULL, ""); - int mdi = mdx - 1; // We distinguish valid mdi from zero by adding one. - address mdp = mdo->di_to_dp(mdi); - interpreter_frame_set_mdx((intptr_t)mdp); - } - } else { - if (is_now_bci) { - // The bcx was just converted from bcp to bci. - // Convert the mdx in parallel. - MethodData* mdo = interpreter_frame_method()->method_data(); - assert(mdo != NULL, ""); - int mdi = mdo->dp_to_di((address)mdx); - interpreter_frame_set_mdx((intptr_t)mdi + 1); // distinguish valid from 0. - } - } - } - } else { - *interpreter_frame_bcx_addr() = bcx; - } -} - jint frame::interpreter_frame_bci() const { assert(is_interpreted_frame(), "interpreted frame expected"); - intptr_t bcx = interpreter_frame_bcx(); - return is_bci(bcx) ? bcx : interpreter_frame_method()->bci_from((address)bcx); -} - -void frame::interpreter_frame_set_bci(jint bci) { - assert(is_interpreted_frame(), "interpreted frame expected"); - assert(!is_bci(interpreter_frame_bcx()), "should not set bci during GC"); - interpreter_frame_set_bcx((intptr_t)interpreter_frame_method()->bcp_from(bci)); + address bcp = interpreter_frame_bcp(); + return interpreter_frame_method()->bci_from(bcp); } address frame::interpreter_frame_bcp() const { assert(is_interpreted_frame(), "interpreted frame expected"); - intptr_t bcx = interpreter_frame_bcx(); - return is_bci(bcx) ? interpreter_frame_method()->bcp_from(bcx) : (address)bcx; + return (address)*interpreter_frame_bcp_addr(); } void frame::interpreter_frame_set_bcp(address bcp) { assert(is_interpreted_frame(), "interpreted frame expected"); - assert(!is_bci(interpreter_frame_bcx()), "should not set bcp during GC"); - interpreter_frame_set_bcx((intptr_t)bcp); -} - -void frame::interpreter_frame_set_mdx(intptr_t mdx) { - assert(is_interpreted_frame(), "Not an interpreted frame"); - assert(ProfileInterpreter, "must be profiling interpreter"); - *interpreter_frame_mdx_addr() = mdx; + *interpreter_frame_bcp_addr() = (intptr_t)bcp; } address frame::interpreter_frame_mdp() const { assert(ProfileInterpreter, "must be profiling interpreter"); assert(is_interpreted_frame(), "interpreted frame expected"); - intptr_t bcx = interpreter_frame_bcx(); - intptr_t mdx = interpreter_frame_mdx(); - - assert(!is_bci(bcx), "should not access mdp during GC"); - return (address)mdx; + return (address)*interpreter_frame_mdp_addr(); } void frame::interpreter_frame_set_mdp(address mdp) { assert(is_interpreted_frame(), "interpreted frame expected"); - if (mdp == NULL) { - // Always allow the mdp to be cleared. - interpreter_frame_set_mdx((intptr_t)mdp); - } - intptr_t bcx = interpreter_frame_bcx(); - assert(!is_bci(bcx), "should not set mdp during GC"); - interpreter_frame_set_mdx((intptr_t)mdp); + assert(ProfileInterpreter, "must be profiling interpreter"); + *interpreter_frame_mdp_addr() = (intptr_t)mdp; } BasicObjectLock* frame::next_monitor_in_interpreter_frame(BasicObjectLock* current) const { @@ -1182,24 +1110,6 @@ void frame::metadata_do(void f(Metadata*)) { } } -void frame::gc_prologue() { - if (is_interpreted_frame()) { - // set bcx to bci to become Method* position independent during GC - interpreter_frame_set_bcx(interpreter_frame_bci()); - } -} - - -void frame::gc_epilogue() { - if (is_interpreted_frame()) { - // set bcx back to bcp for interpreter - interpreter_frame_set_bcx((intptr_t)interpreter_frame_bcp()); - } - // call processor specific epilog function - pd_gc_epilog(); -} - - # ifdef ENABLE_ZAP_DEAD_LOCALS void frame::CheckValueClosure::do_oop(oop* p) { diff --git a/hotspot/src/share/vm/runtime/frame.hpp b/hotspot/src/share/vm/runtime/frame.hpp index f715f68b52d..9cdb256eea5 100644 --- a/hotspot/src/share/vm/runtime/frame.hpp +++ b/hotspot/src/share/vm/runtime/frame.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,29 +30,6 @@ #include "runtime/monitorChunk.hpp" #include "runtime/registerMap.hpp" #include "utilities/top.hpp" -#ifdef COMPILER2 -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/adGlobals_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/adGlobals_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/adGlobals_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/adGlobals_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/adGlobals_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/adGlobals_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/adGlobals_ppc_64.hpp" -#endif -#endif // COMPILER2 #ifdef ZERO #ifdef TARGET_ARCH_zero # include "stack_zero.hpp" @@ -241,8 +218,8 @@ class frame VALUE_OBJ_CLASS_SPEC { private: intptr_t** interpreter_frame_locals_addr() const; - intptr_t* interpreter_frame_bcx_addr() const; - intptr_t* interpreter_frame_mdx_addr() const; + intptr_t* interpreter_frame_bcp_addr() const; + intptr_t* interpreter_frame_mdp_addr() const; public: // Locals @@ -252,23 +229,13 @@ class frame VALUE_OBJ_CLASS_SPEC { void interpreter_frame_set_locals(intptr_t* locs); - // byte code index/pointer (use these functions for unchecked frame access only!) - intptr_t interpreter_frame_bcx() const { return *interpreter_frame_bcx_addr(); } - void interpreter_frame_set_bcx(intptr_t bcx); - // byte code index jint interpreter_frame_bci() const; - void interpreter_frame_set_bci(jint bci); // byte code pointer address interpreter_frame_bcp() const; void interpreter_frame_set_bcp(address bcp); - // Unchecked access to the method data index/pointer. - // Only use this if you know what you are doing. - intptr_t interpreter_frame_mdx() const { return *interpreter_frame_mdx_addr(); } - void interpreter_frame_set_mdx(intptr_t mdx); - // method data pointer address interpreter_frame_mdp() const; void interpreter_frame_set_mdp(address dp); @@ -437,10 +404,6 @@ class frame VALUE_OBJ_CLASS_SPEC { // RedefineClasses support for finding live interpreted methods on the stack void metadata_do(void f(Metadata*)); - void gc_prologue(); - void gc_epilogue(); - void pd_gc_epilog(); - # ifdef ENABLE_ZAP_DEAD_LOCALS private: class CheckValueClosure: public OopClosure { @@ -477,7 +440,6 @@ class frame VALUE_OBJ_CLASS_SPEC { // Verification void verify(const RegisterMap* map); static bool verify_return_pc(address x); - static bool is_bci(intptr_t bcx); // Usage: // assert(frame::verify_return_pc(return_address), "must be a return pc"); diff --git a/hotspot/src/share/vm/runtime/frame.inline.hpp b/hotspot/src/share/vm/runtime/frame.inline.hpp index ce725956dee..c17c4f4ac60 100644 --- a/hotspot/src/share/vm/runtime/frame.inline.hpp +++ b/hotspot/src/share/vm/runtime/frame.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,21 +31,6 @@ #include "oops/method.hpp" #include "runtime/frame.hpp" #include "runtime/signature.hpp" -#ifdef TARGET_ARCH_x86 -# include "jniTypes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "jniTypes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "jniTypes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "jniTypes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "jniTypes_ppc.hpp" -#endif #ifdef ZERO #ifdef TARGET_ARCH_zero # include "entryFrame_zero.hpp" @@ -55,26 +40,6 @@ #endif #endif -// This file holds platform-independent bodies of inline functions for frames. - -// Note: The bcx usually contains the bcp; however during GC it contains the bci -// (changed by gc_prologue() and gc_epilogue()) to be Method* position -// independent. These accessors make sure the correct value is returned -// by testing the range of the bcx value. bcp's are guaranteed to be above -// max_method_code_size, since methods are always allocated in OldSpace and -// Eden is allocated before OldSpace. -// -// The bcp is accessed sometimes during GC for ArgumentDescriptors; than -// the correct translation has to be performed (was bug). - -inline bool frame::is_bci(intptr_t bcx) { -#ifdef _LP64 - return ((uintptr_t) bcx) <= ((uintptr_t) max_method_code_size) ; -#else - return 0 <= bcx && bcx <= max_method_code_size; -#endif -} - inline bool frame::is_entry_frame() const { return StubRoutines::returns_to_call_stub(pc()); } diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index 3a075117afe..cfecf0a5d57 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -65,21 +65,6 @@ #include "utilities/histogram.hpp" #include "utilities/macros.hpp" #include "utilities/vmError.hpp" -#ifdef TARGET_ARCH_x86 -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vm_version_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vm_version_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vm_version_ppc.hpp" -#endif #if INCLUDE_ALL_GCS #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" #include "gc_implementation/parallelScavenge/psScavenge.hpp" diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index 86bf1d6ba4d..d24c688bf13 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -27,6 +27,7 @@ #include "classfile/javaClasses.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "code/icBuffer.hpp" #include "code/vtableStubs.hpp" #include "gc_implementation/shared/vmGCOperations.hpp" @@ -49,6 +50,7 @@ #include "runtime/os.inline.hpp" #include "runtime/stubRoutines.hpp" #include "runtime/thread.inline.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/memTracker.hpp" #include "services/threadService.hpp" diff --git a/hotspot/src/share/vm/runtime/registerMap.hpp b/hotspot/src/share/vm/runtime/registerMap.hpp index b0f536fb95c..e27b745ff7c 100644 --- a/hotspot/src/share/vm/runtime/registerMap.hpp +++ b/hotspot/src/share/vm/runtime/registerMap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,21 +27,6 @@ #include "code/vmreg.hpp" #include "utilities/globalDefinitions.hpp" -#ifdef TARGET_ARCH_x86 -# include "register_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "register_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "register_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "register_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "register_ppc.hpp" -#endif class JavaThread; diff --git a/hotspot/src/share/vm/runtime/relocator.hpp b/hotspot/src/share/vm/runtime/relocator.hpp index bbc0600f739..6ea9ab4c819 100644 --- a/hotspot/src/share/vm/runtime/relocator.hpp +++ b/hotspot/src/share/vm/runtime/relocator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,21 +27,7 @@ #include "interpreter/bytecodes.hpp" #include "oops/method.hpp" -#ifdef TARGET_ARCH_x86 -# include "bytes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "bytes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytes_ppc.hpp" -#endif +#include "utilities/bytes.hpp" // This code has been converted from the 1.1E java virtual machine // Thanks to the JavaTopics group for using the code diff --git a/hotspot/src/share/vm/runtime/rframe.cpp b/hotspot/src/share/vm/runtime/rframe.cpp index c52d16ff3d5..f3ef5504b37 100644 --- a/hotspot/src/share/vm/runtime/rframe.cpp +++ b/hotspot/src/share/vm/runtime/rframe.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" #include "interpreter/interpreter.hpp" #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp index 8d5ed4cb233..4b16f6b04a8 100644 --- a/hotspot/src/share/vm/runtime/safepoint.cpp +++ b/hotspot/src/share/vm/runtime/safepoint.cpp @@ -56,26 +56,6 @@ #include "services/runtimeService.hpp" #include "utilities/events.hpp" #include "utilities/macros.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -# include "vmreg_ppc.inline.hpp" -#endif #if INCLUDE_ALL_GCS #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" #include "gc_implementation/shared/suspendibleThreadSet.hpp" diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index 917f6d257b4..8ccee76cdb6 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "code/compiledIC.hpp" #include "code/scopeDesc.hpp" #include "code/vtableStubs.hpp" @@ -59,26 +60,6 @@ #include "utilities/hashtable.inline.hpp" #include "utilities/macros.hpp" #include "utilities/xmlstream.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -# include "vmreg_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -# include "vmreg_sparc.inline.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -# include "vmreg_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -# include "vmreg_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -# include "vmreg_ppc.inline.hpp" -#endif #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/stackValueCollection.cpp b/hotspot/src/share/vm/runtime/stackValueCollection.cpp index 3794f64d78c..fdf448b3718 100644 --- a/hotspot/src/share/vm/runtime/stackValueCollection.cpp +++ b/hotspot/src/share/vm/runtime/stackValueCollection.cpp @@ -24,21 +24,6 @@ #include "precompiled.hpp" #include "runtime/stackValueCollection.hpp" -#ifdef TARGET_ARCH_x86 -# include "jniTypes_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "jniTypes_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "jniTypes_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "jniTypes_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "jniTypes_ppc.hpp" -#endif PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC diff --git a/hotspot/src/share/vm/runtime/statSampler.cpp b/hotspot/src/share/vm/runtime/statSampler.cpp index 082cc4ec45e..55fda6fb3f9 100644 --- a/hotspot/src/share/vm/runtime/statSampler.cpp +++ b/hotspot/src/share/vm/runtime/statSampler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,21 +33,7 @@ #include "runtime/javaCalls.hpp" #include "runtime/os.hpp" #include "runtime/statSampler.hpp" -#ifdef TARGET_ARCH_x86 -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vm_version_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vm_version_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vm_version_ppc.hpp" -#endif +#include "runtime/vm_version.hpp" // -------------------------------------------------------- // StatSamplerTask diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index 78381168fc4..46d93a52916 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -31,21 +31,6 @@ #include "runtime/mutexLocker.hpp" #include "runtime/stubCodeGenerator.hpp" #include "utilities/top.hpp" -#ifdef TARGET_ARCH_x86 -# include "nativeInst_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "nativeInst_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "nativeInst_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "nativeInst_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "nativeInst_ppc.hpp" -#endif // StubRoutines provides entry points to assembly routines used by // compiled code and the run-time system. Platform-specific entry diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 984c7522580..08785805729 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -27,6 +27,7 @@ #include "classfile/javaClasses.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "code/scopeDesc.hpp" #include "compiler/compileBroker.hpp" #include "interpreter/interpreter.hpp" @@ -74,6 +75,7 @@ #include "runtime/vframe_hp.hpp" #include "runtime/vmThread.hpp" #include "runtime/vm_operations.hpp" +#include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/management.hpp" #include "services/memTracker.hpp" @@ -2647,20 +2649,6 @@ void JavaThread::deoptimized_wrt_marked_nmethods() { } -// GC support -static void frame_gc_epilogue(frame* f, const RegisterMap* map) { f->gc_epilogue(); } - -void JavaThread::gc_epilogue() { - frames_do(frame_gc_epilogue); -} - - -static void frame_gc_prologue(frame* f, const RegisterMap* map) { f->gc_prologue(); } - -void JavaThread::gc_prologue() { - frames_do(frame_gc_prologue); -} - // If the caller is a NamedThread, then remember, in the current scope, // the given JavaThread in its _processed_thread field. class RememberProcessedThread: public StackObj { @@ -4149,18 +4137,6 @@ void Threads::metadata_do(void f(Metadata*)) { } } -void Threads::gc_epilogue() { - ALL_JAVA_THREADS(p) { - p->gc_epilogue(); - } -} - -void Threads::gc_prologue() { - ALL_JAVA_THREADS(p) { - p->gc_prologue(); - } -} - void Threads::deoptimized_wrt_marked_nmethods() { ALL_JAVA_THREADS(p) { p->deoptimized_wrt_marked_nmethods(); diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp index 715e50a552f..7df1c0f3cbc 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -1416,10 +1416,6 @@ class JavaThread: public Thread { // RedefineClasses Support void metadata_do(void f(Metadata*)); - // Memory management operations - void gc_epilogue(); - void gc_prologue(); - // Misc. operations char* name() const { return (char*)get_thread_name(); } void print_on(outputStream* st) const; @@ -1899,8 +1895,6 @@ class Threads: AllStatic { // RedefineClasses support static void metadata_do(void f(Metadata*)); - static void gc_epilogue(); - static void gc_prologue(); #ifdef ASSERT static bool is_vm_complete() { return _vm_complete; } #endif diff --git a/hotspot/src/share/vm/runtime/vframe.hpp b/hotspot/src/share/vm/runtime/vframe.hpp index 70f31b14c51..17ead61b782 100644 --- a/hotspot/src/share/vm/runtime/vframe.hpp +++ b/hotspot/src/share/vm/runtime/vframe.hpp @@ -511,8 +511,8 @@ inline bool vframeStreamCommon::fill_from_frame() { inline void vframeStreamCommon::fill_from_interpreter_frame() { Method* method = _frame.interpreter_frame_method(); - intptr_t bcx = _frame.interpreter_frame_bcx(); - int bci = method->validate_bci_from_bcx(bcx); + address bcp = _frame.interpreter_frame_bcp(); + int bci = method->validate_bci_from_bcp(bcp); // 6379830 AsyncGetCallTrace sometimes feeds us wild frames. if (bci < 0) { found_bad_method_frame(); diff --git a/hotspot/src/share/vm/runtime/vframeArray.cpp b/hotspot/src/share/vm/runtime/vframeArray.cpp index 72e2e8717cb..6a3652c0ea1 100644 --- a/hotspot/src/share/vm/runtime/vframeArray.cpp +++ b/hotspot/src/share/vm/runtime/vframeArray.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/vmSymbols.hpp" +#include "code/vmreg.inline.hpp" #include "interpreter/bytecode.hpp" #include "interpreter/interpreter.hpp" #include "memory/allocation.inline.hpp" @@ -296,9 +297,9 @@ void vframeArrayElement::unpack_on_stack(int caller_actual_parameters, src->lock()->move_to(src->obj(), top->lock()); } if (ProfileInterpreter) { - iframe()->interpreter_frame_set_mdx(0); // clear out the mdp. + iframe()->interpreter_frame_set_mdp(0); // clear out the mdp. } - iframe()->interpreter_frame_set_bcx((intptr_t)bcp); // cannot use bcp because frame is not initialized yet + iframe()->interpreter_frame_set_bcp(bcp); if (ProfileInterpreter) { MethodData* mdo = method()->method_data(); if (mdo != NULL) { diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index 33fe915e7fe..3ff41705843 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -193,33 +193,13 @@ #include "opto/movenode.hpp" #include "opto/narrowptrnode.hpp" #include "opto/opaquenode.hpp" +#include "opto/optoreg.hpp" #include "opto/phaseX.hpp" #include "opto/parse.hpp" #include "opto/regalloc.hpp" #include "opto/rootnode.hpp" #include "opto/subnode.hpp" #include "opto/vectornode.hpp" -#ifdef TARGET_ARCH_MODEL_x86_32 -# include "adfiles/adGlobals_x86_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_x86_64 -# include "adfiles/adGlobals_x86_64.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_sparc -# include "adfiles/adGlobals_sparc.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_zero -# include "adfiles/adGlobals_zero.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_arm -# include "adfiles/adGlobals_arm.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_32 -# include "adfiles/adGlobals_ppc_32.hpp" -#endif -#ifdef TARGET_ARCH_MODEL_ppc_64 -# include "adfiles/adGlobals_ppc_64.hpp" -#endif #endif // COMPILER2 // Note: the cross-product of (c1, c2, product, nonproduct, ...), diff --git a/hotspot/src/share/vm/runtime/vm_operations.cpp b/hotspot/src/share/vm/runtime/vm_operations.cpp index 6f27fe3fecc..2e913c5015f 100644 --- a/hotspot/src/share/vm/runtime/vm_operations.cpp +++ b/hotspot/src/share/vm/runtime/vm_operations.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/symbolTable.hpp" #include "classfile/vmSymbols.hpp" +#include "code/codeCache.hpp" #include "compiler/compileBroker.hpp" #include "compiler/compilerOracle.hpp" #include "gc_implementation/shared/isGCActiveMark.hpp" diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp index bbebb4157be..c20e9a548cc 100644 --- a/hotspot/src/share/vm/runtime/vm_version.cpp +++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -26,21 +26,7 @@ #include "memory/universe.hpp" #include "oops/oop.inline.hpp" #include "runtime/arguments.hpp" -#ifdef TARGET_ARCH_x86 -# include "vm_version_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "vm_version_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "vm_version_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "vm_version_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "vm_version_ppc.hpp" -#endif +#include "runtime/vm_version.hpp" const char* Abstract_VM_Version::_s_vm_release = Abstract_VM_Version::vm_release(); const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Version::internal_vm_info_string(); diff --git a/hotspot/src/share/vm/runtime/vm_version.hpp b/hotspot/src/share/vm/runtime/vm_version.hpp index fcd7b229348..a4fd05a31e7 100644 --- a/hotspot/src/share/vm/runtime/vm_version.hpp +++ b/hotspot/src/share/vm/runtime/vm_version.hpp @@ -128,4 +128,20 @@ class Abstract_VM_Version: AllStatic { static unsigned int calc_parallel_worker_threads(); }; +#ifdef TARGET_ARCH_x86 +# include "vm_version_x86.hpp" +#endif +#ifdef TARGET_ARCH_sparc +# include "vm_version_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "vm_version_zero.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "vm_version_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vm_version_ppc.hpp" +#endif + #endif // SHARE_VM_RUNTIME_VM_VERSION_HPP diff --git a/hotspot/src/share/vm/services/diagnosticCommand.hpp b/hotspot/src/share/vm/services/diagnosticCommand.hpp index 7a6d3402809..73e8673dddb 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.hpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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,17 +25,16 @@ #ifndef SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP #define SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP -#include "runtime/arguments.hpp" #include "classfile/vmSymbols.hpp" -#include "utilities/ostream.hpp" -#include "runtime/vm_version.hpp" -#include "runtime/vmThread.hpp" +#include "runtime/arguments.hpp" #include "runtime/os.hpp" +#include "runtime/vmThread.hpp" #include "services/diagnosticArgument.hpp" #include "services/diagnosticCommand.hpp" -#include "services/diagnosticFramework.hpp" #include "services/diagnosticCommand_ext.hpp" +#include "services/diagnosticFramework.hpp" #include "utilities/macros.hpp" +#include "utilities/ostream.hpp" class HelpDCmd : public DCmdWithParser { protected: diff --git a/hotspot/src/share/vm/services/diagnosticFramework.hpp b/hotspot/src/share/vm/services/diagnosticFramework.hpp index ca60f53ebc8..4c9fe98da9d 100644 --- a/hotspot/src/share/vm/services/diagnosticFramework.hpp +++ b/hotspot/src/share/vm/services/diagnosticFramework.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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 @@ -29,7 +29,6 @@ #include "memory/allocation.hpp" #include "runtime/arguments.hpp" #include "runtime/os.hpp" -#include "runtime/vm_version.hpp" #include "runtime/vmThread.hpp" #include "utilities/ostream.hpp" diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher_Prefix.pch b/hotspot/src/share/vm/utilities/bytes.hpp similarity index 64% rename from jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher_Prefix.pch rename to hotspot/src/share/vm/utilities/bytes.hpp index c44e81dac57..7da269a4775 100644 --- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher_Prefix.pch +++ b/hotspot/src/share/vm/utilities/bytes.hpp @@ -1,12 +1,10 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * 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 @@ -21,12 +19,26 @@ * 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. + * */ -// -// Prefix header for all source files of the 'JavaAppLauncher' target in the 'JavaAppLauncher' project -// +#ifndef SHARE_VM_UTILITIES_BYTES_HPP +#define SHARE_VM_UTILITIES_BYTES_HPP -#ifdef __OBJC__ - #import +#ifdef TARGET_ARCH_x86 +# include "bytes_x86.hpp" #endif +#ifdef TARGET_ARCH_sparc +# include "bytes_sparc.hpp" +#endif +#ifdef TARGET_ARCH_zero +# include "bytes_zero.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif + +#endif // SHARE_VM_UTILITIES_BYTES_HPP diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp index 0fc7d6af3a1..58e84e23a16 100644 --- a/hotspot/src/share/vm/utilities/debug.cpp +++ b/hotspot/src/share/vm/utilities/debug.cpp @@ -48,6 +48,7 @@ #include "runtime/stubRoutines.hpp" #include "runtime/thread.inline.hpp" #include "runtime/vframe.hpp" +#include "runtime/vm_version.hpp" #include "services/heapDumper.hpp" #include "utilities/defaultStream.hpp" #include "utilities/events.hpp" diff --git a/hotspot/src/share/vm/utilities/ostream.cpp b/hotspot/src/share/vm/utilities/ostream.cpp index 4a807a0662d..59943c4b161 100644 --- a/hotspot/src/share/vm/utilities/ostream.cpp +++ b/hotspot/src/share/vm/utilities/ostream.cpp @@ -28,6 +28,7 @@ #include "oops/oop.inline.hpp" #include "runtime/arguments.hpp" #include "runtime/os.hpp" +#include "runtime/vm_version.hpp" #include "utilities/defaultStream.hpp" #include "utilities/ostream.hpp" #include "utilities/top.hpp" diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index f6b55cc99f0..2bff5f5c824 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" #include "compiler/compileBroker.hpp" #include "gc_interface/collectedHeap.hpp" #include "prims/whitebox.hpp" diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index 6a89ec446d3..b88243644c0 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -117,15 +117,6 @@ compact3 = \ # Tests that require compact3 API's # needs_compact3 = \ - compiler/8009761/Test8009761.java \ - compiler/whitebox/DeoptimizeMethodTest.java \ - compiler/whitebox/SetForceInlineMethodTest.java \ - compiler/whitebox/SetDontInlineMethodTest.java \ - compiler/whitebox/DeoptimizeAllTest.java \ - compiler/whitebox/MakeMethodNotCompilableTest.java \ - compiler/whitebox/ClearMethodStateTest.java \ - compiler/whitebox/EnqueueMethodForCompilationTest.java \ - compiler/whitebox/IsMethodCompilableTest.java \ gc/6581734/Test6581734.java \ gc/7072527/TestFullGCCount.java \ gc/g1/TestHumongousAllocInitialMark.java \ @@ -138,11 +129,7 @@ needs_compact3 = \ runtime/InternalApi/ThreadCpuTimesDeadlock.java \ serviceability/threads/TestFalseDeadLock.java \ serviceability/jvmti/GetObjectSizeOverflow.java \ - serviceability/jvmti/TestRedefineWithUnresolvedClass.java \ - compiler/tiered/NonTieredLevelsTest.java \ - compiler/tiered/TieredLevelsTest.java \ - compiler/intrinsics/bmi/verifycode \ - runtime/whitebox/WBStackSize.java + serviceability/jvmti/TestRedefineWithUnresolvedClass.java # Compact 2 adds full VM tests compact2 = \ @@ -199,8 +186,7 @@ compact2_minimal = \ # Tests that require compact2 API's # -needs_compact2 = \ - compiler/6589834/Test_ia32.java +needs_compact2 = # All tests that run on the most minimal configuration: Minimal VM on Compact 1 compact1_minimal = \ diff --git a/hotspot/test/compiler/5091921/Test6890943.java b/hotspot/test/compiler/5091921/Test6890943.java index 6dee78a593c..9752b1d0c2b 100644 --- a/hotspot/test/compiler/5091921/Test6890943.java +++ b/hotspot/test/compiler/5091921/Test6890943.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,163 +27,195 @@ * @bug 6890943 * @summary JVM mysteriously gives wrong result on 64-bit 1.6 VMs in hotspot mode. * - * @run shell/timeout=240 Test6890943.sh + * @run main/othervm/timeout=240 Test6890943 */ -import java.util.*; + import java.io.*; -import java.util.regex.*; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.Map; +import java.util.Scanner; public class Test6890943 { - public static final boolean AIR = true, ROCK = false; - public static void main(String[] args) { - new Test6890943().go(); - } + public static final boolean AIR = true, ROCK = false; + private static final Path PATH = Paths.get(System.getProperty("test.src", ".")); + private static final Path INPUT_FILE = PATH.resolve("input6890943.txt"); + private static final Path GOLDEN_FILE = PATH.resolve("output6890943.txt"); - int r, c, f, t; - boolean[][] grid; - - public void go() { - Scanner s = new Scanner(System.in); - s.useDelimiter("\\s+"); - int T = s.nextInt(); - for (t = 0 ; t < T ; t++) { - r = s.nextInt(); c = s.nextInt(); f = s.nextInt(); - grid = new boolean[r][c]; - for (int x = 0 ; x < r ; x++) { - String line = s.next(); - for (int y = 0 ; y < c ; y++) grid[x][y] = line.charAt(y) == '.'; - } - int digs = solve(); - String res = digs == -1 ? "No" : "Yes " + digs; - System.out.printf("Case #%d: %s\n", t+1, res); + public static void main(String[] args) { + new Test6890943().go(); } - } - Map M = new HashMap(); + int r, c, f, t; + boolean[][] grid; - private int solve() { - M = new HashMap(); - M.put(calcWalkingRange(0, 0), 0); - for (int digDown = 0 ; digDown < r ; digDown++) { - Map tries = new HashMap(); - for (Map.Entry m : M.entrySet()) { - int q = m.getKey(); - if (depth(q) != (digDown)) continue; - if (stuck(q)) continue; - tries.put(q, m.getValue()); - } - - for (Map.Entry m : tries.entrySet()) { - int q = m.getKey(); - int fallLeftDelta = 0, fallRightDelta = 0; - //fall left - int fallLeft = fall(digDown, start(q)); - if (fallLeft > 0) { - fallLeftDelta = 1; - if (fallLeft <= f) addToM(calcWalkingRange(digDown+fallLeft, start(q)), m.getValue()); + public void go() { + Scanner in, golden; + try { + in = new Scanner(new FileInputStream(INPUT_FILE.toFile())); + golden = new Scanner(new FileInputStream(GOLDEN_FILE.toFile())); + } catch (FileNotFoundException e) { + throw new RuntimeException("TEST failure: can't open test file", e); } + in.useDelimiter("\\s+"); + golden.useDelimiter("\\s+"); - //fall right - int fallRight = fall(digDown, end(q)); - if (fallRight > 0) { - fallRightDelta = 1; - - if (fallRight <= f) addToM(calcWalkingRange(digDown+fallRight, end(q)), m.getValue()); - } - - for (int p = start(q) + fallLeftDelta ; p <= end(q) - fallRightDelta ; p++) { - //goLeft - for (int digSpot = p ; digSpot > start(q) +fallLeftDelta ; digSpot--) { - int fallDown = 1+fall(digDown+1, digSpot); - if (fallDown <= f) { - if (fallDown == 1) { - addToM(calcWalkingRange(digDown + 1, digSpot, digSpot, p), m.getValue() + Math.abs(digSpot-p)+1); - } else { - addToM(calcWalkingRange(digDown + fallDown, digSpot), m.getValue() + Math.abs(digSpot-p)+1); - } + int T = in.nextInt(); + for (t = 0; t < T; t++) { + r = in.nextInt(); + c = in.nextInt(); + f = in.nextInt(); + grid = new boolean[r][c]; + for (int x = 0; x < r; x++) { + String line = in.next(); + for (int y = 0; y < c; y++) { + grid[x][y] = line.charAt(y) == '.'; + } } - } - - //goRight - for (int digSpot = p ; digSpot < end(q)-fallRightDelta ;digSpot++) { - int fallDown = 1+fall(digDown+1, digSpot); - if (fallDown <= f) { - if (fallDown == 1) { - addToM(calcWalkingRange(digDown + 1, digSpot, p, digSpot), m.getValue() + Math.abs(digSpot-p)+1); - } else { - addToM(calcWalkingRange(digDown + fallDown, digSpot), m.getValue() + Math.abs(digSpot-p)+1); - } + int digs = solve(); + String result = "Case #" + (t + 1) + ": " + (digs == -1 ? "No" : "Yes " + digs); + System.out.println(result); + // Compare with golden string from the file + String goldenStr = golden.nextLine(); + if (!result.equals(goldenStr)) { + System.err.println("FAIL: strings are not equal\n" + + "-- Result: " + result + "\n" + + "-- Golden: " + goldenStr); + throw new RuntimeException("FAIL: Result string is not equal to the golden"); } - } } - } } - int result = Integer.MAX_VALUE; - for (Map.Entry m : M.entrySet()) { - if (depth(m.getKey()) == r-1) result = Math.min(m.getValue(), result); + Map M = new HashMap(); + + private int solve() { + M = new HashMap(); + M.put(calcWalkingRange(0, 0), 0); + for (int digDown = 0; digDown < r; digDown++) { + Map tries = new HashMap(); + for (Map.Entry m : M.entrySet()) { + int q = m.getKey(); + if (depth(q) != (digDown)) continue; + if (stuck(q)) continue; + tries.put(q, m.getValue()); + } + + for (Map.Entry m : tries.entrySet()) { + int q = m.getKey(); + int fallLeftDelta = 0, fallRightDelta = 0; + //fall left + int fallLeft = fall(digDown, start(q)); + if (fallLeft > 0) { + fallLeftDelta = 1; + if (fallLeft <= f) addToM(calcWalkingRange(digDown + fallLeft, start(q)), m.getValue()); + } + + //fall right + int fallRight = fall(digDown, end(q)); + if (fallRight > 0) { + fallRightDelta = 1; + + if (fallRight <= f) addToM(calcWalkingRange(digDown + fallRight, end(q)), m.getValue()); + } + + for (int p = start(q) + fallLeftDelta; p <= end(q) - fallRightDelta; p++) { + //goLeft + for (int digSpot = p; digSpot > start(q) + fallLeftDelta; digSpot--) { + int fallDown = 1 + fall(digDown + 1, digSpot); + if (fallDown <= f) { + if (fallDown == 1) { + addToM(calcWalkingRange(digDown + 1, digSpot, digSpot, p), + m.getValue() + Math.abs(digSpot - p) + 1); + } else { + addToM(calcWalkingRange(digDown + fallDown, digSpot), + m.getValue() + Math.abs(digSpot - p) + 1); + } + } + } + + //goRight + for (int digSpot = p; digSpot < end(q) - fallRightDelta; digSpot++) { + int fallDown = 1 + fall(digDown + 1, digSpot); + if (fallDown <= f) { + if (fallDown == 1) { + addToM(calcWalkingRange(digDown + 1, digSpot, p, digSpot), + m.getValue() + Math.abs(digSpot - p) + 1); + } else { + addToM(calcWalkingRange(digDown + fallDown, digSpot), + m.getValue() + Math.abs(digSpot - p) + 1); + } + } + } + } + } + } + + int result = Integer.MAX_VALUE; + for (Map.Entry m : M.entrySet()) { + if (depth(m.getKey()) == r - 1) result = Math.min(m.getValue(), result); + } + + if (result == Integer.MAX_VALUE) return -1; + return result; } - if (result == Integer.MAX_VALUE) return -1; - return result; - } - - private void addToM(int q, int i) { - Integer original = M.get(q); - if ( original == null ) M.put(q, i); - else M.put(q, Math.min(original, i)); - } - - private int fall(int row, int column) { - int res = 0; - for ( int p = row+1 ; p < r ; p++) { - if (grid[p][column] == AIR) res++; - else break; - } - return res; - } - - private boolean stuck(int q) { - return start(q) == end(q); - } - - private int depth(int q) { - return q % 50; - } - - private int start(int q) { - return q / (50*50); - } - - private int end(int q) { - return (q / 50) % 50; - } - - private int calcWalkingRange(int depth, int pos) { - return calcWalkingRange(depth, pos, Integer.MAX_VALUE, Integer.MIN_VALUE); - } - - private int calcWalkingRange(int depth, int pos, int airOverrideStart, int airOverrideEnd) { - int left = pos, right = pos; - if (depth >= r) return (c-1)*50 + depth; - - while (left > 0) { - if (grid[depth][left-1] == ROCK && (left-1 < airOverrideStart || left-1 > airOverrideEnd)) break; - if (depth < r-1 && grid[depth+1][left-1] == AIR) { - left--; - break; - } - left--; - } - while (right < c-1) { - if (grid[depth][right+1] == ROCK && (right+1 < airOverrideStart || right+1 > airOverrideEnd)) break; - if (depth < r-1 && grid[depth+1][right+1] == AIR) { - right++; - break; - } - right++; + private void addToM(int q, int i) { + Integer original = M.get(q); + if (original == null) M.put(q, i); + else M.put(q, Math.min(original, i)); } - return left *50*50 + right*50 + depth; - } + private int fall(int row, int column) { + int res = 0; + for (int p = row + 1; p < r; p++) { + if (grid[p][column] == AIR) res++; + else break; + } + return res; + } + + private boolean stuck(int q) { + return start(q) == end(q); + } + + private int depth(int q) { + return q % 50; + } + + private int start(int q) { + return q / (50 * 50); + } + + private int end(int q) { + return (q / 50) % 50; + } + + private int calcWalkingRange(int depth, int pos) { + return calcWalkingRange(depth, pos, Integer.MAX_VALUE, Integer.MIN_VALUE); + } + + private int calcWalkingRange(int depth, int pos, int airOverrideStart, int airOverrideEnd) { + int left = pos, right = pos; + if (depth >= r) return (c - 1) * 50 + depth; + + while (left > 0) { + if (grid[depth][left - 1] == ROCK && (left - 1 < airOverrideStart || left - 1 > airOverrideEnd)) break; + if (depth < r - 1 && grid[depth + 1][left - 1] == AIR) { + left--; + break; + } + left--; + } + while (right < c - 1) { + if (grid[depth][right + 1] == ROCK && (right + 1 < airOverrideStart || right + 1 > airOverrideEnd)) break; + if (depth < r - 1 && grid[depth + 1][right + 1] == AIR) { + right++; + break; + } + right++; + } + + return left * 50 * 50 + right * 50 + depth; + } } diff --git a/hotspot/test/compiler/5091921/Test6890943.sh b/hotspot/test/compiler/5091921/Test6890943.sh deleted file mode 100644 index 755f56890f1..00000000000 --- a/hotspot/test/compiler/5091921/Test6890943.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# 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. -# -# -## some tests require path to find test source dir -if [ "${TESTSRC}" = "" ] -then - TESTSRC=${PWD} - echo "TESTSRC not set. Using "${TESTSRC}" as default" -fi -echo "TESTSRC=${TESTSRC}" -## Adding common setup Variables for running shell tests. -. ${TESTSRC}/../../test_env.sh - - -set -x - -cp ${TESTSRC}/Test6890943.java . -cp ${TESTSRC}/input6890943.txt . -cp ${TESTSRC}/output6890943.txt . -cp ${TESTSRC}/Test6890943.sh . - -${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} -d . Test6890943.java - -${TESTJAVA}/bin/java -XX:-PrintVMOptions -XX:+IgnoreUnrecognizedVMOptions ${TESTVMOPTS} Test6890943 < input6890943.txt > pretest.out 2>&1 - -# This test sometimes tickles an unrelated performance warning that interferes with diff. -grep -v 'warning: Performance bug: SystemDictionary' pretest.out > test.out - -diff output6890943.txt test.out - -result=$? -if [ $result -eq 0 ] -then - echo "Passed" - exit 0 -else - echo "Failed" - exit 1 -fi diff --git a/hotspot/test/compiler/6589834/InlinedArrayCloneTestCase.java b/hotspot/test/compiler/6589834/InlinedArrayCloneTestCase.java new file mode 100644 index 00000000000..aadc1056323 --- /dev/null +++ b/hotspot/test/compiler/6589834/InlinedArrayCloneTestCase.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2014, 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 + * 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. + */ + +public class InlinedArrayCloneTestCase implements Runnable { + private Test_ia32 executionController; + + public InlinedArrayCloneTestCase(Test_ia32 executionController) { + this.executionController = executionController; + } + + /* + * Please leave following two methods (invokeArrayClone and verifyArguments) + * static. + * + * It does not really matter if these methods are static or instance, + * original issue could be reproduced in both cases, but if these methods + * are static then it is much easier to understand that reproduced issue + * is actually interpreter's stack corruption. + * + * If these methods are non-static, then interpreter's stack will contain + * invalid 'this' pointer required for instance's method call and + * verifyArguments' call may throw NullPointerException. There was another + * issue w/ NPE after deoptimization addressed by JDK-6833129, so NPE looks + * a little bit confusing. + * + * If these methods are static then after deptimization we'll get incorrect + * arguments values in verifyArguments. + * Something like "2, -1289936896, 3, 4" instead of "1, 2, 3, 4". + * This information tells much more about actual issue comparing to NPE, + * so it's preferable to leave these methods static. + */ + private static int verifyArguments(int i1, int i2, LoadedClass[] arr, + int i3, int i4) { + if (!(i1==1 && i2==2 && i3==3 && i4==4)) { + throw new RuntimeException(String.format( + "Arguments have unexpected values: %d, %d, %d, %d", + i1, i2, i3, i4)); + } + return arr.length; + } + + private static int invokeArrayClone(LoadedClass[] a) { + return InlinedArrayCloneTestCase.verifyArguments(1, 2, a.clone(), 3, 4); + } + + @Override + public void run() { + LoadedClass[] array = executionController.getArray(); + int length; + + while (executionController.continueExecution()) { + try { + length = InlinedArrayCloneTestCase.invokeArrayClone(array); + } catch (Throwable e) { + e.printStackTrace(); + executionController.setTestFailed(); + return; + } + if (length != array.length) { + System.out.println(String.format("f(array) returned %d " + + "instead of %d.", length, array.length)); + executionController.setTestFailed(); + } + } + } +} diff --git a/hotspot/test/compiler/6589834/Test_ia32.java b/hotspot/test/compiler/6589834/Test_ia32.java index f9c2f524b26..aed3198320d 100644 --- a/hotspot/test/compiler/6589834/Test_ia32.java +++ b/hotspot/test/compiler/6589834/Test_ia32.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, 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 @@ -24,103 +24,116 @@ /** * @test * @bug 6589834 - * @summary deoptimization problem with -XX:+DeoptimizeALot - * - * @run main Test_ia32 + * @summary Safepoint placed between stack pointer increment and decrement leads + * to interpreter's stack corruption after deoptimization. + * @library /testlibrary /testlibrary/whitebox + * @build ClassFileInstaller sun.hotspot.WhiteBox com.oracle.java.testlibrary.* + * Test_ia32 InlinedArrayCloneTestCase + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:CompileOnly=InlinedArrayCloneTestCase + * -XX:CompileCommand=dontinline,InlinedArrayCloneTestCase.invokeArrayClone + * -XX:CompileCommand=inline,InlinedArrayCloneTestCase.verifyArguments + * -XX:+IgnoreUnrecognizedVMOptions -XX:+VerifyStack Test_ia32 */ -/*************************************************************************************** -NOTE: The bug shows up (with several "Bug!" message) even without the - flag -XX:+DeoptimizeALot. In a debug build, you may want to try - the flags -XX:+VerifyStack and -XX:+DeoptimizeALot to get more information. -****************************************************************************************/ -import java.lang.reflect.Constructor; +import java.lang.reflect.Method; + +import com.oracle.java.testlibrary.Asserts; +import sun.hotspot.WhiteBox; public class Test_ia32 { + private static final int NUM_THREADS + = Math.min(100, 2 * Runtime.getRuntime().availableProcessors()); + private static final int CLONE_LENGTH = 1000; - public static int NUM_THREADS = 100; + private static WhiteBox wb = WhiteBox.getWhiteBox(); - public static int CLONE_LENGTH = 1000; + private final LoadedClass[] ARRAY = new LoadedClass[Test_ia32.CLONE_LENGTH]; + private volatile boolean doSpin = true; + private volatile boolean testFailed = false; - public static void main(String[] args) throws InterruptedException, ClassNotFoundException { + public boolean continueExecution() { + return doSpin; + } + + public void stopExecution() { + doSpin = false; + } + + public boolean isTestFailed() { + return testFailed; + } + + public void setTestFailed() { + this.testFailed = true; + stopExecution(); + } + + public LoadedClass[] getArray() { + return ARRAY; + } + + public void runTest() { + Thread[] threads = new Thread[Test_ia32.NUM_THREADS]; + Method method; + + try { + method = InlinedArrayCloneTestCase.class.getDeclaredMethod( + "invokeArrayClone", LoadedClass[].class); + } catch (NoSuchMethodException e) { + throw new Error("Tested method not found", e); + } + + Asserts.assertTrue(wb.isMethodCompilable(method), + "Method " + method.getName() + " should be compilable."); - Reflector[] threads = new Reflector[NUM_THREADS]; for (int i = 0; i < threads.length; i++) { - threads[i] = new Reflector(); + threads[i] = new Thread(new InlinedArrayCloneTestCase(this)); threads[i].start(); } - System.out.println("Give Reflector.run() some time to compile..."); - Thread.sleep(5000); + /* + * Wait until InlinedArrayCloneTestCase::invokeArrayClone is compiled. + */ + while (!wb.isMethodCompiled(method)) { + Thread.yield(); + } - System.out.println("Load RMISecurityException causing run() deoptimization"); - ClassLoader.getSystemClassLoader().loadClass("java.rmi.RMISecurityException"); + /* + * Load NotLoadedClass to cause deoptimization of + * InlinedArrayCloneTestCase::invokeArrayClone due to invalidated + * dependency. + */ + try { + Class.forName("NotLoadedClass"); + } catch (ClassNotFoundException e) { + throw new Error("Unable to load class that invalidates " + + "CHA-dependency for method " + method.getName(), e); + } - for (Reflector thread : threads) - thread.requestStop(); + stopExecution(); - for (Reflector thread : threads) + for (Thread thread : threads) { try { thread.join(); } catch (InterruptedException e) { - System.out.println(e); + throw new Error("Fail to join thread " + thread, e); } + } + Asserts.assertFalse(isTestFailed(), "Test failed."); } + public static void main(String[] args) { + new Test_ia32().runTest(); + } } -class Reflector extends Thread { - - volatile boolean _doSpin = true; - - Test_ia32[] _tests; - - Reflector() { - _tests = new Test_ia32[Test_ia32.CLONE_LENGTH]; - for (int i = 0; i < _tests.length; i++) { - _tests[i] = new Test_ia32(); - } - } - - static int g(int i1, int i2, Test_ia32[] arr, int i3, int i4) { - - if (!(i1==1 && i2==2 && i3==3 && i4==4)) { - System.out.println("Bug!"); - } - - return arr.length; - } - - static int f(Test_ia32[] arr) { - return g(1, 2, arr.clone(), 3, 4); - } - - @Override - public void run() { - Constructor[] ctrs = null; - Class klass = Test_ia32.class; - try { - ctrs = klass.getConstructors(); - } catch (SecurityException e) { - System.out.println(e); - } - - try { - while (_doSpin) { - if (f(_tests) < 0) - System.out.println("return value usage"); - } - } catch (NullPointerException e) { - e.printStackTrace(); - } - - System.out.println(this + " - stopped."); - } - - public void requestStop() { - System.out.println(this + " - stop requested."); - _doSpin = false; - } - +class LoadedClass { +} + +@SuppressWarnings("unused") +class NotLoadedClass extends LoadedClass { } diff --git a/hotspot/test/compiler/8004051/Test8004051.java b/hotspot/test/compiler/8004051/Test8004051.java index 97073e96b1e..981effb2089 100644 --- a/hotspot/test/compiler/8004051/Test8004051.java +++ b/hotspot/test/compiler/8004051/Test8004051.java @@ -28,7 +28,7 @@ * @bug 8005722 * @summary assert(_oprs_len[mode] < maxNumberOfOperands) failed: array overflow * - * @run main/othervm -Xcomp -client Test8004051 + * @run main/othervm -Xcomp Test8004051 */ public class Test8004051 { diff --git a/hotspot/test/compiler/ciReplay/TestSA.sh b/hotspot/test/compiler/ciReplay/TestSA.sh index 61d93652f25..56736c7807e 100644 --- a/hotspot/test/compiler/ciReplay/TestSA.sh +++ b/hotspot/test/compiler/ciReplay/TestSA.sh @@ -26,7 +26,7 @@ ## ## @test ## @bug 8011675 -## @ignore 8032226, 8031978 +## @ignore 8031978 ## @summary testing of ciReplay with using generated by SA replay.txt ## @author igor.ignatyev@oracle.com ## @run shell TestSA.sh diff --git a/hotspot/test/compiler/ciReplay/TestVM.sh b/hotspot/test/compiler/ciReplay/TestVM.sh index c972c607947..e58d63e16fa 100644 --- a/hotspot/test/compiler/ciReplay/TestVM.sh +++ b/hotspot/test/compiler/ciReplay/TestVM.sh @@ -26,7 +26,6 @@ ## ## @test ## @bug 8011675 -## @ignore 8031978 ## @summary testing of ciReplay with using generated by VM replay.txt ## @author igor.ignatyev@oracle.com ## @run shell TestVM.sh diff --git a/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh b/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh index 4d0ee773c44..d961d42541d 100644 --- a/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh +++ b/hotspot/test/compiler/ciReplay/TestVM_no_comp_level.sh @@ -26,7 +26,6 @@ ## ## @test ## @bug 8011675 -## @ignore 8031978 ## @summary testing of ciReplay with using generated by VM replay.txt w/o comp_level ## @author igor.ignatyev@oracle.com ## @run shell TestVM_no_comp_level.sh diff --git a/hotspot/test/compiler/ciReplay/common.sh b/hotspot/test/compiler/ciReplay/common.sh index cf17febc4f7..b7c5b7b4292 100644 --- a/hotspot/test/compiler/ciReplay/common.sh +++ b/hotspot/test/compiler/ciReplay/common.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2014, 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 @@ -223,21 +223,29 @@ generate_replay() { -XX:CICrashAt=1 \ -XX:+CreateMinidumpOnCrash \ -XX:+DumpReplayDataOnError \ + -XX:-TransmitErrorReport \ + -XX:+PreferInterpreterNativeStubs \ + -XX:+PrintCompilation \ -XX:ReplayDataFile=${replay_data} \ -version" echo GENERATION OF REPLAY.TXT: echo $cmd ${cmd} > crash.out 2>&1 - + + exit_code=$? + if [ ${exit_code} -eq 0 ] + then + cat crash.out + test_fail 3 "CHECK :: CRASH" "JVM exits gracefully" + fi + core_locations=`grep -i core crash.out | grep "location:" | \ sed -e 's/.*location: //'` - echo CRASH OUTPUT: - cat crash.out - - if [ "${core_locations}" = "" ] + + if [ -z "${core_locations}" ] then - test_fail 2 "CHECK :: CORE_LOCATION" "output doesn't contain the location of core file, see crash.out" + test_fail 4 "CHECK :: CORE_LOCATION" "output doesn't contain the location of core file, see crash.out" fi rm crash.out @@ -245,16 +253,19 @@ generate_replay() { # processing core locations for *nix if [ $VM_OS != "windows" ] then - # remove 'or' between '/core.' and 'core' + # remove 'or' between '/core.' and 'core' + # and the rest of line -- ' (max size ...) . To ensure a full core ...' core_locations=`echo $core_locations | \ - sed -e 's/\([^ ]*\) or \([^ ]*\)/\1 \2/'` - # add /core. core. + sed -e 's/\([^ ]*\) or \([^ ]*\).*/\1 \2/'` core_with_dir=`echo $core_locations | awk '{print $1}'` - dir=`dirname $core_with_dir` core_with_pid=`echo $core_locations | awk '{print $2}'` - if [ -n ${core_with_pid} ] + dir=`dirname $core_with_dir` + file=`basename $core_with_dir` + # add /core. core + core_locations="'$core_with_dir' '$file'" + if [ -n "${core_with_pid}" ] then - core_locations="$core_locations $dir${FS}$core_with_pid $core_with_pid" + core_locations="$core_locations '$core_with_pid' '$dir${FS}$core_with_pid'" fi fi diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java index 0425bafc4a0..49efda1215b 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java @@ -146,6 +146,10 @@ public class BmiIntrinsicBase extends CompilerWhiteBoxTest { } protected int countCpuInstructions(byte[] nativeCode) { + return countCpuInstructions(nativeCode, instrMask, instrPattern); + } + + public static int countCpuInstructions(byte[] nativeCode, byte[] instrMask, byte[] instrPattern) { int count = 0; int patternSize = Math.min(instrMask.length, instrPattern.length); boolean found; @@ -183,4 +187,21 @@ public class BmiIntrinsicBase extends CompilerWhiteBoxTest { return "UseBMI1Instructions"; } } + + abstract static class BmiTestCase_x64 extends BmiTestCase { + protected byte[] instrMask_x64; + protected byte[] instrPattern_x64; + + protected BmiTestCase_x64(Method method) { + super(method); + } + + protected int countCpuInstructions(byte[] nativeCode) { + int cnt = super.countCpuInstructions(nativeCode); + if (Platform.isX64()) { // on x64 platform the instruction we search for can be encoded in 2 different ways + cnt += countCpuInstructions(nativeCode, instrMask_x64, instrPattern_x64); + } + return cnt; + } + } } diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java index 0ba76e69bc5..62c8642833b 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java @@ -33,12 +33,15 @@ import java.lang.reflect.Method; -public class LZcntTestI extends BmiIntrinsicBase.BmiTestCase { +public class LZcntTestI extends BmiIntrinsicBase.BmiTestCase_x64 { protected LZcntTestI(Method method) { super(method); instrMask = new byte[]{(byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; instrPattern = new byte[]{(byte) 0xF3, (byte) 0x0F, (byte) 0xBD}; + + instrMask_x64 = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF}; + instrPattern_x64 = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBD}; } public static void main(String[] args) throws Exception { diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java index 5ecfb96d637..16caae2b0d9 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java @@ -31,8 +31,6 @@ * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction LZcntTestL */ -import com.oracle.java.testlibrary.Platform; - import java.lang.reflect.Method; public class LZcntTestL extends LZcntTestI { @@ -40,10 +38,6 @@ public class LZcntTestL extends LZcntTestI { protected LZcntTestL(Method method) { super(method); isLongOperation = true; - if (Platform.isX64()) { - instrMask = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF}; - instrPattern = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBD}; - } } public static void main(String[] args) throws Exception { diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java index ad2af2c615a..2502641e8da 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java @@ -33,12 +33,15 @@ import java.lang.reflect.Method; -public class TZcntTestI extends BmiIntrinsicBase.BmiTestCase { +public class TZcntTestI extends BmiIntrinsicBase.BmiTestCase_x64 { protected TZcntTestI(Method method) { super(method); instrMask = new byte[]{(byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; instrPattern = new byte[]{(byte) 0xF3, (byte) 0x0F, (byte) 0xBC}; + + instrMask_x64 = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF}; + instrPattern_x64 = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBC}; } public static void main(String[] args) throws Exception { diff --git a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java index 0a856dfa9e2..c08dbcc1fc9 100644 --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java @@ -31,8 +31,6 @@ * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountTrailingZerosInstruction TZcntTestL */ -import com.oracle.java.testlibrary.Platform; - import java.lang.reflect.Method; public class TZcntTestL extends TZcntTestI { @@ -40,11 +38,6 @@ public class TZcntTestL extends TZcntTestI { protected TZcntTestL(Method method) { super(method); isLongOperation = true; - if (Platform.isX64()) { - instrMask = new byte[]{(byte) 0xFF, (byte) 0x00, (byte) 0xFF, (byte) 0xFF}; - instrPattern = new byte[]{(byte) 0xF3, (byte) 0x00, (byte) 0x0F, (byte) 0xBC}; - } - isLongOperation = true; } public static void main(String[] args) throws Exception { diff --git a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java index 08321b87266..ab975e4bdb7 100644 --- a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java +++ b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java @@ -25,8 +25,8 @@ import java.util.function.IntPredicate; /** * @test NonTieredLevelsTest - * @ignore 8046268 * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @ignore 8046268 * @build NonTieredLevelsTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:-TieredCompilation diff --git a/hotspot/test/compiler/tiered/TieredLevelsTest.java b/hotspot/test/compiler/tiered/TieredLevelsTest.java index 4b9a0a4a906..d862f50e904 100644 --- a/hotspot/test/compiler/tiered/TieredLevelsTest.java +++ b/hotspot/test/compiler/tiered/TieredLevelsTest.java @@ -23,8 +23,8 @@ /** * @test TieredLevelsTest - * @ignore 8046268 * @library /testlibrary /testlibrary/whitebox /compiler/whitebox + * @ignore 8046268 * @build TieredLevelsTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+TieredCompilation diff --git a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java index 195221658cf..8adbf2075a9 100644 --- a/hotspot/test/compiler/whitebox/ClearMethodStateTest.java +++ b/hotspot/test/compiler/whitebox/ClearMethodStateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, 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,9 +25,9 @@ import java.util.function.Function; /* * @test ClearMethodStateTest - * @ignore 8046268 * @bug 8006683 8007288 8022832 * @library /testlibrary /testlibrary/whitebox + * @ignore 8046268 * @build ClearMethodStateTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* ClearMethodStateTest diff --git a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java index 5f353998061..ea673d6b862 100644 --- a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java +++ b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java @@ -21,11 +21,8 @@ * questions. */ -import com.sun.management.HotSpotDiagnosticMXBean; -import com.sun.management.VMOption; import sun.hotspot.WhiteBox; import sun.hotspot.code.NMethod; -import sun.management.ManagementFactoryHelper; import java.lang.reflect.Constructor; import java.lang.reflect.Executable; @@ -98,15 +95,7 @@ public abstract class CompilerWhiteBoxTest { */ protected static String getVMOption(String name) { Objects.requireNonNull(name); - HotSpotDiagnosticMXBean diagnostic - = ManagementFactoryHelper.getDiagnosticMXBean(); - VMOption tmp; - try { - tmp = diagnostic.getVMOption(name); - } catch (IllegalArgumentException e) { - tmp = null; - } - return (tmp == null ? null : tmp.getValue()); + return Objects.toString(WHITE_BOX.getVMFlag(name), null); } /** @@ -174,7 +163,7 @@ public abstract class CompilerWhiteBoxTest { * @see #test() */ protected final void runTest() { - if (ManagementFactoryHelper.getCompilationMXBean() == null) { + if (CompilerWhiteBoxTest.MODE.startsWith("interpreted ")) { System.err.println( "Warning: test is not applicable in interpreted mode"); return; diff --git a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java index a5b9d794c66..1a297ae350e 100644 --- a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java +++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java @@ -23,9 +23,9 @@ /* * @test DeoptimizeAllTest - * @ignore 8046268 * @bug 8006683 8007288 8022832 * @library /testlibrary /testlibrary/whitebox + * @ignore 8046268 * @build DeoptimizeAllTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* DeoptimizeAllTest diff --git a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java index e257a1e5e25..bee232d2cb0 100644 --- a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java +++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java @@ -23,9 +23,9 @@ /* * @test DeoptimizeMethodTest - * @ignore 8046268 * @bug 8006683 8007288 8022832 * @library /testlibrary /testlibrary/whitebox + * @ignore 8046268 * @build DeoptimizeMethodTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* DeoptimizeMethodTest diff --git a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java index 4acebb2b123..5c6c4f39690 100644 --- a/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java +++ b/hotspot/test/compiler/whitebox/EnqueueMethodForCompilationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, 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 @@ -23,9 +23,9 @@ /* * @test EnqueueMethodForCompilationTest - * @ignore 8046268 * @bug 8006683 8007288 8022832 * @library /testlibrary /testlibrary/whitebox + * @ignore 8046268 * @build EnqueueMethodForCompilationTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm/timeout=600 -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* EnqueueMethodForCompilationTest diff --git a/hotspot/test/compiler/whitebox/GetNMethodTest.java b/hotspot/test/compiler/whitebox/GetNMethodTest.java index 9800f3a3eb3..14bc76278dd 100644 --- a/hotspot/test/compiler/whitebox/GetNMethodTest.java +++ b/hotspot/test/compiler/whitebox/GetNMethodTest.java @@ -26,9 +26,9 @@ import sun.hotspot.code.NMethod; /* * @test GetNMethodTest - * @ignore 8046268 * @bug 8038240 * @library /testlibrary /testlibrary/whitebox + * @ignore 8046268 * @build GetNMethodTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* GetNMethodTest diff --git a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java index 604175c38ef..651002d078e 100644 --- a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java +++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java @@ -23,9 +23,9 @@ /* * @test MakeMethodNotCompilableTest - * @ignore 8046268 * @bug 8012322 8006683 8007288 8022832 * @library /testlibrary /testlibrary/whitebox + * @ignore 8046268 * @build MakeMethodNotCompilableTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* MakeMethodNotCompilableTest diff --git a/hotspot/test/runtime/whitebox/WBStackSize.java b/hotspot/test/runtime/whitebox/WBStackSize.java index 2a0216082d7..ff1a4dcca25 100644 --- a/hotspot/test/runtime/whitebox/WBStackSize.java +++ b/hotspot/test/runtime/whitebox/WBStackSize.java @@ -39,7 +39,6 @@ * Please file a test bug, if this is a problem. */ -import com.sun.management.HotSpotDiagnosticMXBean; import sun.hotspot.WhiteBox; public class WBStackSize { @@ -81,8 +80,7 @@ public class WBStackSize { } public static void main(String[] args) { - HotSpotDiagnosticMXBean bean = sun.management.ManagementFactoryHelper.getDiagnosticMXBean(); - long configStackSize = Long.valueOf(bean.getVMOption("ThreadStackSize").getValue()) * K; + long configStackSize = wb.getIntxVMFlag("ThreadStackSize") * K; System.out.println("ThreadStackSize VM option: " + configStackSize); diff --git a/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java b/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java index bc38438285e..bb58361ffda 100644 --- a/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java +++ b/hotspot/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java @@ -25,6 +25,10 @@ package sun.hotspot; import java.lang.reflect.Executable; +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Stream; import java.security.BasicPermission; import sun.hotspot.parser.DiagnosticCommand; @@ -171,4 +175,15 @@ public class WhiteBox { public native Long getUint64VMFlag(String name); public native String getStringVMFlag(String name); public native Double getDoubleVMFlag(String name); + private final List> flagsGetters = Arrays.asList( + this::getBooleanVMFlag, this::getIntxVMFlag, this::getUintxVMFlag, + this::getUint64VMFlag, this::getStringVMFlag, this::getDoubleVMFlag); + + public Object getVMFlag(String name) { + return flagsGetters.stream() + .map(f -> f.apply(name)) + .filter(x -> x != null) + .findAny() + .orElse(null); + } } diff --git a/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java b/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java index 0818f21f1c0..6c98889e6ae 100644 --- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java +++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/VmFlagTest.java @@ -91,16 +91,20 @@ public final class VmFlagTest { } private void testPositive(T value, T expected) { - Asserts.assertEQ(getVMOptionAsString(), asString(getValue())); + String oldValue = getVMOptionAsString(); + Asserts.assertEQ(oldValue, asString(getValue())); + Asserts.assertEQ(oldValue, asString(WHITE_BOX.getVMFlag(flagName))); setNewValue(value); String newValue = getVMOptionAsString(); Asserts.assertEQ(newValue, asString(expected)); - Asserts.assertEQ(getVMOptionAsString(), asString(getValue())); + Asserts.assertEQ(newValue, asString(getValue())); + Asserts.assertEQ(newValue, asString(WHITE_BOX.getVMFlag(flagName))); } private void testNegative(T value, T expected) { String oldValue = getVMOptionAsString(); Asserts.assertEQ(oldValue, asString(getValue())); + Asserts.assertEQ(oldValue, asString(WHITE_BOX.getVMFlag(flagName))); setNewValue(value); String newValue = getVMOptionAsString(); Asserts.assertEQ(oldValue, newValue); diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 70e4a78662f..63f10acd85e 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -267,3 +267,4 @@ f9c82769a6bc2b219a8f01c24afe5c91039267d7 jdk9-b19 82b94ff002c6e007a03bf0f364ca94b381e09135 jdk9-b22 2e5b63006187bfc64d8eace374dbc2806267a160 jdk9-b23 345af113f57206711f75089c3ebf84a36a789122 jdk9-b24 +73757f4b8aa353ca8937abc07e79e7ece4c011a1 jdk9-b25 diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java index 45b91dc9aa2..39b6929379b 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/CoreDOMImplementationImpl.java @@ -3,11 +3,12 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -385,8 +386,18 @@ public class CoreDOMImplementationImpl * reference to the default error handler. */ public LSSerializer createLSSerializer() { - return new DOMSerializerImpl(); - } + try { + Class serializerClass = ObjectFactory.findProviderClass( + "com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl", + ObjectFactory.findClassLoader(), true); + return (LSSerializer) serializerClass.newInstance(); + } + 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. * Create a new empty input source. diff --git a/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java index 526f5e1b5f0..ea0e9b7a9a4 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/sax2dtm/SAX2DTM2.java @@ -3145,7 +3145,11 @@ public class SAX2DTM2 extends SAX2DTM m_data.elementAt(-dataIndex+1)); } } - else if (DTM.ELEMENT_NODE == type || DTM.DOCUMENT_FRAGMENT_NODE == type + else if (DTM.ELEMENT_NODE == type) + { + return getStringValueX(nodeHandle); + } + else if (DTM.DOCUMENT_FRAGMENT_NODE == type || DTM.DOCUMENT_NODE == type) { return null; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java index 3150b10d860..2c9a4988fca 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/BaseMarkupSerializer.java @@ -123,6 +123,11 @@ import org.xml.sax.ext.LexicalHandler; * @author Sunitha Reddy, Sun Microsystems * @see Serializer * @see org.w3c.dom.ls.LSSerializer + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public abstract class BaseMarkupSerializer implements ContentHandler, DocumentHandler, LexicalHandler, diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializer.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializer.java index 40566616ed9..408b35cd9ba 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializer.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializer.java @@ -3,11 +3,12 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -35,6 +36,11 @@ import org.w3c.dom.DocumentFragment; * * @author Scott Boag * @author Assaf Arkin + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public interface DOMSerializer { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java index eae65068d82..dc9378b39e5 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/DOMSerializerImpl.java @@ -72,6 +72,9 @@ import org.w3c.dom.ls.LSSerializerFilter; * @author Gopal Sharma, Sun Microsystems * @author Arun Yadav, Sun Microsystems * @author Sunitha Reddy, Sun Microsystems + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, replaced by + * {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl} */ public class DOMSerializerImpl implements LSSerializer, DOMConfiguration { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/ElementState.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/ElementState.java index d6b412e50fe..8b556f93431 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/ElementState.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/ElementState.java @@ -3,11 +3,12 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -28,9 +29,13 @@ import java.util.Hashtable; /** * Holds the state of the currently serialized element. * - * * @author Assaf Arkin * @see BaseMarkupSerializer + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public class ElementState { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java index 252483fc53d..6756daf410b 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/EncodingInfo.java @@ -3,11 +3,12 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2000-2002,2004,2005 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -29,6 +30,10 @@ import com.sun.org.apache.xerces.internal.util.EncodingMap; /** * This class represents an encoding. * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public class EncodingInfo { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/Encodings.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/Encodings.java index 711b217b87d..adc8c3c86ba 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/Encodings.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/Encodings.java @@ -3,11 +3,12 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -36,6 +37,11 @@ import com.sun.org.apache.xerces.internal.util.EncodingMap; * for each encoding. * * @author Assaf Arkin + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public class Encodings { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/HTMLdtd.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/HTMLdtd.java index 17e3964bfa5..6b50dcd1567 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/HTMLdtd.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/HTMLdtd.java @@ -3,11 +3,12 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -45,8 +46,12 @@ import java.util.Locale; * from value to name. A small entities resource is loaded into memory the * first time any of these methods is called for fast and efficient access. * - * * @author Assaf Arkin + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public final class HTMLdtd { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/IndentPrinter.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/IndentPrinter.java index efc7af1248d..34e03138974 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/IndentPrinter.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/IndentPrinter.java @@ -3,11 +3,12 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -32,6 +33,11 @@ import java.io.IOException; * wrapping. * * @author Assaf Arkin + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public class IndentPrinter extends Printer diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/LineSeparator.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/LineSeparator.java index bb4b1b9ae18..1886ac44055 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/LineSeparator.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/LineSeparator.java @@ -3,11 +3,12 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -25,6 +26,11 @@ package com.sun.org.apache.xml.internal.serialize; /** * @author Assaf Arkin * @see OutputFormat + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public final class LineSeparator { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/Method.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/Method.java index c6cfff09d7d..99b97d0572a 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/Method.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/Method.java @@ -3,11 +3,12 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -25,6 +26,11 @@ package com.sun.org.apache.xml.internal.serialize; /** * @author Assaf Arkin * @see OutputFormat + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public final class Method { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/OutputFormat.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/OutputFormat.java index 505a8996df3..1d0db3fa57d 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/OutputFormat.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/OutputFormat.java @@ -3,11 +3,12 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -59,6 +60,11 @@ import org.w3c.dom.html.HTMLDocument; * @see Serializer * @see Method * @see LineSeparator + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public class OutputFormat { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/Printer.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/Printer.java index ab9d8e4a0e5..2e966809094 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/Printer.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/Printer.java @@ -3,11 +3,12 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -40,6 +41,11 @@ import java.io.IOException; * extending this class. * * @author Assaf Arkin + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public class Printer { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/Serializer.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/Serializer.java index 5aecb4ffe43..3bb0fd6de90 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/Serializer.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/Serializer.java @@ -3,11 +3,12 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -60,6 +61,11 @@ import org.xml.sax.DocumentHandler; * @see ContentHandler * @see OutputFormat * @see DOMSerializer + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public interface Serializer { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java index 2150e31a0b5..d1af445b11d 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactory.java @@ -3,11 +3,12 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -34,6 +35,11 @@ import java.util.StringTokenizer; * * @author Scott Boag * @author Assaf Arkin + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public abstract class SerializerFactory { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactoryImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactoryImpl.java index dd27e57ceec..8883a820dfb 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactoryImpl.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/SerializerFactoryImpl.java @@ -3,11 +3,12 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -34,6 +35,11 @@ import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter; * * @author Scott Boag * @author Assaf Arkin + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ final class SerializerFactoryImpl extends SerializerFactory diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/TextSerializer.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/TextSerializer.java index 789f6368cfd..09ceaf0f3f5 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/TextSerializer.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/TextSerializer.java @@ -3,11 +3,12 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2002,2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -58,6 +59,11 @@ import org.xml.sax.SAXException; * * @author Assaf Arkin * @see Serializer + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public class TextSerializer extends BaseMarkupSerializer diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/XML11Serializer.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/XML11Serializer.java index ced3ef5c4d5..514e417acb3 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/XML11Serializer.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/XML11Serializer.java @@ -73,10 +73,16 @@ import org.xml.sax.SAXException; * boundaries, indent lines, and serialize elements on separate * lines. Line terminators will be regarded as spaces, and * spaces at beginning of line will be stripped. + * * @author Assaf Arkin * @author Rahul Srivastava * @author Elena Litani IBM * @see Serializer + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public class XML11Serializer extends XMLSerializer { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java b/jaxp/src/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java index 884fd4b5fe5..0c39d3eeaf8 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serialize/XMLSerializer.java @@ -84,10 +84,16 @@ import org.xml.sax.helpers.AttributesImpl; * boundaries, indent lines, and serialize elements on separate * lines. Line terminators will be regarded as spaces, and * spaces at beginning of line will be stripped. + * * @author Assaf Arkin * @author Rahul Srivastava * @author Elena Litani IBM * @see Serializer + * + * @deprecated As of JDK 1.9, Xerces 2.9.0, Xerces DOM L3 Serializer implementation + * is replaced by that of Xalan. Main class + * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced + * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. */ public class XMLSerializer extends BaseMarkupSerializer { diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/DOM3Serializer.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/DOM3Serializer.java new file mode 100644 index 00000000000..a31c68b9ec3 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/DOM3Serializer.java @@ -0,0 +1,117 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package com.sun.org.apache.xml.internal.serializer; + +import java.io.IOException; + +import org.w3c.dom.Node; +import org.w3c.dom.DOMErrorHandler; +import org.w3c.dom.ls.LSSerializerFilter; + +/** + * Interface for a DOM serializer capable of serializing DOMs as specified in + * the DOM Level 3 Save Recommendation. + *

+ * The DOM3Serializer is a facet of a serializer and is obtained from the + * asDOM3Serializer() method of the org.apache.xml.serializer.Serializer interface. + * A serializer may or may not support a level 3 DOM serializer, if it does not then the + * return value from asDOM3Serializer() is null. + *

+ * Example: + *

+ * Document     doc;
+ * Serializer   ser;
+ * OutputStream os;
+ * DOMErrorHandler handler;
+ *
+ * ser = ...;
+ * os = ...;
+ * handler = ...;
+ *
+ * ser.setOutputStream( os );
+ * DOM3Serialzier dser = (DOM3Serialzier)ser.asDOM3Serializer();
+ * dser.setErrorHandler(handler);
+ * dser.serialize(doc);
+ * 
+ * + * @see org.apache.xml.serializer.Serializer + * + * @xsl.usage general + * + */ +public interface DOM3Serializer { + /** + * Serializes the Level 3 DOM node. Throws an exception only if an I/O + * exception occured while serializing. + * + * This interface is a public API. + * + * @param node the Level 3 DOM node to serialize + * @throws IOException if an I/O exception occured while serializing + */ + public void serializeDOM3(Node node) throws IOException; + + /** + * Sets a DOMErrorHandler on the DOM Level 3 Serializer. + * + * This interface is a public API. + * + * @param handler the Level 3 DOMErrorHandler + */ + public void setErrorHandler(DOMErrorHandler handler); + + /** + * Returns a DOMErrorHandler set on the DOM Level 3 Serializer. + * + * This interface is a public API. + * + * @return A Level 3 DOMErrorHandler + */ + public DOMErrorHandler getErrorHandler(); + + /** + * Sets a LSSerializerFilter on the DOM Level 3 Serializer to filter nodes + * during serialization. + * + * This interface is a public API. + * + * @param filter the Level 3 LSSerializerFilter + */ + public void setNodeFilter(LSSerializerFilter filter); + + /** + * Returns a LSSerializerFilter set on the DOM Level 3 Serializer to filter nodes + * during serialization. + * + * This interface is a public API. + * + * @return The Level 3 LSSerializerFilter + */ + public LSSerializerFilter getNodeFilter(); + + /** + * Sets the new line character to be used during serialization + * @param newLine a String that is the end-of-line character sequence to be + * used in serialization. + */ + public void setNewLine(String newLine); +} diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java index 09a13dace09..35952c88d0c 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java @@ -786,4 +786,13 @@ public class EmptySerializer implements SerializationHandler aMethodIsCalled(); } + + /** + * @see org.apache.xml.serializer.Serializer#asDOM3Serializer() + */ + public Object asDOM3Serializer() throws IOException + { + couldThrowIOException(); + return null; + } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java index 80eb8a5d969..18e76134891 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/Encodings.java @@ -152,6 +152,24 @@ public final class Encodings extends Object return ei; } + /** + * Determines if the encoding specified was recognized by the + * serializer or not. + * + * @param encoding The encoding + * @return boolean - true if the encoding was recognized else false + */ + public static boolean isRecognizedEncoding(String encoding) + { + EncodingInfo ei; + + String normalizedEncoding = toUpperCaseFast(encoding); + ei = _encodingInfos.findEncoding(normalizedEncoding); + if (ei != null) + return true; + return false; + } + /** * A fast and cheap way to uppercase a String that is * only made of printable ASCII characters. diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java index 1e918553be7..93331efc589 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializationHandler.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2003-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -110,9 +112,29 @@ public interface SerializationHandler public void setNamespaceMappings(NamespaceMappings mappings); /** - * Flush any pending events currently queued up in the serializer. This will - * flush any input that the serializer has which it has not yet sent as - * output. + * A SerializationHandler accepts SAX-like events, so + * it can accumulate attributes or namespace nodes after + * a startElement(). + *

+ * If the SerializationHandler has a Writer or OutputStream, + * a call to this method will flush such accumulated + * events as a closed start tag for an element. + *

+ * If the SerializationHandler wraps a ContentHandler, + * a call to this method will flush such accumulated + * events as a SAX (not SAX-like) calls to + * startPrefixMapping() and startElement(). + *

+ * If one calls endDocument() then one need not call + * this method since a call to endDocument() will + * do what this method does. However, in some + * circumstances, such as with document fragments, + * endDocument() is not called and it may be + * necessary to call this method to flush + * any pending events. + *

+ * For performance reasons this method should not be called + * very often. */ public void flushPending() throws SAXException; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/Serializer.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/Serializer.java index 9cae2d22d0b..b855659a226 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/Serializer.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/Serializer.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -220,4 +222,20 @@ public interface Serializer { * @return True if serializer has been reset and can be reused */ public boolean reset(); + + /** + * Return an Object into this serializer to be cast to a DOM3Serializer. + * Through the returned object the document to be serialized, + * a DOM (Level 3), can be provided to the serializer. + * If the serializer does not support casting to a {@link DOM3Serializer} + * interface, it should return null. + *

+ * In principle only one of asDOM3Serializer() or asContentHander() + * should be called. + * + * @return An Object to be cast to a DOM3Serializer interface into this serializer, + * or null if the serializer is not DOM capable + * @throws IOException An I/O exception occured + */ + public Object asDOM3Serializer() throws IOException; } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java index fb80d771f00..5d706e2f5ab 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java @@ -1558,6 +1558,21 @@ public abstract class SerializerBase return getProp(name,false); } + /** + * Return a {@link DOM3Serializer} interface into this serializer. If the + * serializer does not support the {@link DOM3Serializer} interface, it should + * return null. + * + * @return A {@link DOM3Serializer} interface into this serializer, or null + * if the serializer is not DOM capable + * @throws IOException An I/O exception occured + * @see org.apache.xml.serializer.Serializer#asDOM3Serializer() + */ + public Object asDOM3Serializer() throws IOException + { + return new com.sun.org.apache.xml.internal.serializer.dom3.DOM3SerializerImpl(this); + } + /** * Get the default value of an xsl:output property, * which would be null only if no default value exists diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java index 358c4f25bb6..d2c5f264b18 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerFactory.java @@ -136,7 +136,7 @@ public final class SerializerFactory if (obj instanceof SerializationHandler) { // this is one of the supplied serializers - ser = (Serializer) cls.newInstance(); + ser = (Serializer) obj; ser.setOutputFormat(format); } else diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java index 2195e71f8b0..0e0efe7c2e2 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java @@ -537,7 +537,7 @@ abstract public class ToStream extends SerializerBase if (OutputPropertiesFactory.S_KEY_INDENT_AMOUNT.equals(name)) { setIndentAmount(Integer.parseInt(val)); } else if (OutputKeys.INDENT.equals(name)) { - boolean b = "yes".equals(val) ? true : false; + boolean b = val.endsWith("yes") ? true : false; m_doIndent = b; } @@ -556,7 +556,7 @@ abstract public class ToStream extends SerializerBase break; case 'o': if (OutputKeys.OMIT_XML_DECLARATION.equals(name)) { - boolean b = "yes".equals(val) ? true : false; + boolean b = val.endsWith("yes") ? true : false; this.m_shouldNotWriteXMLHeader = b; } break; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java index a68382c4160..9583dd5d30f 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java @@ -1335,4 +1335,12 @@ public final class ToUnknownStream extends SerializerBase ch.length); } } + + /** + * @see org.apache.xml.serializer.Serializer#asDOM3Serializer() + */ + public Object asDOM3Serializer() throws IOException + { + return m_handler.asDOM3Serializer(); + } } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOM3SerializerImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOM3SerializerImpl.java new file mode 100644 index 00000000000..0d4509c2a97 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOM3SerializerImpl.java @@ -0,0 +1,150 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.sun.org.apache.xml.internal.serializer.dom3; + +import java.io.IOException; + +import com.sun.org.apache.xml.internal.serializer.DOM3Serializer; +import com.sun.org.apache.xml.internal.serializer.SerializationHandler; +import com.sun.org.apache.xml.internal.serializer.utils.WrappedRuntimeException; +import org.w3c.dom.DOMErrorHandler; +import org.w3c.dom.Node; +import org.w3c.dom.ls.LSSerializerFilter; + +/** + * This class implements the DOM3Serializer interface. + * + * @xsl.usage internal + */ +public final class DOM3SerializerImpl implements DOM3Serializer { + + /** + * Private class members + */ + // The DOMErrorHandler + private DOMErrorHandler fErrorHandler; + + // A LSSerializerFilter + private LSSerializerFilter fSerializerFilter; + + // The end-of-line character sequence + private String fNewLine; + + // A SerializationHandler ex. an instance of ToXMLStream + private SerializationHandler fSerializationHandler; + + /** + * Constructor + * + * @param handler An instance of the SerializationHandler interface. + */ + public DOM3SerializerImpl(SerializationHandler handler) { + fSerializationHandler = handler; + } + + // Public memebers + + /** + * Returns a DOMErrorHandler set on the DOM Level 3 Serializer. + * + * This interface is a public API. + * + * @return A Level 3 DOMErrorHandler + */ + public DOMErrorHandler getErrorHandler() { + return fErrorHandler; + } + + /** + * Returns a LSSerializerFilter set on the DOM Level 3 Serializer to filter nodes + * during serialization. + * + * This interface is a public API. + * + * @return The Level 3 LSSerializerFilter + */ + public LSSerializerFilter getNodeFilter() { + return fSerializerFilter; + } + + + /** + * Serializes the Level 3 DOM node by creating an instance of DOM3TreeWalker + * which traverses the DOM tree and invokes handler events to serialize + * the DOM NOde. Throws an exception only if an I/O exception occured + * while serializing. + * This interface is a public API. + * + * @param node the Level 3 DOM node to serialize + * @throws IOException if an I/O exception occured while serializing + */ + public void serializeDOM3(Node node) throws IOException { + try { + DOM3TreeWalker walker = new DOM3TreeWalker(fSerializationHandler, + fErrorHandler, fSerializerFilter, fNewLine); + + walker.traverse(node); + } catch (org.xml.sax.SAXException se) { + throw new WrappedRuntimeException(se); + } + } + + /** + * Sets a DOMErrorHandler on the DOM Level 3 Serializer. + * + * This interface is a public API. + * + * @param handler the Level 3 DOMErrorHandler + */ + public void setErrorHandler(DOMErrorHandler handler) { + fErrorHandler = handler; + } + + /** + * Sets a LSSerializerFilter on the DOM Level 3 Serializer to filter nodes + * during serialization. + * + * This interface is a public API. + * + * @param filter the Level 3 LSSerializerFilter + */ + public void setNodeFilter(LSSerializerFilter filter) { + fSerializerFilter = filter; + } + + /** + * Sets a SerializationHandler on the DOM Serializer. + * + * This interface is a public API. + * + * @param handler An instance of SerializationHandler + */ + public void setSerializationHandler(SerializationHandler handler) { + fSerializationHandler = handler; + } + + /** + * Sets the new line character to be used during serialization + * @param newLine a String that is the end-of-line character sequence to be + * used in serialization. + */ + public void setNewLine(String newLine) { + fNewLine = newLine; + } +} diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOM3TreeWalker.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOM3TreeWalker.java new file mode 100644 index 00000000000..b83d2ebde50 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOM3TreeWalker.java @@ -0,0 +1,2145 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package com.sun.org.apache.xml.internal.serializer.dom3; + +import java.io.File; +import java.io.IOException; +import java.io.Writer; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Properties; + +import com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory; +import com.sun.org.apache.xml.internal.serializer.SerializationHandler; +import com.sun.org.apache.xml.internal.serializer.utils.MsgKey; +import com.sun.org.apache.xml.internal.serializer.utils.Utils; +import com.sun.org.apache.xerces.internal.util.XML11Char; +import com.sun.org.apache.xerces.internal.util.XMLChar; +import org.w3c.dom.Attr; +import org.w3c.dom.CDATASection; +import org.w3c.dom.Comment; +import org.w3c.dom.DOMError; +import org.w3c.dom.DOMErrorHandler; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentType; +import org.w3c.dom.Element; +import org.w3c.dom.Entity; +import org.w3c.dom.EntityReference; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.ProcessingInstruction; +import org.w3c.dom.Text; +import org.w3c.dom.ls.LSSerializerFilter; +import org.w3c.dom.traversal.NodeFilter; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; +import org.xml.sax.ext.LexicalHandler; +import org.xml.sax.helpers.LocatorImpl; + +/** + * Built on org.apache.xml.serializer.TreeWalker and adds functionality to + * traverse and serialize a DOM Node (Level 2 or Level 3) as specified in + * the DOM Level 3 LS Recommedation by evaluating and applying DOMConfiguration + * parameters and filters if any during serialization. + * + * @xsl.usage internal + */ +final class DOM3TreeWalker { + + /** + * The SerializationHandler, it extends ContentHandler and when + * this class is instantiated via the constructor provided, a + * SerializationHandler object is passed to it. + */ + private SerializationHandler fSerializer = null; + + /** We do not need DOM2Helper since DOM Level 3 LS applies to DOM Level 2 or newer */ + + /** Locator object for this TreeWalker */ + private LocatorImpl fLocator = new LocatorImpl(); + + /** ErrorHandler */ + private DOMErrorHandler fErrorHandler = null; + + /** LSSerializerFilter */ + private LSSerializerFilter fFilter = null; + + /** If the serializer is an instance of a LexicalHandler */ + private LexicalHandler fLexicalHandler = null; + + private int fWhatToShowFilter; + + /** New Line character to use in serialization */ + private String fNewLine = null; + + /** DOMConfiguration Properties */ + private Properties fDOMConfigProperties = null; + + /** Keeps track if we are in an entity reference when entities=true */ + private boolean fInEntityRef = false; + + /** Stores the version of the XML document to be serialize */ + private String fXMLVersion = null; + + /** XML Version, default 1.0 */ + private boolean fIsXMLVersion11 = false; + + /** Is the Node a Level 3 DOM node */ + private boolean fIsLevel3DOM = false; + + /** DOM Configuration Parameters */ + private int fFeatures = 0; + + /** Flag indicating whether following text to be processed is raw text */ + boolean fNextIsRaw = false; + + // + private static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/"; + + // + private static final String XMLNS_PREFIX = "xmlns"; + + // + private static final String XML_URI = "http://www.w3.org/XML/1998/namespace"; + + // + private static final String XML_PREFIX = "xml"; + + /** stores namespaces in scope */ + protected NamespaceSupport fNSBinder; + + /** stores all namespace bindings on the current element */ + protected NamespaceSupport fLocalNSBinder; + + /** stores the current element depth */ + private int fElementDepth = 0; + + // *********************************************************************** + // DOMConfiguration paramter settings + // *********************************************************************** + // Parameter canonical-form, true [optional] - NOT SUPPORTED + private final static int CANONICAL = 0x1 << 0; + + // Parameter cdata-sections, true [required] (default) + private final static int CDATA = 0x1 << 1; + + // Parameter check-character-normalization, true [optional] - NOT SUPPORTED + private final static int CHARNORMALIZE = 0x1 << 2; + + // Parameter comments, true [required] (default) + private final static int COMMENTS = 0x1 << 3; + + // Parameter datatype-normalization, true [optional] - NOT SUPPORTED + private final static int DTNORMALIZE = 0x1 << 4; + + // Parameter element-content-whitespace, true [required] (default) - value - false [optional] NOT SUPPORTED + private final static int ELEM_CONTENT_WHITESPACE = 0x1 << 5; + + // Parameter entities, true [required] (default) + private final static int ENTITIES = 0x1 << 6; + + // Parameter infoset, true [required] (default), false has no effect --> True has no effect for the serializer + private final static int INFOSET = 0x1 << 7; + + // Parameter namespaces, true [required] (default) + private final static int NAMESPACES = 0x1 << 8; + + // Parameter namespace-declarations, true [required] (default) + private final static int NAMESPACEDECLS = 0x1 << 9; + + // Parameter normalize-characters, true [optional] - NOT SUPPORTED + private final static int NORMALIZECHARS = 0x1 << 10; + + // Parameter split-cdata-sections, true [required] (default) + private final static int SPLITCDATA = 0x1 << 11; + + // Parameter validate, true [optional] - NOT SUPPORTED + private final static int VALIDATE = 0x1 << 12; + + // Parameter validate-if-schema, true [optional] - NOT SUPPORTED + private final static int SCHEMAVALIDATE = 0x1 << 13; + + // Parameter split-cdata-sections, true [required] (default) + private final static int WELLFORMED = 0x1 << 14; + + // Parameter discard-default-content, true [required] (default) + // Not sure how this will be used in level 2 Documents + private final static int DISCARDDEFAULT = 0x1 << 15; + + // Parameter format-pretty-print, true [optional] + private final static int PRETTY_PRINT = 0x1 << 16; + + // Parameter ignore-unknown-character-denormalizations, true [required] (default) + // We currently do not support XML 1.1 character normalization + private final static int IGNORE_CHAR_DENORMALIZE = 0x1 << 17; + + // Parameter discard-default-content, true [required] (default) + private final static int XMLDECL = 0x1 << 18; + + /** + * Constructor. + * @param contentHandler serialHandler The implemention of the SerializationHandler interface + */ + DOM3TreeWalker( + SerializationHandler serialHandler, + DOMErrorHandler errHandler, + LSSerializerFilter filter, + String newLine) { + fSerializer = serialHandler; + //fErrorHandler = errHandler == null ? new DOMErrorHandlerImpl() : errHandler; // Should we be using the default? + fErrorHandler = errHandler; + fFilter = filter; + fLexicalHandler = null; + fNewLine = newLine; + + fNSBinder = new NamespaceSupport(); + fLocalNSBinder = new NamespaceSupport(); + + fDOMConfigProperties = fSerializer.getOutputFormat(); + fSerializer.setDocumentLocator(fLocator); + initProperties(fDOMConfigProperties); + + try { + // Bug see Bugzilla 26741 + fLocator.setSystemId( + System.getProperty("user.dir") + File.separator + "dummy.xsl"); + } catch (SecurityException se) { // user.dir not accessible from applet + + } + } + + /** + * Perform a pre-order traversal non-recursive style. + * + * Note that TreeWalker assumes that the subtree is intended to represent + * a complete (though not necessarily well-formed) document and, during a + * traversal, startDocument and endDocument will always be issued to the + * SAX listener. + * + * @param pos Node in the tree where to start traversal + * + * @throws TransformerException + */ + public void traverse(Node pos) throws org.xml.sax.SAXException { + this.fSerializer.startDocument(); + + // Determine if the Node is a DOM Level 3 Core Node. + if (pos.getNodeType() != Node.DOCUMENT_NODE) { + Document ownerDoc = pos.getOwnerDocument(); + if (ownerDoc != null + && ownerDoc.getImplementation().hasFeature("Core", "3.0")) { + fIsLevel3DOM = true; + } + } else { + if (((Document) pos) + .getImplementation() + .hasFeature("Core", "3.0")) { + fIsLevel3DOM = true; + } + } + + if (fSerializer instanceof LexicalHandler) { + fLexicalHandler = ((LexicalHandler) this.fSerializer); + } + + if (fFilter != null) + fWhatToShowFilter = fFilter.getWhatToShow(); + + Node top = pos; + + while (null != pos) { + startNode(pos); + + Node nextNode = null; + + nextNode = pos.getFirstChild(); + + while (null == nextNode) { + endNode(pos); + + if (top.equals(pos)) + break; + + nextNode = pos.getNextSibling(); + + if (null == nextNode) { + pos = pos.getParentNode(); + + if ((null == pos) || (top.equals(pos))) { + if (null != pos) + endNode(pos); + + nextNode = null; + + break; + } + } + } + + pos = nextNode; + } + this.fSerializer.endDocument(); + } + + /** + * Perform a pre-order traversal non-recursive style. + + * Note that TreeWalker assumes that the subtree is intended to represent + * a complete (though not necessarily well-formed) document and, during a + * traversal, startDocument and endDocument will always be issued to the + * SAX listener. + * + * @param pos Node in the tree where to start traversal + * @param top Node in the tree where to end traversal + * + * @throws TransformerException + */ + public void traverse(Node pos, Node top) throws org.xml.sax.SAXException { + + this.fSerializer.startDocument(); + + // Determine if the Node is a DOM Level 3 Core Node. + if (pos.getNodeType() != Node.DOCUMENT_NODE) { + Document ownerDoc = pos.getOwnerDocument(); + if (ownerDoc != null + && ownerDoc.getImplementation().hasFeature("Core", "3.0")) { + fIsLevel3DOM = true; + } + } else { + if (((Document) pos) + .getImplementation() + .hasFeature("Core", "3.0")) { + fIsLevel3DOM = true; + } + } + + if (fSerializer instanceof LexicalHandler) { + fLexicalHandler = ((LexicalHandler) this.fSerializer); + } + + if (fFilter != null) + fWhatToShowFilter = fFilter.getWhatToShow(); + + while (null != pos) { + startNode(pos); + + Node nextNode = null; + + nextNode = pos.getFirstChild(); + + while (null == nextNode) { + endNode(pos); + + if ((null != top) && top.equals(pos)) + break; + + nextNode = pos.getNextSibling(); + + if (null == nextNode) { + pos = pos.getParentNode(); + + if ((null == pos) || ((null != top) && top.equals(pos))) { + nextNode = null; + + break; + } + } + } + + pos = nextNode; + } + this.fSerializer.endDocument(); + } + + /** + * Optimized dispatch of characters. + */ + private final void dispatachChars(Node node) + throws org.xml.sax.SAXException { + if (fSerializer != null) { + this.fSerializer.characters(node); + } else { + String data = ((Text) node).getData(); + this.fSerializer.characters(data.toCharArray(), 0, data.length()); + } + } + + /** + * Start processing given node + * + * @param node Node to process + * + * @throws org.xml.sax.SAXException + */ + protected void startNode(Node node) throws org.xml.sax.SAXException { + if (node instanceof Locator) { + Locator loc = (Locator) node; + fLocator.setColumnNumber(loc.getColumnNumber()); + fLocator.setLineNumber(loc.getLineNumber()); + fLocator.setPublicId(loc.getPublicId()); + fLocator.setSystemId(loc.getSystemId()); + } else { + fLocator.setColumnNumber(0); + fLocator.setLineNumber(0); + } + + switch (node.getNodeType()) { + case Node.DOCUMENT_TYPE_NODE : + serializeDocType((DocumentType) node, true); + break; + case Node.COMMENT_NODE : + serializeComment((Comment) node); + break; + case Node.DOCUMENT_FRAGMENT_NODE : + // Children are traversed + break; + case Node.DOCUMENT_NODE : + break; + case Node.ELEMENT_NODE : + serializeElement((Element) node, true); + break; + case Node.PROCESSING_INSTRUCTION_NODE : + serializePI((ProcessingInstruction) node); + break; + case Node.CDATA_SECTION_NODE : + serializeCDATASection((CDATASection) node); + break; + case Node.TEXT_NODE : + serializeText((Text) node); + break; + case Node.ENTITY_REFERENCE_NODE : + serializeEntityReference((EntityReference) node, true); + break; + default : + } + } + + /** + * End processing of given node + * + * + * @param node Node we just finished processing + * + * @throws org.xml.sax.SAXException + */ + protected void endNode(Node node) throws org.xml.sax.SAXException { + + switch (node.getNodeType()) { + case Node.DOCUMENT_NODE : + break; + case Node.DOCUMENT_TYPE_NODE : + serializeDocType((DocumentType) node, false); + break; + case Node.ELEMENT_NODE : + serializeElement((Element) node, false); + break; + case Node.CDATA_SECTION_NODE : + break; + case Node.ENTITY_REFERENCE_NODE : + serializeEntityReference((EntityReference) node, false); + break; + default : + } + } + + // *********************************************************************** + // Node serialization methods + // *********************************************************************** + /** + * Applies a filter on the node to serialize + * + * @param node The Node to serialize + * @return True if the node is to be serialized else false if the node + * is to be rejected or skipped. + */ + protected boolean applyFilter(Node node, int nodeType) { + if (fFilter != null && (fWhatToShowFilter & nodeType) != 0) { + + short code = fFilter.acceptNode(node); + switch (code) { + case NodeFilter.FILTER_REJECT : + case NodeFilter.FILTER_SKIP : + return false; // skip the node + default : // fall through.. + } + } + return true; + } + + /** + * Serializes a Document Type Node. + * + * @param node The Docuemnt Type Node to serialize + * @param bStart Invoked at the start or end of node. Default true. + */ + protected void serializeDocType(DocumentType node, boolean bStart) + throws SAXException { + // The DocType and internalSubset can not be modified in DOM and is + // considered to be well-formed as the outcome of successful parsing. + String docTypeName = node.getNodeName(); + String publicId = node.getPublicId(); + String systemId = node.getSystemId(); + String internalSubset = node.getInternalSubset(); + + //DocumentType nodes are never passed to the filter + + if (internalSubset != null && !"".equals(internalSubset)) { + + if (bStart) { + try { + // The Serializer does not provide a way to write out the + // DOCTYPE internal subset via an event call, so we write it + // out here. + Writer writer = fSerializer.getWriter(); + StringBuffer dtd = new StringBuffer(); + + dtd.append(""); + dtd.append(fNewLine); + + writer.write(dtd.toString()); + writer.flush(); + + } catch (IOException e) { + throw new SAXException(Utils.messages.createMessage( + MsgKey.ER_WRITING_INTERNAL_SUBSET, null), e); + } + } // else if !bStart do nothing + + } else { + + if (bStart) { + if (fLexicalHandler != null) { + fLexicalHandler.startDTD(docTypeName, publicId, systemId); + } + } else { + if (fLexicalHandler != null) { + fLexicalHandler.endDTD(); + } + } + } + } + + /** + * Serializes a Comment Node. + * + * @param node The Comment Node to serialize + */ + protected void serializeComment(Comment node) throws SAXException { + // comments=true + if ((fFeatures & COMMENTS) != 0) { + String data = node.getData(); + + // well-formed=true + if ((fFeatures & WELLFORMED) != 0) { + isCommentWellFormed(data); + } + + if (fLexicalHandler != null) { + // apply the LSSerializer filter after the operations requested by the + // DOMConfiguration parameters have been applied + if (!applyFilter(node, NodeFilter.SHOW_COMMENT)) { + return; + } + + fLexicalHandler.comment(data.toCharArray(), 0, data.length()); + } + } + } + + /** + * Serializes an Element Node. + * + * @param node The Element Node to serialize + * @param bStart Invoked at the start or end of node. + */ + protected void serializeElement(Element node, boolean bStart) + throws SAXException { + if (bStart) { + fElementDepth++; + + // We use the Xalan specific startElement and starPrefixMapping calls + // (and addAttribute and namespaceAfterStartElement) as opposed to + // SAX specific, for performance reasons as they reduce the overhead + // of creating an AttList object upfront. + + // well-formed=true + if ((fFeatures & WELLFORMED) != 0) { + isElementWellFormed(node); + } + + // REVISIT: We apply the LSSerializer filter for elements before + // namesapce fixup + if (!applyFilter(node, NodeFilter.SHOW_ELEMENT)) { + return; + } + + // namespaces=true, record and fixup namspaced element + if ((fFeatures & NAMESPACES) != 0) { + fNSBinder.pushContext(); + fLocalNSBinder.reset(); + + recordLocalNSDecl(node); + fixupElementNS(node); + } + + // Namespace normalization + fSerializer.startElement( + node.getNamespaceURI(), + node.getLocalName(), + node.getNodeName()); + + serializeAttList(node); + + } else { + fElementDepth--; + + // apply the LSSerializer filter + if (!applyFilter(node, NodeFilter.SHOW_ELEMENT)) { + return; + } + + this.fSerializer.endElement( + node.getNamespaceURI(), + node.getLocalName(), + node.getNodeName()); + // since endPrefixMapping was not used by SerializationHandler it was removed + // for performance reasons. + + if ((fFeatures & NAMESPACES) != 0 ) { + fNSBinder.popContext(); + } + + } + } + + /** + * Serializes the Attr Nodes of an Element. + * + * @param node The OwnerElement whose Attr Nodes are to be serialized. + */ + protected void serializeAttList(Element node) throws SAXException { + NamedNodeMap atts = node.getAttributes(); + int nAttrs = atts.getLength(); + + for (int i = 0; i < nAttrs; i++) { + Node attr = atts.item(i); + + String localName = attr.getLocalName(); + String attrName = attr.getNodeName(); + String attrPrefix = attr.getPrefix() == null ? "" : attr.getPrefix(); + String attrValue = attr.getNodeValue(); + + // Determine the Attr's type. + String type = null; + if (fIsLevel3DOM) { + type = ((Attr) attr).getSchemaTypeInfo().getTypeName(); + } + type = type == null ? "CDATA" : type; + + String attrNS = attr.getNamespaceURI(); + if (attrNS !=null && attrNS.length() == 0) { + attrNS=null; + // we must remove prefix for this attribute + attrName=attr.getLocalName(); + } + + boolean isSpecified = ((Attr) attr).getSpecified(); + boolean addAttr = true; + boolean applyFilter = false; + boolean xmlnsAttr = + attrName.equals("xmlns") || attrName.startsWith("xmlns:"); + + // well-formed=true + if ((fFeatures & WELLFORMED) != 0) { + isAttributeWellFormed(attr); + } + + //----------------------------------------------------------------- + // start Attribute namespace fixup + //----------------------------------------------------------------- + // namespaces=true, normalize all non-namespace attributes + // Step 3. Attribute + if ((fFeatures & NAMESPACES) != 0 && !xmlnsAttr) { + + // If the Attr has a namespace URI + if (attrNS != null) { + attrPrefix = attrPrefix == null ? "" : attrPrefix; + + String declAttrPrefix = fNSBinder.getPrefix(attrNS); + String declAttrNS = fNSBinder.getURI(attrPrefix); + + // attribute has no prefix (default namespace decl does not apply to + // attributes) + // OR + // attribute prefix is not declared + // OR + // conflict: attribute has a prefix that conflicts with a binding + if ("".equals(attrPrefix) || "".equals(declAttrPrefix) + || !attrPrefix.equals(declAttrPrefix)) { + + // namespaceURI matches an in scope declaration of one or + // more prefixes + if (declAttrPrefix != null && !"".equals(declAttrPrefix)) { + // pick the prefix that was found and change attribute's + // prefix and nodeName. + attrPrefix = declAttrPrefix; + + if (declAttrPrefix.length() > 0 ) { + attrName = declAttrPrefix + ":" + localName; + } else { + attrName = localName; + } + } else { + // The current prefix is not null and it has no in scope + // declaration + if (attrPrefix != null && !"".equals(attrPrefix) + && declAttrNS == null) { + // declare this prefix + if ((fFeatures & NAMESPACEDECLS) != 0) { + fSerializer.addAttribute(XMLNS_URI, attrPrefix, + XMLNS_PREFIX + ":" + attrPrefix, "CDATA", + attrNS); + fNSBinder.declarePrefix(attrPrefix, attrNS); + fLocalNSBinder.declarePrefix(attrPrefix, attrNS); + } + } else { + // find a prefix following the pattern "NS" +index + // (starting at 1) + // make sure this prefix is not declared in the current + // scope. + int counter = 1; + attrPrefix = "NS" + counter++; + + while (fLocalNSBinder.getURI(attrPrefix) != null) { + attrPrefix = "NS" + counter++; + } + // change attribute's prefix and Name + attrName = attrPrefix + ":" + localName; + + // create a local namespace declaration attribute + // Add the xmlns declaration attribute + if ((fFeatures & NAMESPACEDECLS) != 0) { + + fSerializer.addAttribute(XMLNS_URI, attrPrefix, + XMLNS_PREFIX + ":" + attrPrefix, "CDATA", + attrNS); + fNSBinder.declarePrefix(attrPrefix, attrNS); + fLocalNSBinder.declarePrefix(attrPrefix, attrNS); + } + } + } + } + + } else { // if the Attr has no namespace URI + // Attr has no localName + if (localName == null) { + // DOM Level 1 node! + String msg = Utils.messages.createMessage( + MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + new Object[] { attrName }); + + if (fErrorHandler != null) { + fErrorHandler + .handleError(new DOMErrorImpl( + DOMError.SEVERITY_ERROR, msg, + MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, null, + null, null)); + } + + } else { // uri=null and no colon + // attr has no namespace URI and no prefix + // no action is required, since attrs don't use default + } + } + + } + + + // discard-default-content=true + // Default attr's are not passed to the filter and this contraint + // is applied only when discard-default-content=true + // What about default xmlns attributes???? check for xmlnsAttr + if ((((fFeatures & DISCARDDEFAULT) != 0) && isSpecified) + || ((fFeatures & DISCARDDEFAULT) == 0)) { + applyFilter = true; + } else { + addAttr = false; + } + + if (applyFilter) { + // apply the filter for Attributes that are not default attributes + // or namespace decl attributes + if (fFilter != null + && (fFilter.getWhatToShow() & NodeFilter.SHOW_ATTRIBUTE) + != 0) { + + if (!xmlnsAttr) { + short code = fFilter.acceptNode(attr); + switch (code) { + case NodeFilter.FILTER_REJECT : + case NodeFilter.FILTER_SKIP : + addAttr = false; + break; + default : //fall through.. + } + } + } + } + + // if the node is a namespace node + if (addAttr && xmlnsAttr) { + // If namespace-declarations=true, add the node , else don't add it + if ((fFeatures & NAMESPACEDECLS) != 0) { + // The namespace may have been fixed up, in that case don't add it. + if (localName != null && !"".equals(localName)) { + fSerializer.addAttribute(attrNS, localName, attrName, type, attrValue); + } + } + } else if ( + addAttr && !xmlnsAttr) { // if the node is not a namespace node + // If namespace-declarations=true, add the node with the Attr nodes namespaceURI + // else add the node setting it's namespace to null or else the serializer will later + // attempt to add a xmlns attr for the prefixed attribute + if (((fFeatures & NAMESPACEDECLS) != 0) && (attrNS != null)) { + fSerializer.addAttribute( + attrNS, + localName, + attrName, + type, + attrValue); + } else { + fSerializer.addAttribute( + "", + localName, + attrName, + type, + attrValue); + } + } + + // + if (xmlnsAttr && ((fFeatures & NAMESPACEDECLS) != 0)) { + int index; + // Use "" instead of null, as Xerces likes "" for the + // name of the default namespace. Fix attributed + // to "Steven Murray" . + String prefix = + (index = attrName.indexOf(":")) < 0 + ? "" + : attrName.substring(index + 1); + + if (!"".equals(prefix)) { + fSerializer.namespaceAfterStartElement(prefix, attrValue); + } + } + } + + } + + /** + * Serializes an ProcessingInstruction Node. + * + * @param node The ProcessingInstruction Node to serialize + */ + protected void serializePI(ProcessingInstruction node) + throws SAXException { + ProcessingInstruction pi = node; + String name = pi.getNodeName(); + + // well-formed=true + if ((fFeatures & WELLFORMED) != 0) { + isPIWellFormed(node); + } + + // apply the LSSerializer filter + if (!applyFilter(node, NodeFilter.SHOW_PROCESSING_INSTRUCTION)) { + return; + } + + // String data = pi.getData(); + if (name.equals("xslt-next-is-raw")) { + fNextIsRaw = true; + } else { + this.fSerializer.processingInstruction(name, pi.getData()); + } + } + + /** + * Serializes an CDATASection Node. + * + * @param node The CDATASection Node to serialize + */ + protected void serializeCDATASection(CDATASection node) + throws SAXException { + // well-formed=true + if ((fFeatures & WELLFORMED) != 0) { + isCDATASectionWellFormed(node); + } + + // cdata-sections = true + if ((fFeatures & CDATA) != 0) { + + // split-cdata-sections = true + // Assumption: This parameter has an effect only when + // cdata-sections=true + // ToStream, by default splits cdata-sections. Hence the check + // below. + String nodeValue = node.getNodeValue(); + int endIndex = nodeValue.indexOf("]]>"); + if ((fFeatures & SPLITCDATA) != 0) { + if (endIndex >= 0) { + // The first node split will contain the ]] markers + String relatedData = nodeValue.substring(0, endIndex + 2); + + String msg = + Utils.messages.createMessage( + MsgKey.ER_CDATA_SECTIONS_SPLIT, + null); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_WARNING, + msg, + MsgKey.ER_CDATA_SECTIONS_SPLIT, + null, + relatedData, + null)); + } + } + } else { + if (endIndex >= 0) { + // The first node split will contain the ]] markers + String relatedData = nodeValue.substring(0, endIndex + 2); + + String msg = + Utils.messages.createMessage( + MsgKey.ER_CDATA_SECTIONS_SPLIT, + null); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_ERROR, + msg, + MsgKey.ER_CDATA_SECTIONS_SPLIT)); + } + // Report an error and return. What error??? + return; + } + } + + // apply the LSSerializer filter + if (!applyFilter(node, NodeFilter.SHOW_CDATA_SECTION)) { + return; + } + + // splits the cdata-section + if (fLexicalHandler != null) { + fLexicalHandler.startCDATA(); + } + dispatachChars(node); + if (fLexicalHandler != null) { + fLexicalHandler.endCDATA(); + } + } else { + dispatachChars(node); + } + } + + /** + * Serializes an Text Node. + * + * @param node The Text Node to serialize + */ + protected void serializeText(Text node) throws SAXException { + if (fNextIsRaw) { + fNextIsRaw = false; + fSerializer.processingInstruction( + javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, + ""); + dispatachChars(node); + fSerializer.processingInstruction( + javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, + ""); + } else { + // keep track of dispatch or not to avoid duplicaiton of filter code + boolean bDispatch = false; + + // well-formed=true + if ((fFeatures & WELLFORMED) != 0) { + isTextWellFormed(node); + } + + // if the node is whitespace + // Determine the Attr's type. + boolean isElementContentWhitespace = false; + if (fIsLevel3DOM) { + isElementContentWhitespace = + node.isElementContentWhitespace(); + } + + if (isElementContentWhitespace) { + // element-content-whitespace=true + if ((fFeatures & ELEM_CONTENT_WHITESPACE) != 0) { + bDispatch = true; + } + } else { + bDispatch = true; + } + + // apply the LSSerializer filter + if (!applyFilter(node, NodeFilter.SHOW_TEXT)) { + return; + } + + if (bDispatch) { + dispatachChars(node); + } + } + } + + /** + * Serializes an EntityReference Node. + * + * @param node The EntityReference Node to serialize + * @param bStart Inicates if called from start or endNode + */ + protected void serializeEntityReference( + EntityReference node, + boolean bStart) + throws SAXException { + if (bStart) { + EntityReference eref = node; + // entities=true + if ((fFeatures & ENTITIES) != 0) { + + // perform well-formedness and other checking only if + // entities = true + + // well-formed=true + if ((fFeatures & WELLFORMED) != 0) { + isEntityReferneceWellFormed(node); + } + + // check "unbound-prefix-in-entity-reference" [fatal] + // Raised if the configuration parameter "namespaces" is set to true + if ((fFeatures & NAMESPACES) != 0) { + checkUnboundPrefixInEntRef(node); + } + + // The filter should not apply in this case, since the + // EntityReference is not being expanded. + // should we pass entity reference nodes to the filter??? + } + + if (fLexicalHandler != null) { + + // startEntity outputs only Text but not Element, Attr, Comment + // and PI child nodes. It does so by setting the m_inEntityRef + // in ToStream and using this to decide if a node is to be + // serialized or not. + fLexicalHandler.startEntity(eref.getNodeName()); + } + + } else { + EntityReference eref = node; + // entities=true or false, + if (fLexicalHandler != null) { + fLexicalHandler.endEntity(eref.getNodeName()); + } + } + } + + + // *********************************************************************** + // Methods to check well-formedness + // *********************************************************************** + /** + * Taken from org.apache.xerces.dom.CoreDocumentImpl + * + * Check the string against XML's definition of acceptable names for + * elements and attributes and so on using the XMLCharacterProperties + * utility class + */ + protected boolean isXMLName(String s, boolean xml11Version) { + + if (s == null) { + return false; + } + if (!xml11Version) + return XMLChar.isValidName(s); + else + return XML11Char.isXML11ValidName(s); + } + + /** + * Taken from org.apache.xerces.dom.CoreDocumentImpl + * + * Checks if the given qualified name is legal with respect + * to the version of XML to which this document must conform. + * + * @param prefix prefix of qualified name + * @param local local part of qualified name + */ + protected boolean isValidQName( + String prefix, + String local, + boolean xml11Version) { + + // check that both prefix and local part match NCName + if (local == null) + return false; + boolean validNCName = false; + + if (!xml11Version) { + validNCName = + (prefix == null || XMLChar.isValidNCName(prefix)) + && XMLChar.isValidNCName(local); + } else { + validNCName = + (prefix == null || XML11Char.isXML11ValidNCName(prefix)) + && XML11Char.isXML11ValidNCName(local); + } + + return validNCName; + } + + /** + * Checks if a XML character is well-formed + * + * @param characters A String of characters to be checked for Well-Formedness + * @param refInvalidChar A reference to the character to be returned that was determined invalid. + */ + protected boolean isWFXMLChar(String chardata, Character refInvalidChar) { + if (chardata == null || (chardata.length() == 0)) { + return true; + } + + char[] dataarray = chardata.toCharArray(); + int datalength = dataarray.length; + + // version of the document is XML 1.1 + if (fIsXMLVersion11) { + //we need to check all characters as per production rules of XML11 + int i = 0; + while (i < datalength) { + if (XML11Char.isXML11Invalid(dataarray[i++])) { + // check if this is a supplemental character + char ch = dataarray[i - 1]; + if (XMLChar.isHighSurrogate(ch) && i < datalength) { + char ch2 = dataarray[i++]; + if (XMLChar.isLowSurrogate(ch2) + && XMLChar.isSupplemental( + XMLChar.supplemental(ch, ch2))) { + continue; + } + } + // Reference to invalid character which is returned + refInvalidChar = new Character(ch); + return false; + } + } + } // version of the document is XML 1.0 + else { + // we need to check all characters as per production rules of XML 1.0 + int i = 0; + while (i < datalength) { + if (XMLChar.isInvalid(dataarray[i++])) { + // check if this is a supplemental character + char ch = dataarray[i - 1]; + if (XMLChar.isHighSurrogate(ch) && i < datalength) { + char ch2 = dataarray[i++]; + if (XMLChar.isLowSurrogate(ch2) + && XMLChar.isSupplemental( + XMLChar.supplemental(ch, ch2))) { + continue; + } + } + // Reference to invalid character which is returned + refInvalidChar = new Character(ch); + return false; + } + } + } // end-else fDocument.isXMLVersion() + + return true; + } // isXMLCharWF + + /** + * Checks if a XML character is well-formed. If there is a problem with + * the character a non-null Character is returned else null is returned. + * + * @param characters A String of characters to be checked for Well-Formedness + * @return Character A reference to the character to be returned that was determined invalid. + */ + protected Character isWFXMLChar(String chardata) { + Character refInvalidChar; + if (chardata == null || (chardata.length() == 0)) { + return null; + } + + char[] dataarray = chardata.toCharArray(); + int datalength = dataarray.length; + + // version of the document is XML 1.1 + if (fIsXMLVersion11) { + //we need to check all characters as per production rules of XML11 + int i = 0; + while (i < datalength) { + if (XML11Char.isXML11Invalid(dataarray[i++])) { + // check if this is a supplemental character + char ch = dataarray[i - 1]; + if (XMLChar.isHighSurrogate(ch) && i < datalength) { + char ch2 = dataarray[i++]; + if (XMLChar.isLowSurrogate(ch2) + && XMLChar.isSupplemental( + XMLChar.supplemental(ch, ch2))) { + continue; + } + } + // Reference to invalid character which is returned + refInvalidChar = new Character(ch); + return refInvalidChar; + } + } + } // version of the document is XML 1.0 + else { + // we need to check all characters as per production rules of XML 1.0 + int i = 0; + while (i < datalength) { + if (XMLChar.isInvalid(dataarray[i++])) { + // check if this is a supplemental character + char ch = dataarray[i - 1]; + if (XMLChar.isHighSurrogate(ch) && i < datalength) { + char ch2 = dataarray[i++]; + if (XMLChar.isLowSurrogate(ch2) + && XMLChar.isSupplemental( + XMLChar.supplemental(ch, ch2))) { + continue; + } + } + // Reference to invalid character which is returned + refInvalidChar = new Character(ch); + return refInvalidChar; + } + } + } // end-else fDocument.isXMLVersion() + + return null; + } // isXMLCharWF + + /** + * Checks if a comment node is well-formed + * + * @param data The contents of the comment node + * @return a boolean indiacating if the comment is well-formed or not. + */ + protected void isCommentWellFormed(String data) { + if (data == null || (data.length() == 0)) { + return; + } + + char[] dataarray = data.toCharArray(); + int datalength = dataarray.length; + + // version of the document is XML 1.1 + if (fIsXMLVersion11) { + // we need to check all chracters as per production rules of XML11 + int i = 0; + while (i < datalength) { + char c = dataarray[i++]; + if (XML11Char.isXML11Invalid(c)) { + // check if this is a supplemental character + if (XMLChar.isHighSurrogate(c) && i < datalength) { + char c2 = dataarray[i++]; + if (XMLChar.isLowSurrogate(c2) + && XMLChar.isSupplemental( + XMLChar.supplemental(c, c2))) { + continue; + } + } + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + new Object[] { new Character(c)}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER, + null, + null, + null)); + } + } else if (c == '-' && i < datalength && dataarray[i] == '-') { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_DASH_IN_COMMENT, + null); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER, + null, + null, + null)); + } + } + } + } // version of the document is XML 1.0 + else { + // we need to check all chracters as per production rules of XML 1.0 + int i = 0; + while (i < datalength) { + char c = dataarray[i++]; + if (XMLChar.isInvalid(c)) { + // check if this is a supplemental character + if (XMLChar.isHighSurrogate(c) && i < datalength) { + char c2 = dataarray[i++]; + if (XMLChar.isLowSurrogate(c2) + && XMLChar.isSupplemental( + XMLChar.supplemental(c, c2))) { + continue; + } + } + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + new Object[] { new Character(c)}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER, + null, + null, + null)); + } + } else if (c == '-' && i < datalength && dataarray[i] == '-') { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_DASH_IN_COMMENT, + null); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER, + null, + null, + null)); + } + } + } + } + return; + } + + /** + * Checks if an element node is well-formed, by checking its Name for well-formedness. + * + * @param data The contents of the comment node + * @return a boolean indiacating if the comment is well-formed or not. + */ + protected void isElementWellFormed(Node node) { + boolean isNameWF = false; + if ((fFeatures & NAMESPACES) != 0) { + isNameWF = + isValidQName( + node.getPrefix(), + node.getLocalName(), + fIsXMLVersion11); + } else { + isNameWF = isXMLName(node.getNodeName(), fIsXMLVersion11); + } + + if (!isNameWF) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + new Object[] { "Element", node.getNodeName()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + null, + null, + null)); + } + } + } + + /** + * Checks if an attr node is well-formed, by checking it's Name and value + * for well-formedness. + * + * @param data The contents of the comment node + * @return a boolean indiacating if the comment is well-formed or not. + */ + protected void isAttributeWellFormed(Node node) { + boolean isNameWF = false; + if ((fFeatures & NAMESPACES) != 0) { + isNameWF = + isValidQName( + node.getPrefix(), + node.getLocalName(), + fIsXMLVersion11); + } else { + isNameWF = isXMLName(node.getNodeName(), fIsXMLVersion11); + } + + if (!isNameWF) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + new Object[] { "Attr", node.getNodeName()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + null, + null, + null)); + } + } + + // Check the Attr's node value + // WFC: No < in Attribute Values + String value = node.getNodeValue(); + if (value.indexOf('<') >= 0) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_LT_IN_ATTVAL, + new Object[] { + ((Attr) node).getOwnerElement().getNodeName(), + node.getNodeName()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_LT_IN_ATTVAL, + null, + null, + null)); + } + } + + // we need to loop through the children of attr nodes and check their values for + // well-formedness + NodeList children = node.getChildNodes(); + for (int i = 0; i < children.getLength(); i++) { + Node child = children.item(i); + // An attribute node with no text or entity ref child for example + // doc.createAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:ns"); + // followes by + // element.setAttributeNodeNS(attribute); + // can potentially lead to this situation. If the attribute + // was a prefix Namespace attribute declaration then then DOM Core + // should have some exception defined for this. + if (child == null) { + // we should probably report an error + continue; + } + switch (child.getNodeType()) { + case Node.TEXT_NODE : + isTextWellFormed((Text) child); + break; + case Node.ENTITY_REFERENCE_NODE : + isEntityReferneceWellFormed((EntityReference) child); + break; + default : + } + } + + // TODO: + // WFC: Check if the attribute prefix is bound to + // http://www.w3.org/2000/xmlns/ + + // WFC: Unique Att Spec + // Perhaps pass a seen boolean value to this method. serializeAttList will determine + // if the attr was seen before. + } + + /** + * Checks if a PI node is well-formed, by checking it's Name and data + * for well-formedness. + * + * @param data The contents of the comment node + */ + protected void isPIWellFormed(ProcessingInstruction node) { + // Is the PI Target a valid XML name + if (!isXMLName(node.getNodeName(), fIsXMLVersion11)) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + new Object[] { "ProcessingInstruction", node.getTarget()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + null, + null, + null)); + } + } + + // Does the PI Data carry valid XML characters + + // REVISIT: Should we check if the PI DATA contains a ?> ??? + Character invalidChar = isWFXMLChar(node.getData()); + if (invalidChar != null) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + new Object[] { Integer.toHexString(Character.getNumericValue(invalidChar.charValue())) }); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER, + null, + null, + null)); + } + } + } + + /** + * Checks if an CDATASection node is well-formed, by checking it's data + * for well-formedness. Note that the presence of a CDATA termination mark + * in the contents of a CDATASection is handled by the parameter + * spli-cdata-sections + * + * @param data The contents of the comment node + */ + protected void isCDATASectionWellFormed(CDATASection node) { + // Does the data valid XML character data + Character invalidChar = isWFXMLChar(node.getData()); + //if (!isWFXMLChar(node.getData(), invalidChar)) { + if (invalidChar != null) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + new Object[] { Integer.toHexString(Character.getNumericValue(invalidChar.charValue())) }); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER, + null, + null, + null)); + } + } + } + + /** + * Checks if an Text node is well-formed, by checking if it contains invalid + * XML characters. + * + * @param data The contents of the comment node + */ + protected void isTextWellFormed(Text node) { + // Does the data valid XML character data + Character invalidChar = isWFXMLChar(node.getData()); + if (invalidChar != null) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + new Object[] { Integer.toHexString(Character.getNumericValue(invalidChar.charValue())) }); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER, + null, + null, + null)); + } + } + } + + /** + * Checks if an EntityRefernece node is well-formed, by checking it's node name. Then depending + * on whether it is referenced in Element content or in an Attr Node, checks if the EntityReference + * references an unparsed entity or a external entity and if so throws raises the + * appropriate well-formedness error. + * + * @param data The contents of the comment node + * @parent The parent of the EntityReference Node + */ + protected void isEntityReferneceWellFormed(EntityReference node) { + // Is the EntityReference name a valid XML name + if (!isXMLName(node.getNodeName(), fIsXMLVersion11)) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + new Object[] { "EntityReference", node.getNodeName()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + null, + null, + null)); + } + } + + // determine the parent node + Node parent = node.getParentNode(); + + // Traverse the declared entities and check if the nodeName and namespaceURI + // of the EntityReference matches an Entity. If so, check the if the notationName + // is not null, if so, report an error. + DocumentType docType = node.getOwnerDocument().getDoctype(); + if (docType != null) { + NamedNodeMap entities = docType.getEntities(); + for (int i = 0; i < entities.getLength(); i++) { + Entity ent = (Entity) entities.item(i); + + String nodeName = + node.getNodeName() == null ? "" : node.getNodeName(); + String nodeNamespaceURI = + node.getNamespaceURI() == null + ? "" + : node.getNamespaceURI(); + String entName = + ent.getNodeName() == null ? "" : ent.getNodeName(); + String entNamespaceURI = + ent.getNamespaceURI() == null ? "" : ent.getNamespaceURI(); + // If referenced in Element content + // WFC: Parsed Entity + if (parent.getNodeType() == Node.ELEMENT_NODE) { + if (entNamespaceURI.equals(nodeNamespaceURI) + && entName.equals(nodeName)) { + + if (ent.getNotationName() != null) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + new Object[] { node.getNodeName()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + null, + null, + null)); + } + } + } + } // end if WFC: Parsed Entity + + // If referenced in an Attr value + // WFC: No External Entity References + if (parent.getNodeType() == Node.ATTRIBUTE_NODE) { + if (entNamespaceURI.equals(nodeNamespaceURI) + && entName.equals(nodeName)) { + + if (ent.getPublicId() != null + || ent.getSystemId() != null + || ent.getNotationName() != null) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + new Object[] { node.getNodeName()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + null, + null, + null)); + } + } + } + } //end if WFC: No External Entity References + } + } + } // isEntityReferneceWellFormed + + /** + * If the configuration parameter "namespaces" is set to true, this methods + * checks if an entity whose replacement text contains unbound namespace + * prefixes is referenced in a location where there are no bindings for + * the namespace prefixes and if so raises a LSException with the error-type + * "unbound-prefix-in-entity-reference" + * + * @param Node, The EntityReference nodes whose children are to be checked + */ + protected void checkUnboundPrefixInEntRef(Node node) { + Node child, next; + for (child = node.getFirstChild(); child != null; child = next) { + next = child.getNextSibling(); + + if (child.getNodeType() == Node.ELEMENT_NODE) { + + //If a NamespaceURI is not declared for the current + //node's prefix, raise a fatal error. + String prefix = child.getPrefix(); + if (prefix != null + && fNSBinder.getURI(prefix) == null) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + new Object[] { + node.getNodeName(), + child.getNodeName(), + prefix }); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + null, + null, + null)); + } + } + + NamedNodeMap attrs = child.getAttributes(); + + for (int i = 0; i < attrs.getLength(); i++) { + String attrPrefix = attrs.item(i).getPrefix(); + if (attrPrefix != null + && fNSBinder.getURI(attrPrefix) == null) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + new Object[] { + node.getNodeName(), + child.getNodeName(), + attrs.item(i)}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, + msg, + MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + null, + null, + null)); + } + } + } + } + + if (child.hasChildNodes()) { + checkUnboundPrefixInEntRef(child); + } + } + } + + // *********************************************************************** + // Namespace normalization + // *********************************************************************** + /** + * Records local namespace declarations, to be used for normalization later + * + * @param Node, The element node, whose namespace declarations are to be recorded + */ + protected void recordLocalNSDecl(Node node) { + NamedNodeMap atts = ((Element) node).getAttributes(); + int length = atts.getLength(); + + for (int i = 0; i < length; i++) { + Node attr = atts.item(i); + + String localName = attr.getLocalName(); + String attrPrefix = attr.getPrefix(); + String attrValue = attr.getNodeValue(); + String attrNS = attr.getNamespaceURI(); + + localName = + localName == null + || XMLNS_PREFIX.equals(localName) ? "" : localName; + attrPrefix = attrPrefix == null ? "" : attrPrefix; + attrValue = attrValue == null ? "" : attrValue; + attrNS = attrNS == null ? "" : attrNS; + + // check if attribute is a namespace decl + if (XMLNS_URI.equals(attrNS)) { + + // No prefix may be bound to http://www.w3.org/2000/xmlns/. + if (XMLNS_URI.equals(attrValue)) { + String msg = + Utils.messages.createMessage( + MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + new Object[] { attrPrefix, XMLNS_URI }); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_ERROR, + msg, + MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + null, + null, + null)); + } + } else { + // store the namespace-declaration + if (XMLNS_PREFIX.equals(attrPrefix) ) { + // record valid decl + if (attrValue.length() != 0) { + fNSBinder.declarePrefix(localName, attrValue); + } else { + // Error; xmlns:prefix="" + } + } else { // xmlns + // empty prefix is always bound ("" or some string) + fNSBinder.declarePrefix("", attrValue); + } + } + + } + } + } + + /** + * Fixes an element's namespace + * + * @param Node, The element node, whose namespace is to be fixed + */ + protected void fixupElementNS(Node node) throws SAXException { + String namespaceURI = ((Element) node).getNamespaceURI(); + String prefix = ((Element) node).getPrefix(); + String localName = ((Element) node).getLocalName(); + + if (namespaceURI != null) { + //if ( Element's prefix/namespace pair (or default namespace, + // if no prefix) are within the scope of a binding ) + prefix = prefix == null ? "" : prefix; + String inScopeNamespaceURI = fNSBinder.getURI(prefix); + + if ((inScopeNamespaceURI != null + && inScopeNamespaceURI.equals(namespaceURI))) { + // do nothing, declaration in scope is inherited + + } else { + // Create a local namespace declaration attr for this namespace, + // with Element's current prefix (or a default namespace, if + // no prefix). If there's a conflicting local declaration + // already present, change its value to use this namespace. + + // Add the xmlns declaration attribute + //fNSBinder.pushNamespace(prefix, namespaceURI, fElementDepth); + if ((fFeatures & NAMESPACEDECLS) != 0) { + if ("".equals(prefix) || "".equals(namespaceURI)) { + ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX, namespaceURI); + } else { + ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX + ":" + prefix, namespaceURI); + } + } + fLocalNSBinder.declarePrefix(prefix, namespaceURI); + fNSBinder.declarePrefix(prefix, namespaceURI); + + } + } else { + // Element has no namespace + // DOM Level 1 + if (localName == null || "".equals(localName)) { + // DOM Level 1 node! + String msg = + Utils.messages.createMessage( + MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + new Object[] { node.getNodeName()}); + + if (fErrorHandler != null) { + fErrorHandler.handleError( + new DOMErrorImpl( + DOMError.SEVERITY_ERROR, + msg, + MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + null, + null, + null)); + } + } else { + namespaceURI = fNSBinder.getURI(""); + if (namespaceURI !=null && namespaceURI.length() > 0) { + ((Element)node).setAttributeNS(XMLNS_URI, XMLNS_PREFIX, ""); + fLocalNSBinder.declarePrefix("", ""); + fNSBinder.declarePrefix("", ""); + } + } + } + } + /** + * This table is a quick lookup of a property key (String) to the integer that + * is the bit to flip in the fFeatures field, so the integers should have + * values 1,2,4,8,16... + * + */ + private static final Hashtable s_propKeys = new Hashtable(); + static { + + // Initialize the mappings of property keys to bit values (Integer objects) + // or mappings to a String object "", which indicates we are interested + // in the property, but it does not have a simple bit value to flip + + // cdata-sections + int i = CDATA; + Integer val = new Integer(i); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_CDATA_SECTIONS, + val); + + // comments + int i1 = COMMENTS; + val = new Integer(i1); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_COMMENTS, + val); + + // element-content-whitespace + int i2 = ELEM_CONTENT_WHITESPACE; + val = new Integer(i2); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, + val); + int i3 = ENTITIES; + + // entities + val = new Integer(i3); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_ENTITIES, + val); + + // namespaces + int i4 = NAMESPACES; + val = new Integer(i4); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_NAMESPACES, + val); + + // namespace-declarations + int i5 = NAMESPACEDECLS; + val = new Integer(i5); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACE_DECLARATIONS, + val); + + // split-cdata-sections + int i6 = SPLITCDATA; + val = new Integer(i6); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_SPLIT_CDATA, + val); + + // discard-default-content + int i7 = WELLFORMED; + val = new Integer(i7); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + DOMConstants.DOM_WELLFORMED, + val); + + // discard-default-content + int i8 = DISCARDDEFAULT; + val = new Integer(i8); + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, + val); + + // We are interested in these properties, but they don't have a simple + // bit value to deal with. + s_propKeys.put( + DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_FORMAT_PRETTY_PRINT, + ""); + s_propKeys.put(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, ""); + s_propKeys.put( + DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, + ""); + s_propKeys.put(DOMConstants.S_XSL_OUTPUT_ENCODING, ""); + s_propKeys.put(OutputPropertiesFactory.S_KEY_ENTITIES, ""); + } + + /** + * Initializes fFeatures based on the DOMConfiguration Parameters set. + * + * @param properties DOMConfiguraiton properties that were set and which are + * to be used while serializing the DOM. + */ + protected void initProperties(Properties properties) { + + for (Enumeration keys = properties.keys(); keys.hasMoreElements();) { + + final String key = (String) keys.nextElement(); + + // caonical-form + // Other features will be enabled or disabled when this is set to true or false. + + // error-handler; set via the constructor + + // infoset + // Other features will be enabled or disabled when this is set to true + + // A quick lookup for the given set of properties (cdata-sections ...) + final Object iobj = s_propKeys.get(key); + if (iobj != null) { + if (iobj instanceof Integer) { + // Dealing with a property that has a simple bit value that + // we need to set + + // cdata-sections + // comments + // element-content-whitespace + // entities + // namespaces + // namespace-declarations + // split-cdata-sections + // well-formed + // discard-default-content + final int BITFLAG = ((Integer) iobj).intValue(); + if ((properties.getProperty(key).endsWith("yes"))) { + fFeatures = fFeatures | BITFLAG; + } else { + fFeatures = fFeatures & ~BITFLAG; + } + } else { + // We are interested in the property, but it is not + // a simple bit that we need to set. + + if ((DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_FORMAT_PRETTY_PRINT) + .equals(key)) { + // format-pretty-print; set internally on the serializers via xsl:output properties in LSSerializer + if ((properties.getProperty(key).endsWith("yes"))) { + fSerializer.setIndent(true); + fSerializer.setIndentAmount(4); + } else { + fSerializer.setIndent(false); + } + } else if ( + (DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL).equals( + key)) { + // omit-xml-declaration; set internally on the serializers via xsl:output properties in LSSerializer + if ((properties.getProperty(key).endsWith("yes"))) { + fSerializer.setOmitXMLDeclaration(true); + } else { + fSerializer.setOmitXMLDeclaration(false); + } + } else if ( + ( + DOMConstants.S_XERCES_PROPERTIES_NS + + DOMConstants.S_XML_VERSION).equals( + key)) { + // Retreive the value of the XML Version attribute via the xml-version + String version = properties.getProperty(key); + if ("1.1".equals(version)) { + fIsXMLVersion11 = true; + fSerializer.setVersion(version); + } else { + fSerializer.setVersion("1.0"); + } + } else if ( + (DOMConstants.S_XSL_OUTPUT_ENCODING).equals(key)) { + // Retreive the value of the XML Encoding attribute + String encoding = properties.getProperty(key); + if (encoding != null) { + fSerializer.setEncoding(encoding); + } + } else if ((OutputPropertiesFactory.S_KEY_ENTITIES).equals(key)) { + // Retreive the value of the XML Encoding attribute + String entities = properties.getProperty(key); + if (DOMConstants.S_XSL_VALUE_ENTITIES.equals(entities)) { + fSerializer.setDTDEntityExpansion(false); + } + } else { + // We shouldn't get here, ever, now what? + } + } + } + } + // Set the newLine character to use + if (fNewLine != null) { + fSerializer.setOutputProperty(OutputPropertiesFactory.S_KEY_LINE_SEPARATOR, fNewLine); + } + } + +} //TreeWalker diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMConstants.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMConstants.java new file mode 100644 index 00000000000..07f19b29d1f --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMConstants.java @@ -0,0 +1,134 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package com.sun.org.apache.xml.internal.serializer.dom3; + +/** + * DOM Constants used by the DOM Level 3 LSSerializer implementation. + * + * @xsl.usage internal + */ +final class DOMConstants { + // + // Constants: DOM Level 3 feature ids + // + public static final String DOM3_REC_URL = "http://www.w3.org/TR/DOM-Level-3-LS"; + + public static final String XERCES_URL = "http://xml.apache.org/xerces-2j"; + + // The namespace used to qualified DOM Level 3 DOMConfiguration parameters + public static final String S_DOM3_PROPERTIES_NS = "{" + + DOMConstants.DOM3_REC_URL + "}"; + + public static final String S_XERCES_PROPERTIES_NS = "{" + + DOMConstants.XERCES_URL + "}"; + + // xmlns namespaces + private static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/"; + + // namespace prefix + private static final String XMLNS_PREFIX = "xmlns"; + + // ************************************************************************ + // DOM Level 3 DOM Configuration parameter names + // ************************************************************************ + // DOM Level 3 parameters defined in Core + public static final String DOM_CANONICAL_FORM = "canonical-form"; // Unsupported, we only appear to support this + + public static final String DOM_CDATA_SECTIONS = "cdata-sections"; + + public static final String DOM_CHECK_CHAR_NORMALIZATION = "check-character-normalization"; // Unsupported + + public static final String DOM_COMMENTS = "comments"; + + public static final String DOM_DATATYPE_NORMALIZATION = "datatype-normalization"; // Unsupported + + public static final String DOM_ELEMENT_CONTENT_WHITESPACE = "element-content-whitespace"; + + public static final String DOM_ENTITIES = "entities"; + + public static final String DOM_INFOSET = "infoset"; + + public static final String DOM_NAMESPACES = "namespaces"; + + public static final String DOM_NAMESPACE_DECLARATIONS = "namespace-declarations"; + + public static final String DOM_NORMALIZE_CHARACTERS = "normalize-characters"; // Unsupported + + public static final String DOM_SPLIT_CDATA = "split-cdata-sections"; + + public static final String DOM_VALIDATE_IF_SCHEMA = "validate-if-schema"; // Unsopported + + public static final String DOM_VALIDATE = "validate"; // Unsopported + + public static final String DOM_WELLFORMED = "well-formed"; + + // DOM Level 3 Save + public static final String DOM_DISCARD_DEFAULT_CONTENT = "discard-default-content"; + + public static final String DOM_FORMAT_PRETTY_PRINT = "format-pretty-print"; + + public static final String DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS = "ignore-unknown-character-denormalizations"; // Unsupported + + public static final String DOM_XMLDECL = "xml-declaration"; + + // DOM Properties + public static final String DOM_ERROR_HANDLER = "error-handler"; + + public static final String DOM_SCHEMA_TYPE = "schema-type"; // Unsupported + + public static final String DOM_SCHEMA_LOCATION = "schema-location"; // Unsupported + + // ************************************************************************ + + // XSL Output properties + // The xsl:output 'indent' property used in LSSerializer + public static final String S_XSL_OUTPUT_INDENT = "indent"; + + // The xsl:output 'indent' property used in LSSerializer + public static final String S_XSL_OUTPUT_ENCODING = "encoding"; + + // The xsl:output 'omit-xml-declaration' property used in LSSerializer + public static final String S_XSL_OUTPUT_OMIT_XML_DECL = "omit-xml-declaration"; + + // The xerces serializer specific 'omit-xml-declaration' property used in LSSerializer + public static final String S_XML_VERSION = "xml-version"; + + // + public static final String S_XSL_VALUE_ENTITIES = "com/sun/org/apache/xml/internal/serializer/XMLEntities"; + + // Parameter values + public static final String DOM3_EXPLICIT_TRUE = "explicit:yes"; + + public static final String DOM3_DEFAULT_TRUE = "default:yes"; + + public static final String DOM3_EXPLICIT_FALSE = "explicit:no"; + + public static final String DOM3_DEFAULT_FALSE = "default:no"; + + // DOM Exceptions + public static final String DOM_EXCEPTION_FEATURE_NOT_FOUND = "FEATURE_NOT_FOUND"; + + public static final String DOM_EXCEPTION_FEATURE_NOT_SUPPORTED = "FEATURE_NOT_SUPPORTED"; + + public static final String DOM_LSEXCEPTION_SERIALIZER_ERR = "SERIALIZER_ERROR"; + +} diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMErrorHandlerImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMErrorHandlerImpl.java new file mode 100644 index 00000000000..e1b577ffaa9 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMErrorHandlerImpl.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package com.sun.org.apache.xml.internal.serializer.dom3; + +import org.w3c.dom.DOMError; +import org.w3c.dom.DOMErrorHandler; + +/** + * This is the default implementation of the ErrorHandler interface and is + * used if one is not provided. The default implementation simply reports + * DOMErrors to System.err. + * + * @xsl.usage internal + */ +final class DOMErrorHandlerImpl implements DOMErrorHandler { + + /** + * Default Constructor + */ + DOMErrorHandlerImpl() { + } + + /** + * Implementation of DOMErrorHandler.handleError that + * adds copy of error to list for later retrieval. + * + */ + public boolean handleError(DOMError error) { + boolean fail = true; + String severity = null; + if (error.getSeverity() == DOMError.SEVERITY_WARNING) { + fail = false; + severity = "[Warning]"; + } else if (error.getSeverity() == DOMError.SEVERITY_ERROR) { + severity = "[Error]"; + } else if (error.getSeverity() == DOMError.SEVERITY_FATAL_ERROR) { + severity = "[Fatal Error]"; + } + + System.err.println(severity + ": " + error.getMessage() + "\t"); + System.err.println("Type : " + error.getType() + "\t" + "Related Data: " + + error.getRelatedData() + "\t" + "Related Exception: " + + error.getRelatedException() ); + + return fail; + } +} diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMErrorImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMErrorImpl.java new file mode 100644 index 00000000000..a143f65491e --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMErrorImpl.java @@ -0,0 +1,176 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package com.sun.org.apache.xml.internal.serializer.dom3; + +import org.w3c.dom.DOMError; +import org.w3c.dom.DOMLocator; + +/** + * Implementation of the DOM Level 3 DOMError interface. + * + *

See also the DOMError Interface definition from Document Object Model (DOM) Level 3 Core Specification. + * + * @xsl.usage internal + */ + +final class DOMErrorImpl implements DOMError { + + /** private data members */ + + // The DOMError Severity + private short fSeverity = DOMError.SEVERITY_WARNING; + + // The Error message + private String fMessage = null; + + // A String indicating which related data is expected in relatedData. + private String fType; + + // The platform related exception + private Exception fException = null; + + // + private Object fRelatedData; + + // The location of the exception + private DOMLocatorImpl fLocation = new DOMLocatorImpl(); + + + // + // Constructors + // + + /** + * Default constructor. + */ + DOMErrorImpl () { + } + + /** + * @param severity + * @param message + * @param type + */ + DOMErrorImpl(short severity, String message, String type) { + fSeverity = severity; + fMessage = message; + fType = type; + } + + /** + * @param severity + * @param message + * @param type + * @param exception + */ + DOMErrorImpl(short severity, String message, String type, + Exception exception) { + fSeverity = severity; + fMessage = message; + fType = type; + fException = exception; + } + + /** + * @param severity + * @param message + * @param type + * @param exception + * @param relatedData + * @param location + */ + DOMErrorImpl(short severity, String message, String type, + Exception exception, Object relatedData, DOMLocatorImpl location) { + fSeverity = severity; + fMessage = message; + fType = type; + fException = exception; + fRelatedData = relatedData; + fLocation = location; + } + + + /** + * The severity of the error, either SEVERITY_WARNING, + * SEVERITY_ERROR, or SEVERITY_FATAL_ERROR. + * + * @return A short containing the DOMError severity + */ + public short getSeverity() { + return fSeverity; + } + + /** + * The DOMError message string. + * + * @return String + */ + public String getMessage() { + return fMessage; + } + + /** + * The location of the DOMError. + * + * @return A DOMLocator object containing the DOMError location. + */ + public DOMLocator getLocation() { + return fLocation; + } + + /** + * The related platform dependent exception if any. + * + * @return A java.lang.Exception + */ + public Object getRelatedException(){ + return fException; + } + + /** + * Returns a String indicating which related data is expected in relatedData. + * + * @return A String + */ + public String getType(){ + return fType; + } + + /** + * The related DOMError.type dependent data if any. + * + * @return java.lang.Object + */ + public Object getRelatedData(){ + return fRelatedData; + } + + public void reset(){ + fSeverity = DOMError.SEVERITY_WARNING; + fException = null; + fMessage = null; + fType = null; + fRelatedData = null; + fLocation = null; + } + +}// class DOMErrorImpl diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMLocatorImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMLocatorImpl.java new file mode 100644 index 00000000000..f0e87c340f4 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMLocatorImpl.java @@ -0,0 +1,180 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package com.sun.org.apache.xml.internal.serializer.dom3; + +import org.w3c.dom.DOMLocator; +import org.w3c.dom.Node; + + +/** + * DOMLocatorImpl is an implementaion that describes a location (e.g. + * where an error occured). + *

See also the Document Object Model (DOM) Level 3 Core Specification. + * This class is a copy of the Xerces-2J class org.apache.xerces.dom.DOMLocatorImpl.java v 1.10 + * + * @author Gopal Sharma, SUN Microsystems Inc. + * @version $Id: + * + * @xsl.usage internal + */ +final class DOMLocatorImpl implements DOMLocator { + + // + // Data + // + + /** + * The column number where the error occured, + * or -1 if there is no column number available. + */ + private final int fColumnNumber; + + /** + * The line number where the error occured, + * or -1 if there is no line number available. + */ + private final int fLineNumber; + + /** related data node*/ + private final Node fRelatedNode; + + /** + * The URI where the error occured, + * or null if there is no URI available. + */ + private final String fUri; + + /** + * The byte offset into the input source this locator is pointing to or -1 + * if there is no byte offset available + */ + private final int fByteOffset; + + /** + * The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646], + * offset into the input source this locator is pointing to or -1 if there + * is no UTF-16 offset available. + */ + private final int fUtf16Offset; + + // + // Constructors + // + + DOMLocatorImpl(){ + fColumnNumber = -1; + fLineNumber = -1; + fRelatedNode = null; + fUri = null; + fByteOffset = -1; + fUtf16Offset = -1; + } + + DOMLocatorImpl (int lineNumber, int columnNumber, String uri ){ + fLineNumber = lineNumber ; + fColumnNumber = columnNumber ; + fUri = uri; + + fRelatedNode = null; + fByteOffset = -1; + fUtf16Offset = -1; + } // DOMLocatorImpl (int lineNumber, int columnNumber, String uri ) + + DOMLocatorImpl (int lineNumber, int columnNumber, int utf16Offset, String uri ){ + fLineNumber = lineNumber ; + fColumnNumber = columnNumber ; + fUri = uri; + fUtf16Offset = utf16Offset; + + + fRelatedNode = null; + fByteOffset = -1; + } // DOMLocatorImpl (int lineNumber, int columnNumber, int utf16Offset, String uri ) + + DOMLocatorImpl (int lineNumber, int columnNumber, int byteoffset, Node relatedData, String uri ){ + fLineNumber = lineNumber ; + fColumnNumber = columnNumber ; + fByteOffset = byteoffset ; + fRelatedNode = relatedData ; + fUri = uri; + + fUtf16Offset = -1; + } // DOMLocatorImpl (int lineNumber, int columnNumber, int offset, Node errorNode, String uri ) + + DOMLocatorImpl (int lineNumber, int columnNumber, int byteoffset, Node relatedData, String uri, int utf16Offset ){ + fLineNumber = lineNumber ; + fColumnNumber = columnNumber ; + fByteOffset = byteoffset ; + fRelatedNode = relatedData ; + fUri = uri; + fUtf16Offset = utf16Offset; + } // DOMLocatorImpl (int lineNumber, int columnNumber, int offset, Node errorNode, String uri ) + + + /** + * The line number where the error occured, or -1 if there is no line + * number available. + */ + public int getLineNumber(){ + return fLineNumber; + } + + /** + * The column number where the error occured, or -1 if there is no column + * number available. + */ + public int getColumnNumber(){ + return fColumnNumber; + } + + + /** + * The URI where the error occured, or null if there is no URI available. + */ + public String getUri(){ + return fUri; + } + + + public Node getRelatedNode(){ + return fRelatedNode; + } + + + /** + * The byte offset into the input source this locator is pointing to or -1 + * if there is no byte offset available + */ + public int getByteOffset(){ + return fByteOffset; + } + + /** + * The UTF-16, as defined in [Unicode] and Amendment 1 of [ISO/IEC 10646], + * offset into the input source this locator is pointing to or -1 if there + * is no UTF-16 offset available. + */ + public int getUtf16Offset(){ + return fUtf16Offset; + } + +}// class DOMLocatorImpl diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMOutputImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMOutputImpl.java new file mode 100644 index 00000000000..d6c0a5d59a8 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMOutputImpl.java @@ -0,0 +1,177 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package com.sun.org.apache.xml.internal.serializer.dom3; + +import org.w3c.dom.ls.LSOutput; + +import java.io.Writer; +import java.io.OutputStream; + +/** + * This is a copy of the Xerces-2J class org.apache.xerces.dom.DOMOutputImpl.java + * + * This class represents an output destination for data. + * This interface allows an application to encapsulate information about an + * output destination in a single object, which may include a URI, a byte stream + * (possibly with a specifiedencoding), a base URI, and/or a character stream. + * The exact definitions of a byte stream and a character stream are binding + * dependent. + * The application is expected to provide objects that implement this interface + * whenever such objects are needed. The application can either provide its + * own objects that implement this interface, or it can use the generic factory + * method DOMImplementationLS.createLSOutput() to create objects that + * implement this interface. + * The DOMSerializer will use the LSOutput object to determine where to + * serialize the output to. The DOMSerializer will look at the different + * outputs specified in the LSOutput in the following order to know which one + * to output to, the first one that data can be output to will be used: + * 1.LSOutput.characterStream + * 2.LSOutput.byteStream + * 3.LSOutput.systemId + * LSOutput objects belong to the application. The DOM implementation will + * never modify them (though it may make copies and modify the copies, + * if necessary). + * + * + * @author Arun Yadav, Sun Microsytems + * @author Gopal Sharma, Sun Microsystems + * @version $Id : + * @xsl.usage internal + */ + +final class DOMOutputImpl implements LSOutput { + + private Writer fCharStream = null; + private OutputStream fByteStream = null; + private String fSystemId = null; + private String fEncoding = null; + + /** + * Default Constructor + */ + DOMOutputImpl() {} + + /** + * An attribute of a language and binding dependent type that represents a + * writable stream of bytes. If the application knows the character encoding + * of the byte stream, it should set the encoding attribute. Setting the + * encoding in this way will override any encoding specified in an XML + * declaration in the data. + */ + + public Writer getCharacterStream(){ + return fCharStream; + }; + + /** + * An attribute of a language and binding dependent type that represents a + * writable stream of bytes. If the application knows the character encoding + * of the byte stream, it should set the encoding attribute. Setting the + * encoding in this way will override any encoding specified in an XML + * declaration in the data. + */ + + public void setCharacterStream(Writer characterStream){ + fCharStream = characterStream; + }; + + /** + * Depending on the language binding in use, this attribute may not be + * available. An attribute of a language and binding dependent type that + * represents a writable stream to which 16-bit units can be output. The + * application must encode the stream using UTF-16 (defined in [Unicode] and + * Amendment 1 of [ISO/IEC 10646]). + */ + + public OutputStream getByteStream(){ + return fByteStream; + }; + + /** + * Depending on the language binding in use, this attribute may not be + * available. An attribute of a language and binding dependent type that + * represents a writable stream to which 16-bit units can be output. The + * application must encode the stream using UTF-16 (defined in [Unicode] and + * Amendment 1 of [ISO/IEC 10646]). + */ + + public void setByteStream(OutputStream byteStream){ + fByteStream = byteStream; + }; + + /** + * The system identifier, a URI reference [IETF RFC 2396], for this output + * destination. If the application knows the character encoding of the + * object pointed to by the system identifier, it can set the encoding + * using the encoding attribute. If the system ID is a relative URI + * reference (see section 5 in [IETF RFC 2396]), the behavior is + * implementation dependent. + */ + + public String getSystemId(){ + return fSystemId; + }; + + /** + * The system identifier, a URI reference [IETF RFC 2396], for this output + * destination. If the application knows the character encoding of the + * object pointed to by the system identifier, it can set the encoding + * using the encoding attribute. If the system ID is a relative URI + * reference (see section 5 in [IETF RFC 2396]), the behavior is + * implementation dependent. + */ + + public void setSystemId(String systemId){ + fSystemId = systemId; + }; + + /** + * The character encoding, if known. The encoding must be a string + * acceptable for an XML encoding declaration ([XML 1.0] section 4.3.3 + * "Character Encoding in Entities"). This attribute has no effect when the + * application provides a character stream or string data. For other sources + * of input, an encoding specified by means of this attribute will override + * any encoding specified in the XML declaration or the Text declaration, or + * an encoding obtained from a higher level protocol, such as HTTP + * [IETF RFC 2616]. + */ + + public String getEncoding(){ + return fEncoding; + }; + + /** + * The character encoding, if known. The encoding must be a string + * acceptable for an XML encoding declaration ([XML 1.0] section 4.3.3 + * "Character Encoding in Entities"). This attribute has no effect when the + * application provides a character stream or string data. For other sources + * of input, an encoding specified by means of this attribute will override + * any encoding specified in the XML declaration or the Text declaration, or + * an encoding obtained from a higher level protocol, such as HTTP + * [IETF RFC 2616]. + */ + + public void setEncoding(String encoding){ + fEncoding = encoding; + }; + +}//DOMOutputImpl diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMStringListImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMStringListImpl.java new file mode 100644 index 00000000000..11eac2aa2e8 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/DOMStringListImpl.java @@ -0,0 +1,99 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ +package com.sun.org.apache.xml.internal.serializer.dom3; + +import java.util.Vector; + +//import org.apache.xerces.dom3.DOMStringList; +import org.w3c.dom.DOMStringList; + +/** + * This class implemets the DOM Level 3 Core interface DOMStringList. + * + * @xsl.usage internal + */ +final class DOMStringListImpl implements DOMStringList { + + //A collection of DOMString values + private Vector fStrings; + + /** + * Construct an empty list of DOMStringListImpl + */ + DOMStringListImpl() { + fStrings = new Vector(); + } + + /** + * Construct an empty list of DOMStringListImpl + */ + DOMStringListImpl(Vector params) { + fStrings = params; + } + + /** + * Construct an empty list of DOMStringListImpl + */ + DOMStringListImpl(String[] params ) { + fStrings = new Vector(); + if (params != null) { + for (int i=0; i < params.length; i++) { + fStrings.add(params[i]); + } + } + } + + /** + * @see org.apache.xerces.dom3.DOMStringList#item(int) + */ + public String item(int index) { + try { + return (String) fStrings.elementAt(index); + } catch (ArrayIndexOutOfBoundsException e) { + return null; + } + } + + /** + * @see org.apache.xerces.dom3.DOMStringList#getLength() + */ + public int getLength() { + return fStrings.size(); + } + + /** + * @see org.apache.xerces.dom3.DOMStringList#contains(String) + */ + public boolean contains(String param) { + return fStrings.contains(param) ; + } + + /** + * DOM Internal: + * Add a DOMString to the list. + * + * @param domString A string to add to the list + */ + public void add(String param) { + fStrings.add(param); + } + +} diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/LSSerializerImpl.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/LSSerializerImpl.java new file mode 100644 index 00000000000..5ab43abad0e --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/LSSerializerImpl.java @@ -0,0 +1,1405 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package com.sun.org.apache.xml.internal.serializer.dom3; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.UnsupportedEncodingException; +import java.io.Writer; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLConnection; +import java.util.Properties; + +import com.sun.org.apache.xml.internal.serializer.DOM3Serializer; +import com.sun.org.apache.xml.internal.serializer.Encodings; +import com.sun.org.apache.xml.internal.serializer.Serializer; +import com.sun.org.apache.xml.internal.serializer.OutputPropertiesFactory; +import com.sun.org.apache.xml.internal.serializer.SerializerFactory; +import com.sun.org.apache.xml.internal.serializer.utils.MsgKey; +import com.sun.org.apache.xml.internal.serializer.utils.Utils; +import com.sun.org.apache.xml.internal.serializer.utils.SystemIDResolver; +import org.w3c.dom.DOMConfiguration; +import org.w3c.dom.DOMError; +import org.w3c.dom.DOMErrorHandler; +import org.w3c.dom.DOMException; +import org.w3c.dom.DOMStringList; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.ls.LSException; +import org.w3c.dom.ls.LSOutput; +import org.w3c.dom.ls.LSSerializer; +import org.w3c.dom.ls.LSSerializerFilter; + + +/** + * Implemenatation of DOM Level 3 org.w3c.ls.LSSerializer and + * org.w3c.dom.ls.DOMConfiguration. Serialization is achieved by delegating + * serialization calls to org.apache.xml.serializer.ToStream or + * one of its derived classes depending on the serialization method, while walking + * the DOM in DOM3TreeWalker. + * @see org.w3c.dom.ls.LSSerializer + * @see org.w3c.dom.DOMConfiguration + * + * @version $Id: + * + * @xsl.usage internal + */ +final public class LSSerializerImpl implements DOMConfiguration, LSSerializer { + + /** private data members */ + private Serializer fXMLSerializer = null; + + // Tracks DOMConfiguration features. + protected int fFeatures = 0; + + // Common DOM serializer + private DOM3Serializer fDOMSerializer = null; + + // A filter set on the LSSerializer + private LSSerializerFilter fSerializerFilter = null; + + // Stores the nodeArg parameter to speed up multiple writes of the same node. + private Node fVisitedNode = null; + + // The end-of-line character sequence used in serialization. "\n" is whats used on the web. + private String fEndOfLine = "\n"; + + // The DOMErrorhandler. + private DOMErrorHandler fDOMErrorHandler = null; + + // The Configuration parameter to pass to the Underlying serilaizer. + private Properties fDOMConfigProperties = null; + + // The encoding to use during serialization. + private String fEncoding; + + // ************************************************************************ + // DOM Level 3 DOM Configuration parameter names + // ************************************************************************ + // Parameter canonical-form, true [optional] - NOT SUPPORTED + private final static int CANONICAL = 0x1 << 0; + + // Parameter cdata-sections, true [required] (default) + private final static int CDATA = 0x1 << 1; + + // Parameter check-character-normalization, true [optional] - NOT SUPPORTED + private final static int CHARNORMALIZE = 0x1 << 2; + + // Parameter comments, true [required] (default) + private final static int COMMENTS = 0x1 << 3; + + // Parameter datatype-normalization, true [optional] - NOT SUPPORTED + private final static int DTNORMALIZE = 0x1 << 4; + + // Parameter element-content-whitespace, true [required] (default) - value - false [optional] NOT SUPPORTED + private final static int ELEM_CONTENT_WHITESPACE = 0x1 << 5; + + // Parameter entities, true [required] (default) + private final static int ENTITIES = 0x1 << 6; + + // Parameter infoset, true [required] (default), false has no effect --> True has no effect for the serializer + private final static int INFOSET = 0x1 << 7; + + // Parameter namespaces, true [required] (default) + private final static int NAMESPACES = 0x1 << 8; + + // Parameter namespace-declarations, true [required] (default) + private final static int NAMESPACEDECLS = 0x1 << 9; + + // Parameter normalize-characters, true [optional] - NOT SUPPORTED + private final static int NORMALIZECHARS = 0x1 << 10; + + // Parameter split-cdata-sections, true [required] (default) + private final static int SPLITCDATA = 0x1 << 11; + + // Parameter validate, true [optional] - NOT SUPPORTED + private final static int VALIDATE = 0x1 << 12; + + // Parameter validate-if-schema, true [optional] - NOT SUPPORTED + private final static int SCHEMAVALIDATE = 0x1 << 13; + + // Parameter split-cdata-sections, true [required] (default) + private final static int WELLFORMED = 0x1 << 14; + + // Parameter discard-default-content, true [required] (default) + // Not sure how this will be used in level 2 Documents + private final static int DISCARDDEFAULT = 0x1 << 15; + + // Parameter format-pretty-print, true [optional] + private final static int PRETTY_PRINT = 0x1 << 16; + + // Parameter ignore-unknown-character-denormalizations, true [required] (default) + // We currently do not support XML 1.1 character normalization + private final static int IGNORE_CHAR_DENORMALIZE = 0x1 << 17; + + // Parameter discard-default-content, true [required] (default) + private final static int XMLDECL = 0x1 << 18; + // ************************************************************************ + + // Recognized parameters for which atleast one value can be set + private String fRecognizedParameters [] = { + DOMConstants.DOM_CANONICAL_FORM, + DOMConstants.DOM_CDATA_SECTIONS, + DOMConstants.DOM_CHECK_CHAR_NORMALIZATION, + DOMConstants.DOM_COMMENTS, + DOMConstants.DOM_DATATYPE_NORMALIZATION, + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, + DOMConstants.DOM_ENTITIES, + DOMConstants.DOM_INFOSET, + DOMConstants.DOM_NAMESPACES, + DOMConstants.DOM_NAMESPACE_DECLARATIONS, + //DOMConstants.DOM_NORMALIZE_CHARACTERS, + DOMConstants.DOM_SPLIT_CDATA, + DOMConstants.DOM_VALIDATE, + DOMConstants.DOM_VALIDATE_IF_SCHEMA, + DOMConstants.DOM_WELLFORMED, + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, + DOMConstants.DOM_FORMAT_PRETTY_PRINT, + DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS, + DOMConstants.DOM_XMLDECL, + DOMConstants.DOM_ERROR_HANDLER + }; + + + /** + * Constructor: Creates a LSSerializerImpl object. The underlying + * XML 1.0 or XML 1.1 org.apache.xml.serializer.Serializer object is + * created and initialized the first time any of the write methods are + * invoked to serialize the Node. Subsequent write methods on the same + * LSSerializerImpl object will use the previously created Serializer object. + */ + public LSSerializerImpl () { + // set default parameters + fFeatures |= CDATA; + fFeatures |= COMMENTS; + fFeatures |= ELEM_CONTENT_WHITESPACE; + fFeatures |= ENTITIES; + fFeatures |= NAMESPACES; + fFeatures |= NAMESPACEDECLS; + fFeatures |= SPLITCDATA; + fFeatures |= WELLFORMED; + fFeatures |= DISCARDDEFAULT; + fFeatures |= XMLDECL; + + // New OutputFormat properties + fDOMConfigProperties = new Properties(); + + // Initialize properties to be passed on the underlying serializer + initializeSerializerProps(); + + // Read output_xml.properties and System Properties to initialize properties + Properties configProps = OutputPropertiesFactory.getDefaultMethodProperties("xml"); + + // change xml version from 1.0 to 1.1 + //configProps.setProperty("version", "1.1"); + + // Get a serializer that seriailizes according to the properties, + // which in this case is to xml + fXMLSerializer = SerializerFactory.getSerializer(configProps); + + // Initialize Serializer + fXMLSerializer.setOutputFormat(fDOMConfigProperties); + } + + /** + * Initializes the underlying serializer's configuration depending on the + * default DOMConfiguration parameters. This method must be called before a + * node is to be serialized. + * + * @xsl.usage internal + */ + public void initializeSerializerProps () { + // canonical-form + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CANONICAL_FORM, DOMConstants.DOM3_DEFAULT_FALSE); + + // cdata-sections + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_DEFAULT_TRUE); + + // "check-character-normalization" + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CHECK_CHAR_NORMALIZATION, + DOMConstants.DOM3_DEFAULT_FALSE); + + // comments + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_DEFAULT_TRUE); + + // datatype-normalization + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DATATYPE_NORMALIZATION, + DOMConstants.DOM3_DEFAULT_FALSE); + + // element-content-whitespace + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, + DOMConstants.DOM3_DEFAULT_TRUE); + + // entities + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_DEFAULT_TRUE); + // preserve entities + fDOMConfigProperties.setProperty( + OutputPropertiesFactory.S_KEY_ENTITIES, DOMConstants.S_XSL_VALUE_ENTITIES); + + // error-handler + // Should we set our default ErrorHandler + /* + * if (fDOMConfig.getParameter(Constants.DOM_ERROR_HANDLER) != null) { + * fDOMErrorHandler = + * (DOMErrorHandler)fDOMConfig.getParameter(Constants.DOM_ERROR_HANDLER); } + */ + + // infoset + if ((fFeatures & INFOSET) != 0) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_DEFAULT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACE_DECLARATIONS, + DOMConstants.DOM3_DEFAULT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_DEFAULT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, + DOMConstants.DOM3_DEFAULT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_DEFAULT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_DEFAULT_FALSE); + // preserve entities + fDOMConfigProperties.setProperty( + OutputPropertiesFactory.S_KEY_ENTITIES, ""); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CDATA_SECTIONS, + DOMConstants.DOM3_DEFAULT_FALSE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_VALIDATE_IF_SCHEMA, + DOMConstants.DOM3_DEFAULT_FALSE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DATATYPE_NORMALIZATION, + DOMConstants.DOM3_DEFAULT_FALSE); + } + + // namespaces + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_DEFAULT_TRUE); + + // namespace-declarations + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACE_DECLARATIONS, + DOMConstants.DOM3_DEFAULT_TRUE); + + // normalize-characters + /* + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NORMALIZE_CHARACTERS, + DOMConstants.DOM3_DEFAULT_FALSE); + */ + + // split-cdata-sections + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_DEFAULT_TRUE); + + // validate + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_VALIDATE, DOMConstants.DOM3_DEFAULT_FALSE); + + // validate-if-schema + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_VALIDATE_IF_SCHEMA, + DOMConstants.DOM3_DEFAULT_FALSE); + + // well-formed + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_DEFAULT_TRUE); + + // pretty-print + fDOMConfigProperties.setProperty( + DOMConstants.S_XSL_OUTPUT_INDENT, + DOMConstants.DOM3_DEFAULT_FALSE); + fDOMConfigProperties.setProperty( + OutputPropertiesFactory.S_KEY_INDENT_AMOUNT, Integer.toString(4)); + + // + + // discard-default-content + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, + DOMConstants.DOM3_DEFAULT_TRUE); + + // xml-declaration + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "no"); + + } + + // ************************************************************************ + // DOMConfiguraiton implementation + // ************************************************************************ + + /** + * Checks if setting a parameter to a specific value is supported. + * + * @see org.w3c.dom.DOMConfiguration#canSetParameter(java.lang.String, java.lang.Object) + * @since DOM Level 3 + * @param name A String containing the DOMConfiguration parameter name. + * @param value An Object specifying the value of the corresponding parameter. + */ + public boolean canSetParameter(String name, Object value) { + if (value instanceof Boolean){ + if ( name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS) + || name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS) + || name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES) + || name.equalsIgnoreCase(DOMConstants.DOM_INFOSET) + || name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE) + || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES) + || name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS) + || name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA) + || name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED) + || name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT) + || name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT) + || name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)){ + // both values supported + return true; + } + else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) + || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) + || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) + || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA) + || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) + // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) + ) { + // true is not supported + return !((Boolean)value).booleanValue(); + } + else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) { + // false is not supported + return ((Boolean)value).booleanValue(); + } + } + else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER) && + value == null || value instanceof DOMErrorHandler){ + return true; + } + return false; + } + /** + * This method returns the value of a parameter if known. + * + * @see org.w3c.dom.DOMConfiguration#getParameter(java.lang.String) + * + * @param name A String containing the DOMConfiguration parameter name + * whose value is to be returned. + * @return Object The value of the parameter if known. + */ + public Object getParameter(String name) throws DOMException { + + if(name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)){ + return null; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) { + return ((fFeatures & COMMENTS) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) { + return ((fFeatures & CDATA) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) { + return ((fFeatures & ENTITIES) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) { + return ((fFeatures & NAMESPACES) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) { + return ((fFeatures & NAMESPACEDECLS) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) { + return ((fFeatures & SPLITCDATA) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) { + return ((fFeatures & WELLFORMED) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) { + return ((fFeatures & DISCARDDEFAULT) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { + return ((fFeatures & PRETTY_PRINT) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) { + return ((fFeatures & XMLDECL) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) { + return ((fFeatures & ELEM_CONTENT_WHITESPACE) != 0) ? Boolean.TRUE : Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) { + return Boolean.TRUE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) + || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) + || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) + // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) + || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) + || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { + return Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)){ + if ((fFeatures & ENTITIES) == 0 && + (fFeatures & CDATA) == 0 && + (fFeatures & ELEM_CONTENT_WHITESPACE) != 0 && + (fFeatures & NAMESPACES) != 0 && + (fFeatures & NAMESPACEDECLS) != 0 && + (fFeatures & WELLFORMED) != 0 && + (fFeatures & COMMENTS) != 0) { + return Boolean.TRUE; + } + return Boolean.FALSE; + } else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) { + return fDOMErrorHandler; + } else if ( + name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) + || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE)) { + return null; + } else { + // Here we have to add the Xalan specific DOM Message Formatter + String msg = Utils.messages.createMessage( + MsgKey.ER_FEATURE_NOT_FOUND, + new Object[] { name }); + throw new DOMException(DOMException.NOT_FOUND_ERR, msg); + } + } + + /** + * This method returns a of the parameters supported by this DOMConfiguration object + * and for which at least one value can be set by the application + * + * @see org.w3c.dom.DOMConfiguration#getParameterNames() + * + * @return DOMStringList A list of DOMConfiguration parameters recognized + * by the serializer + */ + public DOMStringList getParameterNames() { + return new DOMStringListImpl(fRecognizedParameters); + } + + /** + * This method sets the value of the named parameter. + * + * @see org.w3c.dom.DOMConfiguration#setParameter(java.lang.String, java.lang.Object) + * + * @param name A String containing the DOMConfiguration parameter name. + * @param value An Object contaiing the parameters value to set. + */ + public void setParameter(String name, Object value) throws DOMException { + // If the value is a boolean + if (value instanceof Boolean) { + boolean state = ((Boolean) value).booleanValue(); + + if (name.equalsIgnoreCase(DOMConstants.DOM_COMMENTS)) { + fFeatures = state ? fFeatures | COMMENTS : fFeatures + & ~COMMENTS; + // comments + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_CDATA_SECTIONS)) { + fFeatures = state ? fFeatures | CDATA : fFeatures + & ~CDATA; + // cdata-sections + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_ENTITIES)) { + fFeatures = state ? fFeatures | ENTITIES : fFeatures + & ~ENTITIES; + // entities + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_TRUE); + fDOMConfigProperties.setProperty( + OutputPropertiesFactory.S_KEY_ENTITIES, DOMConstants.S_XSL_VALUE_ENTITIES); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_NAMESPACES)) { + fFeatures = state ? fFeatures | NAMESPACES : fFeatures + & ~NAMESPACES; + // namespaces + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name + .equalsIgnoreCase(DOMConstants.DOM_NAMESPACE_DECLARATIONS)) { + fFeatures = state ? fFeatures | NAMESPACEDECLS + : fFeatures & ~NAMESPACEDECLS; + // namespace-declarations + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_SPLIT_CDATA)) { + fFeatures = state ? fFeatures | SPLITCDATA : fFeatures + & ~SPLITCDATA; + // split-cdata-sections + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_SPLIT_CDATA, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_WELLFORMED)) { + fFeatures = state ? fFeatures | WELLFORMED : fFeatures + & ~WELLFORMED; + // well-formed + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name + .equalsIgnoreCase(DOMConstants.DOM_DISCARD_DEFAULT_CONTENT)) { + fFeatures = state ? fFeatures | DISCARDDEFAULT + : fFeatures & ~DISCARDDEFAULT; + // discard-default-content + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DISCARD_DEFAULT_CONTENT, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_FORMAT_PRETTY_PRINT)) { + fFeatures = state ? fFeatures | PRETTY_PRINT : fFeatures + & ~PRETTY_PRINT; + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_INDENT,DOMConstants.DOM3_EXPLICIT_TRUE); + fDOMConfigProperties.setProperty(OutputPropertiesFactory.S_KEY_INDENT_AMOUNT, Integer.toString(4)); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_INDENT,DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_XMLDECL)) { + fFeatures = state ? fFeatures | XMLDECL : fFeatures + & ~XMLDECL; + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "no"); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, "yes"); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE)) { + fFeatures = state ? fFeatures | ELEM_CONTENT_WHITESPACE : fFeatures + & ~ELEM_CONTENT_WHITESPACE; + // element-content-whitespace + if (state) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_FALSE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS)) { + // false is not supported + if (!state) { + // Here we have to add the Xalan specific DOM Message Formatter + String msg = Utils.messages.createMessage( + MsgKey.ER_FEATURE_NOT_SUPPORTED, + new Object[] { name }); + throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); + } else { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM) + || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA) + || name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE) + || name.equalsIgnoreCase(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION) + || name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION) + // || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) + ) { + // true is not supported + if (state) { + String msg = Utils.messages.createMessage( + MsgKey.ER_FEATURE_NOT_SUPPORTED, + new Object[] { name }); + throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); + } else { + if (name.equalsIgnoreCase(DOMConstants.DOM_CANONICAL_FORM)) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CANONICAL_FORM, DOMConstants.DOM3_EXPLICIT_FALSE); + } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE); + } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE)) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_VALIDATE, DOMConstants.DOM3_EXPLICIT_FALSE); + } else if (name.equalsIgnoreCase(DOMConstants.DOM_VALIDATE_IF_SCHEMA)) { + fDOMConfigProperties.setProperty(DOMConstants.DOM_CHECK_CHAR_NORMALIZATION + + DOMConstants.DOM_CHECK_CHAR_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); + } else if (name.equalsIgnoreCase(DOMConstants.DOM_DATATYPE_NORMALIZATION)) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); + } /* else if (name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)) { + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NORMALIZE_CHARACTERS, DOMConstants.DOM3_EXPLICIT_FALSE); + } */ + } + } else if (name.equalsIgnoreCase(DOMConstants.DOM_INFOSET)) { + if (state) { + fFeatures &= ~ENTITIES; + fFeatures &= ~CDATA; + fFeatures &= ~SCHEMAVALIDATE; + fFeatures &= ~DTNORMALIZE; + fFeatures |= NAMESPACES; + fFeatures |= NAMESPACEDECLS; + fFeatures |= WELLFORMED; + fFeatures |= ELEM_CONTENT_WHITESPACE; + fFeatures |= COMMENTS; + } + + // infoset + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACES, DOMConstants.DOM3_EXPLICIT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_NAMESPACE_DECLARATIONS, DOMConstants.DOM3_EXPLICIT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_COMMENTS, DOMConstants.DOM3_EXPLICIT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ELEMENT_CONTENT_WHITESPACE, DOMConstants.DOM3_EXPLICIT_TRUE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_WELLFORMED, DOMConstants.DOM3_EXPLICIT_TRUE); + + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_ENTITIES, DOMConstants.DOM3_EXPLICIT_FALSE); + fDOMConfigProperties.setProperty( + OutputPropertiesFactory.S_KEY_ENTITIES, ""); + + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_CDATA_SECTIONS, DOMConstants.DOM3_EXPLICIT_FALSE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_VALIDATE_IF_SCHEMA, DOMConstants.DOM3_EXPLICIT_FALSE); + fDOMConfigProperties.setProperty(DOMConstants.S_DOM3_PROPERTIES_NS + + DOMConstants.DOM_DATATYPE_NORMALIZATION, DOMConstants.DOM3_EXPLICIT_FALSE); + } else if (name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS)) { + String msg = Utils.messages.createMessage( + MsgKey.ER_FEATURE_NOT_SUPPORTED, + new Object[] { name }); + throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); + } else { + // Setting this to false has no effect + } + } // If the parameter value is not a boolean + else if (name.equalsIgnoreCase(DOMConstants.DOM_ERROR_HANDLER)) { + if (value == null || value instanceof DOMErrorHandler) { + fDOMErrorHandler = (DOMErrorHandler)value; + } else { + String msg = Utils.messages.createMessage( + MsgKey.ER_TYPE_MISMATCH_ERR, + new Object[] { name }); + throw new DOMException(DOMException.TYPE_MISMATCH_ERR, msg); + } + } else if ( + name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_LOCATION) + || name.equalsIgnoreCase(DOMConstants.DOM_SCHEMA_TYPE) + || name.equalsIgnoreCase(DOMConstants.DOM_NORMALIZE_CHARACTERS) + && value != null) { + String msg = Utils.messages.createMessage( + MsgKey.ER_FEATURE_NOT_SUPPORTED, + new Object[] { name }); + throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg); + } else { + String msg = Utils.messages.createMessage( + MsgKey.ER_FEATURE_NOT_FOUND, + new Object[] { name }); + throw new DOMException(DOMException.NOT_FOUND_ERR, msg); + } + } + // ************************************************************************ + + + // ************************************************************************ + // DOMConfiguraiton implementation + // ************************************************************************ + + /** + * Returns the DOMConfiguration of the LSSerializer. + * + * @see org.w3c.dom.ls.LSSerializer#getDomConfig() + * @since DOM Level 3 + * @return A DOMConfiguration object. + */ + public DOMConfiguration getDomConfig() { + return (DOMConfiguration)this; + } + + /** + * Returns the DOMConfiguration of the LSSerializer. + * + * @see org.w3c.dom.ls.LSSerializer#getFilter() + * @since DOM Level 3 + * @return A LSSerializerFilter object. + */ + public LSSerializerFilter getFilter() { + return fSerializerFilter; + } + + /** + * Returns the End-Of-Line sequence of characters to be used in the XML + * being serialized. If none is set a default "\n" is returned. + * + * @see org.w3c.dom.ls.LSSerializer#getNewLine() + * @since DOM Level 3 + * @return A String containing the end-of-line character sequence used in + * serialization. + */ + public String getNewLine() { + return fEndOfLine; + } + + /** + * Set a LSSerilizerFilter on the LSSerializer. When set, the filter is + * called before each node is serialized which depending on its implemention + * determines if the node is to be serialized or not. + * + * @see org.w3c.dom.ls.LSSerializer#setFilter + * @since DOM Level 3 + * @param filter A LSSerializerFilter to be applied to the stream to serialize. + */ + public void setFilter(LSSerializerFilter filter) { + fSerializerFilter = filter; + } + + /** + * Sets the End-Of-Line sequence of characters to be used in the XML + * being serialized. Setting this attribute to null will reset its + * value to the default value i.e. "\n". + * + * @see org.w3c.dom.ls.LSSerializer#setNewLine + * @since DOM Level 3 + * @param newLine a String that is the end-of-line character sequence to be used in + * serialization. + */ + public void setNewLine(String newLine) { + fEndOfLine = newLine !=null? newLine: fEndOfLine; + } + + /** + * Serializes the specified node to the specified LSOutput and returns true if the Node + * was successfully serialized. + * + * @see org.w3c.dom.ls.LSSerializer#write(org.w3c.dom.Node, org.w3c.dom.ls.LSOutput) + * @since DOM Level 3 + * @param nodeArg The Node to serialize. + * @throws org.w3c.dom.ls.LSException SERIALIZE_ERR: Raised if the + * LSSerializer was unable to serialize the node. + * + */ + public boolean write(Node nodeArg, LSOutput destination) throws LSException { + // If the destination is null + if (destination == null) { + String msg = Utils.messages + .createMessage( + MsgKey.ER_NO_OUTPUT_SPECIFIED, + null); + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, msg, + MsgKey.ER_NO_OUTPUT_SPECIFIED)); + } + throw new LSException(LSException.SERIALIZE_ERR, msg); + } + + // If nodeArg is null, return false. Should we throw and LSException instead? + if (nodeArg == null ) { + return false; + } + + // Obtain a reference to the serializer to use + // Serializer serializer = getXMLSerializer(xmlVersion); + Serializer serializer = fXMLSerializer; + serializer.reset(); + + // If the node has not been seen + if ( nodeArg != fVisitedNode) { + // Determine the XML Document version of the Node + String xmlVersion = getXMLVersion(nodeArg); + + // Determine the encoding: 1.LSOutput.encoding, 2.Document.inputEncoding, 3.Document.xmlEncoding. + fEncoding = destination.getEncoding(); + if (fEncoding == null ) { + fEncoding = getInputEncoding(nodeArg); + fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg); + } + + // If the encoding is not recognized throw an exception. + // Note: The serializer defaults to UTF-8 when created + if (!Encodings.isRecognizedEncoding(fEncoding)) { + String msg = Utils.messages + .createMessage( + MsgKey.ER_UNSUPPORTED_ENCODING, + null); + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, msg, + MsgKey.ER_UNSUPPORTED_ENCODING)); + } + throw new LSException(LSException.SERIALIZE_ERR, msg); + } + + serializer.getOutputFormat().setProperty("version", xmlVersion); + + // Set the output encoding and xml version properties + fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding); + + // If the node to be serialized is not a Document, Element, or Entity + // node + // then the XML declaration, or text declaration, should be never be + // serialized. + if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE + || nodeArg.getNodeType() != Node.ELEMENT_NODE + || nodeArg.getNodeType() != Node.ENTITY_NODE) + && ((fFeatures & XMLDECL) != 0)) { + fDOMConfigProperties.setProperty( + DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, + DOMConstants.DOM3_DEFAULT_FALSE); + } + + fVisitedNode = nodeArg; + } + + // Update the serializer properties + fXMLSerializer.setOutputFormat(fDOMConfigProperties); + + // + try { + + // The LSSerializer will use the LSOutput object to determine + // where to serialize the output to in the following order the + // first one that is not null and not an empty string will be + // used: 1.LSOutput.characterStream, 2.LSOutput.byteStream, + // 3. LSOutput.systemId + // 1.LSOutput.characterStream + Writer writer = destination.getCharacterStream(); + if (writer == null ) { + + // 2.LSOutput.byteStream + OutputStream outputStream = destination.getByteStream(); + if ( outputStream == null) { + + // 3. LSOutput.systemId + String uri = destination.getSystemId(); + if (uri == null) { + String msg = Utils.messages + .createMessage( + MsgKey.ER_NO_OUTPUT_SPECIFIED, + null); + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, msg, + MsgKey.ER_NO_OUTPUT_SPECIFIED)); + } + throw new LSException(LSException.SERIALIZE_ERR, msg); + + } else { + // Expand the System Id and obtain an absolute URI for it. + String absoluteURI = SystemIDResolver.getAbsoluteURI(uri); + + URL url = new URL(absoluteURI); + OutputStream urlOutStream = null; + String protocol = url.getProtocol(); + String host = url.getHost(); + + // For file protocols, there is no need to use a URL to get its + // corresponding OutputStream + + // Scheme names consist of a sequence of characters. The lower case + // letters "a"--"z", digits, and the characters plus ("+"), period + // ("."), and hyphen ("-") are allowed. For resiliency, programs + // interpreting URLs should treat upper case letters as equivalent to + // lower case in scheme names (e.g., allow "HTTP" as well as "http"). + if (protocol.equalsIgnoreCase("file") + && (host == null || host.length() == 0 || host.equals("localhost"))) { + // do we also need to check for host.equals(hostname) + urlOutStream = new FileOutputStream(new File(url.getPath())); + + } else { + // This should support URL's whose schemes are mentioned in + // RFC1738 other than file + + URLConnection urlCon = url.openConnection(); + urlCon.setDoInput(false); + urlCon.setDoOutput(true); + urlCon.setUseCaches(false); + urlCon.setAllowUserInteraction(false); + + // When writing to a HTTP URI, a HTTP PUT is performed. + if (urlCon instanceof HttpURLConnection) { + HttpURLConnection httpCon = (HttpURLConnection) urlCon; + httpCon.setRequestMethod("PUT"); + } + urlOutStream = urlCon.getOutputStream(); + } + // set the OutputStream to that obtained from the systemId + serializer.setWriter(new OutputStreamWriter(urlOutStream)); + } + } else { + // 2.LSOutput.byteStream + serializer.setWriter(new OutputStreamWriter(outputStream, fEncoding)); + } + } else { + // 1.LSOutput.characterStream + serializer.setWriter(writer); + } + + // The associated media type by default is set to text/xml on + // org.apache.xml.serializer.SerializerBase. + + // Get a reference to the serializer then lets you serilize a DOM + // Use this hack till Xalan support JAXP1.3 + if (fDOMSerializer == null) { + fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); + } + + // Set the error handler on the DOM3Serializer interface implementation + if (fDOMErrorHandler != null) { + fDOMSerializer.setErrorHandler(fDOMErrorHandler); + } + + // Set the filter on the DOM3Serializer interface implementation + if (fSerializerFilter != null) { + fDOMSerializer.setNodeFilter(fSerializerFilter); + } + + // Set the NewLine character to be used + fDOMSerializer.setNewLine(fEndOfLine); + + // Serializer your DOM, where node is an org.w3c.dom.Node + // Assuming that Xalan's serializer can serialize any type of DOM node + fDOMSerializer.serializeDOM3(nodeArg); + + } catch( UnsupportedEncodingException ue) { + + String msg = Utils.messages + .createMessage( + MsgKey.ER_UNSUPPORTED_ENCODING, + null); + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, msg, + MsgKey.ER_UNSUPPORTED_ENCODING, ue)); + } + throw new LSException(LSException.SERIALIZE_ERR, ue.getMessage()); + } catch (LSException lse) { + // Rethrow LSException. + throw lse; + } catch (RuntimeException e) { + e.printStackTrace(); + throw new LSException(LSException.SERIALIZE_ERR, e!=null?e.getMessage():"NULL Exception") ; + } catch (Exception e) { + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), + null, e)); + } + e.printStackTrace(); + throw new LSException(LSException.SERIALIZE_ERR, e.toString()); + } + return true; + } + + /** + * Serializes the specified node and returns a String with the serialized + * data to the caller. + * + * @see org.w3c.dom.ls.LSSerializer#writeToString(org.w3c.dom.Node) + * @since DOM Level 3 + * @param nodeArg The Node to serialize. + * @throws org.w3c.dom.ls.LSException SERIALIZE_ERR: Raised if the + * LSSerializer was unable to serialize the node. + * + */ + public String writeToString(Node nodeArg) throws DOMException, LSException { + // return null is nodeArg is null. Should an Exception be thrown instead? + if (nodeArg == null) { + return null; + } + + // Should we reset the serializer configuration before each write operation? + // Obtain a reference to the serializer to use + Serializer serializer = fXMLSerializer; + serializer.reset(); + + if (nodeArg != fVisitedNode){ + // Determine the XML Document version of the Node + String xmlVersion = getXMLVersion(nodeArg); + + serializer.getOutputFormat().setProperty("version", xmlVersion); + + // Set the output encoding and xml version properties + fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, "UTF-16"); + + // If the node to be serialized is not a Document, Element, or Entity + // node + // then the XML declaration, or text declaration, should be never be + // serialized. + if ((nodeArg.getNodeType() != Node.DOCUMENT_NODE + || nodeArg.getNodeType() != Node.ELEMENT_NODE + || nodeArg.getNodeType() != Node.ENTITY_NODE) + && ((fFeatures & XMLDECL) != 0)) { + fDOMConfigProperties.setProperty( + DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, + DOMConstants.DOM3_DEFAULT_FALSE); + } + + fVisitedNode = nodeArg; + } + // Update the serializer properties + fXMLSerializer.setOutputFormat(fDOMConfigProperties); + + // StringWriter to Output to + StringWriter output = new StringWriter(); + + // + try { + + // Set the Serializer's Writer to a StringWriter + serializer.setWriter(output); + + // Get a reference to the serializer then lets you serilize a DOM + // Use this hack till Xalan support JAXP1.3 + if (fDOMSerializer == null) { + fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); + } + + // Set the error handler on the DOM3Serializer interface implementation + if (fDOMErrorHandler != null) { + fDOMSerializer.setErrorHandler(fDOMErrorHandler); + } + + // Set the filter on the DOM3Serializer interface implementation + if (fSerializerFilter != null) { + fDOMSerializer.setNodeFilter(fSerializerFilter); + } + + // Set the NewLine character to be used + fDOMSerializer.setNewLine(fEndOfLine); + + // Serializer your DOM, where node is an org.w3c.dom.Node + fDOMSerializer.serializeDOM3(nodeArg); + } catch (LSException lse) { + // Rethrow LSException. + throw lse; + } catch (RuntimeException e) { + e.printStackTrace(); + throw new LSException(LSException.SERIALIZE_ERR, e.toString()); + } catch (Exception e) { + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), + null, e)); + } + e.printStackTrace(); + throw new LSException(LSException.SERIALIZE_ERR, e.toString()); + } + + // return the serialized string + return output.toString(); + } + + /** + * Serializes the specified node to the specified URI and returns true if the Node + * was successfully serialized. + * + * @see org.w3c.dom.ls.LSSerializer#writeToURI(org.w3c.dom.Node, String) + * @since DOM Level 3 + * @param nodeArg The Node to serialize. + * @throws org.w3c.dom.ls.LSException SERIALIZE_ERR: Raised if the + * LSSerializer was unable to serialize the node. + * + */ + public boolean writeToURI(Node nodeArg, String uri) throws LSException { + // If nodeArg is null, return false. Should we throw and LSException instead? + if (nodeArg == null ) { + return false; + } + + // Obtain a reference to the serializer to use + Serializer serializer = fXMLSerializer; + serializer.reset(); + + if (nodeArg != fVisitedNode) { + // Determine the XML Document version of the Node + String xmlVersion = getXMLVersion(nodeArg); + + // Determine the encoding: 1.LSOutput.encoding, + // 2.Document.inputEncoding, 3.Document.xmlEncoding. + fEncoding = getInputEncoding(nodeArg); + if (fEncoding == null ) { + fEncoding = fEncoding != null ? fEncoding : getXMLEncoding(nodeArg) == null? "UTF-8": getXMLEncoding(nodeArg); + } + + serializer.getOutputFormat().setProperty("version", xmlVersion); + + // Set the output encoding and xml version properties + fDOMConfigProperties.setProperty(DOMConstants.S_XERCES_PROPERTIES_NS + DOMConstants.S_XML_VERSION, xmlVersion); + fDOMConfigProperties.setProperty(DOMConstants.S_XSL_OUTPUT_ENCODING, fEncoding); + + // If the node to be serialized is not a Document, Element, or Entity + // node + // then the XML declaration, or text declaration, should be never be + // serialized. + if ( (nodeArg.getNodeType() != Node.DOCUMENT_NODE + || nodeArg.getNodeType() != Node.ELEMENT_NODE + || nodeArg.getNodeType() != Node.ENTITY_NODE) + && ((fFeatures & XMLDECL) != 0)) { + fDOMConfigProperties.setProperty( + DOMConstants.S_XSL_OUTPUT_OMIT_XML_DECL, + DOMConstants.DOM3_DEFAULT_FALSE); + } + + fVisitedNode = nodeArg; + } + + // Update the serializer properties + fXMLSerializer.setOutputFormat(fDOMConfigProperties); + + // + try { + // If the specified encoding is not supported an + // "unsupported-encoding" fatal error is raised. ?? + if (uri == null) { + String msg = Utils.messages.createMessage( + MsgKey.ER_NO_OUTPUT_SPECIFIED, null); + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, msg, + MsgKey.ER_NO_OUTPUT_SPECIFIED)); + } + throw new LSException(LSException.SERIALIZE_ERR, msg); + + } else { + // REVISIT: Can this be used to get an absolute expanded URI + String absoluteURI = SystemIDResolver.getAbsoluteURI(uri); + + URL url = new URL(absoluteURI); + OutputStream urlOutStream = null; + String protocol = url.getProtocol(); + String host = url.getHost(); + + // For file protocols, there is no need to use a URL to get its + // corresponding OutputStream + + // Scheme names consist of a sequence of characters. The lower + // case letters "a"--"z", digits, and the characters plus ("+"), + // period ("."), and hyphen ("-") are allowed. For resiliency, + // programs interpreting URLs should treat upper case letters as + // equivalent to lower case in scheme names + // (e.g., allow "HTTP" as well as "http"). + if (protocol.equalsIgnoreCase("file") + && (host == null || host.length() == 0 || host + .equals("localhost"))) { + // do we also need to check for host.equals(hostname) + urlOutStream = new FileOutputStream(new File(url.getPath())); + + } else { + // This should support URL's whose schemes are mentioned in + // RFC1738 other than file + + URLConnection urlCon = url.openConnection(); + urlCon.setDoInput(false); + urlCon.setDoOutput(true); + urlCon.setUseCaches(false); + urlCon.setAllowUserInteraction(false); + + // When writing to a HTTP URI, a HTTP PUT is performed. + if (urlCon instanceof HttpURLConnection) { + HttpURLConnection httpCon = (HttpURLConnection) urlCon; + httpCon.setRequestMethod("PUT"); + } + urlOutStream = urlCon.getOutputStream(); + } + // set the OutputStream to that obtained from the systemId + serializer.setWriter(new OutputStreamWriter(urlOutStream, fEncoding)); + } + + // Get a reference to the serializer then lets you serilize a DOM + // Use this hack till Xalan support JAXP1.3 + if (fDOMSerializer == null) { + fDOMSerializer = (DOM3Serializer)serializer.asDOM3Serializer(); + } + + // Set the error handler on the DOM3Serializer interface implementation + if (fDOMErrorHandler != null) { + fDOMSerializer.setErrorHandler(fDOMErrorHandler); + } + + // Set the filter on the DOM3Serializer interface implementation + if (fSerializerFilter != null) { + fDOMSerializer.setNodeFilter(fSerializerFilter); + } + + // Set the NewLine character to be used + fDOMSerializer.setNewLine(fEndOfLine); + + // Serializer your DOM, where node is an org.w3c.dom.Node + // Assuming that Xalan's serializer can serialize any type of DOM + // node + fDOMSerializer.serializeDOM3(nodeArg); + + } catch (LSException lse) { + // Rethrow LSException. + throw lse; + } catch (RuntimeException e) { + e.printStackTrace(); + throw new LSException(LSException.SERIALIZE_ERR, e.toString()); + } catch (Exception e) { + if (fDOMErrorHandler != null) { + fDOMErrorHandler.handleError(new DOMErrorImpl( + DOMError.SEVERITY_FATAL_ERROR, e.getMessage(), + null, e)); + } + e.printStackTrace(); + throw new LSException(LSException.SERIALIZE_ERR, e.toString()); + } + + return true; + } + // ************************************************************************ + + + // ************************************************************************ + // Implementaion methods + // ************************************************************************ + + /** + * Determines the XML Version of the Document Node to serialize. If the Document Node + * is not a DOM Level 3 Node, then the default version returned is 1.0. + * + * @param nodeArg The Node to serialize + * @return A String containing the version pseudo-attribute of the XMLDecl. + * @throws Throwable if the DOM implementation does not implement Document.getXmlVersion() + */ + //protected String getXMLVersion(Node nodeArg) throws Throwable { + protected String getXMLVersion(Node nodeArg) { + Document doc = null; + + // Determine the XML Version of the document + if (nodeArg != null) { + if (nodeArg.getNodeType() == Node.DOCUMENT_NODE) { + // The Document node is the Node argument + doc = (Document)nodeArg; + } else { + // The Document node is the Node argument's ownerDocument + doc = nodeArg.getOwnerDocument(); + } + + // Determine the DOM Version. + if (doc != null && doc.getImplementation().hasFeature("Core","3.0")) { + try { + return doc.getXmlVersion(); + } catch (AbstractMethodError e) { + //ignore, impl does not support the method + } + } + } + // The version will be treated as "1.0" which may result in + // an ill-formed document being serialized. + // If nodeArg does not have an ownerDocument, treat this as XML 1.0 + return "1.0"; + } + + /** + * Determines the XML Encoding of the Document Node to serialize. If the Document Node + * is not a DOM Level 3 Node, then the default encoding "UTF-8" is returned. + * + * @param nodeArg The Node to serialize + * @return A String containing the encoding pseudo-attribute of the XMLDecl. + * @throws Throwable if the DOM implementation does not implement Document.getXmlEncoding() + */ + protected String getXMLEncoding(Node nodeArg) { + Document doc = null; + + // Determine the XML Encoding of the document + if (nodeArg != null) { + if (nodeArg.getNodeType() == Node.DOCUMENT_NODE) { + // The Document node is the Node argument + doc = (Document)nodeArg; + } else { + // The Document node is the Node argument's ownerDocument + doc = nodeArg.getOwnerDocument(); + } + + // Determine the XML Version. + if (doc != null && doc.getImplementation().hasFeature("Core","3.0")) { + return doc.getXmlEncoding(); + } + } + // The default encoding is UTF-8 except for the writeToString method + return "UTF-8"; + } + + /** + * Determines the Input Encoding of the Document Node to serialize. If the Document Node + * is not a DOM Level 3 Node, then null is returned. + * + * @param nodeArg The Node to serialize + * @return A String containing the input encoding. + */ + protected String getInputEncoding(Node nodeArg) { + Document doc = null; + + // Determine the Input Encoding of the document + if (nodeArg != null) { + if (nodeArg.getNodeType() == Node.DOCUMENT_NODE) { + // The Document node is the Node argument + doc = (Document)nodeArg; + } else { + // The Document node is the Node argument's ownerDocument + doc = nodeArg.getOwnerDocument(); + } + + // Determine the DOM Version. + if (doc != null && doc.getImplementation().hasFeature("Core","3.0")) { + return doc.getInputEncoding(); + } + } + // The default encoding returned is null + return null; + } + + /** + * This method returns the LSSerializer's error handler. + * + * @return Returns the fDOMErrorHandler. + */ + public DOMErrorHandler getErrorHandler() { + return fDOMErrorHandler; + } + +} diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/NamespaceSupport.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/NamespaceSupport.java new file mode 100644 index 00000000000..611b984f05a --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/dom3/NamespaceSupport.java @@ -0,0 +1,315 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + * $Id: $ + */ + +package com.sun.org.apache.xml.internal.serializer.dom3; + +import java.util.Enumeration; +import java.util.NoSuchElementException; + +/** + * Namespace support for XML document handlers. This class doesn't + * perform any error checking and assumes that all strings passed + * as arguments to methods are unique symbols. The SymbolTable class + * can be used for this purpose. + * + * Derived from org.apache.xerces.util.NamespaceSupport + * + * @author Andy Clark, IBM + * + * @version $Id: Exp $ + */ +public class NamespaceSupport { + + static final String PREFIX_XML = "xml".intern(); + + static final String PREFIX_XMLNS = "xmlns".intern(); + + /** + * The XML Namespace ("http://www.w3.org/XML/1998/namespace"). This is + * the Namespace URI that is automatically mapped to the "xml" prefix. + */ + public final static String XML_URI = "http://www.w3.org/XML/1998/namespace".intern(); + + /** + * XML Information Set REC + * all namespace attributes (including those named xmlns, + * whose [prefix] property has no value) have a namespace URI of http://www.w3.org/2000/xmlns/ + */ + public final static String XMLNS_URI = "http://www.w3.org/2000/xmlns/".intern(); + + // + // Data + // + + /** + * Namespace binding information. This array is composed of a + * series of tuples containing the namespace binding information: + * <prefix, uri>. The default size can be set to anything + * as long as it is a power of 2 greater than 1. + * + * @see #fNamespaceSize + * @see #fContext + */ + protected String[] fNamespace = new String[16 * 2]; + + /** The top of the namespace information array. */ + protected int fNamespaceSize; + + // NOTE: The constructor depends on the initial context size + // being at least 1. -Ac + + /** + * Context indexes. This array contains indexes into the namespace + * information array. The index at the current context is the start + * index of declared namespace bindings and runs to the size of the + * namespace information array. + * + * @see #fNamespaceSize + */ + protected int[] fContext = new int[8]; + + /** The current context. */ + protected int fCurrentContext; + + protected String[] fPrefixes = new String[16]; + + // + // Constructors + // + + /** Default constructor. */ + public NamespaceSupport() { + } // () + + // + // Public methods + // + + /** + * @see org.apache.xerces.xni.NamespaceContext#reset() + */ + public void reset() { + + // reset namespace and context info + fNamespaceSize = 0; + fCurrentContext = 0; + fContext[fCurrentContext] = fNamespaceSize; + + // bind "xml" prefix to the XML uri + fNamespace[fNamespaceSize++] = PREFIX_XML; + fNamespace[fNamespaceSize++] = XML_URI; + // bind "xmlns" prefix to the XMLNS uri + fNamespace[fNamespaceSize++] = PREFIX_XMLNS; + fNamespace[fNamespaceSize++] = XMLNS_URI; + ++fCurrentContext; + + } // reset(SymbolTable) + + + /** + * @see org.apache.xerces.xni.NamespaceContext#pushContext() + */ + public void pushContext() { + + // extend the array, if necessary + if (fCurrentContext + 1 == fContext.length) { + int[] contextarray = new int[fContext.length * 2]; + System.arraycopy(fContext, 0, contextarray, 0, fContext.length); + fContext = contextarray; + } + + // push context + fContext[++fCurrentContext] = fNamespaceSize; + + } // pushContext() + + + /** + * @see org.apache.xerces.xni.NamespaceContext#popContext() + */ + public void popContext() { + fNamespaceSize = fContext[fCurrentContext--]; + } // popContext() + + /** + * @see org.apache.xerces.xni.NamespaceContext#declarePrefix(String, String) + */ + public boolean declarePrefix(String prefix, String uri) { + // ignore "xml" and "xmlns" prefixes + if (prefix == PREFIX_XML || prefix == PREFIX_XMLNS) { + return false; + } + + // see if prefix already exists in current context + for (int i = fNamespaceSize; i > fContext[fCurrentContext]; i -= 2) { + //if (fNamespace[i - 2] == prefix) { + if (fNamespace[i - 2].equals(prefix) ) { + // REVISIT: [Q] Should the new binding override the + // previously declared binding or should it + // it be ignored? -Ac + // NOTE: The SAX2 "NamespaceSupport" helper allows + // re-bindings with the new binding overwriting + // the previous binding. -Ac + fNamespace[i - 1] = uri; + return true; + } + } + + // resize array, if needed + if (fNamespaceSize == fNamespace.length) { + String[] namespacearray = new String[fNamespaceSize * 2]; + System.arraycopy(fNamespace, 0, namespacearray, 0, fNamespaceSize); + fNamespace = namespacearray; + } + + // bind prefix to uri in current context + fNamespace[fNamespaceSize++] = prefix; + fNamespace[fNamespaceSize++] = uri; + + return true; + + } // declarePrefix(String,String):boolean + + /** + * @see org.apache.xerces.xni.NamespaceContext#getURI(String) + */ + public String getURI(String prefix) { + + // find prefix in current context + for (int i = fNamespaceSize; i > 0; i -= 2) { + //if (fNamespace[i - 2] == prefix) { + if (fNamespace[i - 2].equals(prefix) ) { + return fNamespace[i - 1]; + } + } + + // prefix not found + return null; + + } // getURI(String):String + + + /** + * @see org.apache.xerces.xni.NamespaceContext#getPrefix(String) + */ + public String getPrefix(String uri) { + + // find uri in current context + for (int i = fNamespaceSize; i > 0; i -= 2) { + //if (fNamespace[i - 1] == uri) { + if (fNamespace[i - 1].equals(uri) ) { + //if (getURI(fNamespace[i - 2]) == uri) + if (getURI(fNamespace[i - 2]).equals(uri) ) + return fNamespace[i - 2]; + } + } + + // uri not found + return null; + + } // getPrefix(String):String + + + /** + * @see org.apache.xerces.xni.NamespaceContext#getDeclaredPrefixCount() + */ + public int getDeclaredPrefixCount() { + return (fNamespaceSize - fContext[fCurrentContext]) / 2; + } // getDeclaredPrefixCount():int + + /** + * @see org.apache.xerces.xni.NamespaceContext#getDeclaredPrefixAt(int) + */ + public String getDeclaredPrefixAt(int index) { + return fNamespace[fContext[fCurrentContext] + index * 2]; + } // getDeclaredPrefixAt(int):String + + /** + * @see org.apache.xerces.xni.NamespaceContext#getAllPrefixes() + */ + public Enumeration getAllPrefixes() { + int count = 0; + if (fPrefixes.length < (fNamespace.length/2)) { + // resize prefix array + String[] prefixes = new String[fNamespaceSize]; + fPrefixes = prefixes; + } + String prefix = null; + boolean unique = true; + for (int i = 2; i < (fNamespaceSize-2); i += 2) { + prefix = fNamespace[i + 2]; + for (int k=0;k'."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "An instance of the Well-Formedness checker could not be created. The well-formed parameter was set to true but well-formedness checking can not be performed." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "The node ''{0}'' contains invalid XML characters." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "An invalid XML character (Unicode: 0x{0}) was found in the comment." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "An invalid XML character (Unicode: 0x{0}) was found in the processing instructiondata." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "An invalid XML character (Unicode: 0x{0}) was found in the contents of the CDATASection." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "An invalid XML character (Unicode: 0x{0}) was found in the node''s character data content." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "An invalid XML character(s) was found in the {0} node named ''{1}''." + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "The string \"--\" is not permitted within comments." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "The value of attribute \"{1}\" associated with an element type \"{0}\" must not contain the ''<'' character." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "The unparsed entity reference \"&{0};\" is not permitted." + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "The external entity reference \"&{0};\" is not permitted in an attribute value." + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "The prefix \"{0}\" can not be bound to namespace \"{1}\"." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "The local name of element \"{0}\" is null." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "The local name of attr \"{0}\" is null." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "The replacement text of the entity node \"{0}\" contains an element node \"{1}\" with an unbound prefix \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "The replacement text of the entity node \"{0}\" contains an attribute node \"{1}\" with an unbound prefix \"{2}\"." + }, + + { MsgKey.ER_WRITING_INTERNAL_SUBSET, + "An error occured while writing the internal subset." + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ca.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ca.java index 55337933552..5dd866b8bbb 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ca.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ca.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -122,7 +124,106 @@ public class SerializerMessages_ca extends ListResourceBundle { "Userinfo may not be specified if host is not specified"}, { MsgKey.ER_SCHEME_REQUIRED, - "Scheme is required!"} + "Scheme is required!"}, + + /* + * Note to translators: The words 'Properties' and + * 'SerializerFactory' in this message are Java class names + * and should not be translated. + */ + { MsgKey.ER_FACTORY_PROPERTY_MISSING, + "L''objecte de propietats passat a SerializerFactory no t\u00e9 cap propietat ''{0}''." }, + + { MsgKey.ER_ENCODING_NOT_SUPPORTED, + "Av\u00eds: el temps d''execuci\u00f3 de Java no d\u00f3na suport a la codificaci\u00f3 ''{0}''." }, + + {MsgKey.ER_FEATURE_NOT_FOUND, + "El par\u00e0metre ''{0}'' no es reconeix."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "El par\u00e0metre ''{0}'' es reconeix per\u00f2 el valor sol\u00b7licitat no es pot establir."}, + + {MsgKey.ER_STRING_TOO_LONG, + "La cadena resultant \u00e9s massa llarga per cabre en una DOMString: ''{0}''."}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "El tipus de valor per a aquest nom de par\u00e0metre \u00e9s incompatible amb el tipus de valor esperat."}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "La destinaci\u00f3 de sortida per a les dades que s'ha d'escriure era nul\u00b7la."}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "S'ha trobat una codificaci\u00f3 no suportada."}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "El node no s'ha pogut serialitzat."}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "La secci\u00f3 CDATA cont\u00e9 un o m\u00e9s marcadors d'acabament ']]>'."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "No s'ha pogut crear cap inst\u00e0ncia per comprovar si t\u00e9 un format correcte o no. El par\u00e0metre del tipus ben format es va establir en cert, per\u00f2 la comprovaci\u00f3 de format no s'ha pogut realitzar." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "El node ''{0}'' cont\u00e9 car\u00e0cters XML no v\u00e0lids." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x{0}) en el comentari." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x{0}) en les dades d''instrucci\u00f3 de proc\u00e9s." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x''{0})'' en els continguts de la CDATASection." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "S''ha trobat un car\u00e0cter XML no v\u00e0lid (Unicode: 0x''{0})'' en el contingut de dades de car\u00e0cter del node." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "S''han trobat car\u00e0cters XML no v\u00e0lids al node {0} anomenat ''{1}''." + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "La cadena \"--\" no est\u00e0 permesa dins dels comentaris." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "El valor d''atribut \"{1}\" associat amb un tipus d''element \"{0}\" no pot contenir el car\u00e0cter ''<''." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "La refer\u00e8ncia de l''entitat no analitzada \"&{0};\" no est\u00e0 permesa." + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "La refer\u00e8ncia externa de l''entitat \"&{0};\" no est\u00e0 permesa en un valor d''atribut." + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "El prefix \"{0}\" no es pot vincular a l''espai de noms \"{1}\"." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "El nom local de l''element \"{0}\" \u00e9s nul." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "El nom local d''atr \"{0}\" \u00e9s nul." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "El text de recanvi del node de l''entitat \"{0}\" cont\u00e9 un node d''element \"{1}\" amb un prefix de no enlla\u00e7at \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "El text de recanvi del node de l''entitat \"{0}\" cont\u00e9 un node d''atribut \"{1}\" amb un prefix de no enlla\u00e7at \"{2}\"." + }, }; return contents; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_cs.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_cs.java index 5c6977c79dd..ef7c3236b1c 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_cs.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_cs.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 1999-2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -114,7 +116,106 @@ public class SerializerMessages_cs extends ListResourceBundle { "Nen\u00ed-li ur\u010den hostitel, nelze zadat \u00fadaje o u\u017eivateli."}, { MsgKey.ER_SCHEME_REQUIRED, - "Je vy\u017eadov\u00e1no sch\u00e9ma!"} + "Je vy\u017eadov\u00e1no sch\u00e9ma!"}, + + /* + * Note to translators: The words 'Properties' and + * 'SerializerFactory' in this message are Java class names + * and should not be translated. + */ + { MsgKey.ER_FACTORY_PROPERTY_MISSING, + "Objekt vlastnost\u00ed p\u0159edan\u00fd faktorii SerializerFactory neobsahuje vlastnost ''{0}''. " }, + + { MsgKey.ER_ENCODING_NOT_SUPPORTED, + "Varov\u00e1n\u00ed: K\u00f3dov\u00e1n\u00ed ''{0}'' nen\u00ed v b\u011bhov\u00e9m prost\u0159ed\u00ed Java podporov\u00e1no." }, + + {MsgKey.ER_FEATURE_NOT_FOUND, + "Parametr ''{0}'' nebyl rozpozn\u00e1n."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "Parametr ''{0}'' byl rozpozn\u00e1n, ale nelze nastavit po\u017eadovanou hodnotu."}, + + {MsgKey.ER_STRING_TOO_LONG, + "V\u00fdsledn\u00fd \u0159et\u011bzec je p\u0159\u00edli\u0161 dlouh\u00fd pro \u0159et\u011bzec DOMString: ''{0}''."}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "Typ hodnoty pro tento n\u00e1zev parametru nen\u00ed kompatibiln\u00ed s o\u010dek\u00e1van\u00fdm typem hodnoty."}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "C\u00edlov\u00e9 um\u00edst\u011bn\u00ed v\u00fdstupu pro data ur\u010den\u00e1 k z\u00e1pisu je rovno hodnot\u011b Null. "}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "Bylo nalezeno nepodporovan\u00e9 k\u00f3dov\u00e1n\u00ed."}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "Nelze prov\u00e9st serializaci uzlu. "}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "Sekce CDATA obsahuje jednu nebo v\u00edce ukon\u010dovac\u00edch zna\u010dek ']]>'."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "Nelze vytvo\u0159it instanci modulu pro kontrolu spr\u00e1vn\u00e9ho utvo\u0159en\u00ed. Parametr spr\u00e1vn\u00e9ho utvo\u0159en\u00ed byl nastaven na hodnotu true, nepoda\u0159ilo se v\u0161ak zkontrolovat spr\u00e1vnost utvo\u0159en\u00ed. " + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "Uzel ''{0}'' obsahuje neplatn\u00e9 znaky XML. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "V pozn\u00e1mce byl zji\u0161t\u011bn neplatn\u00fd znak XML (Unicode: 0x{0})." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "V datech instrukce zpracov\u00e1n\u00ed byl nalezen neplatn\u00fd znak XML (Unicode: 0x{0})." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "V odd\u00edlu CDATASection byl nalezen neplatn\u00fd znak XML (Unicode: 0x{0})." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "V obsahu znakov\u00fdch dat uzlu byl nalezen neplatn\u00fd znak XML (Unicode: 0x{0})." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "V objektu {0} s n\u00e1zvem ''{1}'' byl nalezen neplatn\u00fd znak XML. " + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "V pozn\u00e1mk\u00e1ch nen\u00ed povolen \u0159et\u011bzec \"--\"." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "Hodnota atributu \"{1}\" souvisej\u00edc\u00edho s typem prvku \"{0}\" nesm\u00ed obsahovat znak ''<''." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "Odkaz na neanalyzovanou entitu \"&{0};\" nen\u00ed povolen." + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "Extern\u00ed odkaz na entitu \"&{0};\" nen\u00ed v hodnot\u011b atributu povolen." + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "P\u0159edpona \"{0}\" nesm\u00ed b\u00fdt v\u00e1zan\u00e1 k oboru n\u00e1zv\u016f \"{1}\"." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "Lok\u00e1ln\u00ed n\u00e1zev prvku \"{0}\" m\u00e1 hodnotu Null. " + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "Lok\u00e1ln\u00ed n\u00e1zev atributu \"{0}\" m\u00e1 hodnotu Null. " + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "Nov\u00fd text uzlu entity \"{0}\" obsahuje uzel prvku \"{1}\" s nesv\u00e1zanou p\u0159edponou \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "Nov\u00fd text uzlu entity \"{0}\" obsahuje uzel atributu \"{1}\" s nesv\u00e1zanou p\u0159edponou \"{2}\". " + }, }; return contents; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java index 20e8a4de7b8..6d3fea66a20 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_de.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -200,6 +202,93 @@ public class SerializerMessages_de extends ListResourceBundle { { MsgKey.ER_ENCODING_NOT_SUPPORTED, "Warnung: Die Codierung \"{0}\" wird nicht von der Java-Laufzeit unterst\u00FCtzt." }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "Der Parameter ''{0}'' wird nicht erkannt."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "Der Parameter ''{0}'' wird erkannt, der angeforderte Wert kann jedoch nicht festgelegt werden."}, + + {MsgKey.ER_STRING_TOO_LONG, + "Die Ergebniszeichenfolge ist zu lang f\u00fcr eine DOM-Zeichenfolge: ''{0}''."}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "Der Werttyp f\u00fcr diesen Parameternamen ist nicht kompatibel mit dem erwarteten Werttyp."}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "Das Ausgabeziel f\u00fcr die zu schreibenden Daten war leer."}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "Eine nicht unterst\u00fctzte Codierung wurde festgestellt."}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "Der Knoten konnte nicht serialisiert werden."}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "Der Abschnitt CDATA enth\u00e4lt mindestens eine Beendigungsmarkierung ']]>'."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "Eine Instanz des Pr\u00fcfprogramms f\u00fcr korrekte Formatierung konnte nicht erstellt werden. F\u00fcr den korrekt formatierten Parameter wurde der Wert 'True' festgelegt, die Pr\u00fcfung auf korrekte Formatierung kann jedoch nicht durchgef\u00fchrt werden." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "Der Knoten ''{0}'' enth\u00e4lt ung\u00fcltige XML-Zeichen." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "Im Kommentar wurde ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) gefunden." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "In der Verarbeitungsanweisung wurde ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) gefunden." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "Im Inhalt von CDATASection wurde ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) gefunden." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "Ein ung\u00fcltiges XML-Zeichen (Unicode: 0x{0}) wurde im Inhalt der Zeichendaten des Knotens gefunden." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "Ung\u00fcltige XML-Zeichen wurden gefunden in {0} im Knoten ''{1}''." + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "Die Zeichenfolge \"--\" ist innerhalb von Kommentaren nicht zul\u00e4ssig." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "Der Wert des Attributs \"{1}\" mit einem Elementtyp \"{0}\" darf nicht das Zeichen ''<'' enthalten." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "Der syntaktisch nicht analysierte Entit\u00e4tenverweis \"&{0};\" ist nicht zul\u00e4ssig." + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "Der externe Entit\u00e4tenverweis \"&{0};\" ist in einem Attributwert nicht zul\u00e4ssig." + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "Das Pr\u00e4fix \"{0}\" kann nicht an den Namensbereich \"{1}\" gebunden werden." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "Der lokale Name von Element \"{0}\" ist nicht angegeben." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "Der lokale Name des Attributs \"{0}\" ist nicht angegeben." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "Der Ersatztext des Entit\u00e4tenknotens \"{0}\" enth\u00e4lt einen Elementknoten \"{1}\" mit einem nicht gebundenen Pr\u00e4fix \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "Der Ersatztext des Entit\u00e4tenknotens \"{0}\" enth\u00e4lt einen Attributknoten \"{1}\" mit einem nicht gebundenen Pr\u00e4fix \"{2}\"." + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java index 4628321c2a0..c942361102b 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_es.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -198,8 +200,95 @@ public class SerializerMessages_es extends ListResourceBundle { "El objeto de propiedades transferido a SerializerFactory no tiene una propiedad ''{0}''." }, { MsgKey.ER_ENCODING_NOT_SUPPORTED, - "Advertencia: el tiempo de ejecuci\u00F3n de Java no soporta la codificaci\u00F3n ''{0}''." }, + "Aviso: La codificaci\u00f3n ''{0}'' no est\u00e1 soportada por Java Runtime." }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "El par\u00e1metro ''{0}'' no se reconoce."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "Se reconoce el par\u00e1metro ''{0}'' pero no puede establecerse el valor solicitado."}, + + {MsgKey.ER_STRING_TOO_LONG, + "La serie producida es demasiado larga para ajustarse a DOMString: ''{0}''."}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "El tipo de valor para este nombre de par\u00e1metro es incompatible con el tipo de valor esperado."}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "El destino de salida de escritura de los datos es nulo."}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "Se ha encontrado una codificaci\u00f3n no soportada."}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "No se ha podido serializar el nodo."}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "La secci\u00f3n CDATA contiene uno o m\u00e1s marcadores ']]>' de terminaci\u00f3n."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "No se ha podido crear una instancia del comprobador de gram\u00e1tica correcta. El par\u00e1metro well-formed se ha establecido en true pero no se puede realizar la comprobaci\u00f3n de gram\u00e1tica correcta." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "El nodo ''{0}'' contiene caracteres XML no v\u00e1lidos." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en el comentario." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en los datos de la instrucci\u00f3n de proceso." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en el contenido de CDATASection." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "Se ha encontrado un car\u00e1cter XML no v\u00e1lido (Unicode: 0x{0}) en el contenido de datos de caracteres del nodo." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "Se ha encontrado un car\u00e1cter o caracteres XML no v\u00e1lidos en el nodo {0} denominado ''{1}''." + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "No se permite la serie \"--\" dentro de los comentarios." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "El valor del atributo \"{1}\" asociado a un tipo de elemento \"{0}\" no debe contener el car\u00e1cter ''''<''''." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "No se permite la referencia de entidad no analizada \"&{0};\"." + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "La referencia de entidad externa \"&{0};\" no est\u00e1 permitida en un valor de atributo." + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "No se puede encontrar el prefijo \"{0}\" en el espacio de nombres \"{1}\"." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "El nombre local del elemento \"{0}\" es null." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "El nombre local del atributo \"{0}\" es null." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "El texto de sustituci\u00f3n del nodo de entidad \"{0}\" contiene un nodo de elemento \"{1}\" con un prefijo no enlazado \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "El texto de sustituci\u00f3n del nodo de entidad \"{0}\" contiene un nodo de atributo \"{1}\" con un prefijo no enlazado \"{2}\"." + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java index 97fb91fea96..0998038064e 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_fr.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -200,6 +202,93 @@ public class SerializerMessages_fr extends ListResourceBundle { { MsgKey.ER_ENCODING_NOT_SUPPORTED, "Avertissement : l''encodage ''{0}'' n''est pas pris en charge par l''ex\u00E9cution Java." }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "Le param\u00e8tre ''{0}'' n''est pas reconnu."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "Le param\u00e8tre ''{0}'' est reconnu mas la valeur demand\u00e9e ne peut pas \u00eatre d\u00e9finie."}, + + {MsgKey.ER_STRING_TOO_LONG, + "La cha\u00eene obtenue est trop longue pour un DOMString : ''{0}''."}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "Le type de valeur de ce param\u00e8tre est incompatible avec le type de valeur attendu."}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "La sortie de destination des donn\u00e9es \u00e0 \u00e9crire \u00e9tait vide."}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "Codage non pris en charge."}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "Le noeud ne peut pas \u00eatre s\u00e9rialis\u00e9."}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "La section CDATA contient un ou plusieurs marqueurs de fin ']]>'."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "Aucune instance du programme de v\u00e9rification de la formation n'a pu \u00eatre cr\u00e9\u00e9e. La valeur true a \u00e9t\u00e9 attribu\u00e9e au param\u00e8tre well-formed mais la v\u00e9rification de la formation n'a pas pu \u00eatre effectu\u00e9e." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "Le noeud ''{0}'' contient des caract\u00e8res XML non valides." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "Un caract\u00e8re XML non valide (Unicode : 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans le commentaire." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "Un caract\u00e8re XML non valide (Unicode : 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans les donn\u00e9es de l''instruction de traitement." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "Un caract\u00e8re XML non valide (Unicode: 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans le contenu de la CDATASection" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "Un caract\u00e8re XML non valide (Unicode : 0x{0}) a \u00e9t\u00e9 trouv\u00e9 dans le contenu des donn\u00e9es de type caract\u00e8res du noeud." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "Un ou plusieurs caract\u00e8res non valides ont \u00e9t\u00e9 trouv\u00e9s dans le noeud {0} nomm\u00e9 ''{1}''." + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "La cha\u00eene \"--\" est interdite dans des commentaires." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "La valeur de l''attribut \"{1}\" associ\u00e9 \u00e0 un type d''\u00e9l\u00e9ment \"{0}\" ne doit pas contenir le caract\u00e8re ''<''." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "La r\u00e9f\u00e9rence d''entit\u00e9 non analys\u00e9e \"&{0};\" n''est pas admise." + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "La r\u00e9f\u00e9rence d''entit\u00e9 externe \"&{0};\" n''est pas admise dans une valeur d''attribut." + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "Le pr\u00e9fixe \"{0}\" ne peut pas \u00eatre li\u00e9 \u00e0 l''espace de noms \"{1}\"." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "Le nom local de l''\u00e9l\u00e9ment \"{0}\" a une valeur null." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "Le nom local de l''attribut \"{0}\" a une valeur null." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "le texte de remplacement du noeud de l''entit\u00e9 \"{0}\" contaient un noeud d''\u00e9l\u00e9ment \"{1}\" avec un pr\u00e9fixe non li\u00e9 \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "Le texte de remplacement du noeud de l''entit\u00e9 \"{0}\" contient un noeud d''attribut \"{1}\" avec un pr\u00e9fixe non li\u00e9 \"{2}\"." + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java index 6d3977af38c..37556dfccfd 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_it.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -200,6 +202,93 @@ public class SerializerMessages_it extends ListResourceBundle { { MsgKey.ER_ENCODING_NOT_SUPPORTED, "Avvertenza: la codifica ''{0}'' non \u00E8 supportata da Java Runtime." }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "Il parametro ''{0}'' non \u00e8 riconosciuto."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "Il parametro ''{0}'' \u00e8 riconosciuto ma non \u00e8 possibile impostare il valore richiesto."}, + + {MsgKey.ER_STRING_TOO_LONG, + "La stringa risultante \u00e8 troppo lunga per essere inserita in DOMString: ''{0}''."}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "Il tipo di valore per questo nome di parametro non \u00e8 compatibile con il tipo di valore previsto."}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "La destinazione di output in cui scrivere i dati era nulla."}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "\u00c8 stata rilevata una codifica non supportata."}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "Impossibile serializzare il nodo."}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "La Sezione CDATA contiene uno o pi\u00f9 markers di termine ']]>'."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "Impossibile creare un'istanza del controllore Well-Formedness. Il parametro well-formed \u00e8 stato impostato su true ma non \u00e8 possibile eseguire i controlli well-formedness." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "Il nodo ''{0}'' contiene caratteri XML non validi." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "Trovato un carattere XML non valido (Unicode: 0x{0}) nel commento." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "Carattere XML non valido (Unicode: 0x{0}) rilevato nell''elaborazione di instructiondata." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "Carattere XML non valido (Unicode: 0x{0}) rilevato nel contenuto di CDATASection." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "Carattere XML non valido (Unicode: 0x{0}) rilevato nel contenuto dati di caratteri del nodo. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "Carattere XML non valido rilevato nel nodo {0} denominato ''{1}''." + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "La stringa \"--\" non \u00e8 consentita nei commenti." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "Il valore dell''''attributo \"{1}\" associato con un tipo di elemento \"{0}\" non deve contenere il carattere ''<''." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "Il riferimento entit\u00e0 non analizzata \"&{0};\" non \u00e8 permesso." + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "Il riferimento all''''entit\u00e0 esterna \"&{0};\" non \u00e8 permesso in un valore attributo." + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "Il prefisso \"{0}\" non pu\u00f2 essere associato allo spazio nome \"{1}\"." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "Il nome locale dell''''elemento \"{0}\" \u00e8 null." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "Il nome locale dell''''attributo \"{0}\" \u00e8 null." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "Il testo di sostituzione del nodo di entit\u00e0 \"{0}\" contiene un nodo di elemento \"{1}\" con un prefisso non associato \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "Il testo di sostituzione del nodo di entit\u00e0 \"{0}\" contiene un nodo di attributo \"{1}\" con un prefisso non associato \"{2}\"." + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java index 069c9f8b2d7..0c3612f820a 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ja.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -200,6 +202,93 @@ public class SerializerMessages_ja extends ListResourceBundle { { MsgKey.ER_ENCODING_NOT_SUPPORTED, "\u8B66\u544A: \u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0''{0}''\u306F\u3001Java\u30E9\u30F3\u30BF\u30A4\u30E0\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002" }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc ''{0}'' \u306f\u8a8d\u8b58\u3055\u308c\u307e\u305b\u3093\u3002"}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc ''{0}'' \u306f\u8a8d\u8b58\u3055\u308c\u307e\u3059\u304c\u3001\u8981\u6c42\u3055\u308c\u305f\u5024\u306f\u8a2d\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002"}, + + {MsgKey.ER_STRING_TOO_LONG, + "\u7d50\u679c\u306e\u30b9\u30c8\u30ea\u30f3\u30b0\u304c\u9577\u3059\u304e\u308b\u305f\u3081\u3001DOMString \u5185\u306b\u53ce\u307e\u308a\u307e\u305b\u3093: ''{0}''\u3002"}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "\u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u540d\u306e\u5024\u306e\u578b\u306f\u3001\u671f\u5f85\u3055\u308c\u308b\u5024\u306e\u578b\u3068\u4e0d\u9069\u5408\u3067\u3059\u3002"}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "\u66f8\u304d\u8fbc\u307e\u308c\u308b\u30c7\u30fc\u30bf\u306e\u51fa\u529b\u5b9b\u5148\u304c\u30cc\u30eb\u3067\u3059\u3002"}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u306a\u3044\u30a8\u30f3\u30b3\u30fc\u30c9\u304c\u691c\u51fa\u3055\u308c\u307e\u3057\u305f\u3002"}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "\u30ce\u30fc\u30c9\u3092\u76f4\u5217\u5316\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002"}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "CDATA \u30bb\u30af\u30b7\u30e7\u30f3\u306b 1 \u3064\u4ee5\u4e0a\u306e\u7d42\u4e86\u30de\u30fc\u30ab\u30fc ']]>' \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002"}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "\u6574\u5f62\u5f0f\u6027\u30c1\u30a7\u30c3\u30ab\u30fc\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 well-formed \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306e\u8a2d\u5b9a\u306f true \u3067\u3057\u305f\u304c\u3001\u6574\u5f62\u5f0f\u6027\u306e\u691c\u67fb\u306f\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093\u3002" + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "\u30ce\u30fc\u30c9 ''{0}'' \u306b\u7121\u52b9\u306a XML \u6587\u5b57\u304c\u3042\u308a\u307e\u3059\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "\u30b3\u30e1\u30f3\u30c8\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "\u51e6\u7406\u547d\u4ee4\u30c7\u30fc\u30bf\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "CDATA \u30bb\u30af\u30b7\u30e7\u30f3\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "\u30ce\u30fc\u30c9\u306e\u6587\u5b57\u30c7\u30fc\u30bf\u306e\u5185\u5bb9\u306b\u7121\u52b9\u306a XML \u6587\u5b57 (Unicode: 0x{0}) \u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "''{1}'' \u3068\u3044\u3046\u540d\u524d\u306e {0} \u30ce\u30fc\u30c9\u306e\u4e2d\u306b\u7121\u52b9\u306a XML \u6587\u5b57\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002" + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "\u30b9\u30c8\u30ea\u30f3\u30b0 \"--\" \u306f\u30b3\u30e1\u30f3\u30c8\u5185\u3067\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002" + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "\u8981\u7d20\u578b \"{0}\" \u306b\u95a2\u9023\u3057\u305f\u5c5e\u6027 \"{1}\" \u306e\u5024\u306b\u306f ''<'' \u6587\u5b57\u3092\u542b\u3081\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002" + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "\u89e3\u6790\u5bfe\u8c61\u5916\u5b9f\u4f53\u53c2\u7167 \"&{0};\" \u306f\u8a31\u53ef\u3055\u308c\u307e\u305b\u3093\u3002" + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "\u5c5e\u6027\u5024\u3067\u306e\u5916\u90e8\u5b9f\u4f53\u53c2\u7167 \"&{0};\" \u306f\u8a31\u53ef\u3055\u308c\u307e\u305b\u3093\u3002" + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "\u63a5\u982d\u90e8 \"{0}\" \u306f\u540d\u524d\u7a7a\u9593 \"{1}\" \u306b\u7d50\u5408\u3067\u304d\u307e\u305b\u3093\u3002" + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "\u8981\u7d20 \"{0}\" \u306e\u30ed\u30fc\u30ab\u30eb\u540d\u304c\u30cc\u30eb\u3067\u3059\u3002" + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "\u5c5e\u6027 \"{0}\" \u306e\u30ed\u30fc\u30ab\u30eb\u540d\u304c\u30cc\u30eb\u3067\u3059\u3002" + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "\u5b9f\u4f53\u30ce\u30fc\u30c9 \"{0}\" \u306e\u7f6e\u63db\u30c6\u30ad\u30b9\u30c8\u306b\u3001\u672a\u7d50\u5408\u306e\u63a5\u982d\u90e8 \"{2}\" \u3092\u6301\u3064\u8981\u7d20\u30ce\u30fc\u30c9 \"{1}\" \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002" + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "\u5b9f\u4f53\u30ce\u30fc\u30c9 \"{0}\" \u306e\u7f6e\u63db\u30c6\u30ad\u30b9\u30c8\u306b\u3001\u672a\u7d50\u5408\u306e\u63a5\u982d\u90e8 \"{2}\" \u3092\u6301\u3064\u5c5e\u6027\u30ce\u30fc\u30c9 \"{1}\" \u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002" + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java index 90750d5245e..410dcadf72c 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_ko.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -200,6 +202,93 @@ public class SerializerMessages_ko extends ListResourceBundle { { MsgKey.ER_ENCODING_NOT_SUPPORTED, "\uACBD\uACE0: \uC778\uCF54\uB529 ''{0}''\uC740(\uB294) Java \uB7F0\uD0C0\uC784\uC5D0 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4." }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "''{0}'' \ub9e4\uac1c\ubcc0\uc218\ub97c \uc778\uc2dd\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "''{0}'' \ub9e4\uac1c\ubcc0\uc218\ub294 \uc778\uc2dd\ud560 \uc218 \uc788\uc73c\ub098 \uc694\uccad\ub41c \uac12\uc744 \uc124\uc815\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}, + + {MsgKey.ER_STRING_TOO_LONG, + "\uacb0\uacfc \ubb38\uc790\uc5f4\uc774 \ub108\ubb34 \uae38\uc5b4 DOMString\uc5d0 \ub9de\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4: ''{0}'' "}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "\uc774 \ub9e4\uac1c\ubcc0\uc218 \uc774\ub984\uc5d0 \ub300\ud55c \uac12 \uc720\ud615\uc774 \uc608\uc0c1 \uac12 \uc720\ud615\uacfc \ud638\ud658\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4."}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "\ub370\uc774\ud130\ub97c \uae30\ub85d\ud560 \ucd9c\ub825 \ub300\uc0c1\uc774 \ub110(null)\uc785\ub2c8\ub2e4."}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "\uc9c0\uc6d0\ub418\uc9c0 \uc54a\ub294 \uc778\ucf54\ub529\uc774 \ubc1c\uacac\ub418\uc5c8\uc2b5\ub2c8\ub2e4."}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "\ub178\ub4dc\ub97c \uc9c1\ub82c\ud654\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4."}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "CDATA \uc139\uc158\uc5d0 \uc885\ub8cc \ud45c\uc2dc \ubb38\uc790\uc778 ']]>'\uac00 \ud558\ub098 \uc774\uc0c1 \ud3ec\ud568\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "Well-Formedness \uac80\uc0ac\uae30\uc758 \uc778\uc2a4\ud134\uc2a4\ub97c \uc791\uc131\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. Well-Formed \ub9e4\uac1c\ubcc0\uc218\uac00 true\ub85c \uc124\uc815\ub418\uc5c8\uc9c0\ub9cc Well-Formedness \uac80\uc0ac\ub97c \uc218\ud589\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "''{0}'' \ub178\ub4dc\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790\uac00 \uc788\uc2b5\ub2c8\ub2e4." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "\uc124\uba85\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "\ucc98\ub9ac \uba85\ub839\uc5b4 \ub370\uc774\ud130\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4 " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "CDATASection\uc758 \ub0b4\uc6a9\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "\ub178\ub4dc\uc758 \ubb38\uc790 \ub370\uc774\ud130 \ub0b4\uc6a9\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790(Unicode: 0x{0})\uac00 \uc788\uc2b5\ub2c8\ub2e4. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "\uc774\ub984\uc774 ''{1}''\uc778 {0} \ub178\ub4dc\uc5d0 \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 XML \ubb38\uc790\uac00 \uc788\uc2b5\ub2c8\ub2e4. " + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "\uc124\uba85 \ub0b4\uc5d0\uc11c\ub294 \"--\" \ubb38\uc790\uc5f4\uc774 \ud5c8\uc6a9\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4." + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "\"{0}\" \uc694\uc18c \uc720\ud615\uacfc \uc5f0\uad00\ub41c \"{1}\" \uc18d\uc131\uac12\uc5d0 ''<'' \ubb38\uc790\uac00 \ud3ec\ud568\ub418\uba74 \uc548\ub429\ub2c8\ub2e4." + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "\"&{0};\"\uc758 \uad6c\ubd84 \ubd84\uc11d\ub418\uc9c0 \uc54a\uc740 \uc5d4\ud2f0\ud2f0 \ucc38\uc870\ub294 \ud5c8\uc6a9\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. " + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "\uc18d\uc131\uac12\uc5d0\ub294 \"&{0};\" \uc678\ubd80 \uc5d4\ud2f0\ud2f0 \ucc38\uc870\uac00 \ud5c8\uc6a9\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. " + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "\"{0}\" \uc811\ub450\ubd80\ub97c \"{1}\" \uc774\ub984 \uacf5\uac04\uc5d0 \ubc14\uc778\ub4dc\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "\"{0}\" \uc694\uc18c\uc758 \ub85c\uceec \uc774\ub984\uc774 \ub110(null)\uc785\ub2c8\ub2e4." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "\"{0}\" \uc18d\uc131\uc758 \ub85c\uceec \uc774\ub984\uc774 \ub110(null)\uc785\ub2c8\ub2e4." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "\"{0}\" \uc5d4\ud2f0\ud2f0 \ub178\ub4dc\uc758 \ub300\uccb4 \ud14d\uc2a4\ud2b8\uc5d0 \ubc14\uc778\ub4dc\ub418\uc9c0 \uc54a\uc740 \uc811\ub450\ubd80 \"{2}\"\uc744(\ub97c) \uac16\ub294 \"{1}\" \uc694\uc18c \ub178\ub4dc\uac00 \uc788\uc2b5\ub2c8\ub2e4." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "\"{0}\" \uc5d4\ud2f0\ud2f0 \ub178\ub4dc\uc758 \ub300\uccb4 \ud14d\uc2a4\ud2b8\uc5d0 \ubc14\uc778\ub4dc\ub418\uc9c0 \uc54a\uc740 \uc811\ub450\ubd80 \"{2}\"\uc744(\ub97c) \uac16\ub294 \"{1}\" \uc18d\uc131 \ub178\ub4dc\uac00 \uc788\uc2b5\ub2c8\ub2e4." + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java index 41949ddbf55..a65026f3d51 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_pt_BR.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -200,6 +202,93 @@ public class SerializerMessages_pt_BR extends ListResourceBundle { { MsgKey.ER_ENCODING_NOT_SUPPORTED, "Advert\u00EAncia: a codifica\u00E7\u00E3o ''{0}'' n\u00E3o \u00E9 suportada pelo Java runtime." }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "O par\u00e2metro ''{0}'' n\u00e3o \u00e9 reconhecido."}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "O par\u00e2metro ''{0}'' \u00e9 reconhecido, mas o valor pedido n\u00e3o pode ser definido. "}, + + {MsgKey.ER_STRING_TOO_LONG, + "A cadeia resultante \u00e9 muito longa para caber em uma DOMString: ''{0}''. "}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "O tipo de valor para este nome de par\u00e2metro \u00e9 incompat\u00edvel com o tipo de valor esperado. "}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "O destino de sa\u00edda para os dados a serem gravados era nulo. "}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "Uma codifica\u00e7\u00e3o n\u00e3o suportada foi encontrada. "}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "O n\u00f3 n\u00e3o p\u00f4de ser serializado."}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "A Se\u00e7\u00e3o CDATA cont\u00e9m um ou mais marcadores de t\u00e9rmino ']]>'."}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "Uma inst\u00e2ncia do verificador Well-Formedness n\u00e3o p\u00f4de ser criada. O par\u00e2metro well-formed foi definido como true, mas a verifica\u00e7\u00e3o well-formedness n\u00e3o pode ser executada." + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "O n\u00f3 ''{0}'' cont\u00e9m caracteres XML inv\u00e1lidos. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no coment\u00e1rio. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no processo instructiondata." + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado nos conte\u00fados do CDATASection. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no conte\u00fado dos dados de caractere dos n\u00f3s. " + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "Um caractere inv\u00e1lido foi encontrado no {0} do n\u00f3 denominado ''{1}''." + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "A cadeia \"--\" n\u00e3o \u00e9 permitida dentro dos coment\u00e1rios. " + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "O valor do atributo \"{1}\" associado a um tipo de elemento \"{0}\" n\u00e3o deve conter o caractere ''<''. " + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "A refer\u00eancia de entidade n\u00e3o analisada \"&{0};\" n\u00e3o \u00e9 permitida. " + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "A refer\u00eancia de entidade externa \"&{0};\" n\u00e3o \u00e9 permitida em um valor de atributo. " + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "O prefixo \"{0}\" n\u00e3o pode ser vinculado ao espa\u00e7o de nomes \"{1}\"." + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "O nome local do elemento \"{0}\" \u00e9 nulo." + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "O nome local do atributo \"{0}\" \u00e9 nulo." + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "O texto de substitui\u00e7\u00e3o do n\u00f3 de entidade \"{0}\" cont\u00e9m um n\u00f3 de elemento \"{1}\" com um prefixo n\u00e3o vinculado \"{2}\"." + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "O texto de substitui\u00e7\u00e3o do n\u00f3 de entidade \"{0}\" cont\u00e9m um n\u00f3 de atributo \"{1}\" com um prefixo n\u00e3o vinculado \"{2}\"." + }, }; diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java index f1f64f1acb4..9d3e4996846 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/utils/SerializerMessages_zh_TW.java @@ -3,9 +3,11 @@ * DO NOT REMOVE OR ALTER! */ /* - * Copyright 2004 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -200,6 +202,93 @@ public class SerializerMessages_zh_TW extends ListResourceBundle { { MsgKey.ER_ENCODING_NOT_SUPPORTED, "\u8B66\u544A: Java Runtime \u4E0D\u652F\u63F4\u7DE8\u78BC ''{0}''\u3002" }, + {MsgKey.ER_FEATURE_NOT_FOUND, + "\u7121\u6cd5\u8fa8\u8b58\u53c3\u6578 ''{0}''\u3002"}, + + {MsgKey.ER_FEATURE_NOT_SUPPORTED, + "\u53ef\u8fa8\u8b58 ''{0}'' \u53c3\u6578\uff0c\u4f46\u6240\u8981\u6c42\u7684\u503c\u7121\u6cd5\u8a2d\u5b9a\u3002"}, + + {MsgKey.ER_STRING_TOO_LONG, + "\u7d50\u679c\u5b57\u4e32\u904e\u9577\uff0c\u7121\u6cd5\u7f6e\u5165 DOMString: ''{0}'' \u4e2d\u3002"}, + + {MsgKey.ER_TYPE_MISMATCH_ERR, + "\u9019\u500b\u53c3\u6578\u540d\u7a31\u7684\u503c\u985e\u578b\u8207\u671f\u671b\u503c\u985e\u578b\u4e0d\u76f8\u5bb9\u3002"}, + + {MsgKey.ER_NO_OUTPUT_SPECIFIED, + "\u8cc7\u6599\u8981\u5beb\u5165\u7684\u8f38\u51fa\u76ee\u7684\u5730\u70ba\u7a7a\u503c\u3002"}, + + {MsgKey.ER_UNSUPPORTED_ENCODING, + "\u767c\u73fe\u4e0d\u652f\u63f4\u7684\u7de8\u78bc\u3002"}, + + {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE, + "\u7bc0\u9ede\u7121\u6cd5\u5e8f\u5217\u5316\u3002"}, + + {MsgKey.ER_CDATA_SECTIONS_SPLIT, + "CDATA \u5340\u6bb5\u5305\u542b\u4e00\u6216\u591a\u500b\u7d42\u6b62\u6a19\u8a18 ']]>'\u3002"}, + + {MsgKey.ER_WARNING_WF_NOT_CHECKED, + "\u7121\u6cd5\u5efa\u7acb\u300c\u5f62\u5f0f\u5b8c\u6574\u300d\u6aa2\u67e5\u7a0b\u5f0f\u7684\u5be6\u4f8b\u3002Well-formed \u53c3\u6578\u96d6\u8a2d\u70ba true\uff0c\u4f46\u7121\u6cd5\u57f7\u884c\u5f62\u5f0f\u5b8c\u6574\u6aa2\u67e5\u3002" + }, + + {MsgKey.ER_WF_INVALID_CHARACTER, + "\u7bc0\u9ede ''{0}'' \u5305\u542b\u7121\u6548\u7684 XML \u5b57\u5143\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT, + "\u5728\u8a3b\u89e3\u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI, + "\u5728\u8655\u7406\u7a0b\u5e8f instructiondata \u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA, + "\u5728 CDATASection \u7684\u5167\u5bb9\u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT, + "\u5728\u7bc0\u9ede\u7684\u5b57\u5143\u8cc7\u6599\u5167\u5bb9\u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143 (Unicode: 0x{0})\u3002" + }, + + { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME, + "\u5728\u540d\u70ba ''{1}'' \u7684 ''{0}'' \u4e2d\u767c\u73fe\u7121\u6548\u7684 XML \u5b57\u5143\u3002" + }, + + { MsgKey.ER_WF_DASH_IN_COMMENT, + "\u8a3b\u89e3\u4e2d\u4e0d\u5141\u8a31\u4f7f\u7528\u5b57\u4e32 \"--\"\u3002" + }, + + {MsgKey.ER_WF_LT_IN_ATTVAL, + "\u8207\u5143\u7d20\u985e\u578b \"{0}\" \u76f8\u95dc\u806f\u7684\u5c6c\u6027 \"{1}\" \u503c\u4e0d\u53ef\u5305\u542b ''<'' \u5b57\u5143\u3002" + }, + + {MsgKey.ER_WF_REF_TO_UNPARSED_ENT, + "\u4e0d\u5141\u8a31\u4f7f\u7528\u672a\u5256\u6790\u7684\u5be6\u9ad4\u53c3\u7167 \"&{0};\"\u3002" + }, + + {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT, + "\u5c6c\u6027\u503c\u4e2d\u4e0d\u5141\u8a31\u4f7f\u7528\u5916\u90e8\u5be6\u9ad4\u53c3\u7167 \"&{0};\"\u3002" + }, + + {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND, + "\u5b57\u9996 \"{0}\" \u7121\u6cd5\u9023\u7d50\u5230\u540d\u7a31\u7a7a\u9593 \"{1}\"\u3002" + }, + + {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME, + "\u5143\u7d20 \"{0}\" \u7684\u672c\u7aef\u540d\u7a31\u662f\u7a7a\u503c\u3002" + }, + + {MsgKey.ER_NULL_LOCAL_ATTR_NAME, + "\u5c6c\u6027 \"{0}\" \u7684\u672c\u7aef\u540d\u7a31\u662f\u7a7a\u503c\u3002" + }, + + { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF, + "\u5be6\u9ad4\u7bc0\u9ede \"{0}\" \u7684\u53d6\u4ee3\u6587\u5b57\u5305\u542b\u9644\u6709\u5df2\u5207\u65b7\u9023\u7d50\u5b57\u9996 \"{2}\" \u7684\u5143\u7d20\u7bc0\u9ede \"{1}\"\u3002" + }, + + { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF, + "\u5be6\u9ad4\u7bc0\u9ede \"{0}\" \u7684\u53d6\u4ee3\u6587\u5b57\u5305\u542b\u9644\u6709\u5df2\u5207\u65b7\u9023\u7d50\u5b57\u9996 \"{2}\" \u7684\u5c6c\u6027\u7bc0\u9ede \"{1}\"\u3002" + }, }; diff --git a/jaxp/src/org/w3c/dom/ranges/DocumentRange.java b/jaxp/src/org/w3c/dom/ranges/DocumentRange.java index 342f9e3ace8..ed51624fc11 100644 --- a/jaxp/src/org/w3c/dom/ranges/DocumentRange.java +++ b/jaxp/src/org/w3c/dom/ranges/DocumentRange.java @@ -43,7 +43,7 @@ package org.w3c.dom.ranges; /** *

See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. - * @since DOM Level 2 + * @since 1.9, DOM Level 2 */ public interface DocumentRange { /** diff --git a/jaxp/src/org/w3c/dom/ranges/Range.java b/jaxp/src/org/w3c/dom/ranges/Range.java index d42fad0c0fe..0efefe21945 100644 --- a/jaxp/src/org/w3c/dom/ranges/Range.java +++ b/jaxp/src/org/w3c/dom/ranges/Range.java @@ -47,7 +47,7 @@ import org.w3c.dom.DocumentFragment; /** *

See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. - * @since DOM Level 2 + * @since 1.9, DOM Level 2 */ public interface Range { /** diff --git a/jaxp/src/org/w3c/dom/ranges/RangeException.java b/jaxp/src/org/w3c/dom/ranges/RangeException.java index 198a135111c..69551a81c95 100644 --- a/jaxp/src/org/w3c/dom/ranges/RangeException.java +++ b/jaxp/src/org/w3c/dom/ranges/RangeException.java @@ -45,7 +45,7 @@ package org.w3c.dom.ranges; * Range operations may throw a RangeException as specified in * their method descriptions. *

See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. - * @since DOM Level 2 + * @since 1.9, DOM Level 2 */ public class RangeException extends RuntimeException { public RangeException(short code, String message) { diff --git a/jaxp/src/org/w3c/dom/traversal/DocumentTraversal.java b/jaxp/src/org/w3c/dom/traversal/DocumentTraversal.java index 80938886afe..bbb53740235 100644 --- a/jaxp/src/org/w3c/dom/traversal/DocumentTraversal.java +++ b/jaxp/src/org/w3c/dom/traversal/DocumentTraversal.java @@ -53,7 +53,7 @@ import org.w3c.dom.DOMException; * Traversal feature, DocumentTraversal will be implemented by * the same objects that implement the Document interface. *

See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. - * @since DOM Level 2 + * @since 1.9, DOM Level 2 */ public interface DocumentTraversal { /** diff --git a/jaxp/src/org/w3c/dom/traversal/NodeFilter.java b/jaxp/src/org/w3c/dom/traversal/NodeFilter.java index e6f22b2b917..5cc8177eeac 100644 --- a/jaxp/src/org/w3c/dom/traversal/NodeFilter.java +++ b/jaxp/src/org/w3c/dom/traversal/NodeFilter.java @@ -59,7 +59,7 @@ import org.w3c.dom.Node; * filter may be used with a number of different kinds of traversals, * encouraging code reuse. *

See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. - * @since DOM Level 2 + * @since 1.9, DOM Level 2 */ public interface NodeFilter { // Constants returned by acceptNode diff --git a/jaxp/src/org/w3c/dom/traversal/NodeIterator.java b/jaxp/src/org/w3c/dom/traversal/NodeIterator.java index 0f6aebf0821..70ef322254f 100644 --- a/jaxp/src/org/w3c/dom/traversal/NodeIterator.java +++ b/jaxp/src/org/w3c/dom/traversal/NodeIterator.java @@ -55,7 +55,7 @@ import org.w3c.dom.DOMException; * NodeIterators are created by calling * DocumentTraversal.createNodeIterator(). *

See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. - * @since DOM Level 2 + * @since 1.9, DOM Level 2 */ public interface NodeIterator { /** diff --git a/jaxp/src/org/w3c/dom/traversal/TreeWalker.java b/jaxp/src/org/w3c/dom/traversal/TreeWalker.java index f0876e5206d..262fd96d167 100644 --- a/jaxp/src/org/w3c/dom/traversal/TreeWalker.java +++ b/jaxp/src/org/w3c/dom/traversal/TreeWalker.java @@ -60,7 +60,7 @@ import org.w3c.dom.DOMException; * nodes will be siblings and appear as direct children of the root node, no * matter how deeply nested the structure of the original document. *

See also the Document Object Model (DOM) Level 2 Traversal and Range Specification. - * @since DOM Level 2 + * @since 1.9, DOM Level 2 */ public interface TreeWalker { /** diff --git a/jdk/.hgtags b/jdk/.hgtags index 0718a4f34ab..d5928939618 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -267,3 +267,4 @@ f87c5be90e01a7ffb47947108eb3e0b0b1920880 jdk9-b20 85bcf0f99edc08873614afbe5a5563e13ce13c83 jdk9-b22 9febf9dbc0a4b15323f2dbd29931cfbf086332b4 jdk9-b23 875450e7ef8dde8f59db662ec1351ea30b8cb35d jdk9-b24 +a31efe49556a7c12f9ea2c9ee8b4fae8aa67723a jdk9-b25 diff --git a/jdk/make/CopyFiles.gmk b/jdk/make/CopyFiles.gmk index acab2541256..7666fcd2dd5 100644 --- a/jdk/make/CopyFiles.gmk +++ b/jdk/make/CopyFiles.gmk @@ -122,7 +122,7 @@ COPY_FILES += $(PSFONTPROPFILE_TARGET_FILES) ########################################################################################## # -# Copy flavormap.properties, cursor.properties and cursors gif files to LIBDIR +# Copy cursor.properties and cursors gif files to LIBDIR # ifneq ($(OPENJDK_TARGET_OS), macosx) OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib @@ -130,11 +130,6 @@ else OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/macosx/lib endif -$(LIBDIR)/flavormap.properties: $(OPENJDK_TARGET_OS_LIB_SRC)/flavormap.properties - $(call install-file) - -COPY_FILES += $(LIBDIR)/flavormap.properties - CURSORS_DEST_DIR = $(LIBDIR)/images/cursors CURSORS_OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/lib/images/cursors diff --git a/jdk/make/CopyIntoClasses.gmk b/jdk/make/CopyIntoClasses.gmk index fdf2a173aca..a80c661ace9 100644 --- a/jdk/make/CopyIntoClasses.gmk +++ b/jdk/make/CopyIntoClasses.gmk @@ -163,6 +163,19 @@ $(foreach R, $(JAVAX_SOUND_RULES), $(eval $(call addto_meta-inf_services, $R))) ################################################################################ +ifneq ($(OPENJDK_TARGET_OS), macosx) + OPENJDK_TARGET_OS_FLAVORMAP_PROPERTIES = $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/awt/datatransfer/flavormap.properties +else + OPENJDK_TARGET_OS_FLAVORMAP_PROPERTIES = $(JDK_TOPDIR)/src/macosx/classes/sun/awt/datatransfer/flavormap.properties +endif + +$(JDK_OUTPUTDIR)/classes/sun/awt/datatransfer/flavormap.properties: $(OPENJDK_TARGET_OS_FLAVORMAP_PROPERTIES) + $(install-file) + +COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/sun/awt/datatransfer/flavormap.properties + +################################################################################ + CLEAN_FILES := $(wildcard \ $(JDK_TOPDIR)/src/share/classes/com/sun/imageio/plugins/common/*.properties \ $(JDK_TOPDIR)/src/share/classes/com/sun/java/util/jar/pack/*.properties \ diff --git a/jdk/make/Setup.gmk b/jdk/make/Setup.gmk index 485c3b72b13..c4f204cf6af 100644 --- a/jdk/make/Setup.gmk +++ b/jdk/make/Setup.gmk @@ -27,7 +27,7 @@ DISABLE_WARNINGS := -Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,- # To build with all warnings enabled, do the following: # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000" -JAVAC_WARNINGS := -Xlint:all,-deprecation,-rawtypes,-unchecked -Werror +JAVAC_WARNINGS := -Xlint:all,-deprecation -Werror # Any java code executed during a JDK build to build other parts of the JDK must be # executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this diff --git a/jdk/make/data/swingbeaninfo/SwingBeanInfo.template b/jdk/make/data/swingbeaninfo/SwingBeanInfo.template index 1bfe54530e2..9c1a133f67f 100644 --- a/jdk/make/data/swingbeaninfo/SwingBeanInfo.template +++ b/jdk/make/data/swingbeaninfo/SwingBeanInfo.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ import sun.swing.BeanInfoUtils; */ public class @(BeanClassName)BeanInfo extends javax.swing.SwingBeanInfoBase { - private static final Class class@(BeanClassName) = @(BeanClassObject); + private static final Class class@(BeanClassName) = @(BeanClassObject); /** * @return a @(BeanClassName) BeanDescriptor diff --git a/jdk/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java b/jdk/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java index 08e55122f5f..d6167b448e5 100644 --- a/jdk/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java +++ b/jdk/make/data/swingbeaninfo/javax/swing/SwingBeanInfoBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -67,7 +67,7 @@ public class SwingBeanInfoBase extends SimpleBeanInfo * its PropertyDescriptors will be included. */ public BeanInfo[] getAdditionalBeanInfo() { - Class superClass = getBeanDescriptor().getBeanClass().getSuperclass(); + Class superClass = getBeanDescriptor().getBeanClass().getSuperclass(); BeanInfo superBeanInfo = null; try { superBeanInfo = Introspector.getBeanInfo(superClass); diff --git a/jdk/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java b/jdk/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java index fbcc2995dd5..037615ad63a 100644 --- a/jdk/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java +++ b/jdk/make/data/swingbeaninfo/sun/swing/BeanInfoUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, 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 @@ -122,7 +122,7 @@ public class BeanInfoUtils * @see java.beans#PropertyDescriptor * @see java.beans#FeatureDescriptor */ - public static PropertyDescriptor createPropertyDescriptor(Class cls, String name, Object[] args) + public static PropertyDescriptor createPropertyDescriptor(Class cls, String name, Object[] args) { PropertyDescriptor pd = null; try { @@ -156,7 +156,7 @@ public class BeanInfoUtils String methodName = (String)value; Method method; try { - method = cls.getMethod(methodName, new Class[0]); + method = cls.getMethod(methodName, new Class[0]); pd.setReadMethod(method); } catch(Exception e) { @@ -168,8 +168,8 @@ public class BeanInfoUtils String methodName = (String)value; Method method; try { - Class type = pd.getPropertyType(); - method = cls.getMethod(methodName, new Class[]{type}); + Class type = pd.getPropertyType(); + method = cls.getMethod(methodName, new Class[]{type}); pd.setWriteMethod(method); } catch(Exception e) { @@ -215,9 +215,9 @@ public class BeanInfoUtils * @see java.beans#BeanInfo * @see java.beans#PropertyDescriptor */ - public static BeanDescriptor createBeanDescriptor(Class cls, Object[] args) + public static BeanDescriptor createBeanDescriptor(Class cls, Object[] args) { - Class customizerClass = null; + Class customizerClass = null; /* For reasons I don't understand, customizerClass is a * readOnly property. So we have to find it and pass it @@ -242,11 +242,11 @@ public class BeanInfoUtils } static private PropertyDescriptor createReadOnlyPropertyDescriptor( - String name, Class cls) throws IntrospectionException { + String name, Class cls) throws IntrospectionException { Method readMethod = null; String base = capitalize(name); - Class[] parameters = new Class[0]; + Class[] parameters = new Class[0]; // Is it a boolean? try { @@ -264,7 +264,7 @@ public class BeanInfoUtils try { // Try indexed accessor pattern. - parameters = new Class[1]; + parameters = new Class[1]; parameters[0] = int.class; readMethod = cls.getMethod("get" + base, parameters); } catch (NoSuchMethodException nsme) { diff --git a/jdk/make/lib/PlatformLibraries.gmk b/jdk/make/lib/PlatformLibraries.gmk index e3fc71c4bf9..3f0a408fab7 100644 --- a/jdk/make/lib/PlatformLibraries.gmk +++ b/jdk/make/lib/PlatformLibraries.gmk @@ -90,8 +90,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) LIBOSX_DIRS := \ $(JDK_TOPDIR)/src/macosx/native/com/apple/concurrent \ $(JDK_TOPDIR)/src/macosx/native/com/apple/eio \ - $(JDK_TOPDIR)/src/macosx/native/apple/security \ - $(JDK_TOPDIR)/src/macosx/native/apple/launcher + $(JDK_TOPDIR)/src/macosx/native/apple/security $(eval $(call SetupNativeCompilation,BUILD_LIBOSX, \ LIBRARY := osx, \ diff --git a/jdk/make/mapfiles/libawt/mapfile-mawt-vers b/jdk/make/mapfiles/libawt/mapfile-mawt-vers index b8ea1636c88..06d3ff802e1 100644 --- a/jdk/make/mapfiles/libawt/mapfile-mawt-vers +++ b/jdk/make/mapfiles/libawt/mapfile-mawt-vers @@ -204,6 +204,7 @@ SUNWprivate_1.1 { Java_sun_print_CUPSPrinter_canConnect; Java_sun_print_CUPSPrinter_getMedia; Java_sun_print_CUPSPrinter_getPageSizes; + Java_sun_print_CUPSPrinter_getResolutions; Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1arrow; Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1box; diff --git a/jdk/make/mapfiles/libawt_headless/mapfile-vers b/jdk/make/mapfiles/libawt_headless/mapfile-vers index c12d07d80fa..df24e4505db 100644 --- a/jdk/make/mapfiles/libawt_headless/mapfile-vers +++ b/jdk/make/mapfiles/libawt_headless/mapfile-vers @@ -76,6 +76,7 @@ SUNWprivate_1.1 { Java_sun_print_CUPSPrinter_canConnect; Java_sun_print_CUPSPrinter_getMedia; Java_sun_print_CUPSPrinter_getPageSizes; + Java_sun_print_CUPSPrinter_getResolutions; # libfontmanager entry points AWTIsHeadless; diff --git a/jdk/make/mapfiles/libawt_xawt/mapfile-vers b/jdk/make/mapfiles/libawt_xawt/mapfile-vers index 3ae8af3ddbf..4a891077b76 100644 --- a/jdk/make/mapfiles/libawt_xawt/mapfile-vers +++ b/jdk/make/mapfiles/libawt_xawt/mapfile-vers @@ -442,6 +442,7 @@ SUNWprivate_1.1 { Java_sun_print_CUPSPrinter_canConnect; Java_sun_print_CUPSPrinter_getMedia; Java_sun_print_CUPSPrinter_getPageSizes; + Java_sun_print_CUPSPrinter_getResolutions; awt_GetDrawingSurface; awt_FreeDrawingSurface; diff --git a/jdk/make/profile-includes.txt b/jdk/make/profile-includes.txt index e252ace094a..fe069c37034 100644 --- a/jdk/make/profile-includes.txt +++ b/jdk/make/profile-includes.txt @@ -177,7 +177,6 @@ FULL_JRE_LIB_FILES := \ ext/dnsns.jar \ ext/nashorn.jar \ ext/zipfs.jar \ - flavormap.properties \ fontconfig.RedHat.5.bfc \ fontconfig.RedHat.5.properties.src \ fontconfig.RedHat.6.bfc \ diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/JavaAppLauncher.xcodeproj/project.pbxproj b/jdk/src/macosx/bundle/JavaAppLauncher/JavaAppLauncher.xcodeproj/project.pbxproj deleted file mode 100644 index b51cbefbd9b..00000000000 --- a/jdk/src/macosx/bundle/JavaAppLauncher/JavaAppLauncher.xcodeproj/project.pbxproj +++ /dev/null @@ -1,318 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 45; - objects = { - -/* Begin PBXBuildFile section */ - 2C483E05143512EB00F2AEFD /* 1.7.0.jre in Copy PlugIns */ = {isa = PBXBuildFile; fileRef = 2C483E04143512EB00F2AEFD /* 1.7.0.jre */; }; - 89D3CD32142EEB2200A08AED /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 89D3CD29142EEB2200A08AED /* InfoPlist.strings */; }; - 89D3CD33142EEB2200A08AED /* GenericApp.icns in Resources */ = {isa = PBXBuildFile; fileRef = 89D3CD2B142EEB2200A08AED /* GenericApp.icns */; }; - 89D3CD35142EEB2200A08AED /* JVMArgs.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D3CD30142EEB2200A08AED /* JVMArgs.m */; }; - 89D3CD36142EEB2200A08AED /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D3CD31142EEB2200A08AED /* main.m */; }; - 89D3D365143041F000A08AED /* JavaAppLauncher.m in Sources */ = {isa = PBXBuildFile; fileRef = 89D3D364143041F000A08AED /* JavaAppLauncher.m */; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 2C48F06614350F0F00F2AEFD /* Copy PlugIns */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 13; - files = ( - 2C483E05143512EB00F2AEFD /* 1.7.0.jre in Copy PlugIns */, - ); - name = "Copy PlugIns"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 2C483E04143512EB00F2AEFD /* 1.7.0.jre */ = {isa = PBXFileReference; lastKnownFileType = folder; name = 1.7.0.jre; path = "../../../../../build/macosx-universal/j2sdk-bundle/1.7.0.jdk/Contents/Home/1.7.0.jre"; sourceTree = SOURCE_ROOT; }; - 2C48F06714350F8300F2AEFD /* 1.7.0.jdk */ = {isa = PBXFileReference; lastKnownFileType = folder; name = 1.7.0.jdk; path = "../../../../../build/macosx-universal/j2sdk-bundle/1.7.0.jdk"; sourceTree = SOURCE_ROOT; }; - 2CB5DA5E14355FCA00D3A656 /* classfile_constants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = classfile_constants.h; sourceTree = ""; }; - 2CB5DA6014355FCA00D3A656 /* jawt_md.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jawt_md.h; sourceTree = ""; }; - 2CB5DA6114355FCA00D3A656 /* jni_md.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jni_md.h; sourceTree = ""; }; - 2CB5DA6214355FCA00D3A656 /* jawt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jawt.h; sourceTree = ""; }; - 2CB5DA6314355FCA00D3A656 /* jdwpTransport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jdwpTransport.h; sourceTree = ""; }; - 2CB5DA6414355FCA00D3A656 /* jni.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jni.h; sourceTree = ""; }; - 2CB5DA6514355FCA00D3A656 /* jvmti.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jvmti.h; sourceTree = ""; }; - 2CB5DA6614355FCA00D3A656 /* jvmticmlr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jvmticmlr.h; sourceTree = ""; }; - 89D3CD2A142EEB2200A08AED /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 89D3CD2B142EEB2200A08AED /* GenericApp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = GenericApp.icns; path = /System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/GenericApp.icns; sourceTree = ""; }; - 89D3CD2C142EEB2200A08AED /* JavaAppLauncher-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "JavaAppLauncher-Info.plist"; sourceTree = ""; }; - 89D3CD2E142EEB2200A08AED /* JavaAppLauncher_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaAppLauncher_Prefix.pch; sourceTree = ""; }; - 89D3CD2F142EEB2200A08AED /* JVMArgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JVMArgs.h; sourceTree = ""; }; - 89D3CD30142EEB2200A08AED /* JVMArgs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JVMArgs.m; sourceTree = ""; }; - 89D3CD31142EEB2200A08AED /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 89D3D363143041F000A08AED /* JavaAppLauncher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaAppLauncher.h; sourceTree = ""; }; - 89D3D364143041F000A08AED /* JavaAppLauncher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JavaAppLauncher.m; sourceTree = ""; }; - 8D1107320486CEB800E47090 /* JavaAppLauncher.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JavaAppLauncher.app; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1058C7A0FEA54F0111CA2CBB /* frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - ); - name = frameworks; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* JavaAppLauncher.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* JavaAppLauncher */ = { - isa = PBXGroup; - children = ( - 89D3CD2D142EEB2200A08AED /* src */, - 89D3CD28142EEB2200A08AED /* resources */, - 29B97323FDCFA39411CA2CEA /* linking */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - name = JavaAppLauncher; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* linking */ = { - isa = PBXGroup; - children = ( - 2C48F06714350F8300F2AEFD /* 1.7.0.jdk */, - 2C483E04143512EB00F2AEFD /* 1.7.0.jre */, - 2CB5DA5D14355FCA00D3A656 /* include */, - 1058C7A0FEA54F0111CA2CBB /* frameworks */, - ); - name = linking; - sourceTree = ""; - }; - 2CB5DA5D14355FCA00D3A656 /* include */ = { - isa = PBXGroup; - children = ( - 2CB5DA5E14355FCA00D3A656 /* classfile_constants.h */, - 2CB5DA5F14355FCA00D3A656 /* darwin */, - 2CB5DA6214355FCA00D3A656 /* jawt.h */, - 2CB5DA6314355FCA00D3A656 /* jdwpTransport.h */, - 2CB5DA6414355FCA00D3A656 /* jni.h */, - 2CB5DA6514355FCA00D3A656 /* jvmti.h */, - 2CB5DA6614355FCA00D3A656 /* jvmticmlr.h */, - ); - name = include; - path = "../../../../../build/macosx-universal/j2sdk-bundle/1.7.0.jdk/Contents/Home/include"; - sourceTree = ""; - }; - 2CB5DA5F14355FCA00D3A656 /* darwin */ = { - isa = PBXGroup; - children = ( - 2CB5DA6014355FCA00D3A656 /* jawt_md.h */, - 2CB5DA6114355FCA00D3A656 /* jni_md.h */, - ); - path = darwin; - sourceTree = ""; - }; - 89D3CD28142EEB2200A08AED /* resources */ = { - isa = PBXGroup; - children = ( - 89D3CD29142EEB2200A08AED /* InfoPlist.strings */, - 89D3CD2B142EEB2200A08AED /* GenericApp.icns */, - 89D3CD2C142EEB2200A08AED /* JavaAppLauncher-Info.plist */, - ); - path = resources; - sourceTree = ""; - }; - 89D3CD2D142EEB2200A08AED /* src */ = { - isa = PBXGroup; - children = ( - 89D3CD31142EEB2200A08AED /* main.m */, - 89D3D363143041F000A08AED /* JavaAppLauncher.h */, - 89D3D364143041F000A08AED /* JavaAppLauncher.m */, - 89D3CD2F142EEB2200A08AED /* JVMArgs.h */, - 89D3CD30142EEB2200A08AED /* JVMArgs.m */, - 89D3CD2E142EEB2200A08AED /* JavaAppLauncher_Prefix.pch */, - ); - path = src; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* JavaAppLauncher */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "JavaAppLauncher" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 2C48F06614350F0F00F2AEFD /* Copy PlugIns */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = JavaAppLauncher; - productInstallPath = "$(HOME)/Applications"; - productName = JavaAppLauncher; - productReference = 8D1107320486CEB800E47090 /* JavaAppLauncher.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "JavaAppLauncher" */; - compatibilityVersion = "Xcode 3.1"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - en, - English, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* JavaAppLauncher */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D1107260486CEB800E47090 /* JavaAppLauncher */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 89D3CD32142EEB2200A08AED /* InfoPlist.strings in Resources */, - 89D3CD33142EEB2200A08AED /* GenericApp.icns in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 89D3CD35142EEB2200A08AED /* JVMArgs.m in Sources */, - 89D3CD36142EEB2200A08AED /* main.m in Sources */, - 89D3D365143041F000A08AED /* JavaAppLauncher.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 89D3CD29142EEB2200A08AED /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 89D3CD2A142EEB2200A08AED /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = src/JavaAppLauncher_Prefix.pch; - INFOPLIST_FILE = "resources/JavaAppLauncher-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = "$(inherited)"; - PRODUCT_NAME = JavaAppLauncher; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = src/JavaAppLauncher_Prefix.pch; - INFOPLIST_FILE = "resources/JavaAppLauncher-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = "$(inherited)"; - PRODUCT_NAME = JavaAppLauncher; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = YES; - PREBINDING = NO; - SDKROOT = ""; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PREBINDING = NO; - SDKROOT = ""; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "JavaAppLauncher" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "JavaAppLauncher" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/resources/English.lproj/InfoPlist.strings b/jdk/src/macosx/bundle/JavaAppLauncher/resources/English.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8f8..00000000000 --- a/jdk/src/macosx/bundle/JavaAppLauncher/resources/English.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/resources/JavaAppLauncher-Info.plist b/jdk/src/macosx/bundle/JavaAppLauncher/resources/JavaAppLauncher-Info.plist deleted file mode 100644 index a3268bb9f89..00000000000 --- a/jdk/src/macosx/bundle/JavaAppLauncher/resources/JavaAppLauncher-Info.plist +++ /dev/null @@ -1,48 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - GenericApp.icns - CFBundleIdentifier - com.yourcompany.${PRODUCT_NAME:rfc1034identifier} - CFBundleDisplayName - Your Cool App - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSMinimumSystemVersion - ${MACOSX_DEPLOYMENT_TARGET} - NSHumanReadableCopyright - Copyright © 2011 Your Company Inc. All Rights Reserved. - JVMInfo - - JRE - 1.7.0.jre - ClassPath - - Properties - - apple.laf.useScreenMenuBar - true - - MainClass - com.yourcompany.yourapp.mainclass - Arguments - - - - diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.h b/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.h deleted file mode 100644 index cceb88d6e7c..00000000000 --- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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. - */ - -#import - -#import "jni.h" - - -@interface JVMArgs : NSObject { -@public - NSBundle *jreBundle; - char *preferredJVMLib; - JavaVMInitArgs vm_args; - BOOL startOnFirstThread; - BOOL debug; - - NSDictionary *appInfo; - NSMutableDictionary *jvmInfo; - - NSString *userHome; - NSString *appPackage; - NSString *javaRoot; -} - -@property (retain, nonatomic) NSBundle *jreBundle; -@property (nonatomic) char *preferredJVMLib; -@property (nonatomic) JavaVMInitArgs vm_args; -@property (nonatomic) BOOL startOnFirstThread; -@property (nonatomic) BOOL debug; - -@property (retain, nonatomic) NSDictionary *appInfo; -@property (retain, nonatomic) NSMutableDictionary *jvmInfo; - -@property (retain, nonatomic) NSString *userHome; -@property (retain, nonatomic) NSString *appPackage; -@property (retain, nonatomic) NSString *javaRoot; - -+ (JVMArgs *)jvmArgsForBundle:(NSBundle *)appBundle argc:(int)argc argv:(char *[])argv; - -@end diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m b/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m deleted file mode 100644 index 1f4af016080..00000000000 --- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JVMArgs.m +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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. - */ - -#import "JVMArgs.h" - - -#define kArgsFailure "JVMArgsFailure" - -NSString *kArgumentsKey = @"Arguments"; - -NSString *kClassPathKey = @"ClassPath"; -#ifdef __i386__ -NSString *kArchClassPathKey = @"ClassPath.i386"; -#elif __x86_64__ -NSString *kArchClassPathKey = @"ClassPath.x86_64"; -#endif - -NSString *kVMOptionsKey = @"VMOptions"; -#ifdef __i386__ -NSString *kArchVMOptionsKey = @"VMOptions.i386"; -#elif __x86_64__ -NSString *kArchVMOptionsKey = @"VMOptions.x86_64"; -#endif - - -@implementation JVMArgs - -@synthesize jreBundle; -@synthesize preferredJVMLib; -@synthesize vm_args; -@synthesize startOnFirstThread; -@synthesize debug; - -@synthesize appInfo; -@synthesize jvmInfo; - -@synthesize userHome; -@synthesize appPackage; -@synthesize javaRoot; - -- (void) dealloc { - self.jreBundle = nil; - if (self.preferredJVMLib) free(self.preferredJVMLib); - - self.appInfo = nil; - self.jvmInfo = nil; - - self.userHome = nil; - self.appPackage = nil; - self.javaRoot = nil; - - [super dealloc]; -} - - -NSString *GetJavaRoot(NSDictionary *jvmInfoDict) { - NSObject *javaRoot = [jvmInfoDict objectForKey:@"$JAVAROOT"]; - if (![javaRoot isKindOfClass:[NSString class]]) return @"$APP_PACKAGE/Contents/Java"; - return (NSString *)javaRoot; -} - -// Replaces occurances of $JAVAROOT, $APP_PACKAGE, and $USER_HOME -- (NSString *) expandMacros:(NSString *)str { - if ([str rangeOfString:@"$JAVAROOT"].length == 0 && [str rangeOfString:@"$APP_PACKAGE"].length == 0 && [str rangeOfString:@"$USER_HOME"].length == 0) return str; - - // expand $JAVAROOT first, because it can contain $APP_PACKAGE - NSMutableString *mutable = [str mutableCopy]; - [mutable replaceOccurrencesOfString:@"$JAVAROOT" withString:javaRoot options:0 range:NSMakeRange(0, [str length])]; - [mutable replaceOccurrencesOfString:@"$APP_PACKAGE" withString:appPackage options:0 range:NSMakeRange(0, [str length])]; - [mutable replaceOccurrencesOfString:@"$USER_HOME" withString:userHome options:0 range:NSMakeRange(0, [str length])]; - return mutable; -} - -- (NSArray *) arrayFrom:(id) obj delimitedBy:(NSString *)delimiter withErrKey:(NSString *)key { - if (obj == nil) return nil; - if ([obj isKindOfClass:[NSArray class]]) return obj; - if (![obj isKindOfClass:[NSString class]]) { - [NSException raise:@kArgsFailure format:@"%@", [NSString stringWithFormat:@"Failed to find '%@' array in JVMInfo Info.plist"]]; - } - - // split - return [(NSString *)obj componentsSeparatedByString:delimiter]; -} - -- (void) buildArgsForBundle:(NSBundle *)appBundle argc:(int)argc argv:(char *[])argv { - // for verbose logging - self.debug = NULL != getenv("JAVA_LAUNCHER_VERBOSE"); - - self.appInfo = [appBundle infoDictionary]; - - // all apps must have a JVMInfo dictionary inside their Info.plist - self.jvmInfo = [[self.appInfo objectForKey:@"JVMInfo"] mutableCopy]; - if (![jvmInfo isKindOfClass:[NSDictionary class]]) { - [NSException raise:@kArgsFailure format:@"Failed to find 'JVMInfo' dictionary in Info.plist"]; - } - - // initialize macro expansion values - self.userHome = NSHomeDirectory(); - self.appPackage = [appBundle bundlePath]; - self.javaRoot = GetJavaRoot(jvmInfo); - self.javaRoot = [self expandMacros:self.javaRoot]; // dereference $APP_PACKAGE - - // if the 'Arguments' key is defined, those override the ones that came into main() - NSArray *jvmInfoArgs = [jvmInfo valueForKey:kArgumentsKey]; - if (jvmInfoArgs != nil) { - // substitute all the variables in the 'Arguments' array/string - jvmInfoArgs = [self arrayFrom:jvmInfoArgs delimitedBy:@" " withErrKey:kArgumentsKey]; - NSMutableArray *arguments = [NSMutableArray arrayWithCapacity:[jvmInfoArgs count]]; - [jvmInfoArgs enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - [arguments replaceObjectAtIndex:idx withObject:[self expandMacros:[obj description]]]; - }]; - [jvmInfo setObject:arguments forKey:kArgumentsKey]; - } else if (argc != 0) { - // put the (macro expanded) args to main() in an NSArray - NSMutableArray *arguments = [NSMutableArray arrayWithCapacity:argc]; - for (int i = 0; i < argc; i++) { - [arguments addObject:[self expandMacros:[NSString stringWithUTF8String:(argv[i])]]]; - } - [jvmInfo setObject:arguments forKey:kArgumentsKey]; - } - - // all JVMInfo's must have a JRE or JDK key - NSString *jreBundleName = [jvmInfo objectForKey:@"JRE"]; - if (!jreBundleName) jreBundleName = [jvmInfo objectForKey:@"JDK"]; - if (![jreBundleName isKindOfClass:[NSString class]]) { - [NSException raise:@kArgsFailure format:@"Failed to find 'JRE' or 'JDK' string in Info.plist JVMInfo"]; - } - - // the JRE/JDK must be loadable from the ($APP_PACKAGE)/Contents/PlugIns/ directory - NSURL *jreBundleURL = [[appBundle builtInPlugInsURL] URLByAppendingPathComponent:jreBundleName]; - self.jreBundle = [NSBundle bundleWithURL:jreBundleURL]; - if (!self.jreBundle) { - [NSException raise:@kArgsFailure format:@"Failed to find JRE/JDK at: %@", jreBundleURL]; - } - - // if the app prefers 'client' or 'server', use the JVM key - NSString *JVMLib = [jvmInfo objectForKey:@"JVM"]; - if (JVMLib != nil) self.preferredJVMLib = strdup([JVMLib UTF8String]); - - // sniff for StartOnFirstThread - if ([[jvmInfo objectForKey:@"StartOnFirstThread"] boolValue]) { - self.startOnFirstThread = YES; - } else if ([[jvmInfo objectForKey:@"StartOnMainThread"] boolValue]) { - // for key compatibility with the Apple JavaApplicationStub's 'Java' dictionary - self.startOnFirstThread = YES; - } - - // add $JAVAROOT directory to the JNI library search path - setenv("JAVA_LIBRARY_PATH", [javaRoot UTF8String], 1); - - // 'WorkingDirectory' key changes current working directory - NSString *javaWorkingDir = [jvmInfo objectForKey:@"WorkingDirectory"]; - if (javaWorkingDir == nil) javaWorkingDir = @"$APP_PACKAGE/.."; - javaWorkingDir = [self expandMacros:javaWorkingDir]; - if (chdir([javaWorkingDir UTF8String]) == -1) { - NSLog(@kArgsFailure " chdir() failed, could not change the current working directory to %s\n", [javaWorkingDir UTF8String]); - } - - NSMutableArray *classpath = [NSMutableArray array]; - - // 'Jar' key sets exactly one classpath entry - NSString *jarFile = [jvmInfo objectForKey:@"Jar"]; - if (jarFile != nil) { - [jvmInfo setObject:[self expandMacros:jarFile] forKey:@"Jar"]; - [classpath addObject:jarFile]; - } - - // 'ClassPath' key allows arbitrary classpath - [classpath addObjectsFromArray:[self arrayFrom:[jvmInfo objectForKey:kClassPathKey] delimitedBy:@":" withErrKey:kClassPathKey]]; - [classpath addObjectsFromArray:[self arrayFrom:[jvmInfo objectForKey:kArchClassPathKey] delimitedBy:@":" withErrKey:kArchClassPathKey]]; - - // Sum up all the classpath entries into one big JVM arg - NSMutableString *classpathOption = [NSMutableString stringWithString:@"-Djava.class.path="]; - [classpath enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - if (idx > 1) [classpathOption appendString:@":"]; - [classpathOption appendString:obj]; - }]; - - NSMutableArray *jvmOptions = [NSMutableArray arrayWithObject:classpathOption]; - - // 'VMOptions' key allows arbitary VM start up options - [jvmOptions addObjectsFromArray:[self arrayFrom:[jvmInfo objectForKey:kVMOptionsKey] delimitedBy:@" " withErrKey:kVMOptionsKey]]; - [jvmOptions addObjectsFromArray:[self arrayFrom:[jvmInfo objectForKey:kArchVMOptionsKey] delimitedBy:@" " withErrKey:kArchVMOptionsKey]]; - - // 'Properties' key is a sub-dictionary transfered to initial System.properties - NSDictionary *properties = [jvmInfo objectForKey:@"Properties"]; - if (properties != nil) { - if (![properties isKindOfClass:[NSDictionary class]]) { - [NSException raise:@kArgsFailure format:@"Failed to find 'Properties' dictionary in Info.plist JVMInfo"]; - } - - [properties enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - [jvmOptions addObject:[NSString stringWithFormat:@"-D%@=%@", key, obj]]; - }]; - } - - // build the real JVM init args struct - vm_args.version = JNI_VERSION_1_6; - vm_args.ignoreUnrecognized = JNI_TRUE; - vm_args.nOptions = [jvmOptions count]; - vm_args.options = calloc(vm_args.nOptions, sizeof(JavaVMOption)); - [jvmOptions enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - NSString *expanded = [self expandMacros:[obj description]]; // turn everything into a string, and expand macros - vm_args.options[idx].optionString = strdup([expanded UTF8String]); - }]; -} - -+ (JVMArgs *)jvmArgsForBundle:(NSBundle *)appBundle argc:(int)argc argv:(char *[])argv { - JVMArgs *args = [JVMArgs new]; - [args buildArgsForBundle:appBundle argc:argc argv:argv]; - return [args autorelease]; -} - -@end diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.m b/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.m deleted file mode 100644 index db44ab3fee7..00000000000 --- a/jdk/src/macosx/bundle/JavaAppLauncher/src/JavaAppLauncher.m +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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. - */ - -#import "JavaAppLauncher.h" - -#import - -#import "jni.h" - -#define kLaunchFailure "JavaAppLauncherFailure" - - -typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, void **env, void *args); -typedef void (JNICALL *SetPreferredJVM_t)(const char *prefJVM); - - -@implementation JavaAppLauncher - -@synthesize args; - -- (void) findAndLoadJVM { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - - @try { - // load the libjli.dylib of the embedded JRE (or JDK) bundle - NSURL *jreBundleURL = [args.jreBundle bundleURL]; - CFBundleRef jreBundle = CFBundleCreate(NULL, (CFURLRef)jreBundleURL); - - NSError *err = nil; - Boolean jreBundleLoaded = CFBundleLoadExecutableAndReturnError(jreBundle, (CFErrorRef *)&err); - if (err != nil || !jreBundleLoaded) { - [NSException raise:@kLaunchFailure format:@"could not load the JRE/JDK: %@", err]; - } - - // if there is a preferred libjvm to load, set it here - if (args.preferredJVMLib != NULL) { - SetPreferredJVM_t setPrefJVMFxnPtr = CFBundleGetFunctionPointerForName(jreBundle, CFSTR("JLI_SetPreferredJVM")); - if (setPrefJVMFxnPtr != NULL) { - setPrefJVMFxnPtr(args.preferredJVMLib); - } else { - NSLog(@"No JLI_SetPreferredJVM in JRE/JDK primary executable, failed to set preferred JVM library to: %s", args->preferredJVMLib); - } - } - - // pull the JNI_CreateJavaVM function pointer out of the primary executable of the JRE/JDK bundle - CreateJavaVM_t createJVMFxnPtr = CFBundleGetFunctionPointerForName(jreBundle, CFSTR("JNI_CreateJavaVM")); - if (createJVMFxnPtr == NULL) { - [NSException raise:@kLaunchFailure format:@"null JNI_CreateJavaVM fxn ptr from: %@", jreBundle]; - } - - // instantiate the JVM - JNIEnv *env; - jint createJVMStatus = createJVMFxnPtr(&jvm, (void **)&env, &(args->vm_args)); - if (createJVMStatus != JNI_OK) { - [NSException raise:@kLaunchFailure format:@"failed to JNI_CreateJavaVM (%d): %@", createJVMStatus, jreBundle]; - } - - // check the app needs to run the Java main() on the main thread - if (args.startOnFirstThread) { - dispatch_sync(dispatch_get_main_queue(), ^(void) { - JNIEnv *mainThreadEnv; - (*jvm)->AttachCurrentThread(jvm, (void **)&mainThreadEnv, NULL); - [self invokeBundledAppJavaLauncherWithEnv:mainThreadEnv]; - (*jvm)->DetachCurrentThread(jvm); - }); - } else { - [self invokeBundledAppJavaLauncherWithEnv:env]; - } - - } @catch (NSException *e) { - NSLog(@"%@: %@", e, [e callStackSymbols]); - } - - if (jvm) { - (*jvm)->DetachCurrentThread(jvm); - (*jvm)->DestroyJavaVM(jvm); - } - - [pool drain]; -} - -static const char kLauncherClassName[] = "apple/launcher/JavaAppLauncher"; - -- (void) invokeBundledAppJavaLauncherWithEnv:(JNIEnv *)env { - // hand off control to the apple.launcher.JavaAppLauncher class - - jclass mainClass = (*env)->FindClass(env, kLauncherClassName); - if (mainClass == NULL) { - fprintf(stderr, kLaunchFailure " FindClass() failed for class %s:\n", kLauncherClassName); - (*env)->ExceptionDescribe(env); - return; - } - - jmethodID mainMethod = (*env)->GetStaticMethodID(env, mainClass, "launch", "(JZ)V"); - if ((mainMethod == NULL) || (*env)->ExceptionOccurred(env)) { - fprintf(stderr, kLaunchFailure " GetStaticMethodID() failed for launch() method"); - (*env)->ExceptionDescribe(env); - return; - } - - CFDictionaryRef jvmInfo = CFRetain(args.jvmInfo); - - (*env)->CallStaticVoidMethod(env, mainClass, mainMethod, (jlong)jvmInfo, (jboolean)args.debug); - if ((*env)->ExceptionOccurred(env)) { - fprintf(stderr, kLaunchFailure " CallStaticVoidMethod() threw an exception\n"); - (*env)->ExceptionDescribe(env); - return; - } -} - -@end diff --git a/jdk/src/macosx/bundle/JavaAppLauncher/src/main.m b/jdk/src/macosx/bundle/JavaAppLauncher/src/main.m deleted file mode 100644 index 019e78a7d48..00000000000 --- a/jdk/src/macosx/bundle/JavaAppLauncher/src/main.m +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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. - */ - -#import - -#import "JVMArgs.h" -#import "JavaAppLauncher.h" - - -static void dummyTimer(CFRunLoopTimerRef timer, void *info) {} -static void ParkEventLoop() { - // RunLoop needs at least one source, and 1e20 is pretty far into the future - CFRunLoopTimerRef t = CFRunLoopTimerCreate(kCFAllocatorDefault, 1.0e20, 0.0, 0, 0, dummyTimer, NULL); - CFRunLoopAddTimer(CFRunLoopGetCurrent(), t, kCFRunLoopDefaultMode); - CFRelease(t); - - // Park this thread in the main run loop. - int32_t result; - do { - result = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1.0e20, false); - } while (result != kCFRunLoopRunFinished); -} - -int main(int argc, char *argv[]) { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - - @try { - NSBundle *mainBundle = [NSBundle mainBundle]; - - // pick apart the Info.plist, and release all the temporary objects - NSAutoreleasePool *argParsingPool = [NSAutoreleasePool new]; - JVMArgs *args = [JVMArgs jvmArgsForBundle:mainBundle argc:argc argv:argv]; - JavaAppLauncher *launcher = [JavaAppLauncher new]; - launcher.args = args; - [argParsingPool drain]; - - // kick off a new thread to instantiate the JVM on - NSThread *thread = [[NSThread alloc] initWithTarget:launcher selector:@selector(findAndLoadJVM) object:nil]; - struct rlimit limit; - int err = getrlimit(RLIMIT_STACK, &limit); - if (err == 0 && limit.rlim_cur != 0LL) { - [thread setStackSize:limit.rlim_cur]; - } - [thread start]; - [thread release]; - - [launcher release]; - - ParkEventLoop(); - - } @catch (NSException *e) { - NSLog(@"%@: %@", e, [e callStackSymbols]); - } - - [pool drain]; - - return 0; -} diff --git a/jdk/src/macosx/classes/apple/launcher/JavaAppLauncher.java b/jdk/src/macosx/classes/apple/launcher/JavaAppLauncher.java deleted file mode 100644 index c701b1be63e..00000000000 --- a/jdk/src/macosx/classes/apple/launcher/JavaAppLauncher.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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. - */ - -package apple.launcher; - -import java.io.*; -import java.lang.reflect.*; -import java.text.MessageFormat; -import java.util.*; -import java.util.jar.*; - -import javax.swing.*; - -class JavaAppLauncher implements Runnable { - static { - java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Void run() { - System.loadLibrary("osx"); - return null; - } - }); - } - - private static native T nativeConvertAndRelease(final long ptr); - private static native void nativeInvokeNonPublic(Class cls, Method m, String[] args); - - // entry point from native - static void launch(final long javaDictionaryPtr, final boolean verbose) { - final Map javaDictionary = nativeConvertAndRelease(javaDictionaryPtr); - (new JavaAppLauncher(javaDictionary, verbose)).run(); - } - - // these are the values for the enumeration JavaFailureMode - static final String kJavaFailureMainClassNotSpecified = "MainClassNotSpecified"; - static final String kJavaFailureMainClassNotFound = "CannotLoadMainClass"; - static final String kJavaFailureMainClassHasNoMain = "NoMainMethod"; - static final String kJavaFailureMainClassMainNotStatic = "MainNotStatic"; - static final String kJavaFailureMainThrewException = "MainThrewException"; - static final String kJavaFailureMainInitializerException = "MainInitializerException"; - - final boolean verbose; // Normally set by environment variable JAVA_LAUNCHER_VERBOSE. - final Map javaDictionary; - - JavaAppLauncher(final Map javaDictionary, final boolean verbose) { - this.verbose = verbose; - this.javaDictionary = javaDictionary; - } - - @Override - public void run() { - final Method m = loadMainMethod(getMainMethod()); - final String methodName = m.getDeclaringClass().getName() + ".main(String[])"; - try { - log("Calling " + methodName + " method"); - m.invoke(null, new Object[] { getArguments() }); - log(methodName + " has returned"); - } catch (final IllegalAccessException x) { - try { - nativeInvokeNonPublic(m.getClass(), m, getArguments()); - } catch (final Throwable excpt) { - logError(methodName + " threw an exception:"); - if ((excpt instanceof UnsatisfiedLinkError) && excpt.getMessage().equals("nativeInvokeNonPublic")) { - showFailureAlertAndKill(kJavaFailureMainThrewException, "nativeInvokeNonPublic not registered"); - } else { - excpt.printStackTrace(); - showFailureAlertAndKill(kJavaFailureMainThrewException, excpt.toString()); - } - } - } catch (final InvocationTargetException invokeExcpt) { - logError(methodName + " threw an exception:"); - invokeExcpt.getTargetException().printStackTrace(); - showFailureAlertAndKill(kJavaFailureMainThrewException, invokeExcpt.getTargetException().toString()); - } - } - - Method loadMainMethod(final String mainClassName) { - try { - final Class mainClass = Class.forName(mainClassName, true, sun.misc.Launcher.getLauncher().getClassLoader()); - final Method mainMethod = mainClass.getDeclaredMethod("main", new Class[] { String[].class }); - if ((mainMethod.getModifiers() & Modifier.STATIC) == 0) { - logError("The main(String[]) method of class " + mainClassName + " is not static!"); - showFailureAlertAndKill(kJavaFailureMainClassMainNotStatic, mainClassName); - } - return mainMethod; - } catch (final ExceptionInInitializerError x) { - logError("The main class \"" + mainClassName + "\" had a static initializer throw an exception."); - x.getException().printStackTrace(); - showFailureAlertAndKill(kJavaFailureMainInitializerException, x.getException().toString()); - } catch (final ClassNotFoundException x) { - logError("The main class \"" + mainClassName + "\" could not be found."); - showFailureAlertAndKill(kJavaFailureMainClassNotFound, mainClassName); - } catch (final NoSuchMethodException x) { - logError("The main class \"" + mainClassName + "\" has no static main(String[]) method."); - showFailureAlertAndKill(kJavaFailureMainClassHasNoMain, mainClassName); - } catch (final NullPointerException x) { - logError("No main class specified"); - showFailureAlertAndKill(kJavaFailureMainClassNotSpecified, null); - } - - return null; - } - - // get main class name from 'Jar' key, or 'MainClass' key - String getMainMethod() { - final Object javaJar = javaDictionary.get("Jar"); - if (javaJar != null) { - if (!(javaJar instanceof String)) { - logError("'Jar' key in 'Java' sub-dictionary of Info.plist requires a string value"); - return null; - } - - final String jarPath = (String)javaJar; - if (jarPath.length() == 0) { - log("'Jar' key of sub-dictionary 'Java' of Info.plist key is empty"); - } else { - // extract main class from manifest of this jar - final String main = getMainFromManifest(jarPath); - if (main == null) { - logError("jar file '" + jarPath + "' does not have Main-Class: attribute in its manifest"); - return null; - } - - log("Main class " + main + " found in jar manifest"); - return main; - } - } - - final Object javaMain = javaDictionary.get("MainClass"); - if (!(javaMain instanceof String)) { - logError("'MainClass' key in 'Java' sub-dictionary of Info.plist requires a string value"); - return null; - } - - final String main = (String)javaMain; - if (main.length() == 0) { - log("'MainClass' key of sub-dictionary 'Java' of Info.plist key is empty"); - return null; - } - - log("Main class " + (String)javaMain + " found via 'MainClass' key of sub-dictionary 'Java' of Info.plist key"); - return (String)javaMain; - } - - // get arguments for main(String[]) out of Info.plist and command line - String[] getArguments() { - // check for 'Arguments' key, which contains the main() args if not defined in Info.plist - final Object javaArguments = javaDictionary.get("Arguments"); - if (javaArguments == null) { - // no arguments - log("No arguments for main(String[]) specified"); - return new String[0]; - } - - if (javaArguments instanceof List) { - final List args = (List)javaArguments; - final int count = args.size(); - log("Arguments to main(String[" + count + "]):"); - - final String[] result = new String[count]; - for (int i = 0; i < count; ++i) { - final Object element = args.get(i); - if (element instanceof String) { - result[i] = (String)element; - } else { - logError("Found non-string in array"); - } - log(" arg[" + i + "]=" + result[i]); - } - return result; - } - - logError("'Arguments' key in 'Java' sub-dictionary of Info.plist requires a string value or an array of strings"); - return new String[0]; - } - - // returns name of main class, or null - String getMainFromManifest(final String jarpath) { - JarFile jar = null; - try { - jar = new JarFile(jarpath); - final Manifest man = jar.getManifest(); - final Attributes attr = man.getMainAttributes(); - return attr.getValue("Main-Class"); - } catch (final IOException x) { - // shrug - } finally { - if (jar != null) { - try { - jar.close(); - } catch (final IOException x) { } - } - } - return null; - } - - void log(final String s) { - if (!verbose) return; - System.out.println("[LaunchRunner] " + s); - } - - static void logError(final String s) { - System.err.println("[LaunchRunner Error] " + s); - } - - // This kills the app and does not return! - static void showFailureAlertAndKill(final String msg, String arg) { - if (arg == null) arg = "<>"; - JOptionPane.showMessageDialog(null, getMessage(msg, arg), "", JOptionPane.ERROR_MESSAGE); - System.exit(-1); - } - - static String getMessage(final String msgKey, final Object ... args) { - final String msg = ResourceBundle.getBundle("appLauncherErrors").getString(msgKey); - return MessageFormat.format(msg, args); - } -} diff --git a/jdk/src/macosx/classes/apple/launcher/appLauncherErrors.properties b/jdk/src/macosx/classes/apple/launcher/appLauncherErrors.properties deleted file mode 100644 index 9f880b7a075..00000000000 --- a/jdk/src/macosx/classes/apple/launcher/appLauncherErrors.properties +++ /dev/null @@ -1,6 +0,0 @@ -MainClassNotSpecified=No main class specified. -CannotLoadMainClass=The main class \u201C{0}\u201D could not be loaded. -NoMainMethod=The main class \u201C{0}\u201D has no \u201Cvoid main(String[])\u201D method. -MainNotStatic=The \u201Cmain(String[])\u201D method of class \u201C{0}\u201D is not static. -MainThrewException=Uncaught exception in main method: {0} -MainInitializerException=A static initializer of the main class threw an exception: {0} diff --git a/jdk/src/macosx/classes/apple/security/KeychainStore.java b/jdk/src/macosx/classes/apple/security/KeychainStore.java index 8df45d7bea7..8d04ee976f6 100644 --- a/jdk/src/macosx/classes/apple/security/KeychainStore.java +++ b/jdk/src/macosx/classes/apple/security/KeychainStore.java @@ -74,19 +74,19 @@ public final class KeychainStore extends KeyStoreSpi { * Entries that have been deleted. When something calls engineStore we'll * remove them from the keychain. */ - private Hashtable deletedEntries = new Hashtable(); + private Hashtable deletedEntries = new Hashtable<>(); /** * Entries that have been added. When something calls engineStore we'll * add them to the keychain. */ - private Hashtable addedEntries = new Hashtable(); + private Hashtable addedEntries = new Hashtable<>(); /** * Private keys and certificates are stored in a hashtable. * Hash entries are keyed by alias names. */ - private Hashtable entries = new Hashtable(); + private Hashtable entries = new Hashtable<>(); /** * Algorithm identifiers and corresponding OIDs for the contents of the PKCS12 bag we get from the Keychain. @@ -471,7 +471,7 @@ public final class KeychainStore extends KeyStoreSpi { // This will be slow, but necessary. Enumerate the values and then see if the cert matches the one in the trusted cert entry. // Security framework doesn't support the same certificate twice in a keychain. - Collection allValues = entries.values(); + Collection allValues = entries.values(); for (Object value : allValues) { if (value instanceof TrustedCertEntry) { @@ -517,7 +517,7 @@ public final class KeychainStore extends KeyStoreSpi { * * @return enumeration of the alias names */ - public Enumeration engineAliases() { + public Enumeration engineAliases() { permissionCheck(); return entries.keys(); } @@ -598,8 +598,8 @@ public final class KeychainStore extends KeyStoreSpi { permissionCheck(); Certificate certElem; - for (Enumeration e = entries.keys(); e.hasMoreElements(); ) { - String alias = (String)e.nextElement(); + for (Enumeration e = entries.keys(); e.hasMoreElements(); ) { + String alias = e.nextElement(); Object entry = entries.get(alias); if (entry instanceof TrustedCertEntry) { certElem = ((TrustedCertEntry)entry).cert; @@ -634,8 +634,8 @@ public final class KeychainStore extends KeyStoreSpi { permissionCheck(); // Delete items that do have a keychain item ref. - for (Enumeration e = deletedEntries.keys(); e.hasMoreElements(); ) { - String alias = (String)e.nextElement(); + for (Enumeration e = deletedEntries.keys(); e.hasMoreElements(); ) { + String alias = e.nextElement(); Object entry = deletedEntries.get(alias); if (entry instanceof TrustedCertEntry) { if (((TrustedCertEntry)entry).certRef != 0) { @@ -664,8 +664,8 @@ public final class KeychainStore extends KeyStoreSpi { // Add all of the certs or keys in the added entries. // No need to check for 0 refs, as they are in the added list. - for (Enumeration e = addedEntries.keys(); e.hasMoreElements(); ) { - String alias = (String)e.nextElement(); + for (Enumeration e = addedEntries.keys(); e.hasMoreElements(); ) { + String alias = e.nextElement(); Object entry = addedEntries.get(alias); if (entry instanceof TrustedCertEntry) { TrustedCertEntry tce = (TrustedCertEntry)entry; @@ -730,8 +730,8 @@ public final class KeychainStore extends KeyStoreSpi { // Release any stray keychain references before clearing out the entries. synchronized(entries) { - for (Enumeration e = entries.keys(); e.hasMoreElements(); ) { - String alias = (String)e.nextElement(); + for (Enumeration e = entries.keys(); e.hasMoreElements(); ) { + String alias = e.nextElement(); Object entry = entries.get(alias); if (entry instanceof TrustedCertEntry) { if (((TrustedCertEntry)entry).certRef != 0) { @@ -816,7 +816,7 @@ public final class KeychainStore extends KeyStoreSpi { // Next, create X.509 Certificate objects from the raw data. This is complicated // because a certificate's public key may be too long for Java's default encryption strength. - List createdCerts = new ArrayList(); + List createdCerts = new ArrayList<>(); try { CertificateFactory cf = CertificateFactory.getInstance("X.509"); @@ -842,12 +842,12 @@ public final class KeychainStore extends KeyStoreSpi { // We have our certificates in the List, so now extract them into an array of // Certificates and SecCertificateRefs. - Object[] objArray = createdCerts.toArray(); + CertKeychainItemPair[] objArray = createdCerts.toArray(new CertKeychainItemPair[0]); Certificate[] certArray = new Certificate[objArray.length]; long[] certRefArray = new long[objArray.length]; for (int i = 0; i < objArray.length; i++) { - CertKeychainItemPair addedItem = (CertKeychainItemPair)objArray[i]; + CertKeychainItemPair addedItem = objArray[i]; certArray[i] = addedItem.mCert; certRefArray[i] = addedItem.mCertificateRef; } diff --git a/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java b/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java index e91efeaa009..76dea3a7ed3 100644 --- a/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java +++ b/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java @@ -95,7 +95,7 @@ class _AppDockIconHandler { static Creator getCImageCreator() { try { - final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {}); + final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {}); getCreatorMethod.setAccessible(true); return (Creator)getCreatorMethod.invoke(null, new Object[] {}); } catch (final Throwable e) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java b/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java index dfb6fddd5ce..e9eda68094c 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java @@ -75,7 +75,7 @@ public abstract class AquaBorder implements Border, UIResource { protected AquaBorder deriveBorderForSize(final Size size) { try { final Class clazz = getClass(); - final AquaBorder border = clazz.getConstructor(new Class[] { clazz }).newInstance(new Object[] { this }); + final AquaBorder border = clazz.getConstructor(new Class[] { clazz }).newInstance(new Object[] { this }); border.setSize(size); return border; } catch (final Throwable e) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java index 2867245ee1e..c87bcb78c04 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java @@ -35,8 +35,8 @@ import apple.laf.JRSUIConstants.*; @SuppressWarnings("serial") // Superclass is not serializable across versions class AquaComboBoxButton extends JButton { - final protected JComboBox comboBox; - final protected JList list; + final protected JComboBox comboBox; + final protected JList list; final protected CellRendererPane rendererPane; final protected AquaComboBoxUI ui; @@ -45,7 +45,10 @@ class AquaComboBoxButton extends JButton { boolean isSquare; @SuppressWarnings("serial") // anonymous class - protected AquaComboBoxButton(final AquaComboBoxUI ui, final JComboBox comboBox, final CellRendererPane rendererPane, final JList list) { + protected AquaComboBoxButton(final AquaComboBoxUI ui, + final JComboBox comboBox, + final CellRendererPane rendererPane, + final JList list) { super(""); putClientProperty("JButton.buttonType", "comboboxInternal"); @@ -163,7 +166,7 @@ class AquaComboBoxButton extends JButton { } protected void doRendererPaint(final Graphics g, final ButtonModel buttonModel, final boolean editable, final Insets insets, int left, int top, int width, int height) { - final ListCellRenderer renderer = comboBox.getRenderer(); + final ListCellRenderer renderer = comboBox.getRenderer(); // fake it out! not renderPressed final Component c = renderer.getListCellRendererComponent(list, comboBox.getSelectedItem(), -1, false, false); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java index dde9b1be337..0f466e188e6 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java @@ -43,7 +43,7 @@ class AquaComboBoxPopup extends BasicComboPopup { protected Component bottomStrut; protected boolean isPopDown = false; - public AquaComboBoxPopup(final JComboBox cBox) { + public AquaComboBoxPopup(final JComboBox cBox) { super(cBox); } @@ -93,7 +93,7 @@ class AquaComboBoxPopup extends BasicComboPopup { final int rowCount = Math.min(maxRowCount, currentElementCount); final Dimension popupSize = new Dimension(); - final ListCellRenderer renderer = list.getCellRenderer(); + final ListCellRenderer renderer = list.getCellRenderer(); for (int i = 0; i < rowCount; i++) { final Object value = list.getModel().getElementAt(i); @@ -149,8 +149,8 @@ class AquaComboBoxPopup extends BasicComboPopup { @Override @SuppressWarnings("serial") // anonymous class - protected JList createList() { - return new JList(comboBox.getModel()) { + protected JList createList() { + return new JList(comboBox.getModel()) { @Override public void processMouseEvent(MouseEvent e) { if (e.isMetaDown()) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java index 6161eb6447c..f4d4225efe0 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java @@ -29,8 +29,8 @@ import javax.swing.*; import javax.swing.plaf.UIResource; @SuppressWarnings("serial") // Superclass is not serializable across versions -class AquaComboBoxRenderer extends AquaComboBoxRendererInternal implements UIResource { - public AquaComboBoxRenderer(final JComboBox comboBox) { +class AquaComboBoxRenderer extends AquaComboBoxRendererInternal implements UIResource { + public AquaComboBoxRenderer(final JComboBox comboBox) { super(comboBox); } } diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java index 2ed6dcfcf70..cf1025f6a85 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java @@ -31,8 +31,8 @@ import javax.swing.*; import java.awt.*; @SuppressWarnings("serial") // Superclass is not serializable across versions -class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { - final JComboBox fComboBox; +class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { + final JComboBox fComboBox; boolean fSelected; boolean fChecked; boolean fInList; @@ -40,7 +40,7 @@ class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { boolean fDrawCheckedItem = true; // Provides space for a checkbox, and is translucent - public AquaComboBoxRendererInternal(final JComboBox comboBox) { + public AquaComboBoxRendererInternal(final JComboBox comboBox) { super(); fComboBox = comboBox; } @@ -72,7 +72,10 @@ class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer { } // Really means is the one with the mouse over it - public Component getListCellRendererComponent(final JList list, final Object value, int index, final boolean isSelected, final boolean cellHasFocus) { + public Component getListCellRendererComponent(final JList list, + final E value, int index, + final boolean isSelected, + final boolean cellHasFocus) { fInList = (index >= 0); // When the button wants the item painted, it passes in -1 fSelected = isSelected; if (index < 0) { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java index 75c7babb58a..80ca6ff5b49 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java @@ -102,13 +102,13 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { if (now - 1000 < lastBlink) return; lastBlink = now; - final JList itemList = popup.getList(); + final JList itemList = popup.getList(); final ListUI listUI = itemList.getUI(); if (!(listUI instanceof AquaListUI)) return; final AquaListUI aquaListUI = (AquaListUI)listUI; final int selectedIndex = comboBox.getSelectedIndex(); - final ListModel dataModel = itemList.getModel(); + final ListModel dataModel = itemList.getModel(); if (dataModel == null) return; final Object value = dataModel.getElementAt(selectedIndex); @@ -125,7 +125,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { // this space intentionally left blank } - protected ListCellRenderer createRenderer() { + protected ListCellRenderer createRenderer() { return new AquaComboBoxRenderer(comboBox); } @@ -185,7 +185,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { final Object text = editor.getText(); - final ListModel model = listBox.getModel(); + final ListModel model = listBox.getModel(); final int items = model.getSize(); for (int i = 0; i < items; i++) { final Object element = model.getElementAt(i); @@ -423,7 +423,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { return; } - final JComboBox cb = (JComboBox)parent; + final JComboBox cb = (JComboBox) parent; final int width = cb.getWidth(); final int height = cb.getHeight(); @@ -450,11 +450,11 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { return Boolean.TRUE.equals(c.getClientProperty(AquaComboBoxUI.IS_TABLE_CELL_EDITOR)); } - protected static boolean isPopdown(final JComboBox c) { + protected static boolean isPopdown(final JComboBox c) { return c.isEditable() || Boolean.TRUE.equals(c.getClientProperty(AquaComboBoxUI.POPDOWN_CLIENT_PROPERTY_KEY)); } - protected static void triggerSelectionEvent(final JComboBox comboBox, final ActionEvent e) { + protected static void triggerSelectionEvent(final JComboBox comboBox, final ActionEvent e) { if (!comboBox.isEnabled()) return; final AquaComboBoxUI aquaUi = (AquaComboBoxUI)comboBox.getUI(); @@ -505,7 +505,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { @SuppressWarnings("serial") // anonymous class private static final Action toggleSelectionAction = new AbstractAction() { public void actionPerformed(final ActionEvent e) { - final JComboBox comboBox = (JComboBox)e.getSource(); + final JComboBox comboBox = (JComboBox) e.getSource(); if (!comboBox.isEnabled()) return; if (comboBox.isEditable()) return; @@ -525,7 +525,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { private final Action hideAction = new AbstractAction() { @Override public void actionPerformed(final ActionEvent e) { - final JComboBox comboBox = (JComboBox)e.getSource(); + final JComboBox comboBox = (JComboBox) e.getSource(); comboBox.firePopupMenuCanceled(); comboBox.setPopupVisible(false); } @@ -588,10 +588,11 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } @SuppressWarnings("unchecked") - static final RecyclableSingleton> APPLICATOR = new RecyclableSingleton>() { + static final RecyclableSingleton, AquaComboBoxUI>> APPLICATOR = new + RecyclableSingleton, AquaComboBoxUI>>() { @Override - protected ClientPropertyApplicator getInstance() { - return new ClientPropertyApplicator( + protected ClientPropertyApplicator, AquaComboBoxUI> getInstance() { + return new ClientPropertyApplicator, AquaComboBoxUI>( new Property(AquaFocusHandler.FRAME_ACTIVE_PROPERTY) { public void applyProperty(final AquaComboBoxUI target, final Object value) { if (Boolean.FALSE.equals(value)) { @@ -633,7 +634,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { } } ) { - public AquaComboBoxUI convertJComponentToTarget(final JComboBox combo) { + public AquaComboBoxUI convertJComponentToTarget(final JComboBox combo) { final ComboBoxUI comboUI = combo.getUI(); if (comboUI instanceof AquaComboBoxUI) return (AquaComboBoxUI)comboUI; return null; @@ -641,7 +642,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable { }; } }; - static ClientPropertyApplicator getApplicator() { + static ClientPropertyApplicator, AquaComboBoxUI> getApplicator() { return APPLICATOR.get(); } } diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java index 3fae5e20310..ebb3b4b6433 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java @@ -724,6 +724,7 @@ public class AquaFileChooserUI extends FileChooserUI { final Transferable transferable = dtde.getTransferable(); try { + @SuppressWarnings("unchecked") final java.util.List fileList = (java.util.List)transferable.getTransferData(DataFlavor.javaFileListFlavor); dropFiles(fileList.toArray(new File[fileList.size()])); dtde.dropComplete(true); @@ -1144,11 +1145,14 @@ public class AquaFileChooserUI extends FileChooserUI { } @SuppressWarnings("serial") // anonymous class - protected ListCellRenderer createDirectoryComboBoxRenderer(final JFileChooser fc) { - return new AquaComboBoxRendererInternal(directoryComboBox) { - public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - final File directory = (File)value; + protected ListCellRenderer createDirectoryComboBoxRenderer(final JFileChooser fc) { + return new AquaComboBoxRendererInternal(directoryComboBox) { + public Component getListCellRendererComponent(final JList list, + final File directory, + final int index, + final boolean isSelected, + final boolean cellHasFocus) { + super.getListCellRendererComponent(list, directory, index, isSelected, cellHasFocus); if (directory == null) { setText(""); return this; @@ -1173,7 +1177,7 @@ public class AquaFileChooserUI extends FileChooserUI { * Data model for a type-face selection combo-box. */ @SuppressWarnings("serial") // Superclass is not serializable across versions - protected class DirectoryComboBoxModel extends AbstractListModel implements ComboBoxModel { + protected class DirectoryComboBoxModel extends AbstractListModel implements ComboBoxModel { Vector fDirectories = new Vector(); int topIndex = -1; int fPathCount = 0; @@ -1248,7 +1252,7 @@ public class AquaFileChooserUI extends FileChooserUI { return fDirectories.size(); } - public Object getElementAt(final int index) { + public File getElementAt(final int index) { return fDirectories.elementAt(index); } } @@ -1257,11 +1261,14 @@ public class AquaFileChooserUI extends FileChooserUI { // Renderer for Types ComboBox // @SuppressWarnings("serial") // anonymous class - protected ListCellRenderer createFilterComboBoxRenderer() { - return new AquaComboBoxRendererInternal(filterComboBox) { - public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - final FileFilter filter = (FileFilter)value; + protected ListCellRenderer createFilterComboBoxRenderer() { + return new AquaComboBoxRendererInternal(filterComboBox) { + public Component getListCellRendererComponent(final JList list, + final FileFilter filter, + final int index, + final boolean isSelected, + final boolean cellHasFocus) { + super.getListCellRendererComponent(list, filter, index, isSelected, cellHasFocus); if (filter != null) setText(filter.getDescription()); return this; } @@ -1356,7 +1363,7 @@ public class AquaFileChooserUI extends FileChooserUI { } public void actionPerformed(final ActionEvent e) { - getFileChooser().setFileFilter((FileFilter)filterComboBox.getSelectedItem()); + getFileChooser().setFileFilter((FileFilter) filterComboBox.getSelectedItem()); } } @@ -1503,7 +1510,7 @@ public class AquaFileChooserUI extends FileChooserUI { fTextfieldPanel.add(tPanel, BorderLayout.CENTER); // DirectoryComboBox, left-justified, 200x20 not including drop shadow - directoryComboBox = new JComboBox(); + directoryComboBox = new JComboBox<>(); directoryComboBox.putClientProperty("JComboBox.lightweightKeyboardNavigation", "Lightweight"); fDirectoryComboBoxModel = createDirectoryComboBoxModel(fc); directoryComboBox.setModel(fDirectoryComboBoxModel); @@ -1551,7 +1558,7 @@ public class AquaFileChooserUI extends FileChooserUI { // Combobox filterComboBoxModel = createFilterComboBoxModel(); fc.addPropertyChangeListener(filterComboBoxModel); - filterComboBox = new JComboBox(filterComboBoxModel); + filterComboBox = new JComboBox<>(filterComboBoxModel); formatLabel.setLabelFor(filterComboBox); filterComboBox.setRenderer(createFilterComboBoxRenderer()); d = new Dimension(220, (int)filterComboBox.getMinimumSize().getHeight()); @@ -1788,7 +1795,7 @@ public class AquaFileChooserUI extends FileChooserUI { } } - JComboBox directoryComboBox; + JComboBox directoryComboBox; DirectoryComboBoxModel fDirectoryComboBoxModel; private final Action directoryComboBoxAction = new DirectoryComboBoxAction(); @@ -1797,7 +1804,7 @@ public class AquaFileChooserUI extends FileChooserUI { JTableExtension fFileList; private FilterComboBoxModel filterComboBoxModel; - JComboBox filterComboBox; + JComboBox filterComboBox; private final Action filterComboBoxAction = new FilterComboBoxAction(); private static final Dimension hstrut10 = new Dimension(10, 1); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java b/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java index d5fec4e292c..1438d2c118c 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java @@ -131,7 +131,7 @@ public class AquaFocusHandler implements FocusListener, PropertyChangeListener { c.setSelectionBackground(UIManager.getColor(bgName)); } - static void swapSelectionColors(final String prefix, final JList c, final Object value) { + static void swapSelectionColors(final String prefix, final JList c, final Object value) { if (!isComponentValid(c)) return; final Color bg = c.getSelectionBackground(); @@ -149,7 +149,7 @@ public class AquaFocusHandler implements FocusListener, PropertyChangeListener { } } - static void setSelectionColors(final JList c, final String fgName, final String bgName) { + static void setSelectionColors(final JList c, final String fgName, final String bgName) { c.setSelectionForeground(UIManager.getColor(fgName)); c.setSelectionBackground(UIManager.getColor(bgName)); } diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java index 85d06468912..24217af311c 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java @@ -79,7 +79,7 @@ public class AquaListUI extends BasicListUI { * For a Home action, scrolls to the top. Otherwise, scroll to the end. */ public void actionPerformed(final ActionEvent e) { - final JList list = (JList)e.getSource(); + final JList list = (JList)e.getSource(); if (fHomeAction) { list.ensureIndexIsVisible(0); @@ -135,7 +135,7 @@ public class AquaListUI extends BasicListUI { }*/ } - JList getComponent() { + JList getComponent() { return list; } @@ -144,7 +144,7 @@ public class AquaListUI extends BasicListUI { final Rectangle rowBounds = getCellBounds(list, selectedIndex, selectedIndex); if (rowBounds == null) return; - final ListCellRenderer renderer = list.getCellRenderer(); + final ListCellRenderer renderer = list.getCellRenderer(); if (renderer == null) return; final Component rendererComponent = renderer.getListCellRendererComponent(list, value, selectedIndex, selected, true); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java index dd65433283f..8dd4fa60d2d 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java @@ -3820,7 +3820,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing _loader = null; final Class klass = (Class)loader; try { - final java.lang.reflect.Method method = klass.getDeclaredMethod("loadActionMap", new Class[] { LazyActionMap.class }); + final java.lang.reflect.Method method = klass.getDeclaredMethod("loadActionMap", new Class[] { LazyActionMap.class }); method.invoke(klass, new Object[] { this }); } catch (final NoSuchMethodException nsme) { assert false : "LazyActionMap unable to load actions " + klass; diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java b/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java index 5d847e98ef2..dbc8c8c86ad 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java @@ -69,6 +69,7 @@ public class AquaTableHeaderUI extends BasicTableHeaderUI { final static RecyclableSingleton> TABLE_HEADER_APPLICATORS = new RecyclableSingleton>() { @Override + @SuppressWarnings("unchecked") protected ClientPropertyApplicator getInstance() { return new ClientPropertyApplicator( new Property("JTableHeader.selectedColumn") { diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java b/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java index b64595f4245..17b372af858 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java @@ -121,7 +121,7 @@ public class AquaUtilControlSize { try { // see if this component has a "getUI" method final Class clazz = c.getClass(); - final Method getUIMethod = clazz.getMethod("getUI", new Class[0]); + final Method getUIMethod = clazz.getMethod("getUI", new Class[0]); // see if that UI is one of ours that understands sizing final Object ui = getUIMethod.invoke(c, new Object[0]); diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java index 078435b161b..faa670345c7 100644 --- a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java +++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java @@ -82,7 +82,8 @@ final class AquaUtils { @Override public Creator run() { try { - final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {}); + final Method getCreatorMethod = CImage.class.getDeclaredMethod( + "getCreator", new Class[] {}); getCreatorMethod.setAccessible(true); return (Creator)getCreatorMethod.invoke(null, new Object[] {}); } catch (final Exception ignored) { @@ -383,7 +384,8 @@ final class AquaUtils { @Override public Method run() { try { - final Method method = JComponent.class.getDeclaredMethod("getFlag", new Class[] { int.class }); + final Method method = JComponent.class.getDeclaredMethod( + "getFlag", new Class[] { int.class }); method.setAccessible(true); return method; } catch (final Throwable ignored) { diff --git a/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java b/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java index 665c9319cc1..908c63c2c3e 100644 --- a/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java +++ b/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java @@ -33,6 +33,7 @@ import javax.swing.JComponent; public class ClientPropertyApplicator implements PropertyChangeListener { private final Map> properties = new HashMap>(); + @SuppressWarnings("unchecked") public ClientPropertyApplicator(final Property... propertyList) { for (final Property p : propertyList) { properties.put(p.name, p); diff --git a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java index 1735b444ea5..2d56499ebb3 100644 --- a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java +++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java @@ -25,6 +25,9 @@ package com.apple.laf; +import sun.awt.AWTAccessor; +import sun.lwawt.macosx.CMenuBar; + import java.awt.*; import java.awt.event.*; import java.lang.reflect.*; @@ -243,54 +246,25 @@ public class ScreenMenuBar extends MenuBar implements ContainerListener, ScreenM fSubmenus.remove(menu); } - private static Field[] stolenFields = null; - - static { - stolenFields = AccessController.doPrivileged(new PrivilegedAction() { - public Field[] run() { - try { - final Field[] localFields = new Field[2]; - localFields[0] = MenuBar.class.getDeclaredField("menus"); - localFields[1] = MenuComponent.class.getDeclaredField("parent"); - AccessibleObject.setAccessible(localFields, true); - return localFields; - } catch (final NoSuchFieldException nsf) { - // If this happens, Sun changed the definition of MenuBar and MenuComponent! - nsf.printStackTrace(System.err); - return null; - } - } - }); - }; - public Menu add(final Menu m, final int index) { synchronized (getTreeLock()) { if (m.getParent() != null) { m.getParent().remove(m); } - // Use nasty reflection to get at the menus array and parent fields. - try { - if (stolenFields == null) return m; + final Vector menus = AWTAccessor.getMenuBarAccessor().getMenus(this); + menus.insertElementAt(m, index); + AWTAccessor.getMenuComponentAccessor().setParent(m, this); - final Vector menus = (Vector)stolenFields[0].get(this); - menus.insertElementAt(m, index); + final CMenuBar peer = (CMenuBar)getPeer(); + if (peer == null) return m; - stolenFields[1].set(m, this); - - final sun.lwawt.macosx.CMenuBar peer = (sun.lwawt.macosx.CMenuBar)getPeer(); - if (peer == null) return m; - - peer.setNextInsertionIndex(index); - if (m.getPeer() == null) { - m.addNotify(); - } - - peer.setNextInsertionIndex(-1); - } catch (final IllegalAccessException iae) { - iae.printStackTrace(System.err); + peer.setNextInsertionIndex(index); + if (m.getPeer() == null) { + m.addNotify(); } + peer.setNextInsertionIndex(-1); return m; } } diff --git a/jdk/src/macosx/lib/flavormap.properties b/jdk/src/macosx/classes/sun/awt/datatransfer/flavormap.properties similarity index 86% rename from jdk/src/macosx/lib/flavormap.properties rename to jdk/src/macosx/classes/sun/awt/datatransfer/flavormap.properties index 8f17d95fa20..b50c523279e 100644 --- a/jdk/src/macosx/lib/flavormap.properties +++ b/jdk/src/macosx/classes/sun/awt/datatransfer/flavormap.properties @@ -2,19 +2,12 @@ # This properties file is used to initialize the default # java.awt.datatransfer.SystemFlavorMap. It contains the Mac OS X platform-specific, # default mappings between common Mac OS X selection atoms and platform-independent -# MIME type strings, which will be converted into +# MIME type strings, which will be converted into # java.awt.datatransfer.DataFlavors. # -# These default mappings may be augmented by specifying the -# -# AWT.DnD.flavorMapFileURL -# -# property in the appropriate awt.properties file. The specified properties URL -# will be loaded into the SystemFlavorMap. -# # The standard format is: # -# = +# =,, ... # # should be a string identifier that the native platform will # recognize as a valid data format. should specify both a MIME @@ -23,9 +16,9 @@ # where each parameter to the MIME type is separated by a ';'. # # Because SystemFlavorMap implements FlavorTable, developers are free to -# duplicate both native keys and DataFlavor values. If a mapping contains a -# duplicate key or value, earlier mappings which included this key or value -# will be preferred. +# duplicate DataFlavor values and set multiple values for a single native by +# separating them with ",". If a mapping contains a duplicate key or value, +# earlier mappings which included this key or value will be preferred. # # Mappings whose values specify DataFlavors with primary MIME types of # "text", and which support the charset parameter, should specify the exact @@ -79,5 +72,5 @@ JFIF=image/x-java-image;class=java.awt.Image TIFF=image/x-java-image;class=java.awt.Image RICH_TEXT=text/rtf HTML=text/html;charset=utf-8;eoln="\r\n";terminators=1 -URL=application/x-java-url;class=java.net.URL -URL=text/uri-list;eoln="\r\n";terminators=1 +URL=application/x-java-url;class=java.net.URL,\ + text/uri-list;eoln="\r\n";terminators=1 diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java index 67570c18a6f..c6c75bc82c6 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java @@ -88,7 +88,7 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { super.startDrag(dsc, cursor, dragImage, dragImageOffset); } - protected void startDrag(Transferable transferable, long[] formats, Map formatMap) { + protected void startDrag(Transferable transferable, long[] formats, Map formatMap) { DragGestureEvent trigger = getTrigger(); InputEvent triggerEvent = trigger.getTriggerEvent(); @@ -311,7 +311,7 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { } } - private void setDefaultDragImage(JList component) { + private void setDefaultDragImage(JList component) { Rectangle selectedOutline = null; // This code actually works, even under the (non-existant) multiple-selections, because we only draw a union outline @@ -485,7 +485,7 @@ public final class CDragSourceContextPeer extends SunDragSourceContextPeer { private native long createNativeDragSource(Component component, long nativePeer, Transferable transferable, InputEvent triggerEvent, int dragPosX, int dragPosY, int extModifiers, int clickCount, long timestamp, long nsDragImagePtr, int dragImageOffsetX, int dragImageOffsetY, - int sourceActions, long[] formats, Map formatMap); + int sourceActions, long[] formats, Map formatMap); private native void doDragging(long nativeDragSource); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java index eef5284175b..077b156d806 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java @@ -44,13 +44,14 @@ import sun.lwawt.*; public class CInputMethod extends InputMethodAdapter { private InputMethodContext fIMContext; private Component fAwtFocussedComponent; - private LWComponentPeer fAwtFocussedComponentPeer; + private LWComponentPeer fAwtFocussedComponentPeer; private boolean isActive; private static Map[] sHighlightStyles; // Intitalize highlight mapping table and its mapper. static { + @SuppressWarnings({"rawtypes", "unchecked"}) Map styles[] = new Map[4]; HashMap map; @@ -242,7 +243,7 @@ public class CInputMethod extends InputMethodAdapter { public void hideWindows() { } - long getNativeViewPtr(LWComponentPeer peer) { + long getNativeViewPtr(LWComponentPeer peer) { if (peer.getPlatformWindow() instanceof CPlatformWindow) { CPlatformWindow platformWindow = (CPlatformWindow) peer.getPlatformWindow(); CPlatformView platformView = platformWindow.getContentView(); @@ -272,7 +273,7 @@ public class CInputMethod extends InputMethodAdapter { * to talk to when responding to key events. */ protected void setAWTFocussedComponent(Component component) { - LWComponentPeer peer = null; + LWComponentPeer peer = null; long modelPtr = 0; CInputMethod imInstance = this; @@ -305,7 +306,7 @@ public class CInputMethod extends InputMethodAdapter { /** * @see java.awt.Toolkit#mapInputMethodHighlight */ - public static Map mapInputMethodHighlight(InputMethodHighlight highlight) { + public static Map mapInputMethodHighlight(InputMethodHighlight highlight) { int index; int state = highlight.getState(); if (state == InputMethodHighlight.RAW_TEXT) { @@ -384,7 +385,7 @@ public class CInputMethod extends InputMethodAdapter { // java.awt.Toolkit#getNativeContainer() is not available // from this package - private LWComponentPeer getNearestNativePeer(Component comp) { + private LWComponentPeer getNearestNativePeer(Component comp) { if (comp==null) return null; @@ -796,7 +797,7 @@ public class CInputMethod extends InputMethodAdapter { // these calls will be ignored. private native void nativeNotifyPeer(long nativePeer, CInputMethod imInstance); private native void nativeEndComposition(long nativePeer); - private native void nativeHandleEvent(LWComponentPeer peer, AWTEvent event); + private native void nativeHandleEvent(LWComponentPeer peer, AWTEvent event); // Returns the locale of the active input method. static native Locale getNativeLocale(); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java index d922d029b33..3deba1e33f9 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java @@ -57,7 +57,7 @@ public class CInputMethodDescriptor implements InputMethodDescriptor { } static Object[] getAvailableLocalesInternal() { - List workList = nativeGetAvailableLocales(); + List workList = nativeGetAvailableLocales(); if (workList != null) { return workList.toArray(); @@ -119,5 +119,5 @@ public class CInputMethodDescriptor implements InputMethodDescriptor { } private static native void nativeInit(); - private static native List nativeGetAvailableLocales(); + private static native List nativeGetAvailableLocales(); } diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java index 534cf0dd744..5af2cdfe1d0 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java @@ -151,7 +151,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo return (bits & mask) != 0; } - @SuppressWarnings("unchecked") + @SuppressWarnings({"unchecked", "rawtypes"}) static ClientPropertyApplicator CLIENT_PROPERTY_APPLICATOR = new ClientPropertyApplicator(new Property[] { new Property(WINDOW_DOCUMENT_MODIFIED) { public void applyProperty(final CPlatformWindow c, final Object value) { c.setStyleBits(DOCUMENT_MODIFIED, value == null ? false : Boolean.parseBoolean(value.toString())); diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java index edbebbacb67..768086220c3 100644 --- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java +++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java @@ -32,6 +32,7 @@ import java.awt.dnd.peer.DragSourceContextPeer; import java.awt.event.InputEvent; import java.awt.event.InvocationEvent; import java.awt.event.KeyEvent; +import java.awt.font.TextAttribute; import java.awt.im.InputMethodHighlight; import java.awt.im.spi.InputMethodDescriptor; import java.awt.peer.*; @@ -543,9 +544,9 @@ public final class LWCToolkit extends LWToolkit { return super.getImage(filename); } - String fileneame2x = getScaledImageName(filename); - return (imageExists(fileneame2x)) - ? getImageWithResolutionVariant(filename, fileneame2x) + String filename2x = getScaledImageName(filename); + return (imageExists(filename2x)) + ? getImageWithResolutionVariant(filename, filename2x) : super.getImage(filename); } @@ -691,6 +692,7 @@ public final class LWCToolkit extends LWToolkit { } @Override + @SuppressWarnings("unchecked") public T createDragGestureRecognizer( Class abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl) { @@ -743,7 +745,7 @@ public final class LWCToolkit extends LWToolkit { * @since 1.3 */ @Override - public Map mapInputMethodHighlight(InputMethodHighlight highlight) { + public Map mapInputMethodHighlight(InputMethodHighlight highlight) { return CInputMethod.mapInputMethodHighlight(highlight); } @@ -906,6 +908,9 @@ public final class LWCToolkit extends LWToolkit { } private static boolean isValidPath(String path) { - return !path.isEmpty() && !path.endsWith("/") && !path.endsWith("."); + return path != null && + !path.isEmpty() && + !path.endsWith("/") && + !path.endsWith("."); } } diff --git a/jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m b/jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m deleted file mode 100644 index 11f98dbdde7..00000000000 --- a/jdk/src/macosx/native/apple/launcher/JavaAppLauncher.m +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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. - */ - -#import "apple_launcher_JavaAppLauncher.h" - -#import -#import - - -/* - * Class: apple_launcher_JavaAppLauncher - * Method: nativeConvertAndRelease - * Signature: (J)Ljava/lang/Object; - */ -JNIEXPORT jobject JNICALL Java_apple_launcher_JavaAppLauncher_nativeConvertAndRelease -(JNIEnv *env, jclass clazz, jlong nsObjectPtr) { - - jobject value = NULL; - -JNF_COCOA_ENTER(env); - - id obj = jlong_to_ptr(nsObjectPtr); - value = [[JNFDefaultCoercions defaultCoercer] coerceNSObject:obj withEnv:env]; - CFRelease(obj); - -JNF_COCOA_EXIT(env); - - return value; -} - -/* - * Class: apple_launcher_JavaAppLauncher - * Method: nativeInvokeNonPublic - * Signature: (Ljava/lang/Class;Ljava/lang/reflect/Method;[Ljava/lang/String;)V - */ -JNIEXPORT void JNICALL Java_apple_launcher_JavaAppLauncher_nativeInvokeNonPublic -(JNIEnv *env, jclass clazz, jclass targetClass, jobject targetMethod, jobjectArray args) { - jmethodID mainMethodID = (*env)->FromReflectedMethod(env, targetMethod); - if ((*env)->ExceptionOccurred(env)) return; - (*env)->CallStaticVoidMethod(env, targetClass, mainMethodID, args); -} diff --git a/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m b/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m index affb6577d64..25b00545a74 100644 --- a/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m +++ b/jdk/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m @@ -45,6 +45,7 @@ #include #include +#import "ThreadUtilities.h" static NSScreen* SplashNSScreen() { @@ -130,8 +131,12 @@ char* SplashGetScaledImageName(const char* jar, const char* file, NSAutoreleasePool *pool = [NSAutoreleasePool new]; *scaleFactor = 1; char* scaledFile = nil; - float screenScaleFactor = [SplashNSScreen() backingScaleFactor]; - + __block float screenScaleFactor = 1; + + [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ + screenScaleFactor = [SplashNSScreen() backingScaleFactor]; + }]; + if (screenScaleFactor > 1) { NSString *fileName = [NSString stringWithUTF8String: file]; NSUInteger length = [fileName length]; diff --git a/jdk/src/share/bin/java.c b/jdk/src/share/bin/java.c index df1f832cef8..c71f4c26fab 100644 --- a/jdk/src/share/bin/java.c +++ b/jdk/src/share/bin/java.c @@ -98,6 +98,7 @@ static int numOptions, maxOptions; */ static void SetClassPath(const char *s); static void SelectVersion(int argc, char **argv, char **main_class); +static void SetJvmEnvironment(int argc, char **argv); static jboolean ParseArguments(int *pargc, char ***pargv, int *pmode, char **pwhat, int *pret, const char *jrepath); @@ -238,6 +239,10 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */ jvmpath, sizeof(jvmpath), jvmcfg, sizeof(jvmcfg)); + if (!IsJavaArgs()) { + SetJvmEnvironment(argc,argv); + } + ifn.CreateJavaVM = 0; ifn.GetDefaultJavaVMInitArgs = 0; @@ -640,6 +645,67 @@ CheckJvmType(int *pargc, char ***argv, jboolean speculative) { return jvmtype; } +/* + * static void SetJvmEnvironment(int argc, char **argv); + * Is called just before the JVM is loaded. We can set env variables + * that are consumed by the JVM. This function is non-destructive, + * leaving the arg list intact. The first use is for the JVM flag + * -XX:NativeMemoryTracking=value. + */ +static void +SetJvmEnvironment(int argc, char **argv) { + + static const char* NMT_Env_Name = "NMT_LEVEL_"; + + int i; + for (i = 0; i < argc; i++) { + /* + * The following case checks for "-XX:NativeMemoryTracking=value". + * If value is non null, an environmental variable set to this value + * will be created to be used by the JVM. + * The argument is passed to the JVM, which will check validity. + * The JVM is responsible for removing the env variable. + */ + char *arg = argv[i]; + if (JLI_StrCCmp(arg, "-XX:NativeMemoryTracking=") == 0) { + int retval; + // get what follows this parameter, include "=" + size_t pnlen = JLI_StrLen("-XX:NativeMemoryTracking="); + if (JLI_StrLen(arg) > pnlen) { + char* value = arg + pnlen; + size_t pbuflen = pnlen + JLI_StrLen(value) + 10; // 10 max pid digits + + /* + * ensures that malloc successful + * DONT JLI_MemFree() pbuf. JLI_PutEnv() uses system call + * that could store the address. + */ + char * pbuf = (char*)JLI_MemAlloc(pbuflen); + + JLI_Snprintf(pbuf, pbuflen, "%s%d=%s", NMT_Env_Name, JLI_GetPid(), value); + retval = JLI_PutEnv(pbuf); + if (JLI_IsTraceLauncher()) { + char* envName; + char* envBuf; + + // ensures that malloc successful + envName = (char*)JLI_MemAlloc(pbuflen); + JLI_Snprintf(envName, pbuflen, "%s%d", NMT_Env_Name, JLI_GetPid()); + + printf("TRACER_MARKER: NativeMemoryTracking: env var is %s\n",envName); + printf("TRACER_MARKER: NativeMemoryTracking: putenv arg %s\n",pbuf); + envBuf = getenv(envName); + printf("TRACER_MARKER: NativeMemoryTracking: got value %s\n",envBuf); + free(envName); + } + + } + + } + + } +} + /* copied from HotSpot function "atomll()" */ static int parse_size(const char *s, jlong *result) { diff --git a/jdk/src/share/bin/jli_util.h b/jdk/src/share/bin/jli_util.h index d3c9f0ff8f2..579972278b3 100644 --- a/jdk/src/share/bin/jli_util.h +++ b/jdk/src/share/bin/jli_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2014, 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 @@ -64,17 +64,22 @@ int JLI_GetStdArgc(); #ifdef _WIN32 #include #include +#include #define JLI_StrCaseCmp(p1, p2) stricmp((p1), (p2)) #define JLI_StrNCaseCmp(p1, p2, p3) strnicmp((p1), (p2), (p3)) int JLI_Snprintf(char *buffer, size_t size, const char *format, ...); void JLI_CmdToArgs(char *cmdline); #define JLI_Lseek _lseeki64 +#define JLI_PutEnv _putenv +#define JLI_GetPid _getpid #else /* NIXES */ #include #include #define JLI_StrCaseCmp(p1, p2) strcasecmp((p1), (p2)) #define JLI_StrNCaseCmp(p1, p2, p3) strncasecmp((p1), (p2), (p3)) #define JLI_Snprintf snprintf +#define JLI_PutEnv putenv +#define JLI_GetPid getpid #ifdef __solaris__ #define JLI_Lseek llseek #endif diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java index 03d649907e2..c22415b7575 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/bmp/BMPMetadata.java @@ -126,18 +126,18 @@ public class BMPMetadata extends IIOMetadata implements BMPConstants { new IIOMetadataNode(nativeMetadataFormatName); addChildNode(root, "BMPVersion", bmpVersion); - addChildNode(root, "Width", new Integer(width)); - addChildNode(root, "Height", new Integer(height)); + addChildNode(root, "Width", width); + addChildNode(root, "Height", height); addChildNode(root, "BitsPerPixel", new Short(bitsPerPixel)); - addChildNode(root, "Compression", new Integer(compression)); - addChildNode(root, "ImageSize", new Integer(imageSize)); + addChildNode(root, "Compression", compression); + addChildNode(root, "ImageSize", imageSize); IIOMetadataNode node = addChildNode(root, "PixelsPerMeter", null); - addChildNode(node, "X", new Integer(xPixelsPerMeter)); - addChildNode(node, "Y", new Integer(yPixelsPerMeter)); + addChildNode(node, "X", xPixelsPerMeter); + addChildNode(node, "Y", yPixelsPerMeter); - addChildNode(root, "ColorsUsed", new Integer(colorsUsed)); - addChildNode(root, "ColorsImportant", new Integer(colorsImportant)); + addChildNode(root, "ColorsUsed", colorsUsed); + addChildNode(root, "ColorsImportant", colorsImportant); int version = 0; for (int i = 0; i < bmpVersion.length(); i++) @@ -146,19 +146,19 @@ public class BMPMetadata extends IIOMetadata implements BMPConstants { if (version >= 4) { node = addChildNode(root, "Mask", null); - addChildNode(node, "Red", new Integer(redMask)); - addChildNode(node, "Green", new Integer(greenMask)); - addChildNode(node, "Blue", new Integer(blueMask)); - addChildNode(node, "Alpha", new Integer(alphaMask)); + addChildNode(node, "Red", redMask); + addChildNode(node, "Green", greenMask); + addChildNode(node, "Blue", blueMask); + addChildNode(node, "Alpha", alphaMask); - addChildNode(root, "ColorSpaceType", new Integer(colorSpace)); + addChildNode(root, "ColorSpaceType", colorSpace); node = addChildNode(root, "CIEXYZEndPoints", null); addXYZPoints(node, "Red", redX, redY, redZ); addXYZPoints(node, "Green", greenX, greenY, greenZ); addXYZPoints(node, "Blue", blueX, blueY, blueZ); - node = addChildNode(root, "Intent", new Integer(intent)); + node = addChildNode(root, "Intent", intent); } // Palette diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java index 51f1234d74d..f25863955ec 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java @@ -2323,7 +2323,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { SOSMarkerSegment sos = (SOSMarkerSegment) seg; SOSMarkerSegment.ScanComponentSpec [] specs = sos.componentSpecs; for (int i = 0; i < specs.length; i++) { - Integer id = new Integer(specs[i].componentSelector); + Integer id = specs[i].componentSelector; if (!ids.contains(id)) { ids.add(id); } diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java index 3b2a081d860..d3f489b7ee2 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGImageReader.java @@ -639,7 +639,7 @@ public class PNGImageReader extends ImageReader { metadata.zTXt_keyword.add(keyword); int method = stream.readUnsignedByte(); - metadata.zTXt_compressionMethod.add(new Integer(method)); + metadata.zTXt_compressionMethod.add(method); byte[] b = new byte[chunkLength - keyword.length() - 2]; stream.readFully(b); diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java index 11018ec4015..f02dd4391f0 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java @@ -1254,8 +1254,11 @@ public class PNGMetadata extends IIOMetadata implements Cloneable { if (name.equals("IHDR")) { IHDR_width = getIntAttribute(node, "width"); IHDR_height = getIntAttribute(node, "height"); - IHDR_bitDepth = getEnumeratedAttribute(node, "bitDepth", - IHDR_bitDepths); + IHDR_bitDepth = + Integer.valueOf(IHDR_bitDepths[ + getEnumeratedAttribute(node, + "bitDepth", + IHDR_bitDepths)]); IHDR_colorType = getEnumeratedAttribute(node, "colorType", IHDR_colorTypeNames); IHDR_compressionMethod = @@ -1644,7 +1647,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable { int compressionMethod = getEnumeratedAttribute(zTXt_node, "compressionMethod", zTXt_compressionMethodNames); - zTXt_compressionMethod.add(new Integer(compressionMethod)); + zTXt_compressionMethod.add(compressionMethod); String text = getAttribute(zTXt_node, "text"); zTXt_text.add(text); diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java index c28046f0b58..28ad467eadd 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/wbmp/WBMPMetadata.java @@ -75,9 +75,9 @@ public class WBMPMetadata extends IIOMetadata { IIOMetadataNode root = new IIOMetadataNode(nativeMetadataFormatName); - addChildNode(root, "WBMPType", new Integer(wbmpType)); - addChildNode(root, "Width", new Integer(width)); - addChildNode(root, "Height", new Integer(height)); + addChildNode(root, "WBMPType", wbmpType); + addChildNode(root, "Width", width); + addChildNode(root, "Height", height); return root; } diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java index b35e60d7ec6..cfdd8672303 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java @@ -812,12 +812,12 @@ public class GTKLookAndFeel extends SynthLookAndFeel { "OptionPane.setButtonMargin", Boolean.FALSE, "OptionPane.sameSizeButtons", Boolean.TRUE, - "OptionPane.buttonOrientation", new Integer(SwingConstants.RIGHT), + "OptionPane.buttonOrientation", SwingConstants.RIGHT, "OptionPane.minimumSize", new DimensionUIResource(262, 90), - "OptionPane.buttonPadding", new Integer(10), + "OptionPane.buttonPadding", 10, "OptionPane.windowBindings", new Object[] { "ESCAPE", "close" }, - "OptionPane.buttonClickThreshhold", new Integer(500), + "OptionPane.buttonClickThreshhold", 500, "OptionPane.isYesLast", Boolean.TRUE, "OptionPane.font", new FontLazyValue(Region.OPTION_PANE), diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java index 116fe475be3..79ebfbc8cff 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java @@ -567,7 +567,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel "ProgressBar.selectionForeground", table.get("control"), "ProgressBar.selectionBackground", table.get("controlText"), "ProgressBar.border", loweredBevelBorder, - "ProgressBar.cellLength", new Integer(6), + "ProgressBar.cellLength", 6, "ProgressBar.cellSpacing", Integer.valueOf(0), // Buttons @@ -582,7 +582,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel "released SPACE", "released" }), - "CheckBox.textIconGap", new Integer(8), + "CheckBox.textIconGap", 8, "CheckBox.margin", new InsetsUIResource(4, 2, 4, 2), "CheckBox.icon", checkBoxIcon, "CheckBox.focus", table.get("activeCaptionBorder"), @@ -593,7 +593,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel }), "RadioButton.margin", new InsetsUIResource(4, 2, 4, 2), - "RadioButton.textIconGap", new Integer(8), + "RadioButton.textIconGap", 8, "RadioButton.background", table.get("control"), "RadioButton.foreground", table.get("controlText"), "RadioButton.icon", radioButtonIcon, @@ -627,10 +627,10 @@ public class MotifLookAndFeel extends BasicLookAndFeel "Menu.selectionBackground", menuItemPressedBackground, "Menu.checkIcon", menuItemCheckIcon, "Menu.arrowIcon", menuArrowIcon, - "Menu.menuPopupOffsetX", new Integer(0), - "Menu.menuPopupOffsetY", new Integer(0), - "Menu.submenuPopupOffsetX", new Integer(-2), - "Menu.submenuPopupOffsetY", new Integer(3), + "Menu.menuPopupOffsetX", 0, + "Menu.menuPopupOffsetY", 0, + "Menu.submenuPopupOffsetX", -2, + "Menu.submenuPopupOffsetY", 3, "Menu.shortcutKeys", new int[]{ SwingUtilities2.getSystemMnemonicKeyMask(), KeyEvent.META_MASK @@ -938,7 +938,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel "Tree.collapsedIcon", treeCollapsedIcon, "Tree.editorBorder", focusBorder, "Tree.editorBorderSelectionColor", table.get("activeCaptionBorder"), - "Tree.rowHeight", new Integer(18), + "Tree.rowHeight", 18, "Tree.drawsFocusBorderAroundIcon", Boolean.TRUE, "Tree.focusInputMap", new UIDefaults.LazyInputMap(new Object[] { "COPY", "copy", diff --git a/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java b/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java index 800c0a53643..6a4d3dea7da 100644 --- a/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java +++ b/jdk/src/share/classes/com/sun/jndi/cosnaming/CNCtx.java @@ -1145,7 +1145,7 @@ public class CNCtx implements javax.naming.Context { // Never destroy an orb in CNCtx. // The orb we have is either the shared/default orb, or one passed in to a constructor - // from elsewhere, so that orb is somebody else's reponsibility. + // from elsewhere, so that orb is somebody else's responsibility. } protected void finalize() { diff --git a/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java b/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java index 18654c87808..db1f907182a 100644 --- a/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java +++ b/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java @@ -376,7 +376,7 @@ public class DnsClient { /** - * Tries to retreive an UDP packet matching the given xid + * Tries to retrieve a UDP packet matching the given xid * received within the timeout. * If a packet with different xid is received, the received packet * is enqueued with the corresponding xid in 'resps'. diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java b/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java index 241105bf1ce..be3315674fa 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java @@ -137,7 +137,7 @@ abstract class AbstractLdapNamingEnumeration limit = (entries == null) ? 0 : entries.size(); // handle empty set posn = 0; // reset - // mimimize the number of calls to processReturnCode() + // minimize the number of calls to processReturnCode() // (expensive when batchSize is small and there are many results) if ((res.status != LdapClient.LDAP_SUCCESS) || ((res.status == LdapClient.LDAP_SUCCESS) && diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java b/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java index 5095823dc23..aa535a2b995 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/ClientId.java @@ -196,7 +196,7 @@ class ClientId { System.out.println("ClientId received an exception"); e.printStackTrace(); } - // Failed to invoke the comparator; flag unequality + // Failed to invoke the comparator; flag inequality return false; } if (((Integer) ret) == 0) { diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java b/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java index db335f7acc9..85bc38076f5 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/EventQueue.java @@ -75,7 +75,7 @@ final class EventQueue implements Runnable { * Enqueue an event. * @param event Either a NamingExceptionEvent or a subclass * of NamingEvent or - * UnsolicitedNotificatoniEvent. + * UnsolicitedNotificationEvent. * If it is a subclass of NamingEvent, all listeners must implement * the corresponding subinterface of NamingListener. * For example, for a ObjectAddedEvent, all listeners must @@ -141,7 +141,7 @@ final class EventQueue implements Runnable { // it is interested in. (No need to check mask or // instanceof subinterfaces.) // It is the responsibility of the enqueuer to - // only enqueue events with listseners of the correct type. + // only enqueue events with listeners of the correct type. if (e instanceof NamingEvent) { ((NamingEvent)e).dispatch(v.elementAt(i)); diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java b/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java index a9d45a23c17..86006ff714b 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/EventSupport.java @@ -83,7 +83,7 @@ import javax.naming.ldap.UnsolicitedNotification; *a new notifier is created for the listener. * *

Deregistration

- *When a deregistration request is made, this class attemps to find its + *When a deregistration request is made, this class attempts to find its *corresponding notifier. If the notifier is found, the listener is removed *from the notifier's list. If the listener is the last listener on the list, *the notifier's thread is terminated and removed from this class's hashtable. diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java index 50f6ac69f5f..36c7dad4611 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapAttribute.java @@ -34,7 +34,7 @@ import javax.naming.directory.*; /** * This subclass is used by LDAP to implement the schema calls. * Basically, it keeps track of which context it is an attribute of - * so it can get the schema for that cotnext. + * so it can get the schema for that context. * * @author Jon Ruiz */ @@ -134,7 +134,7 @@ final class LdapAttribute extends BasicAttribute { // setup internal state this.setBaseCtxInfo(); - // let the ObjectOutpurStream do the real work of serialization + // let the ObjectOutputStream do the real work of serialization out.defaultWriteObject(); } diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java index e5821adea6e..c163dce796a 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtx.java @@ -1651,7 +1651,7 @@ final public class LdapCtx extends ComponentDirContext * * This function is called regardless of the server's version, since * an administrator may have setup the server to support client schema - * queries. If this function trys a serarch on a v2 server that + * queries. If this function tries a search on a v2 server that * doesn't support schema, one of these two things will happen: * 1) It will get an exception when querying the root DSE * 2) It will not find a subschemasubentry on the root DSE @@ -2016,7 +2016,7 @@ final public class LdapCtx extends ComponentDirContext * - the returning attributes list is present but empty */ - // returns true if a search can be caried out as a compare, and sets + // returns true if a search can be carried out as a compare, and sets // tokens[0] and tokens[1] to the type and value respectively. // e.g. filter "cn=Jon Ruiz" becomes, type "cn" and value "Jon Ruiz" // This function uses the documents JNDI Compare example as a model @@ -2083,7 +2083,7 @@ final public class LdapCtx extends ComponentDirContext return false; // unbalanced } - // make sure the left and right half are not expresions themselves + // make sure the left and right half are not expressions themselves StringTokenizer illegalCharsTokenizer = new StringTokenizer(tokens[0], "()&|!=~><*", true); @@ -2443,7 +2443,7 @@ final public class LdapCtx extends ComponentDirContext } /** - * Set whether aliases are derefereced during resolution and searches. + * Set whether aliases are dereferenced during resolution and searches. */ private void setDerefAliases(String deref) { if (deref != null) { diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java index d29e408cdec..b3f76d9ab0b 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapName.java @@ -346,8 +346,8 @@ public final class LdapName implements Name { } /** - * Given an attribute value formated according to RFC 2253, - * returns the unformated value. Returns a string value as + * Given an attribute value formatted according to RFC 2253, + * returns the unformatted value. Returns a string value as * a string, and a binary value as a byte array. */ public static Object unescapeAttributeValue(String val) { @@ -687,7 +687,7 @@ public final class LdapName implements Name { private final boolean binary; private final boolean valueCaseSensitive; - // If non-null, a canonical represention of the value suitable + // If non-null, a canonical representation of the value suitable // for comparison using String.compareTo(). private String comparable = null; @@ -842,8 +842,8 @@ public final class LdapName implements Name { } /* - * Given an attribute value formated according to RFC 2253, - * returns the unformated value. Escapes and quotes are + * Given an attribute value formatted according to RFC 2253, + * returns the unformatted value. Escapes and quotes are * stripped away, and hex-encoded UTF-8 is converted to 16-bit * Unicode chars. Returns a string value as a String, and a * binary value as a byte array. diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java index 0a09e0fda69..b810187c649 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapReferralContext.java @@ -679,7 +679,7 @@ final class LdapReferralContext implements DirContext, LdapContext { } catch (LdapReferralException e) { - // %%% VR - setNameResolved(true); + // %%% setNameResolved(true); // append (referrals from) the exception that generated this // context to the new exception, so that referral processing @@ -897,7 +897,7 @@ final class LdapReferralContext implements DirContext, LdapContext { /* * Use the attributes and scope components from the LDAP URL (if present) - * to override the corrpesonding components supplied in SearchControls. + * to override the corresponding components supplied in SearchControls. */ private SearchControls overrideAttributesAndScope(SearchControls cons) { SearchControls urlCons; diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java index 23347ac5dc8..6e7e3e6544b 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapRequest.java @@ -62,7 +62,7 @@ final class LdapRequest { cancelled = true; // Unblock reader of pending request - // Should only ever have atmost one waiter + // Should only ever have at most one waiter notify(); } diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java index 7fddd7799f5..ae3d2bd4881 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSchemaParser.java @@ -84,7 +84,7 @@ final class LdapSchemaParser { // Object Class specific IDs private static final String ABSTRACT_ID = "ABSTRACT"; private static final String STRUCTURAL_ID = "STRUCTURAL"; - private static final String AUXILARY_ID = "AUXILIARY"; + private static final String AUXILIARY_ID = "AUXILIARY"; private static final String MUST_ID = "MUST"; private static final String MAY_ID = "MAY"; @@ -300,8 +300,8 @@ final class LdapSchemaParser { return new Object[] {currentName, attrs}; } - // returns the index of the first whitespace char of a linear whitspace - // sequince ending at the given position. + // returns the index of the first whitespace char of a linear whitespace + // sequence ending at the given position. final private static int findTrailingWhitespace(String string, int pos) { for(int i = pos; i > 0; i--) { if(string.charAt(i) != WHSP) { @@ -423,7 +423,7 @@ final class LdapSchemaParser { if (tag.equals(OBSOLETE_ID) || tag.equals(ABSTRACT_ID) || tag.equals(STRUCTURAL_ID) || - tag.equals(AUXILARY_ID) || + tag.equals(AUXILIARY_ID) || tag.equals(SINGLE_VAL_ID) || tag.equals(COLLECTIVE_ID) || tag.equals(NO_USER_MOD_ID)) { @@ -819,7 +819,7 @@ final class LdapSchemaParser { count++; } - attr = attrs.get(AUXILARY_ID); + attr = attrs.get(AUXILIARY_ID); if (attr != null) { objectDesc.append(writeBoolean(attr)); count++; @@ -856,7 +856,7 @@ final class LdapSchemaParser { attrId.equals(MUST_ID) || attrId.equals(STRUCTURAL_ID) || attrId.equals(DESC_ID) || - attrId.equals(AUXILARY_ID) || + attrId.equals(AUXILIARY_ID) || attrId.equals(ABSTRACT_ID) || attrId.equals(OBSOLETE_ID)) { continue; diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java index 329b1d249af..4af58a8b0dd 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java @@ -156,7 +156,7 @@ final class LdapSearchEnumeration String[] reqAttrs; if ((reqAttrs = searchArgs.reqAttrs) != null) { // create an attribute set for those requested - Attributes rattrs = new BasicAttributes(true); // caseignore + Attributes rattrs = new BasicAttributes(true); // ignore case for (int i = 0; i < reqAttrs.length; i++) { rattrs.put(reqAttrs[i], null); } @@ -213,8 +213,6 @@ final class LdapSearchEnumeration // Update search-specific variables LdapSearchEnumeration se = (LdapSearchEnumeration)ne; startName = se.startName; -//VR - keep original args, don't overwite with current args -// searchArgs = se.searchArgs; } void setStartName(Name nm) { diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java index ada02f6f3bc..40b2b56cf42 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapURL.java @@ -162,7 +162,7 @@ final public class LdapURL extends Uri { } /** - * Derermines whether an LDAP URL has query components. + * Determines whether an LDAP URL has query components. */ public static boolean hasQueryComponents(String url) { return (url.lastIndexOf('?') != -1); diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java b/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java index 05df1bbd6b7..a7bf61d9494 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/ServiceLocator.java @@ -62,7 +62,7 @@ class ServiceLocator { * * @param dn A string distinguished name (RFC 2253). * @return A domain name or null if none can be derived. - * @throw InvalidNameException If the distinugished name is invalid. + * @throw InvalidNameException If the distinguished name is invalid. */ static String mapDnToDomainName(String dn) throws InvalidNameException { if (dn == null) { diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java index 0a696bd4ff2..17e7bc13779 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper.java @@ -25,32 +25,77 @@ package com.sun.jndi.ldap; +import sun.misc.SharedSecrets; + import java.net.MalformedURLException; import java.net.URL; +import java.net.URLClassLoader; +import java.security.AccessControlContext; +import java.security.AccessController; +import java.security.PrivilegedAction; -abstract class VersionHelper { +public final class VersionHelper { - private static final VersionHelper helper = new VersionHelper12(); + private static final VersionHelper helper = new VersionHelper(); - VersionHelper() {} // Disallow anyone from creating one of these. + /** + * Determines whether classes may be loaded from an arbitrary URL code base. + */ + private static final boolean trustURLCodebase; + + static { + // System property to control whether classes may be loaded from an + // arbitrary URL code base + PrivilegedAction act = + () -> System.getProperty("com.sun.jndi.ldap.object.trustURLCodebase", "false"); + String trust = AccessController.doPrivileged(act); + trustURLCodebase = "true".equalsIgnoreCase(trust); + } + + private VersionHelper() { } static VersionHelper getVersionHelper() { return helper; } - abstract ClassLoader getURLClassLoader(String[] url) - throws MalformedURLException; + ClassLoader getURLClassLoader(String[] url) throws MalformedURLException { + ClassLoader parent = getContextClassLoader(); + /* + * Classes may only be loaded from an arbitrary URL code base when + * the system property com.sun.jndi.ldap.object.trustURLCodebase + * has been set to "true". + */ + if (url != null && trustURLCodebase) { + return URLClassLoader.newInstance(getUrlArray(url), parent); + } else { + return parent; + } + } + Class loadClass(String className) throws ClassNotFoundException { + return Class.forName(className, true, getContextClassLoader()); + } - static protected URL[] getUrlArray(String[] url) throws MalformedURLException { + Thread createThread(Runnable r) { + AccessControlContext acc = AccessController.getContext(); + // 4290486: doPrivileged is needed to create a thread in + // an environment that restricts "modifyThreadGroup". + PrivilegedAction act = + () -> SharedSecrets.getJavaLangAccess().newThreadWithAcc(r, acc); + return AccessController.doPrivileged(act); + } + + private ClassLoader getContextClassLoader() { + PrivilegedAction act = + Thread.currentThread()::getContextClassLoader; + return AccessController.doPrivileged(act); + } + + private static URL[] getUrlArray(String[] url) throws MalformedURLException { URL[] urlArray = new URL[url.length]; for (int i = 0; i < urlArray.length; i++) { urlArray[i] = new URL(url[i]); } return urlArray; } - - abstract Class loadClass(String className) throws ClassNotFoundException; - - abstract Thread createThread(Runnable r); } diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java deleted file mode 100644 index 468273ede97..00000000000 --- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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. - */ - -package com.sun.jndi.ldap; - -import java.net.URLClassLoader; -import java.net.MalformedURLException; -import java.security.AccessControlContext; -import java.security.AccessController; -import java.security.PrivilegedAction; -import sun.misc.SharedSecrets; - -final class VersionHelper12 extends VersionHelper { - - // System property to control whether classes may be loaded from an - // arbitrary URL code base. - private static final String TRUST_URL_CODEBASE_PROPERTY = - "com.sun.jndi.ldap.object.trustURLCodebase"; - - // Determine whether classes may be loaded from an arbitrary URL code base. - private static final String trustURLCodebase = - AccessController.doPrivileged( - new PrivilegedAction() { - public String run() { - return System.getProperty(TRUST_URL_CODEBASE_PROPERTY, - "false"); - } - } - ); - - VersionHelper12() {} // Disallow external from creating one of these. - - ClassLoader getURLClassLoader(String[] url) - throws MalformedURLException { - ClassLoader parent = getContextClassLoader(); - /* - * Classes may only be loaded from an arbitrary URL code base when - * the system property com.sun.jndi.ldap.object.trustURLCodebase - * has been set to "true". - */ - if (url != null && "true".equalsIgnoreCase(trustURLCodebase)) { - return URLClassLoader.newInstance(getUrlArray(url), parent); - } else { - return parent; - } - } - - Class loadClass(String className) throws ClassNotFoundException { - ClassLoader cl = getContextClassLoader(); - return Class.forName(className, true, cl); - } - - private ClassLoader getContextClassLoader() { - return AccessController.doPrivileged( - new PrivilegedAction() { - public ClassLoader run() { - return Thread.currentThread().getContextClassLoader(); - } - } - ); - } - - Thread createThread(final Runnable r) { - final AccessControlContext acc = AccessController.getContext(); - // 4290486: doPrivileged is needed to create a thread in - // an environment that restricts "modifyThreadGroup". - return AccessController.doPrivileged( - new PrivilegedAction() { - public Thread run() { - return SharedSecrets.getJavaLangAccess() - .newThreadWithAcc(r, acc); - } - } - ); - } -} diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java index 2df13459570..0e3e1094d67 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Connections.java @@ -254,7 +254,7 @@ final class Connections implements PoolCallback { /** * Removes PooledConnection from list of connections. * The closing of the connection is separate from this method. - * This method is called usually when the caller encouters an error + * This method is called usually when the caller encounters an error * when using the connection and wants it removed from the pool. * * @return true if conn removed; false if it was not in pool diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java index f9786cad213..723f11a8783 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/pool/Pool.java @@ -68,8 +68,8 @@ import javax.naming.NamingException; * whenever a pooled connection is requested or a call to remove the expired * connections is made. The monitoring is done regularly when idle connection * timeout is set as the PoolCleaner removes expired connections periodically. - * As determined by the experiements, cleanup of resources using the - * ReferenceQueue mechanism is reliable and has immidiate effect than the + * As determined by experimentation, cleanup of resources using the + * ReferenceQueue mechanism is reliable and has more immediate effect than the * finalizer approach. * * @author Rosanna Lee diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java b/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java index 8009b67aa2c..3802f5f106c 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/corba/CorbaUtils.java @@ -165,6 +165,7 @@ public class CorbaUtils { // Get Applet from environment if (env != null) { + @SuppressWarnings("deprecation") Applet applet = (Applet) env.get(Context.APPLET); if (applet != null) { // Create ORBs using applet and orbProp diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java index f8f41d598f9..606f38005cf 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/AtomicContext.java @@ -96,7 +96,7 @@ public abstract class AtomicContext extends ComponentContext { * Resolves the nns for 'name' when the named context is acting * as an intermediate context. * - * For a system that supports junctions, this would be equilvalent to + * For a system that supports junctions, this would be equivalent to * a_lookup(name, cont); * because for junctions, an intermediate slash simply signifies * a syntactic separator. @@ -487,7 +487,7 @@ public abstract class AtomicContext extends ComponentContext { resolve_to_nns_and_continue(name, cont); return null; } else { - // use COmponentContext + // use ComponentContext return super.c_getNameParser_nns(name, cont); } } diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java index 351d6d7d0f7..24e65fa104a 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/ComponentContext.java @@ -137,7 +137,7 @@ public abstract class ComponentContext extends PartialCompositeContext { * as an intermediate context. * * For a system that supports only junctions, this would be - * equilvalent to + * equivalent to * c_lookup(name, cont); * because for junctions, an intermediate slash simply signifies * a syntactic separator. diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java index 6c09f935f97..44bc245bad4 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java @@ -172,7 +172,7 @@ public class Continuation extends ResolveResult { * * This method is typically called by _nns methods that have been * given a name to process. It might process part of that name but - * encountered some error. Consequenetly, it would call setErrorNNS() + * encountered some error. Consequently, it would call setErrorNNS() * with the remaining name. Since the _nns method was expected to * operate upon the "nns" of the original name, the remaining name * must include the "nns". That's why this method adds a trailing "/". @@ -219,7 +219,7 @@ public class Continuation extends ResolveResult { * * This method is typically called by methods that have been * given a name to process. It might process part of that name but - * encountered some error. Consequenetly, it would call setError() + * encountered some error. Consequently, it would call setError() * with the resolved object and the remaining name. *

* After this method is called, isContinuing() returns false. diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java index cafd047b144..176e3392b02 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/ContextEnumerator.java @@ -182,14 +182,14 @@ public class ContextEnumerator implements NamingEnumeration { if (!currentReturned) { // returning parent - if(debug) {System.out.println("getNextDescedant: simple case");} + if(debug) {System.out.println("getNextDescendant: simple case");} currentReturned = true; return currentChild; } else if (currentChildExpanded && currentChildEnum.hasMore()) { - if(debug) {System.out.println("getNextDescedant: expanded case");} + if(debug) {System.out.println("getNextDescendant: expanded case");} // if the current child is expanded, use it's enumerator return currentChildEnum.next(); @@ -197,7 +197,7 @@ public class ContextEnumerator implements NamingEnumeration { } else { // Ready to go onto next child - if(debug) {System.out.println("getNextDescedant: next case");} + if(debug) {System.out.println("getNextDescendant: next case");} prepNextChild(); return getNextDescendant(); diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java index e10ee2aec41..35895db2395 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/HierMemDirCtx.java @@ -881,8 +881,8 @@ public class HierMemDirCtx implements DirContext { } } - // CompundNames's HashCode() method isn't good enough for many string. - // The only prupose of this subclass is to have a more discerning + // CompoundNames's HashCode() method isn't good enough for many strings. + // The only purpose of this subclass is to have a more discerning // hash function. We'll make up for the performance hit by caching // the hash value. diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java index b6efbedfa4b..8871e0f051c 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java @@ -152,7 +152,7 @@ final public class LazySearchEnumerationImpl } else if (useFactory) { try { // Give name only if context non-null, - // otherewise, name will be interpreted relative + // otherwise, name will be interpreted relative // to initial context (not what we want) Name nm = (context != null ? new CompositeName(next.getName()) : null); diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java index cf23c3dd2e4..695238309f3 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/dir/SearchFilter.java @@ -256,7 +256,7 @@ public class SearchFilter implements AttrFilter { static final int LESS_MATCH = 4; /** - * A class for dealing wtih atomic filters + * A class for dealing with atomic filters */ final class AtomicFilter implements StringFilter { private String attrID; @@ -369,7 +369,7 @@ public class SearchFilter implements AttrFilter { } break; default: - if (debug) {System.out.println("AtomicFilter: unkown " + + if (debug) {System.out.println("AtomicFilter: unknown " + "matchType");} } } @@ -434,7 +434,7 @@ public class SearchFilter implements AttrFilter { /** - * Creates an LDAP filter as a conjuction of the attributes supplied. + * Creates an LDAP filter as a conjunction of the attributes supplied. */ public static String format(Attributes attrs) throws NamingException { if (attrs == null || attrs.size() == 0) { diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java b/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java index cb5255d0a7b..8493330135b 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/url/GenericURLContext.java @@ -168,7 +168,7 @@ abstract public class GenericURLContext implements Context { } } - // else 0 or 1 iniitial slashes; start is unchanged + // else 0 or 1 initial slashes; start is unchanged return url.substring(0, start); } diff --git a/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java b/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java index 6143363284a..af88b606e21 100644 --- a/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java +++ b/jdk/src/share/classes/com/sun/jndi/url/ldap/ldapURLContext.java @@ -562,7 +562,7 @@ final public class ldapURLContext } // Search using the LDAP URL in name. - // LDAP URL query components override the search argments. + // LDAP URL query components override the search arguments. private NamingEnumeration searchUsingURL(String name) throws NamingException { diff --git a/jdk/src/share/classes/com/sun/management/GcInfo.java b/jdk/src/share/classes/com/sun/management/GcInfo.java index 0a7eda76a51..7257b6c6f62 100644 --- a/jdk/src/share/classes/com/sun/management/GcInfo.java +++ b/jdk/src/share/classes/com/sun/management/GcInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -267,7 +267,7 @@ public class GcInfo implements CompositeData, CompositeDataView { return cdata.toString(); } - public Collection values() { + public Collection values() { return cdata.values(); } diff --git a/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java b/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java index a735b4342ee..09be7ca7cd1 100644 --- a/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java +++ b/jdk/src/share/classes/com/sun/naming/internal/ResourceManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, 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 @@ -28,8 +28,6 @@ package com.sun.naming.internal; import java.io.InputStream; import java.io.IOException; import java.lang.ref.WeakReference; -import java.lang.reflect.Method; -import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Hashtable; import java.util.Map; @@ -126,52 +124,6 @@ public final class ResourceManager { private static final WeakReference NO_FACTORY = new WeakReference<>(null); - /** - * A class to allow JNDI properties be specified as applet parameters - * without creating a static dependency on java.applet. - */ - private static class AppletParameter { - private static final Class clazz = getClass("java.applet.Applet"); - private static final Method getMethod = - getMethod(clazz, "getParameter", String.class); - private static Class getClass(String name) { - try { - return Class.forName(name, true, null); - } catch (ClassNotFoundException e) { - return null; - } - } - private static Method getMethod(Class clazz, - String name, - Class... paramTypes) - { - if (clazz != null) { - try { - return clazz.getMethod(name, paramTypes); - } catch (NoSuchMethodException e) { - throw new AssertionError(e); - } - } else { - return null; - } - } - - /** - * Returns the value of the applet's named parameter. - */ - static Object get(Object applet, String name) { - // if clazz is null then applet cannot be an Applet. - if (clazz == null || !clazz.isInstance(applet)) - throw new ClassCastException(applet.getClass().getName()); - try { - return getMethod.invoke(applet, name); - } catch (InvocationTargetException | - IllegalAccessException e) { - throw new AssertionError(e); - } - } - } - // There should be no instances of this class. private ResourceManager() { } @@ -179,12 +131,11 @@ public final class ResourceManager { // ---------- Public methods ---------- - /* + /** * Given the environment parameter passed to the initial context * constructor, returns the full environment for that initial * context (never null). This is based on the environment - * parameter, the applet parameters (where appropriate), the - * system properties, and all application resource files. + * parameter, the system properties, and all application resource files. * *

This method will modify env and save * a reference to it. The caller may no longer modify it. @@ -196,18 +147,16 @@ public final class ResourceManager { * resource file */ @SuppressWarnings("unchecked") - public static Hashtable getInitialEnvironment( - Hashtable env) + public static Hashtable getInitialEnvironment(Hashtable env) throws NamingException { - String[] props = VersionHelper.PROPS; // system/applet properties + String[] props = VersionHelper.PROPS; // system properties if (env == null) { env = new Hashtable<>(11); } - Object applet = env.get(Context.APPLET); - // Merge property values from env param, applet params, and system - // properties. The first value wins: there's no concatenation of + // Merge property values from env param, and system properties. + // The first value wins: there's no concatenation of // colon-separated lists. // Read system properties by first trying System.getProperties(), // and then trying System.getProperty() if that fails. The former @@ -217,18 +166,13 @@ public final class ResourceManager { for (int i = 0; i < props.length; i++) { Object val = env.get(props[i]); if (val == null) { - if (applet != null) { - val = AppletParameter.get(applet, props[i]); - } - if (val == null) { - // Read system property. - val = (jndiSysProps != null) + // Read system property. + val = (jndiSysProps != null) ? jndiSysProps[i] : helper.getJndiProperty(i); - } - if (val != null) { - ((Hashtable)env).put(props[i], val); - } + } + if (val != null) { + ((Hashtable)env).put(props[i], val); } } @@ -248,8 +192,8 @@ public final class ResourceManager { /** * Retrieves the property from the environment, or from the provider * resource file associated with the given context. The environment - * may in turn contain values that come from applet parameters, - * system properties, or application resource files. + * may in turn contain values that come from system properties, + * or application resource files. * * If concat is true and both the environment and the provider * resource file contain the property, the two values are concatenated @@ -289,7 +233,7 @@ public final class ResourceManager { * property. * * The property is gotten from the environment and the provider - * resource file associated with the given context and concantenated. + * resource file associated with the given context and concatenated. * See getProperty(). The resulting property value is a list of class names. *

* This method then loads each class using the current thread's context diff --git a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java index 63590be93aa..2a9db220af0 100644 --- a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java +++ b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, 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,14 +25,19 @@ package com.sun.naming.internal; -import java.io.InputStream; +import javax.naming.NamingEnumeration; +import java.io.File; +import java.io.FileInputStream; import java.io.IOException; +import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; -import java.util.StringTokenizer; -import java.util.Vector; - -import javax.naming.NamingEnumeration; +import java.net.URLClassLoader; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.util.*; /** * VersionHelper was used by JNDI to accommodate differences between @@ -45,10 +50,10 @@ import javax.naming.NamingEnumeration; * @author Scott Seligman */ -public abstract class VersionHelper { - private static VersionHelper helper = null; +public final class VersionHelper { + private static final VersionHelper helper = new VersionHelper(); - final static String[] PROPS = new String[] { + final static String[] PROPS = new String[]{ javax.naming.Context.INITIAL_CONTEXT_FACTORY, javax.naming.Context.OBJECT_FACTORIES, javax.naming.Context.URL_PKG_PREFIXES, @@ -67,31 +72,57 @@ public abstract class VersionHelper { public final static int DNS_URL = 5; public final static int CONTROL_FACTORIES = 6; - VersionHelper() {} // Disallow anyone from creating one of these. - - static { - helper = new VersionHelper12(); - } + private VersionHelper() {} // Disallow anyone from creating one of these. public static VersionHelper getVersionHelper() { return helper; } - public abstract Class loadClass(String className) - throws ClassNotFoundException; + public Class loadClass(String className) throws ClassNotFoundException { + return loadClass(className, getContextClassLoader()); + } - abstract Class loadClass(String className, ClassLoader cl) - throws ClassNotFoundException; + /** + * @param className A non-null fully qualified class name. + * @param codebase A non-null, space-separated list of URL strings. + */ + public Class loadClass(String className, String codebase) + throws ClassNotFoundException, MalformedURLException { - public abstract Class loadClass(String className, String codebase) - throws ClassNotFoundException, MalformedURLException; + ClassLoader parent = getContextClassLoader(); + ClassLoader cl = + URLClassLoader.newInstance(getUrlArray(codebase), parent); + + return loadClass(className, cl); + } + + /** + * Package private. + *

+ * This internal method is used with Thread Context Class Loader (TCCL), + * please don't expose this method as public. + */ + Class loadClass(String className, ClassLoader cl) + throws ClassNotFoundException { + Class cls = Class.forName(className, true, cl); + return cls; + } /* - * Returns a JNDI property from the system properties. Returns + * Returns a JNDI property from the system properties. Returns * null if the property is not set, or if there is no permission * to read it. */ - abstract String getJndiProperty(int i); + String getJndiProperty(int i) { + PrivilegedAction act = () -> { + try { + return System.getProperty(PROPS[i]); + } catch (SecurityException e) { + return null; + } + }; + return AccessController.doPrivileged(act); + } /* * Reads each property in PROPS from the system properties, and @@ -99,13 +130,33 @@ public abstract class VersionHelper { * unset property, the corresponding array element is set to null. * Returns null if there is no permission to call System.getProperties(). */ - abstract String[] getJndiProperties(); + String[] getJndiProperties() { + PrivilegedAction act = () -> { + try { + return System.getProperties(); + } catch (SecurityException e) { + return null; + } + }; + Properties sysProps = AccessController.doPrivileged(act); + if (sysProps == null) { + return null; + } + String[] jProps = new String[PROPS.length]; + for (int i = 0; i < PROPS.length; i++) { + jProps[i] = sysProps.getProperty(PROPS[i]); + } + return jProps; + } /* * Returns the resource of a given name associated with a particular * class (never null), or null if none can be found. */ - abstract InputStream getResourceAsStream(Class c, String name); + InputStream getResourceAsStream(Class c, String name) { + PrivilegedAction act = () -> c.getResourceAsStream(name); + return AccessController.doPrivileged(act); + } /* * Returns an input stream for a file in /lib, @@ -113,7 +164,22 @@ public abstract class VersionHelper { * * @param filename The file name, sans directory. */ - abstract InputStream getJavaHomeLibStream(String filename); + InputStream getJavaHomeLibStream(String filename) { + PrivilegedAction act = () -> { + try { + String javahome = System.getProperty("java.home"); + if (javahome == null) { + return null; + } + String pathname = javahome + File.separator + + "lib" + File.separator + filename; + return new FileInputStream(pathname); + } catch (Exception e) { + return null; + } + }; + return AccessController.doPrivileged(act); + } /* * Returns an enumeration (never null) of InputStreams of the @@ -121,29 +187,55 @@ public abstract class VersionHelper { * loader. Null represents the bootstrap class loader in some * Java implementations. */ - abstract NamingEnumeration getResources( - ClassLoader cl, String name) - throws IOException; + NamingEnumeration getResources(ClassLoader cl, + String name) throws IOException { + Enumeration urls; + PrivilegedExceptionAction> act = () -> + (cl == null) + ? ClassLoader.getSystemResources(name) + : cl.getResources(name); + try { + urls = AccessController.doPrivileged(act); + } catch (PrivilegedActionException e) { + throw (IOException) e.getException(); + } + return new InputStreamEnumeration(urls); + } - /* - * Returns the context class loader associated with the current thread. - * Null indicates the bootstrap class loader in some Java implementations. - * - * @throws SecurityException if the class loader is not accessible. + + /** + * Package private. + *

+ * This internal method returns Thread Context Class Loader (TCCL), + * if null, returns the system Class Loader. + *

+ * Please don't expose this method as public. + * @throws SecurityException if the class loader is not accessible */ - abstract ClassLoader getContextClassLoader(); + ClassLoader getContextClassLoader() { - static protected URL[] getUrlArray(String codebase) - throws MalformedURLException { + PrivilegedAction act = () -> { + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + if (loader == null) { + // Don't use bootstrap class loader directly! + loader = ClassLoader.getSystemClassLoader(); + } + return loader; + }; + return AccessController.doPrivileged(act); + } + + private static URL[] getUrlArray(String codebase) + throws MalformedURLException { // Parse codebase into separate URLs StringTokenizer parser = new StringTokenizer(codebase); - Vector vec = new Vector<>(10); + List list = new ArrayList<>(); while (parser.hasMoreTokens()) { - vec.addElement(parser.nextToken()); + list.add(parser.nextToken()); } - String[] url = new String[vec.size()]; + String[] url = new String[list.size()]; for (int i = 0; i < url.length; i++) { - url[i] = vec.elementAt(i); + url[i] = list.get(i); } URL[] urlArray = new URL[url.length]; @@ -152,4 +244,70 @@ public abstract class VersionHelper { } return urlArray; } + + /** + * Given an enumeration of URLs, an instance of this class represents + * an enumeration of their InputStreams. Each operation on the URL + * enumeration is performed within a doPrivileged block. + * This is used to enumerate the resources under a foreign codebase. + * This class is not MT-safe. + */ + private class InputStreamEnumeration implements + NamingEnumeration { + + private final Enumeration urls; + + private InputStream nextElement; + + InputStreamEnumeration(Enumeration urls) { + this.urls = urls; + } + + /* + * Returns the next InputStream, or null if there are no more. + * An InputStream that cannot be opened is skipped. + */ + private InputStream getNextElement() { + PrivilegedAction act = () -> { + while (urls.hasMoreElements()) { + try { + return urls.nextElement().openStream(); + } catch (IOException e) { + // skip this URL + } + } + return null; + }; + return AccessController.doPrivileged(act); + } + + public boolean hasMore() { + if (nextElement != null) { + return true; + } + nextElement = getNextElement(); + return (nextElement != null); + } + + public boolean hasMoreElements() { + return hasMore(); + } + + public InputStream next() { + if (hasMore()) { + InputStream res = nextElement; + nextElement = null; + return res; + } else { + throw new NoSuchElementException(); + } + } + + public InputStream nextElement() { + return next(); + } + + public void close() { + } + } } diff --git a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java b/jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java deleted file mode 100644 index bf4586e7ebc..00000000000 --- a/jdk/src/share/classes/com/sun/naming/internal/VersionHelper12.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (c) 1999, 2011, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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. - */ - -package com.sun.naming.internal; - -import java.io.InputStream; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URLClassLoader; -import java.net.URL; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; -import java.util.Enumeration; -import java.util.NoSuchElementException; -import java.util.Properties; - -import javax.naming.*; - -/** - * VersionHelper was used by JNDI to accommodate differences between - * JDK 1.1.x and the Java 2 platform. As this is no longer necessary - * since JNDI's inclusion in the platform, this class currently - * serves as a set of utilities for performing system-level things, - * such as class-loading and reading system properties. - * - * @author Rosanna Lee - * @author Scott Seligman - */ - -final class VersionHelper12 extends VersionHelper { - - // Disallow external from creating one of these. - VersionHelper12() { - } - - public Class loadClass(String className) throws ClassNotFoundException { - return loadClass(className, getContextClassLoader()); - } - - /** - * Package private. - * - * This internal method is used with Thread Context Class Loader (TCCL), - * please don't expose this method as public. - */ - Class loadClass(String className, ClassLoader cl) - throws ClassNotFoundException { - Class cls = Class.forName(className, true, cl); - return cls; - } - - /** - * @param className A non-null fully qualified class name. - * @param codebase A non-null, space-separated list of URL strings. - */ - public Class loadClass(String className, String codebase) - throws ClassNotFoundException, MalformedURLException { - - ClassLoader parent = getContextClassLoader(); - ClassLoader cl = - URLClassLoader.newInstance(getUrlArray(codebase), parent); - - return loadClass(className, cl); - } - - String getJndiProperty(final int i) { - return AccessController.doPrivileged( - new PrivilegedAction() { - public String run() { - try { - return System.getProperty(PROPS[i]); - } catch (SecurityException e) { - return null; - } - } - } - ); - } - - String[] getJndiProperties() { - Properties sysProps = AccessController.doPrivileged( - new PrivilegedAction() { - public Properties run() { - try { - return System.getProperties(); - } catch (SecurityException e) { - return null; - } - } - } - ); - if (sysProps == null) { - return null; - } - String[] jProps = new String[PROPS.length]; - for (int i = 0; i < PROPS.length; i++) { - jProps[i] = sysProps.getProperty(PROPS[i]); - } - return jProps; - } - - InputStream getResourceAsStream(final Class c, final String name) { - return AccessController.doPrivileged( - new PrivilegedAction() { - public InputStream run() { - return c.getResourceAsStream(name); - } - } - ); - } - - InputStream getJavaHomeLibStream(final String filename) { - return AccessController.doPrivileged( - new PrivilegedAction() { - public InputStream run() { - try { - String javahome = System.getProperty("java.home"); - if (javahome == null) { - return null; - } - String pathname = javahome + java.io.File.separator + - "lib" + java.io.File.separator + filename; - return new java.io.FileInputStream(pathname); - } catch (Exception e) { - return null; - } - } - } - ); - } - - NamingEnumeration getResources(final ClassLoader cl, - final String name) throws IOException { - Enumeration urls; - try { - urls = AccessController.doPrivileged( - new PrivilegedExceptionAction>() { - public Enumeration run() throws IOException { - return (cl == null) - ? ClassLoader.getSystemResources(name) - : cl.getResources(name); - } - } - ); - } catch (PrivilegedActionException e) { - throw (IOException)e.getException(); - } - return new InputStreamEnumeration(urls); - } - - /** - * Package private. - * - * This internal method returns Thread Context Class Loader (TCCL), - * if null, returns the system Class Loader. - * - * Please don't expose this method as public. - */ - ClassLoader getContextClassLoader() { - - return AccessController.doPrivileged( - new PrivilegedAction() { - public ClassLoader run() { - ClassLoader loader = - Thread.currentThread().getContextClassLoader(); - if (loader == null) { - // Don't use bootstrap class loader directly! - loader = ClassLoader.getSystemClassLoader(); - } - - return loader; - } - } - ); - } - - /** - * Given an enumeration of URLs, an instance of this class represents - * an enumeration of their InputStreams. Each operation on the URL - * enumeration is performed within a doPrivileged block. - * This is used to enumerate the resources under a foreign codebase. - * This class is not MT-safe. - */ - class InputStreamEnumeration implements NamingEnumeration { - - private final Enumeration urls; - - private InputStream nextElement = null; - - InputStreamEnumeration(Enumeration urls) { - this.urls = urls; - } - - /* - * Returns the next InputStream, or null if there are no more. - * An InputStream that cannot be opened is skipped. - */ - private InputStream getNextElement() { - return AccessController.doPrivileged( - new PrivilegedAction() { - public InputStream run() { - while (urls.hasMoreElements()) { - try { - return urls.nextElement().openStream(); - } catch (IOException e) { - // skip this URL - } - } - return null; - } - } - ); - } - - public boolean hasMore() { - if (nextElement != null) { - return true; - } - nextElement = getNextElement(); - return (nextElement != null); - } - - public boolean hasMoreElements() { - return hasMore(); - } - - public InputStream next() { - if (hasMore()) { - InputStream res = nextElement; - nextElement = null; - return res; - } else { - throw new NoSuchElementException(); - } - } - - public InputStream nextElement() { - return next(); - } - - public void close() { - } - } -} diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java index 5f0c12086d6..4005adc4262 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java @@ -33,18 +33,18 @@ import java.util.ArrayList; public class ExpressionParser implements ExpressionParserConstants { - Stack stack = new Stack(); + Stack stack = new Stack<>(); VirtualMachine vm = null; GetFrame frameGetter = null; private static GetFrame lastFrameGetter; private static LValue lastLValue; LValue peek() { - return (LValue)stack.peek(); + return stack.peek(); } LValue pop() { - return (LValue)stack.pop(); + return stack.pop(); } void push(LValue lval) { @@ -915,7 +915,7 @@ public class ExpressionParser implements ExpressionParserConstants { } final public void PrimarySuffix() throws ParseException { - List argList; + List argList; switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: jj_consume_token(LBRACKET); @@ -993,8 +993,8 @@ public class ExpressionParser implements ExpressionParserConstants { jj_consume_token(NULL); } - final public List Arguments() throws ParseException { - List argList = new ArrayList(); + final public List Arguments() throws ParseException { + List argList = new ArrayList<>(); jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FALSE: @@ -1026,7 +1026,7 @@ public class ExpressionParser implements ExpressionParserConstants { throw new Error("Missing return statement in function"); } - final public void ArgumentList(List argList) throws ParseException { + final public void ArgumentList(List argList) throws ParseException { Expression(); argList.add(pop().interiorGetValue()); label_17: @@ -1046,7 +1046,7 @@ public class ExpressionParser implements ExpressionParserConstants { } final public void AllocationExpression() throws ParseException { - List argList; String className; + List argList; String className; if (jj_2_7(2)) { jj_consume_token(NEW); PrimitiveType(); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java index e7a59b3a4d6..3ad56be2d2c 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -229,9 +229,9 @@ public class JavaClass extends JavaHeapObject { return name.indexOf('[') != -1; } - public Enumeration getInstances(boolean includeSubclasses) { + public Enumeration getInstances(boolean includeSubclasses) { if (includeSubclasses) { - Enumeration res = instances.elements(); + Enumeration res = instances.elements(); for (int i = 0; i < subclasses.length; i++) { res = new CompositeEnumeration(res, subclasses[i].getInstances(true)); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java index 508e0c0d4a3..471a77b595b 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -166,11 +166,11 @@ public abstract class JavaHeapObject extends JavaThing { * * @return an Enumeration of JavaHeapObject instances */ - public Enumeration getReferers() { + public Enumeration getReferers() { if (referersLen != -1) { throw new RuntimeException("not resolved: " + getIdString()); } - return new Enumeration() { + return new Enumeration() { private int num = 0; @@ -178,7 +178,7 @@ public abstract class JavaHeapObject extends JavaThing { return referers != null && num < referers.length; } - public Object nextElement() { + public JavaThing nextElement() { return referers[num++]; } }; diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java index 46978cfaf90..c20d54b7392 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -54,7 +54,7 @@ public class ReachableExcludesImpl implements ReachableExcludes { private File excludesFile; private long lastModified; - private Hashtable methods; // Hashtable, used as a bag + private Hashtable methods; // Used as a bag /** * Create a new ReachableExcludesImpl over the given file. The file will be diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java index 831e8245873..43f4c03aa91 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -86,7 +86,7 @@ public class ReachableObjects { // Now grab the elements into a vector, and sort it in decreasing size JavaThing[] things = new JavaThing[bag.size()]; int i = 0; - for (Enumeration e = bag.elements(); e.hasMoreElements(); ) { + for (Enumeration e = bag.elements(); e.hasMoreElements(); ) { things[i++] = (JavaThing) e.nextElement(); } ArraySorter.sort(things, new Comparer() { @@ -131,7 +131,7 @@ public class ReachableObjects { return usedFields; } - private String[] getElements(Hashtable ht) { + private String[] getElements(Hashtable ht) { Object[] keys = ht.keySet().toArray(); int len = keys.length; String[] res = new String[len]; diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java b/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java index 9c00ce05e18..77613c08e41 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -81,7 +81,7 @@ public class Snapshot { new HashMap(); // soft cache of finalizeable objects - lazily initialized - private SoftReference finalizablesCache; + private SoftReference> finalizablesCache; // represents null reference private JavaThing nullThing; @@ -383,7 +383,7 @@ public class Snapshot { /** * Return an Iterator of all of the classes in this snapshot. **/ - public Iterator getClasses() { + public Iterator getClasses() { // note that because classes is a TreeMap // classes are already sorted by name return classes.values().iterator(); @@ -395,8 +395,8 @@ public class Snapshot { return res; } - public synchronized Enumeration getFinalizerObjects() { - Vector obj; + public synchronized Enumeration getFinalizerObjects() { + Vector obj; if (finalizablesCache != null && (obj = finalizablesCache.get()) != null) { return obj.elements(); @@ -418,7 +418,7 @@ public class Snapshot { finalizables.add(referent); } } - finalizablesCache = new SoftReference(finalizables); + finalizablesCache = new SoftReference>(finalizables); return finalizables.elements(); } @@ -455,7 +455,7 @@ public class Snapshot { // Even though curr is in the rootset, we want to explore its // referers, because they might be more interesting. } - Enumeration referers = curr.getReferers(); + Enumeration referers = curr.getReferers(); while (referers.hasMoreElements()) { JavaHeapObject t = (JavaHeapObject) referers.nextElement(); if (t != null && !visited.containsKey(t)) { diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java b/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java index c69335d9798..c393b445ec6 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ public class OQLEngine { // create JavaScript engine Method getEngineMethod = managerClass.getMethod("getEngineByName", - new Class[] { String.class }); + new Class[] { String.class }); Object jse = getEngineMethod.invoke(manager, new Object[] {"js"}); oqlSupported = (jse != null); } catch (Exception exp) { @@ -205,9 +205,9 @@ public class OQLEngine { } if (q.className != null) { - Enumeration objects = clazz.getInstances(q.isInstanceOf); + Enumeration objects = clazz.getInstances(q.isInstanceOf); while (objects.hasMoreElements()) { - JavaHeapObject obj = (JavaHeapObject) objects.nextElement(); + JavaHeapObject obj = objects.nextElement(); Object[] args = new Object[] { wrapJavaObject(obj) }; boolean b = (whereCode == null); if (!b) { @@ -265,14 +265,14 @@ public class OQLEngine { // create JavaScript engine Method getEngineMethod = managerClass.getMethod("getEngineByName", - new Class[] { String.class }); + new Class[] { String.class }); engine = getEngineMethod.invoke(manager, new Object[] {"js"}); // initialize engine with init file (hat.js) InputStream strm = getInitStream(); Class engineClass = Class.forName("javax.script.ScriptEngine"); evalMethod = engineClass.getMethod("eval", - new Class[] { Reader.class }); + new Class[] { Reader.class }); evalMethod.invoke(engine, new Object[] {new InputStreamReader(strm)}); // initialize ScriptEngine.eval(String) and @@ -280,13 +280,13 @@ public class OQLEngine { Class invocableClass = Class.forName("javax.script.Invocable"); evalMethod = engineClass.getMethod("eval", - new Class[] { String.class }); + new Class[] { String.class }); invokeMethod = invocableClass.getMethod("invokeFunction", - new Class[] { String.class, Object[].class }); + new Class[] { String.class, Object[].class }); // initialize ScriptEngine.put(String, Object) method Method putMethod = engineClass.getMethod("put", - new Class[] { String.class, Object.class }); + new Class[] { String.class, Object.class }); // call ScriptEngine.put to initialize built-in heap object putMethod.invoke(engine, new Object[] { diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java index d453d82c38c..cd08b1bf0da 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -58,10 +58,10 @@ class AllClassesQuery extends QueryHandler { startHtml("All Classes (including platform)"); } - Iterator classes = snapshot.getClasses(); + Iterator classes = snapshot.getClasses(); String lastPackage = null; while (classes.hasNext()) { - JavaClass clazz = (JavaClass) classes.next(); + JavaClass clazz = classes.next(); if (excludePlatform && PlatformClasses.isPlatformClass(clazz)) { // skip this.. continue; diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java index dde9640b4a7..824501381f7 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -151,7 +151,7 @@ class ClassQuery extends QueryHandler { } out.println("

References to this object:

"); out.flush(); - Enumeration referers = obj.getReferers(); + Enumeration referers = obj.getReferers(); while (referers.hasMoreElements()) { JavaHeapObject ref = (JavaHeapObject) referers.nextElement(); printThing(ref); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java index 91f7017ebf2..a717c7aa38c 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,7 @@ import java.util.*; public class FinalizerObjectsQuery extends QueryHandler { public void run() { - Enumeration objs = snapshot.getFinalizerObjects(); + Enumeration objs = snapshot.getFinalizerObjects(); startHtml("Objects pending finalization"); out.println("Finalizer summary"); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java index 916cda738a4..c1aa35bce55 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,7 @@ import java.util.*; public class FinalizerSummaryQuery extends QueryHandler { public void run() { - Enumeration objs = snapshot.getFinalizerObjects(); + Enumeration objs = snapshot.getFinalizerObjects(); startHtml("Finalizer Summary"); out.println("

"); @@ -74,7 +74,7 @@ public class FinalizerSummaryQuery extends QueryHandler { private long count; } - private void printFinalizerSummary(Enumeration objs) { + private void printFinalizerSummary(Enumeration objs) { int count = 0; Map map = new HashMap(); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java index 1b466a49a4f..311df7bbb26 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -111,10 +111,10 @@ class InstancesCountQuery extends QueryHandler { } out.print(" "); if (snapshot.getHasNewSet()) { - Enumeration objects = clazz.getInstances(false); + Enumeration objects = clazz.getInstances(false); int newInst = 0; while (objects.hasMoreElements()) { - JavaHeapObject obj = (JavaHeapObject)objects.nextElement(); + JavaHeapObject obj = objects.nextElement(); if (obj.isNew()) { newInst++; } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java index ff1f60f7be5..7532b0b2e62 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -73,11 +73,11 @@ class InstancesQuery extends QueryHandler { out.print(""); printClass(clazz); out.print("

"); - Enumeration objects = clazz.getInstances(includeSubclasses); + Enumeration objects = clazz.getInstances(includeSubclasses); long totalSize = 0; long instances = 0; while (objects.hasMoreElements()) { - JavaHeapObject obj = (JavaHeapObject) objects.nextElement(); + JavaHeapObject obj = objects.nextElement(); if (newObjects && !obj.isNew()) continue; printThing(obj); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java index 73755c2e523..15f7ae8b492 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -47,15 +47,15 @@ public class RefsByTypeQuery extends QueryHandler { } else { Map referrersStat = new HashMap(); final Map refereesStat = new HashMap(); - Enumeration instances = clazz.getInstances(false); + Enumeration instances = clazz.getInstances(false); while (instances.hasMoreElements()) { - JavaHeapObject instance = (JavaHeapObject) instances.nextElement(); + JavaHeapObject instance = instances.nextElement(); if (instance.getId() == -1) { continue; } - Enumeration e = instance.getReferers(); + Enumeration e = instance.getReferers(); while (e.hasMoreElements()) { - JavaHeapObject ref = (JavaHeapObject) e.nextElement(); + JavaHeapObject ref = (JavaHeapObject)e.nextElement(); JavaClass cl = ref.getClazz(); if (cl == null) { System.out.println("null class for " + ref); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java b/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java index 6663d8ff894..c20afb22339 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,12 +34,13 @@ package com.sun.tools.hat.internal.util; import java.util.Enumeration; import java.util.NoSuchElementException; +import com.sun.tools.hat.internal.model.JavaHeapObject; -public class CompositeEnumeration implements Enumeration { - Enumeration e1; - Enumeration e2; +public class CompositeEnumeration implements Enumeration { + Enumeration e1; + Enumeration e2; - public CompositeEnumeration(Enumeration e1, Enumeration e2) { + public CompositeEnumeration(Enumeration e1, Enumeration e2) { this.e1 = e1; this.e2 = e2; } @@ -48,7 +49,7 @@ public class CompositeEnumeration implements Enumeration { return e1.hasMoreElements() || e2.hasMoreElements(); } - public Object nextElement() { + public JavaHeapObject nextElement() { if (e1.hasMoreElements()) { return e1.nextElement(); } diff --git a/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java b/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java index 11572160825..93c10f0b00f 100644 --- a/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java +++ b/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ import java.util.*; // Warnings from List filters and List[] requestLists is hard to fix. // Remove SuppressWarning when we fix the warnings from List filters // and List[] requestLists. The generic array is not supported. -@SuppressWarnings("unchecked") +@SuppressWarnings({"unchecked", "rawtypes"}) class EventRequestManagerImpl extends MirrorImpl implements EventRequestManager { diff --git a/jdk/src/share/classes/java/awt/Color.java b/jdk/src/share/classes/java/awt/Color.java index e80e991aa15..3a94d73ac74 100644 --- a/jdk/src/share/classes/java/awt/Color.java +++ b/jdk/src/share/classes/java/awt/Color.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, 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 @@ -50,7 +50,7 @@ import java.awt.color.ColorSpace; * see * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html * . - *

+ * * @version 10 Feb 1997 * @author Sami Shaio * @author Arthur van Hoff diff --git a/jdk/src/share/classes/java/awt/Font.java b/jdk/src/share/classes/java/awt/Font.java index 41d143522dc..d9faf3d3e80 100644 --- a/jdk/src/share/classes/java/awt/Font.java +++ b/jdk/src/share/classes/java/awt/Font.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, 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 @@ -542,7 +542,6 @@ public class Font implements java.io.Serializable * compatible alternative, then the font system will map the Font * instance to "Dialog", such that for example, the family as reported * by {@link #getFamily() getFamily} will be "Dialog". - *

* * @param name the font name. This can be a font face name or a font * family name, and may represent either a logical font or a physical diff --git a/jdk/src/share/classes/java/awt/Graphics.java b/jdk/src/share/classes/java/awt/Graphics.java index 4f03e1c61dd..3be860cab31 100644 --- a/jdk/src/share/classes/java/awt/Graphics.java +++ b/jdk/src/share/classes/java/awt/Graphics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, 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 @@ -151,7 +151,7 @@ public abstract class Graphics { * is specified by the width and height * arguments. * - *

+ * * @param x the x coordinate. * @param y the y coordinate. * @param width the width of the clipping rectangle. diff --git a/jdk/src/share/classes/java/awt/MenuComponent.java b/jdk/src/share/classes/java/awt/MenuComponent.java index 4ea95bf5969..64b1db9bf06 100644 --- a/jdk/src/share/classes/java/awt/MenuComponent.java +++ b/jdk/src/share/classes/java/awt/MenuComponent.java @@ -132,16 +132,24 @@ public abstract class MenuComponent implements java.io.Serializable { static { AWTAccessor.setMenuComponentAccessor( new AWTAccessor.MenuComponentAccessor() { + @Override public AppContext getAppContext(MenuComponent menuComp) { return menuComp.appContext; } + @Override public void setAppContext(MenuComponent menuComp, AppContext appContext) { menuComp.appContext = appContext; } + @Override public MenuContainer getParent(MenuComponent menuComp) { return menuComp.parent; } + @Override + public void setParent(MenuComponent menuComp, MenuContainer menuContainer) { + menuComp.parent = menuContainer; + } + @Override public Font getFont_NoClientCode(MenuComponent menuComp) { return menuComp.getFont_NoClientCode(); } diff --git a/jdk/src/share/classes/java/awt/Polygon.java b/jdk/src/share/classes/java/awt/Polygon.java index e714428c0d1..0d89e6045be 100644 --- a/jdk/src/share/classes/java/awt/Polygon.java +++ b/jdk/src/share/classes/java/awt/Polygon.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, 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 @@ -351,7 +351,7 @@ public class Polygon implements Shape, java.io.Serializable { /** * Determines whether the specified coordinates are inside this * Polygon. - *

+ * * @param x the specified X coordinate to be tested * @param y the specified Y coordinate to be tested * @return {@code true} if this {@code Polygon} contains diff --git a/jdk/src/share/classes/java/awt/Rectangle.java b/jdk/src/share/classes/java/awt/Rectangle.java index d64deaf2f0e..727fe8e7ba8 100644 --- a/jdk/src/share/classes/java/awt/Rectangle.java +++ b/jdk/src/share/classes/java/awt/Rectangle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2014, 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 @@ -41,14 +41,13 @@ import java.beans.Transient; *

* * A {@code Rectangle} whose width or height is exactly zero has location - * along those axes with zero dimension, but is otherwise considered empty. + * along those axes with zero dimension, but is otherwise considered empty. * The {@link #isEmpty} method will return true for such a {@code Rectangle}. * Methods which test if an empty {@code Rectangle} contains or intersects * a point or rectangle will always return false if either dimension is zero. * Methods which combine such a {@code Rectangle} with a point or rectangle * will include the location of the {@code Rectangle} on that axis in the * result as if the {@link #add(Point)} method were being called. - * *

* * A {@code Rectangle} whose width or height is negative has neither @@ -422,7 +421,7 @@ public class Rectangle extends Rectangle2D * Rectangle to the specified * x, y, width, * and height. - *

+ * * @param x the new X coordinate for the upper-left * corner of this Rectangle * @param y the new Y coordinate for the upper-left @@ -488,7 +487,7 @@ public class Rectangle extends Rectangle2D /** * Moves this Rectangle to the specified location. - *

+ * * @param x the X coordinate of the new location * @param y the Y coordinate of the new location * @deprecated As of JDK version 1.1, @@ -629,7 +628,7 @@ public class Rectangle extends Rectangle2D /** * Sets the size of this Rectangle to the specified * width and height. - *

+ * * @param width the new width for this Rectangle * @param height the new height for this Rectangle * @deprecated As of JDK version 1.1, diff --git a/jdk/src/share/classes/java/awt/Toolkit.java b/jdk/src/share/classes/java/awt/Toolkit.java index 65b494ba52d..2fc0910cc96 100644 --- a/jdk/src/share/classes/java/awt/Toolkit.java +++ b/jdk/src/share/classes/java/awt/Toolkit.java @@ -1241,10 +1241,9 @@ public abstract class Toolkit { * clipboard enables data transfer between Java programs and native * applications which use native clipboard facilities. *

- * In addition to any and all formats specified in the flavormap.properties - * file, or other file specified by the AWT.DnD.flavorMapFileURL - * Toolkit property, text returned by the system Clipboard's - * getTransferData() method is available in the following flavors: + * In addition to any and all default formats text returned by the system + * Clipboard's getTransferData() method is available in the + * following flavors: *

* *

Summary of attributes

- * * diff --git a/jdk/src/share/classes/java/awt/geom/Arc2D.java b/jdk/src/share/classes/java/awt/geom/Arc2D.java index 3d92306f618..be51e8a4bc3 100644 --- a/jdk/src/share/classes/java/awt/geom/Arc2D.java +++ b/jdk/src/share/classes/java/awt/geom/Arc2D.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -35,8 +35,8 @@ import java.io.Serializable; *

* * The arc is a partial section of a full ellipse which - * inscribes the framing rectangle of its parent {@link RectangularShape}. - * + * inscribes the framing rectangle of its parent {@link RectangularShape}. + * * * The angles are specified relative to the non-square * framing rectangle such that 45 degrees always falls on the line from diff --git a/jdk/src/share/classes/java/awt/image/AffineTransformOp.java b/jdk/src/share/classes/java/awt/image/AffineTransformOp.java index 9e6a66eea5c..d9216606b73 100644 --- a/jdk/src/share/classes/java/awt/image/AffineTransformOp.java +++ b/jdk/src/share/classes/java/awt/image/AffineTransformOp.java @@ -324,7 +324,7 @@ public class AffineTransformOp implements BufferedImageOp, RasterOp { * this part of the rectangle is not drawn. If the coordinates * of the rectangle are positive then the filtered image is drawn at * that position in the destination Raster. - *

+ * * @param src The Raster to transform. * @param dst The Raster in which to store the results of the * transformation. diff --git a/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java b/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java index bac63a8f066..e848fd9c206 100644 --- a/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java +++ b/jdk/src/share/classes/java/awt/image/BufferedImageFilter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -85,7 +85,7 @@ public class BufferedImageFilter extends ImageFilter implements Cloneable { * an image should avoid calling this method directly since that * operation could result in problems with retrieving the requested * pixels. - *

+ * * @param width the width to which to set the width of this * BufferedImageFilter * @param height the height to which to set the height of this diff --git a/jdk/src/share/classes/java/awt/image/ImageFilter.java b/jdk/src/share/classes/java/awt/image/ImageFilter.java index 33198346e03..04077b6d6a5 100644 --- a/jdk/src/share/classes/java/awt/image/ImageFilter.java +++ b/jdk/src/share/classes/java/awt/image/ImageFilter.java @@ -225,7 +225,7 @@ public class ImageFilter implements ImageConsumer, Cloneable { * *

  • * Override the method to simply send the data. - * This is appropriate if the filter can handle the request itself — + * This is appropriate if the filter can handle the request itself — * for example, * if the generated pixels have been saved in some sort of buffer. * diff --git a/jdk/src/share/classes/java/awt/image/WritableRaster.java b/jdk/src/share/classes/java/awt/image/WritableRaster.java index 6ad950288ee..65ff74aa4f9 100644 --- a/jdk/src/share/classes/java/awt/image/WritableRaster.java +++ b/jdk/src/share/classes/java/awt/image/WritableRaster.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -394,7 +394,7 @@ public class WritableRaster extends Raster { * is first converted to a 32-bit int (if necessary), using the above * rules for integral types, and then the int is cast to float or * double. - *

    + * * @param srcRaster The Raster from which to copy pixels. * * @throws NullPointerException if srcRaster is null. diff --git a/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java b/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java index e6b923dda0e..b08e13481ee 100644 --- a/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java +++ b/jdk/src/share/classes/java/awt/image/renderable/ParameterBlock.java @@ -370,7 +370,7 @@ public class ParameterBlock implements Cloneable, Serializable { * the specified parameter. */ public ParameterBlock add(int i) { - return add(new Integer(i)); + return add(i); } /** @@ -489,7 +489,7 @@ public class ParameterBlock implements Cloneable, Serializable { * the specified parameter. */ public ParameterBlock set(int i, int index) { - return set(new Integer(i), index); + return set(i, index); } /** diff --git a/jdk/src/share/classes/java/awt/print/PrinterJob.java b/jdk/src/share/classes/java/awt/print/PrinterJob.java index 0c80d1490d4..41d39ce10ec 100644 --- a/jdk/src/share/classes/java/awt/print/PrinterJob.java +++ b/jdk/src/share/classes/java/awt/print/PrinterJob.java @@ -546,7 +546,6 @@ public abstract class PrinterJob { * user settings returned from * printDialog(PrintRequestAttributeSet attributes to * this print() method. - *

    * * @param attributes a set of attributes for the job * @exception PrinterException an error in the print system diff --git a/jdk/src/share/classes/java/beans/EventHandler.java b/jdk/src/share/classes/java/beans/EventHandler.java index dd41750f2f1..be0f95d8ede 100644 --- a/jdk/src/share/classes/java/beans/EventHandler.java +++ b/jdk/src/share/classes/java/beans/EventHandler.java @@ -437,7 +437,7 @@ public class EventHandler implements InvocationHandler { if (method.getDeclaringClass() == Object.class) { // Handle the Object public methods. if (methodName.equals("hashCode")) { - return new Integer(System.identityHashCode(proxy)); + return System.identityHashCode(proxy); } else if (methodName.equals("equals")) { return (proxy == arguments[0] ? Boolean.TRUE : Boolean.FALSE); } else if (methodName.equals("toString")) { diff --git a/jdk/src/share/classes/java/beans/MetaData.java b/jdk/src/share/classes/java/beans/MetaData.java index d0e7108179d..ee64475b8c4 100644 --- a/jdk/src/share/classes/java/beans/MetaData.java +++ b/jdk/src/share/classes/java/beans/MetaData.java @@ -123,13 +123,13 @@ static final class ArrayPersistenceDelegate extends PersistenceDelegate { Class oldClass = oldInstance.getClass(); return new Expression(oldInstance, Array.class, "newInstance", new Object[]{oldClass.getComponentType(), - new Integer(Array.getLength(oldInstance))}); + Array.getLength(oldInstance)}); } protected void initialize(Class type, Object oldInstance, Object newInstance, Encoder out) { int n = Array.getLength(oldInstance); for (int i = 0; i < n; i++) { - Object index = new Integer(i); + Object index = i; // Expression oldGetExp = new Expression(Array.class, "get", new Object[]{oldInstance, index}); // Expression newGetExp = new Expression(Array.class, "get", new Object[]{newInstance, index}); Expression oldGetExp = new Expression(oldInstance, "get", new Object[]{index}); @@ -635,7 +635,7 @@ static class java_util_List_PersistenceDelegate extends DefaultPersistenceDelega newSize = 0; } for (int i = 0; i < newSize; i++) { - Object index = new Integer(i); + Object index = i; Expression oldGetExp = new Expression(oldInstance, "get", new Object[]{index}); Expression newGetExp = new Expression(newInstance, "get", new Object[]{index}); @@ -892,7 +892,7 @@ static final class java_awt_MenuShortcut_PersistenceDelegate extends Persistence protected Expression instantiate(Object oldInstance, Encoder out) { java.awt.MenuShortcut m = (java.awt.MenuShortcut)oldInstance; return new Expression(oldInstance, m.getClass(), "new", - new Object[]{new Integer(m.getKey()), Boolean.valueOf(m.usesShiftModifier())}); + new Object[]{m.getKey(), Boolean.valueOf(m.usesShiftModifier())}); } } diff --git a/jdk/src/share/classes/java/beans/NameGenerator.java b/jdk/src/share/classes/java/beans/NameGenerator.java index 61dd9339853..fc1db4d0fb7 100644 --- a/jdk/src/share/classes/java/beans/NameGenerator.java +++ b/jdk/src/share/classes/java/beans/NameGenerator.java @@ -107,7 +107,7 @@ class NameGenerator { Integer size = nameToCount.get(className); int instanceNumber = (size == null) ? 0 : (size).intValue() + 1; - nameToCount.put(className, new Integer(instanceNumber)); + nameToCount.put(className, instanceNumber); result = className + instanceNumber; valueToName.put(instance, result); diff --git a/jdk/src/share/classes/java/lang/reflect/Modifier.java b/jdk/src/share/classes/java/lang/reflect/Modifier.java index 7387bbeaa75..f84a35166a9 100644 --- a/jdk/src/share/classes/java/lang/reflect/Modifier.java +++ b/jdk/src/share/classes/java/lang/reflect/Modifier.java @@ -26,6 +26,7 @@ package java.lang.reflect; import java.security.AccessController; +import java.util.StringJoiner; import sun.reflect.LangReflectAccess; import sun.reflect.ReflectionFactory; @@ -232,27 +233,24 @@ public class Modifier { * represented by {@code mod} */ public static String toString(int mod) { - StringBuilder sb = new StringBuilder(); - int len; + StringJoiner sj = new StringJoiner(" "); - if ((mod & PUBLIC) != 0) sb.append("public "); - if ((mod & PROTECTED) != 0) sb.append("protected "); - if ((mod & PRIVATE) != 0) sb.append("private "); + if ((mod & PUBLIC) != 0) sj.add("public"); + if ((mod & PROTECTED) != 0) sj.add("protected"); + if ((mod & PRIVATE) != 0) sj.add("private"); /* Canonical order */ - if ((mod & ABSTRACT) != 0) sb.append("abstract "); - if ((mod & STATIC) != 0) sb.append("static "); - if ((mod & FINAL) != 0) sb.append("final "); - if ((mod & TRANSIENT) != 0) sb.append("transient "); - if ((mod & VOLATILE) != 0) sb.append("volatile "); - if ((mod & SYNCHRONIZED) != 0) sb.append("synchronized "); - if ((mod & NATIVE) != 0) sb.append("native "); - if ((mod & STRICT) != 0) sb.append("strictfp "); - if ((mod & INTERFACE) != 0) sb.append("interface "); + if ((mod & ABSTRACT) != 0) sj.add("abstract"); + if ((mod & STATIC) != 0) sj.add("static"); + if ((mod & FINAL) != 0) sj.add("final"); + if ((mod & TRANSIENT) != 0) sj.add("transient"); + if ((mod & VOLATILE) != 0) sj.add("volatile"); + if ((mod & SYNCHRONIZED) != 0) sj.add("synchronized"); + if ((mod & NATIVE) != 0) sj.add("native"); + if ((mod & STRICT) != 0) sj.add("strictfp"); + if ((mod & INTERFACE) != 0) sj.add("interface"); - if ((len = sb.length()) > 0) /* trim trailing space */ - return sb.toString().substring(0, len-1); - return ""; + return sj.toString(); } /* diff --git a/jdk/src/share/classes/java/time/chrono/JapaneseEra.java b/jdk/src/share/classes/java/time/chrono/JapaneseEra.java index 0187565869f..0c9e3e81e1d 100644 --- a/jdk/src/share/classes/java/time/chrono/JapaneseEra.java +++ b/jdk/src/share/classes/java/time/chrono/JapaneseEra.java @@ -127,7 +127,7 @@ public final class JapaneseEra // the number of defined JapaneseEra constants. // There could be an extra era defined in its configuration. - private static final int N_ERA_CONSTANTS = HEISEI.getValue() + ERA_OFFSET + 1; + private static final int N_ERA_CONSTANTS = HEISEI.getValue() + ERA_OFFSET; /** * Serialization version. @@ -148,7 +148,7 @@ public final class JapaneseEra for (int i = N_ERA_CONSTANTS; i < ERA_CONFIG.length; i++) { CalendarDate date = ERA_CONFIG[i].getSinceDate(); LocalDate isoDate = LocalDate.of(date.getYear(), date.getMonth(), date.getDayOfMonth()); - KNOWN_ERAS[i] = new JapaneseEra(i - ERA_OFFSET, isoDate); + KNOWN_ERAS[i] = new JapaneseEra(i - ERA_OFFSET + 1, isoDate); } }; @@ -195,7 +195,7 @@ public final class JapaneseEra * @throws DateTimeException if the value is invalid */ public static JapaneseEra of(int japaneseEra) { - if (japaneseEra < MEIJI.eraValue || japaneseEra + ERA_OFFSET - 1 >= KNOWN_ERAS.length) { + if (japaneseEra < MEIJI.eraValue || japaneseEra + ERA_OFFSET > KNOWN_ERAS.length) { throw new DateTimeException("Invalid era: " + japaneseEra); } return KNOWN_ERAS[ordinal(japaneseEra)]; diff --git a/jdk/src/share/classes/java/util/Collections.java b/jdk/src/share/classes/java/util/Collections.java index f6a65c7b106..ce4ae7d1b97 100644 --- a/jdk/src/share/classes/java/util/Collections.java +++ b/jdk/src/share/classes/java/util/Collections.java @@ -2342,7 +2342,7 @@ public class Collections { public NavigableSet tailSet(E fromElement, boolean inclusive) { synchronized (mutex) { - return new SynchronizedNavigableSet<>(ns.tailSet(fromElement, inclusive)); + return new SynchronizedNavigableSet<>(ns.tailSet(fromElement, inclusive), mutex); } } } @@ -3486,6 +3486,7 @@ public class Collections { */ @Override public void replaceAll(UnaryOperator operator) { + Objects.requireNonNull(operator); list.replaceAll(e -> typeCheck(operator.apply(e))); } diff --git a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java index 569c35899bc..ab5f59d8a65 100644 --- a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java +++ b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, 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 @@ -129,9 +129,6 @@ public class DoubleSummaryStatistics implements DoubleConsumer { * Returns the sum of values recorded, or zero if no values have been * recorded. * - * If any recorded value is a NaN or the sum is at any point a NaN - * then the sum will be NaN. - * *

    The value of a floating-point sum is a function both of the * input values as well as the order of addition operations. The * order of addition operations of this method is intentionally @@ -143,6 +140,44 @@ public class DoubleSummaryStatistics implements DoubleConsumer { * numerical sum compared to a simple summation of {@code double} * values. * + * Because of the unspecified order of operations and the + * possibility of using differing summation schemes, the output of + * this method may vary on the same input values. + * + *

    Various conditions can result in a non-finite sum being + * computed. This can occur even if the all the recorded values + * being summed are finite. If any recorded value is non-finite, + * the sum will be non-finite: + * + *

      + * + *
    • If any recorded value is a NaN, then the final sum will be + * NaN. + * + *
    • If the recorded values contain one or more infinities, the + * sum will be infinite or NaN. + * + *
        + * + *
      • If the recorded values contain infinities of opposite sign, + * the sum will be NaN. + * + *
      • If the recorded values contain infinities of one sign and + * an intermediate sum overflows to an infinity of the opposite + * sign, the sum may be NaN. + * + *
      + * + *
    + * + * It is possible for intermediate sums of finite values to + * overflow into opposite-signed infinities; if that occurs, the + * final sum will be NaN even if the recorded values are all + * finite. + * + * If all the recorded values are zero, the sign of zero is + * not guaranteed to be preserved in the final sum. + * * @apiNote Values sorted by increasing absolute magnitude tend to yield * more accurate results. * @@ -193,15 +228,9 @@ public class DoubleSummaryStatistics implements DoubleConsumer { * Returns the arithmetic mean of values recorded, or zero if no * values have been recorded. * - * If any recorded value is a NaN or the sum is at any point a NaN - * then the average will be code NaN. - * - *

    The average returned can vary depending upon the order in - * which values are recorded. - * - * This method may be implemented using compensated summation or - * other technique to reduce the error bound in the {@link #getSum - * numerical sum} used to compute the average. + *

    The computed average can vary numerically and have the + * special case behavior as computing the sum; see {@link #getSum} + * for details. * * @apiNote Values sorted by increasing absolute magnitude tend to yield * more accurate results. diff --git a/jdk/src/share/classes/java/util/stream/DoubleStream.java b/jdk/src/share/classes/java/util/stream/DoubleStream.java index cfc12ffde28..08b4eeda304 100644 --- a/jdk/src/share/classes/java/util/stream/DoubleStream.java +++ b/jdk/src/share/classes/java/util/stream/DoubleStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, 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 @@ -470,10 +470,7 @@ public interface DoubleStream extends BaseStream { * code is not necessarily equivalent to the summation computation * done by this method. * - *

    If any stream element is a NaN or the sum is at any point a NaN - * then the sum will be NaN. - * - * The value of a floating-point sum is a function both + *

    The value of a floating-point sum is a function both * of the input values as well as the order of addition * operations. The order of addition operations of this method is * intentionally not defined to allow for implementation @@ -485,6 +482,44 @@ public interface DoubleStream extends BaseStream { * numerical sum compared to a simple summation of {@code double} * values. * + * Because of the unspecified order of operations and the + * possibility of using differing summation schemes, the output of + * this method may vary on the same input elements. + * + *

    Various conditions can result in a non-finite sum being + * computed. This can occur even if the all the elements + * being summed are finite. If any element is non-finite, + * the sum will be non-finite: + * + *

      + * + *
    • If any element is a NaN, then the final sum will be + * NaN. + * + *
    • If the elements contain one or more infinities, the + * sum will be infinite or NaN. + * + *
        + * + *
      • If the elements contain infinities of opposite sign, + * the sum will be NaN. + * + *
      • If the elements contain infinities of one sign and + * an intermediate sum overflows to an infinity of the opposite + * sign, the sum may be NaN. + * + *
      + * + *
    + * + * It is possible for intermediate sums of finite values to + * overflow into opposite-signed infinities; if that occurs, the + * final sum will be NaN even if the elements are all + * finite. + * + * If all the elements are zero, the sign of zero is + * not guaranteed to be preserved in the final sum. + * *

    This is a terminal * operation. * @@ -555,15 +590,9 @@ public interface DoubleStream extends BaseStream { * mean of elements of this stream, or an empty optional if this * stream is empty. * - * If any recorded value is a NaN or the sum is at any point a NaN - * then the average will be NaN. - * - *

    The average returned can vary depending upon the order in - * which values are recorded. - * - * This method may be implemented using compensated summation or - * other technique to reduce the error bound in the {@link #sum - * numerical sum} used to compute the average. + *

    The computed average can vary numerically and have the + * special case behavior as computing the sum; see {@link #sum} + * for details. * *

    The average is a special case of a reduction. diff --git a/jdk/src/share/classes/javax/imageio/package.html b/jdk/src/share/classes/javax/imageio/package.html index f0927fa147b..f8254b11284 100644 --- a/jdk/src/share/classes/javax/imageio/package.html +++ b/jdk/src/share/classes/javax/imageio/package.html @@ -131,8 +131,8 @@ standard plug-ins.

  • the number of bands is 1;
  • the number of bits per sample is not greater than 8;
  • the size of a color component is not greater than 8; -

    - + +

    By default the GIF writer plug-in creates version "89a" images. This can be changed to "87a" by explicitly setting the version in the diff --git a/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java b/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java index f4d17c2b427..54fb8f46745 100644 --- a/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java +++ b/jdk/src/share/classes/javax/imageio/spi/PartiallyOrderedSet.java @@ -170,7 +170,7 @@ class PartialOrderIterator implements Iterator { while (iter.hasNext()) { DigraphNode node = iter.next(); int inDegree = node.getInDegree(); - inDegrees.put(node, new Integer(inDegree)); + inDegrees.put(node, inDegree); // Add nodes with zero in-degree to the zero list if (inDegree == 0) { @@ -191,7 +191,7 @@ class PartialOrderIterator implements Iterator { while (outNodes.hasNext()) { DigraphNode node = outNodes.next(); int inDegree = inDegrees.get(node).intValue() - 1; - inDegrees.put(node, new Integer(inDegree)); + inDegrees.put(node, inDegree); // If the in-degree has fallen to 0, place the node on the list if (inDegree == 0) { diff --git a/jdk/src/share/classes/javax/naming/Context.java b/jdk/src/share/classes/javax/naming/Context.java index db2acbde8d3..3f1b759b424 100644 --- a/jdk/src/share/classes/javax/naming/Context.java +++ b/jdk/src/share/classes/javax/naming/Context.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, 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 @@ -203,9 +203,7 @@ import java.util.Hashtable; *

    Application Resource Files

    * * When an application is deployed, it will generally have several - * codebase directories and JARs in its classpath. Similarly, when an - * applet is deployed, it will have a codebase and archives specifying - * where to find the applet's classes. JNDI locates (using + * codebase directories and JARs in its classpath. JNDI locates (using * {@link ClassLoader#getResources ClassLoader.getResources()}) * all application resource files named jndi.properties * in the classpath. @@ -236,7 +234,7 @@ import java.util.Hashtable; * * When JNDI constructs an initial context, the context's environment * is initialized with properties defined in the environment parameter - * passed to the constructor, the system properties, the applet parameters, + * passed to the constructor, the system properties, * and the application resource files. See * InitialContext * for details. @@ -268,8 +266,8 @@ import java.util.Hashtable; *

    * In this way, each service provider developer can specify a list of * factories to use with that service provider. These can be modified by - * the application resources specified by the deployer of the application - * or applet, which in turn can be modified by the user. + * the application resources specified by the deployer of the application, + * which in turn can be modified by the user. * * @author Rosanna Lee * @author Scott Seligman @@ -822,7 +820,7 @@ public interface Context { * of the property should be the fully qualified class name * of the factory class that will create an initial context. * This property may be specified in the environment parameter - * passed to the initial context constructor, an applet parameter, + * passed to the initial context constructor, * a system property, or an application resource file. * If it is not specified in any of these sources, * NoInitialContextException is thrown when an initial @@ -837,7 +835,6 @@ public interface Context { * @see NoInitialContextException * @see #addToEnvironment(String, Object) * @see #removeFromEnvironment(String) - * @see #APPLET */ String INITIAL_CONTEXT_FACTORY = "java.naming.factory.initial"; @@ -847,8 +844,8 @@ public interface Context { * of the property should be a colon-separated list of the fully * qualified class names of factory classes that will create an object * given information about the object. - * This property may be specified in the environment, an applet - * parameter, a system property, or one or more resource files. + * This property may be specified in the environment, a system property, + * or one or more resource files. * *

    The value of this constant is "java.naming.factory.object". * @@ -856,7 +853,6 @@ public interface Context { * @see javax.naming.spi.ObjectFactory * @see #addToEnvironment(String, Object) * @see #removeFromEnvironment(String) - * @see #APPLET */ String OBJECT_FACTORIES = "java.naming.factory.object"; @@ -866,8 +862,8 @@ public interface Context { * of the property should be a colon-separated list of the fully * qualified class names of state factory classes that will be used * to get an object's state given the object itself. - * This property may be specified in the environment, an applet - * parameter, a system property, or one or more resource files. + * This property may be specified in the environment, a system property, + * or one or more resource files. * *

    The value of this constant is "java.naming.factory.state". * @@ -875,7 +871,6 @@ public interface Context { * @see javax.naming.spi.StateFactory * @see #addToEnvironment(String, Object) * @see #removeFromEnvironment(String) - * @see #APPLET * @since 1.3 */ String STATE_FACTORIES = "java.naming.factory.state"; @@ -887,9 +882,8 @@ public interface Context { * of the property should be a colon-separated list of package * prefixes for the class name of the factory class that will create * a URL context factory. - * This property may be specified in the environment, - * an applet parameter, a system property, or one or more - * resource files. + * This property may be specified in the environment, a system property, + * or one or more resource files. * The prefix com.sun.jndi.url is always appended to * the possibly empty list of package prefixes. * @@ -900,8 +894,7 @@ public interface Context { * @see javax.naming.spi.ObjectFactory * @see #addToEnvironment(String, Object) * @see #removeFromEnvironment(String) - * @see #APPLET - */ + */ String URL_PKG_PREFIXES = "java.naming.factory.url.pkgs"; /** @@ -909,8 +902,8 @@ public interface Context { * for specifying configuration information for the service provider * to use. The value of the property should contain a URL string * (e.g. "ldap://somehost:389"). - * This property may be specified in the environment, - * an applet parameter, a system property, or a resource file. + * This property may be specified in the environment, a system property, + * or a resource file. * If it is not specified in any of these sources, * the default configuration is determined by the service provider. * @@ -918,7 +911,6 @@ public interface Context { * * @see #addToEnvironment(String, Object) * @see #removeFromEnvironment(String) - * @see #APPLET */ String PROVIDER_URL = "java.naming.provider.url"; @@ -926,8 +918,8 @@ public interface Context { * Constant that holds the name of the environment property * for specifying the DNS host and domain names to use for the * JNDI URL context (for example, "dns://somehost/wiz.com"). - * This property may be specified in the environment, - * an applet parameter, a system property, or a resource file. + * This property may be specified in the environment, a system property, + * or a resource file. * If it is not specified in any of these sources * and the program attempts to use a JNDI URL containing a DNS name, * a ConfigurationException will be thrown. @@ -1073,27 +1065,25 @@ public interface Context { String LANGUAGE = "java.naming.language"; /** - * Constant that holds the name of the environment property for - * specifying an applet for the initial context constructor to use - * when searching for other properties. - * The value of this property is the - * java.applet.Applet instance that is being executed. - * This property may be specified in the environment parameter - * passed to the initial context constructor. - * When this property is set, each property that the initial context - * constructor looks for in the system properties is first looked for - * in the applet's parameter list. - * If this property is unspecified, the initial context constructor - * will search for properties only in the environment parameter - * passed to it, the system properties, and application resource files. + * @deprecated An environment property with this name is ignored + * while constructing an initial context. + * This constant was originally used as a property name to specify an + * {@code Applet} to retrieve parameters from, when creating an initial + * context. Currently any applet properties that need to be passed to an + * initial context should be copied into the environment hashtable: + *

    {@code
    +     *     Hashtable env = new Hashtable();
    +     *     env.put(Context.INITIAL_CONTEXT_FACTORY,
    +     *       ((Applet) this).getParameter(Context.INITIAL_CONTEXT_FACTORY));
    +     *     env.put(Context.PROVIDER_URL,
    +     *       ((Applet) this).getParameter(Context.PROVIDER_URL));
    +     *     // ... other properties ...
          *
    -     * 

    The value of this constant is "java.naming.applet". - * - * @see #addToEnvironment(String, Object) - * @see #removeFromEnvironment(String) - * @see InitialContext + * Context ctx = new InitialContext(env); + * }

    * * @since 1.3 */ + @Deprecated String APPLET = "java.naming.applet"; }; diff --git a/jdk/src/share/classes/javax/naming/InitialContext.java b/jdk/src/share/classes/javax/naming/InitialContext.java index 867af4ca598..8a9792dd3b4 100644 --- a/jdk/src/share/classes/javax/naming/InitialContext.java +++ b/jdk/src/share/classes/javax/naming/InitialContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, 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 @@ -41,21 +41,13 @@ import com.sun.naming.internal.ResourceManager; * is initialized with properties defined in the environment parameter * passed to the constructor, and in any * application resource files. - * In addition, a small number of standard JNDI properties may - * be specified as system properties or as applet parameters - * (through the use of {@link Context#APPLET}). - * These special properties are listed in the field detail sections of the - * Context and - * LdapContext - * interface documentation. *

    * JNDI determines each property's value by merging * the values from the following two sources, in order: *

      *
    1. * The first occurrence of the property from the constructor's - * environment parameter and (for appropriate properties) the applet - * parameters and system properties. + * environment parameter and system properties. *
    2. * The application resource files (jndi.properties). *
    diff --git a/jdk/src/share/classes/javax/naming/directory/DirContext.java b/jdk/src/share/classes/javax/naming/directory/DirContext.java index 903ccbea421..2b77486673a 100644 --- a/jdk/src/share/classes/javax/naming/directory/DirContext.java +++ b/jdk/src/share/classes/javax/naming/directory/DirContext.java @@ -723,7 +723,7 @@ public interface DirContext extends Context { * specified set of attributes. * This method returns all the attributes of such objects. * It is equivalent to supplying null as - * the atributesToReturn parameter to the method + * the attributesToReturn parameter to the method * search(Name, Attributes, String[]). *
    * See {@link #search(Name, Attributes, String[])} for a full description. diff --git a/jdk/src/share/classes/javax/naming/ldap/LdapContext.java b/jdk/src/share/classes/javax/naming/ldap/LdapContext.java index 05db4a8648b..d70b865790e 100644 --- a/jdk/src/share/classes/javax/naming/ldap/LdapContext.java +++ b/jdk/src/share/classes/javax/naming/ldap/LdapContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, 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 @@ -334,8 +334,8 @@ public interface LdapContext extends DirContext { * qualified class names of factory classes that will create a control * given another control. See * ControlFactory.getControlInstance() for details. - * This property may be specified in the environment, an applet - * parameter, a system property, or one or more resource files. + * This property may be specified in the environment, a system property, + * or one or more resource files. *

    * The value of this constant is "java.naming.factory.control". * diff --git a/jdk/src/share/classes/javax/naming/ldap/Rdn.java b/jdk/src/share/classes/javax/naming/ldap/Rdn.java index d688e11baf8..dc001705bdd 100644 --- a/jdk/src/share/classes/javax/naming/ldap/Rdn.java +++ b/jdk/src/share/classes/javax/naming/ldap/Rdn.java @@ -421,7 +421,7 @@ public class Rdn implements Serializable, Comparable { private String type; private Object value; - // If non-null, a cannonical representation of the value suitable + // If non-null, a canonical representation of the value suitable // for comparison using String.compareTo() private String comparable = null; @@ -571,10 +571,10 @@ public class Rdn implements Serializable, Comparable { } /** - * Given an attribute value string formated according to the rules + * Given an attribute value string formatted according to the rules * specified in * RFC 2253, - * returns the unformated value. Escapes and quotes are + * returns the unformatted value. Escapes and quotes are * stripped away, and hex-encoded UTF-8 is converted to equivalent * UTF-16 characters. Returns a string value as a String, and a * binary value as a byte array. diff --git a/jdk/src/share/classes/javax/naming/ldap/SortControl.java b/jdk/src/share/classes/javax/naming/ldap/SortControl.java index b7420b987ec..aaeb7a17ad9 100644 --- a/jdk/src/share/classes/javax/naming/ldap/SortControl.java +++ b/jdk/src/share/classes/javax/naming/ldap/SortControl.java @@ -188,7 +188,7 @@ final public class SortControl extends BasicControl { /* * Encodes the sort control's value using ASN.1 BER. * The result includes the BER tag and length for the control's value but - * does not include the control's object identifer and criticality setting. + * does not include the control's object identifier and criticality setting. * * @param sortKeys A non-null list of keys to sort by. * @return A possibly null byte array representing the ASN.1 BER encoded diff --git a/jdk/src/share/classes/javax/naming/spi/NamingManager.java b/jdk/src/share/classes/javax/naming/spi/NamingManager.java index c6a99ec4c3e..6bb98ddc0ee 100644 --- a/jdk/src/share/classes/javax/naming/spi/NamingManager.java +++ b/jdk/src/share/classes/javax/naming/spi/NamingManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, 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 @@ -491,7 +491,7 @@ public class NamingManager { * (e.g. "ftpURLContextFactory" for the "ftp" scheme-id), * in the package specified as follows. * The Context.URL_PKG_PREFIXES environment property (which - * may contain values taken from applet parameters, system properties, + * may contain values taken from system properties, * or application resource files) * contains a colon-separated list of package prefixes. * Each package prefix in @@ -661,8 +661,7 @@ public class NamingManager { if (className == null) { NoInitialContextException ne = new NoInitialContextException( "Need to specify class name in environment or system " + - "property, or as an applet parameter, or in an " + - "application resource file: " + + "property, or in an application resource file: " + Context.INITIAL_CONTEXT_FACTORY); throw ne; } diff --git a/jdk/src/share/classes/javax/print/Doc.java b/jdk/src/share/classes/javax/print/Doc.java index d28a3e565ef..873aac594a6 100644 --- a/jdk/src/share/classes/javax/print/Doc.java +++ b/jdk/src/share/classes/javax/print/Doc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -168,7 +168,7 @@ public interface Doc { * from the print data representation object. * However, if the print data representation object is itself a Reader, * then the print data representation object is simply returned. - *

    + * * @return Reader for reading the print data characters from this doc. * If a reader cannot be provided because this doc does not meet * the criteria stated above, null is returned. @@ -192,7 +192,7 @@ public interface Doc { * object as a stream of bytes is created and returned. However, if the * print data representation object is itself an input stream, then the * print data representation object is simply returned. - *

    + * * @return Input stream for reading the print data bytes from this doc. If * an input stream cannot be provided because this doc does not * meet the criteria stated above, null is returned. diff --git a/jdk/src/share/classes/javax/print/DocFlavor.java b/jdk/src/share/classes/javax/print/DocFlavor.java index eac9d38954d..cb00e00753b 100644 --- a/jdk/src/share/classes/javax/print/DocFlavor.java +++ b/jdk/src/share/classes/javax/print/DocFlavor.java @@ -381,7 +381,6 @@ import java.io.Serializable; *

  • * A line feed (LF) character standing by itself means * "go to column 1 of the next line." - *
  • * *

    * The client must itself perform all plain text print data formatting not @@ -436,7 +435,6 @@ import java.io.Serializable; * Java Print Service instance supports without having * to load the representation classes, which may be problematic for * limited-resource clients. - *

    * * @author Alan Kaminsky */ @@ -536,7 +534,7 @@ public class DocFlavor implements Serializable, Cloneable { * The charset for text types is a commonly useful example. * This convenience method will return the value of the specified * parameter if one was specified in the mime type for this flavor. - *

    + * * @param paramName the name of the paramater. This name is internally * converted to the canonical lower case format before performing * the match. @@ -638,7 +636,6 @@ public class DocFlavor implements Serializable, Cloneable { * Class DocFlavor.BYTE_ARRAY provides predefined static constant * DocFlavor objects for example doc flavors using a byte array * (byte[]) as the print data representation class. - *

    * * @author Alan Kaminsky */ @@ -836,7 +833,6 @@ public class DocFlavor implements Serializable, Cloneable { * DocFlavor objects for example doc flavors using a byte stream ({@link * java.io.InputStream java.io.InputStream}) as the print * data representation class. - *

    * * @author Alan Kaminsky */ @@ -1038,8 +1034,7 @@ public class DocFlavor implements Serializable, Cloneable { * objects. * For example doc flavors using a Uniform Resource Locator ({@link * java.net.URL java.net.URL}) as the print data - * representation class. - *

    + * representation class. * * @author Alan Kaminsky */ @@ -1229,7 +1224,6 @@ public class DocFlavor implements Serializable, Cloneable { * DocFlavor objects for example doc flavors using a character array * (char[]) as the print data representation class. As such, * the character set is Unicode. - *

    * * @author Alan Kaminsky */ @@ -1279,7 +1273,6 @@ public class DocFlavor implements Serializable, Cloneable { * objects for example doc flavors using a string ({@link java.lang.String * java.lang.String}) as the print data representation class. * As such, the character set is Unicode. - *

    * * @author Alan Kaminsky */ @@ -1327,7 +1320,6 @@ public class DocFlavor implements Serializable, Cloneable { * objects for example doc flavors using a character stream ({@link * java.io.Reader java.io.Reader}) as the print data * representation class. As such, the character set is Unicode. - *

    * * @author Alan Kaminsky */ @@ -1376,7 +1368,6 @@ public class DocFlavor implements Serializable, Cloneable { * Class DocFlavor.SERVICE_FORMATTED provides predefined static constant * DocFlavor objects for example doc flavors for service formatted print * data. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/PrintService.java b/jdk/src/share/classes/javax/print/PrintService.java index f52eb72a0d2..a003e730880 100644 --- a/jdk/src/share/classes/javax/print/PrintService.java +++ b/jdk/src/share/classes/javax/print/PrintService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -327,7 +327,6 @@ public interface PrintService { * that indicates bounds on the legal values -- used, for example, by an * integer-valued attribute that must lie within a certain range. * - *

    * * @param category Printing attribute category to test. It must be a * {@link java.lang.Class Class} that implements diff --git a/jdk/src/share/classes/javax/print/PrintServiceLookup.java b/jdk/src/share/classes/javax/print/PrintServiceLookup.java index aece5d1205a..70695a995f8 100644 --- a/jdk/src/share/classes/javax/print/PrintServiceLookup.java +++ b/jdk/src/share/classes/javax/print/PrintServiceLookup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -199,7 +199,6 @@ public abstract class PrintServiceLookup { * available that is not part of the installation. * If the lookup service is already registered, or cannot be registered, * the method returns false. - *

    * * @param sp an implementation of a lookup service. * @return true if the new lookup service is newly @@ -305,7 +304,6 @@ public abstract class PrintServiceLookup { *

    * Locates MultiDoc print services which can be positively confirmed * to support the combination of attributes and DocFlavors specified. - *

    * * @param flavors of documents required. If null or empty it is ignored. * @param attributes required to be supported. If null this diff --git a/jdk/src/share/classes/javax/print/ServiceUI.java b/jdk/src/share/classes/javax/print/ServiceUI.java index 20b23611ed1..c6ba370a064 100644 --- a/jdk/src/share/classes/javax/print/ServiceUI.java +++ b/jdk/src/share/classes/javax/print/ServiceUI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -131,8 +131,7 @@ public class ServiceUI { * } * } * } - *

    - + * * @param gc used to select screen. null means primary or default screen. * @param x location of dialog including border in screen coordinates * @param y location of dialog including border in screen coordinates diff --git a/jdk/src/share/classes/javax/print/ServiceUIFactory.java b/jdk/src/share/classes/javax/print/ServiceUIFactory.java index d293a8cadc7..06deb02e5e8 100644 --- a/jdk/src/share/classes/javax/print/ServiceUIFactory.java +++ b/jdk/src/share/classes/javax/print/ServiceUIFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -111,7 +111,7 @@ public abstract class ServiceUIFactory { /** * Get a UI object which may be cast to the requested UI type * by the application and used in its user interface. - *

    + * * @param role requested. Must be one of the standard roles or * a private role supported by this factory. * @param ui type in which the role is requested. diff --git a/jdk/src/share/classes/javax/print/SimpleDoc.java b/jdk/src/share/classes/javax/print/SimpleDoc.java index 3cf0d779086..f73d794f76b 100644 --- a/jdk/src/share/classes/javax/print/SimpleDoc.java +++ b/jdk/src/share/classes/javax/print/SimpleDoc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, 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 @@ -176,7 +176,7 @@ public final class SimpleDoc implements Doc { * However, if the print data representation object is itself a * Reader then the print data representation object is * simply returned. - *

    + * * @return a Reader for reading the print data * characters from this doc. * If a reader cannot be provided because this doc does not meet @@ -224,7 +224,7 @@ public final class SimpleDoc implements Doc { * However, if the print data representation object is itself an * input stream then the print data representation object is simply * returned. - *

    + * * @return an InputStream for reading the print data * bytes from this doc. If an input stream cannot be * provided because this doc does not meet diff --git a/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java b/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java index dfa91a70fcb..f1f7f28c410 100644 --- a/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java +++ b/jdk/src/share/classes/javax/print/StreamPrintServiceFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -95,7 +95,7 @@ public abstract class StreamPrintServiceFactory { * Although null is an acceptable value to use in the lookup of stream * printing services, it's typical to search for a particular * desired format, such as Postscript(TM). - *

    + * * @param flavor of the input document type - null means match all * types. * @param outputMimeType representing the required output format, used to @@ -153,7 +153,7 @@ public abstract class StreamPrintServiceFactory { * Implementations which allocate resources on construction should examine * the stream and may wish to only allocate resources if the stream is * non-null. - *

    + * * @param out destination stream for generated output. * @return a PrintService which will generate the format specified by the * DocFlavor supported by this Factory. diff --git a/jdk/src/share/classes/javax/print/attribute/Attribute.java b/jdk/src/share/classes/javax/print/attribute/Attribute.java index 5226f9cb80d..a6c58e6f933 100644 --- a/jdk/src/share/classes/javax/print/attribute/Attribute.java +++ b/jdk/src/share/classes/javax/print/attribute/Attribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ import java.io.Serializable; * Interface Attribute is the base interface implemented by any and every * printing attribute class to indicate that the class represents a * printing attribute. All printing attributes are serializable. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java b/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java index d78c8f2004a..72e583a0347 100644 --- a/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/DateTimeSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -54,7 +54,6 @@ import java.util.Date; * rather than a java.util.Calendar because it typically takes * less memory to store and less time to compare a java.util.Date * than a java.util.Calendar. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/DocAttribute.java b/jdk/src/share/classes/javax/print/attribute/DocAttribute.java index e99c09d6bcb..994208f0a9e 100644 --- a/jdk/src/share/classes/javax/print/attribute/DocAttribute.java +++ b/jdk/src/share/classes/javax/print/attribute/DocAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,6 @@ package javax.print.attribute; * PrintRequestAttribute} as well as DocAttribute, the client may include the * attribute in a attribute set which specifies a print job * to specify a characteristic for all the docs in that job. - *

    * * @see DocAttributeSet * @see PrintRequestAttributeSet diff --git a/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java index b4482d2e455..bacc1074f2c 100644 --- a/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/DocAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -40,7 +40,6 @@ package javax.print.attribute; * The {@link #add(Attribute) add(Attribute)}, and * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations * are respecified below to guarantee this additional invariant. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java b/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java index 85ee7d8b402..f774066e592 100644 --- a/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/EnumSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -102,7 +102,6 @@ import java.io.Serializable; * uses some of the same integer values as the superclass. However, the * application in which the enumeration class and subclass are used may need to * have distinct integer values in the superclass and subclass. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java index 7956794d304..e4928a8196d 100644 --- a/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/HashAttributeSet.java @@ -34,7 +34,6 @@ import java.util.HashMap; /** * Class HashAttributeSet provides an AttributeSet * implementation with characteristics of a hash map. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java index d4bc20e27d3..0b915ba2ca9 100644 --- a/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/HashDocAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,6 @@ import java.io.Serializable; * inherits its implementation from class {@link HashAttributeSet * HashAttributeSet} and enforces the semantic restrictions of interface {@link * DocAttributeSet DocAttributeSet}. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java index 980693694e6..f39c85883d5 100644 --- a/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,6 @@ import java.io.Serializable; * which inherits its implementation from class {@link HashAttributeSet * HashAttributeSet} and enforces the semantic restrictions of interface * {@link PrintJobAttributeSet PrintJobAttributeSet}. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java index 53708f0259c..fde4ebb6945 100644 --- a/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,6 @@ import java.io.Serializable; * class {@link HashAttributeSet HashAttributeSet} and enforces the * semantic restrictions of interface * {@link PrintRequestAttributeSet PrintRequestAttributeSet}. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java index 64e5b9e48f3..d98430d0d75 100644 --- a/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -32,7 +32,6 @@ import java.io.Serializable; * which inherits its implementation from class {@link HashAttributeSet * HashAttributeSet} and enforces the semantic restrictions of interface * {@link PrintServiceAttributeSet PrintServiceAttributeSet}. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java b/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java index 7675a8327e7..1fbd3b2556d 100644 --- a/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/IntegerSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,6 @@ import java.io.Serializable; * established when it is constructed (see {@link #IntegerSyntax(int) * IntegerSyntax(int)}). Once constructed, an integer attribute's * value is immutable. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java b/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java index af8258090ba..ad9a0d7217a 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintJobAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,6 @@ package javax.print.attribute; * PrintRequestAttribute PrintRequestAttribute} as well as PrintJobAttribute, * the client may include the attribute in a attribute set to * specify the attribute's value for the Print Job. - *

    * * @see PrintRequestAttributeSet * @see PrintJobAttributeSet diff --git a/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java index 5bce73513e9..4c920a1b48a 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintJobAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ package javax.print.attribute; * The {@link #add(Attribute) add(Attribute)}, and * {@link #addAll(AttributeSet) >addAll(AttributeSet)} operations * are respecified below to guarantee this additional invariant. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java index 78fe37ccb76..48249480e60 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ package javax.print.attribute; * as well as PrintRequestAttribute, the client may include the * attribute in a Doc}'s attribute set to specify * a job setting which pertains just to that doc. - *

    * * @see DocAttributeSet * @see PrintRequestAttributeSet diff --git a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java index eac683b194c..bde6c0cce8b 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintRequestAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -40,7 +40,6 @@ package javax.print.attribute; * The {@link #add(Attribute) add(Attribute)}, and * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations * are respecified below to guarantee this additional invariant. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java index 8ac2b656d18..f09b38870ed 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ package javax.print.attribute; * of a Print Service or some other characteristic of a Print Service. A Print * Service instance adds a number of PrintServiceAttributes to a Print * service's attribute set to report the Print Service's status. - *

    * * @see PrintServiceAttributeSet * diff --git a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java index badde734218..3d3296ed405 100644 --- a/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java +++ b/jdk/src/share/classes/javax/print/attribute/PrintServiceAttributeSet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,6 @@ package javax.print.attribute; * The {@link #add(Attribute) add(Attribute)}, and * {@link #addAll(AttributeSet) addAll(AttributeSet)} operations * are respecified below to guarantee this additional invariant. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java b/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java index 1089381d1c6..7e9c40835b5 100644 --- a/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/ResolutionSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -78,7 +78,6 @@ import java.io.Serializable; * mind, there is no guarantee that the conversion factor for the client's units * will be an exact integer. If the conversion factor isn't an exact integer, * resolution values in the client's units won't be stored precisely. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java b/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java index 0aed773fe6e..8ba9303135a 100644 --- a/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/SetOfIntegerSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -75,7 +75,6 @@ import java.util.Vector; * Class SetOfIntegerSyntax has operations to return the set's members in * canonical array form, to test whether a given integer is a member of the * set, and to iterate through the members of the set. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java b/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java index 0f6a5dfe6c4..76832508c94 100644 --- a/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/Size2DSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -77,7 +77,6 @@ import java.io.Serializable; * client's units will be an exact integer. If the conversion factor isn't an * exact integer, resolution values in the client's units won't be stored * precisely. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java b/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java index 61e4bd57e62..ca8736b1315 100644 --- a/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java +++ b/jdk/src/share/classes/javax/print/attribute/SupportedValuesAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,6 @@ package javax.print.attribute; * which is a SupportedValuesAttribute giving the legal values a client may * specify for the {@link javax.print.attribute.standard.Copies Copies} * attribute. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/TextSyntax.java b/jdk/src/share/classes/javax/print/attribute/TextSyntax.java index 20e27fa314f..7b91de24d0f 100644 --- a/jdk/src/share/classes/javax/print/attribute/TextSyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/TextSyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -35,7 +35,6 @@ import java.util.Locale; * includes a locale to indicate the natural language. Thus, a text attribute * always represents a localized string. Once constructed, a text attribute's * value is immutable. - *

    * * @author David Mendenhall * @author Alan Kaminsky diff --git a/jdk/src/share/classes/javax/print/attribute/URISyntax.java b/jdk/src/share/classes/javax/print/attribute/URISyntax.java index 118b1c0cd8d..770ba8a9592 100644 --- a/jdk/src/share/classes/javax/print/attribute/URISyntax.java +++ b/jdk/src/share/classes/javax/print/attribute/URISyntax.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,6 @@ import java.net.URI; * Class URISyntax is an abstract base class providing the common * implementation of all attributes whose value is a Uniform Resource * Identifier (URI). Once constructed, a URI attribute's value is immutable. - *

    * * @author Alan Kaminsky */ diff --git a/jdk/src/share/classes/javax/print/attribute/package.html b/jdk/src/share/classes/javax/print/attribute/package.html index fa9851655a8..aeedb0df2c2 100644 --- a/jdk/src/share/classes/javax/print/attribute/package.html +++ b/jdk/src/share/classes/javax/print/attribute/package.html @@ -3,7 +3,7 @@ javax.print.attribute package