Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
22dcfe2e
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
22dcfe2e
编写于
9月 02, 2014
作者:
L
lana
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
c611224b
348669a2
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
881 addition
and
43 deletion
+881
-43
make/CompileDemos.gmk
make/CompileDemos.gmk
+1
-1
make/Images.gmk
make/Images.gmk
+1
-1
src/aix/classes/sun/awt/fontconfigs/aix.fontconfig.properties
...aix/classes/sun/awt/fontconfigs/aix.fontconfig.properties
+377
-35
src/share/bin/java.c
src/share/bin/java.c
+9
-5
src/share/bin/java.h
src/share/bin/java.h
+44
-1
test/javax/xml/bind/marshal/8036981/Good.java
test/javax/xml/bind/marshal/8036981/Good.java
+94
-0
test/javax/xml/bind/marshal/8036981/Main.java
test/javax/xml/bind/marshal/8036981/Main.java
+104
-0
test/javax/xml/bind/marshal/8036981/ObjectFactory.java
test/javax/xml/bind/marshal/8036981/ObjectFactory.java
+74
-0
test/javax/xml/bind/marshal/8036981/Root.java
test/javax/xml/bind/marshal/8036981/Root.java
+91
-0
test/javax/xml/bind/marshal/8036981/Test.java
test/javax/xml/bind/marshal/8036981/Test.java
+67
-0
test/javax/xml/bind/marshal/8036981/test.xml
test/javax/xml/bind/marshal/8036981/test.xml
+19
-0
未找到文件。
make/CompileDemos.gmk
浏览文件 @
22dcfe2e
...
...
@@ -456,7 +456,7 @@ endif
##################################################################################################
ifndef OPENJDK
DB_DEMO_ZIPFILE := $(wildcard $(JDK_TOPDIR)/src/closed/share/db/
*
.zip)
DB_DEMO_ZIPFILE := $(wildcard $(JDK_TOPDIR)/src/closed/share/db/
db-derby-*-bin
.zip)
$(JDK_OUTPUTDIR)/demo/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
$(MKDIR) -p $(@D)
...
...
make/Images.gmk
浏览文件 @
22dcfe2e
...
...
@@ -562,7 +562,7 @@ ifndef OPENJDK
$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > $@
JDK_DB_TARGETS := $(patsubst $(JDK_TOPDIR)/src/closed/share/db/%, $(IMAGES_OUTPUTDIR)/_unzip/%.unzipped, \
$(wildcard $(JDK_TOPDIR)/src/closed/share/db/
*
.zip)) \
$(wildcard $(JDK_TOPDIR)/src/closed/share/db/
db-derby-*-bin
.zip)) \
$(JDK_IMAGE_DIR)/db/README-JDK.html $(JDK_IMAGE_DIR)/db/3RDPARTY
endif
...
...
src/aix/classes/sun/awt/fontconfigs/aix.fontconfig.properties
浏览文件 @
22dcfe2e
此差异已折叠。
点击以展开。
src/share/bin/java.c
浏览文件 @
22dcfe2e
/*
* Copyright (c) 1995, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 201
4
, 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
...
...
@@ -1248,11 +1248,13 @@ NewPlatformString(JNIEnv *env, char *s)
(
*
env
)
->
SetByteArrayRegion
(
env
,
ary
,
0
,
len
,
(
jbyte
*
)
s
);
if
(
!
(
*
env
)
->
ExceptionOccurred
(
env
))
{
if
(
makePlatformStringMID
==
NULL
)
{
NULL_CHECK0
(
makePlatformStringMID
=
(
*
env
)
->
GetStaticMethodID
(
env
,
CHECK_JNI_RETURN_0
(
makePlatformStringMID
=
(
*
env
)
->
GetStaticMethodID
(
env
,
cls
,
"makePlatformString"
,
"(Z[B)Ljava/lang/String;"
));
}
str
=
(
*
env
)
->
CallStaticObjectMethod
(
env
,
cls
,
makePlatformStringMID
,
USE_STDERR
,
ary
);
CHECK_JNI_RETURN_0
(
str
=
(
*
env
)
->
CallStaticObjectMethod
(
env
,
cls
,
makePlatformStringMID
,
USE_STDERR
,
ary
));
(
*
env
)
->
DeleteLocalRef
(
env
,
ary
);
return
str
;
}
...
...
@@ -1303,7 +1305,9 @@ LoadMainClass(JNIEnv *env, int mode, char *name)
"(ZILjava/lang/String;)Ljava/lang/Class;"
));
str
=
NewPlatformString
(
env
,
name
);
result
=
(
*
env
)
->
CallStaticObjectMethod
(
env
,
cls
,
mid
,
USE_STDERR
,
mode
,
str
);
CHECK_JNI_RETURN_0
(
result
=
(
*
env
)
->
CallStaticObjectMethod
(
env
,
cls
,
mid
,
USE_STDERR
,
mode
,
str
));
if
(
JLI_IsTraceLauncher
())
{
end
=
CounterGet
();
...
...
src/share/bin/java.h
浏览文件 @
22dcfe2e
/*
* Copyright (c) 1998, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 201
4
, 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
...
...
@@ -256,4 +256,47 @@ typedef struct {
#define NULL_CHECK(NC_check_pointer) \
NULL_CHECK_RETURN_VALUE(NC_check_pointer, )
/*
* For JNI calls :
* - check for thrown exceptions
* - check for null return
*
* JNI calls can return null and/or throw an exception. Check for these.
*
* : CHECK_JNI_RETURN_EXCEPTION()
* return the specified RETURNVALUE if exception was generated
* : CHECK_JNI_RETURN_0(JNISTATEMENT) : check if JNISTATEMENT was successful, return 0 if not
* : CHECK_JNI_RETURN_VOID(JNISTATEMENT) : check if JNISTATEMENT was successful, return void if not
* : CHECK_JNI_RETURN_VALUE(JNISTATEMENT,n) : check if JNISTATEMENT was successful, return n if not
*
* These macros need at least one parameter, the JNI statement [ JNISTATEMENT ].
*
* E.G.: check the JNI statement, and specify a value to return if a failure was detected.
*
* CHECK_JNI_RETURN_VALUE(str = (*env)->CallStaticObjectMethod(env, cls,
* makePlatformStringMID, USE_STDERR, ary), -1);
*/
#define RETURNVOID return
#define RETURN0 return 0
#define RETURN(N) return (N)
#define CHECK_JNI_RETURN_EXCEPTION(RETURNVALUE) \
if ((((*env)->ExceptionOccurred(env))!=NULL)) { \
RETURNVALUE; \
}
#define CHECK_JNI_RETURN_0(JNISTATEMENT) \
CHECK_JNI_RETURN_EXCEPTION(RETURN0); \
NULL_CHECK0(JNISTATEMENT);
#define CHECK_JNI_RETURN_VOID(JNISTATEMENT) \
CHECK_JNI_RETURN_EXCEPTION(RETURNVOID); \
NULL_CHECK(JNISTATEMENT);
#define CHECK_JNI_RETURN_VALUE(JNISTATEMENT, NCRV_return_value) \
CHECK_JNI_RETURN_EXCEPTION(RETURN(NCRV_return_value)); \
NULL_CHECK_RETURN_VALUE(JNISTATEMENT, NCRV_return_value);
#endif
/* _JAVA_H_ */
test/javax/xml/bind/marshal/8036981/Good.java
0 → 100644
浏览文件 @
22dcfe2e
/*
* 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.
*/
package
testjaxbcontext
;
import
org.w3c.dom.Element
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlAnyElement
;
import
javax.xml.bind.annotation.XmlType
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* <p>
* Java class for Good complex type.
*
* <p>
* The following schema fragment specifies the expected content contained within
* this class.
*
* <pre>
* <complexType name="Good">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <any processContents='skip' maxOccurs="70"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@XmlType
(
name
=
"Good"
,
propOrder
=
{
"any"
})
public
class
Good
{
@XmlAnyElement
protected
List
<
Element
>
any
;
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list, not a
* snapshot. Therefore any modification you make to the returned list will
* be present inside the JAXB object. This is why there is not a
* <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link org.w3c.dom.Element }
*
*
*/
public
List
<
Element
>
getAny
()
{
if
(
any
==
null
)
{
any
=
new
ArrayList
<
Element
>();
}
return
this
.
any
;
}
}
test/javax/xml/bind/marshal/8036981/Main.java
0 → 100644
浏览文件 @
22dcfe2e
/*
* 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.
*/
package
testjaxbcontext
;
import
javax.xml.bind.annotation.*
;
/**
* <p>
* Java class for main complex type.
*
* <p>
* The following schema fragment specifies the expected content contained within
* this class.
*
* <pre>
* <complexType name="main">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Root" type="{}Root"/>
* <element name="Good" type="{}Good"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@XmlType
(
name
=
"main"
,
propOrder
=
{
"root"
,
"good"
})
@XmlRootElement
public
class
Main
{
@XmlElement
(
name
=
"Root"
,
required
=
true
)
protected
Root
root
;
@XmlElement
(
name
=
"Good"
,
required
=
true
)
protected
Good
good
;
/**
* Gets the value of the root property.
*
* @return possible object is {@link Root }
*
*/
public
Root
getRoot
()
{
return
root
;
}
/**
* Sets the value of the root property.
*
* @param value allowed object is {@link Root }
*
*/
public
void
setRoot
(
Root
value
)
{
this
.
root
=
value
;
}
/**
* Gets the value of the good property.
*
* @return possible object is {@link Good }
*
*/
public
Good
getGood
()
{
return
good
;
}
/**
* Sets the value of the good property.
*
* @param value allowed object is {@link Good }
*
*/
public
void
setGood
(
Good
value
)
{
this
.
good
=
value
;
}
}
test/javax/xml/bind/marshal/8036981/ObjectFactory.java
0 → 100644
浏览文件 @
22dcfe2e
/*
* 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.
*/
package
testjaxbcontext
;
import
javax.xml.bind.annotation.XmlRegistry
;
/**
* This object contains factory methods for each Java content interface and Java
* element interface generated in the generated package.
* <p>
* An ObjectFactory allows you to programatically construct new instances of the
* Java representation for XML content. The Java representation of XML content
* can consist of schema derived interfaces and classes representing the binding
* of schema type definitions, element declarations and model groups. Factory
* methods for each of these are provided in this class.
*
*/
@XmlRegistry
public
class
ObjectFactory
{
/**
* Create a new ObjectFactory that can be used to create new instances of
* schema derived classes for package: generated
*
*/
public
ObjectFactory
()
{
}
/**
* Create an instance of {@link Root }
*
*/
public
Root
createRoot
()
{
return
new
Root
();
}
/**
* Create an instance of {@link Good }
*
*/
public
Good
createGood
()
{
return
new
Good
();
}
/**
* Create an instance of {@link Main }
*
*/
public
Main
createMain
()
{
return
new
Main
();
}
}
test/javax/xml/bind/marshal/8036981/Root.java
0 → 100644
浏览文件 @
22dcfe2e
/*
* 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.
*/
package
testjaxbcontext
;
import
javax.xml.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* <p>
* Java class for Root complex type.
*
* <p>
* The following schema fragment specifies the expected content contained within
* this class.
*
* <pre>
* <complexType name="Root">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <any processContents='skip' maxOccurs="70"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
@XmlType
(
name
=
"Root"
,
propOrder
=
{
"content"
})
public
class
Root
{
@XmlMixed
@XmlAnyElement
protected
List
<
Object
>
content
;
/**
* Gets the value of the content property.
*
* <p>
* This accessor method returns a reference to the live list, not a
* snapshot. Therefore any modification you make to the returned list will
* be present inside the JAXB object. This is why there is not a
* <CODE>set</CODE> method for the content property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContent().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list {@link org.w3c.dom.Element }
* {@link String }
*
*
*/
public
List
<
Object
>
getContent
()
{
if
(
content
==
null
)
{
content
=
new
ArrayList
<
Object
>();
}
return
this
.
content
;
}
}
test/javax/xml/bind/marshal/8036981/Test.java
0 → 100644
浏览文件 @
22dcfe2e
/*
* 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.
*/
/*
* @test Test.java
* @bug 8036981
* @summary JAXB not preserving formatting during unmarshalling/marshalling
* @compile Good.java Main.java ObjectFactory.java Root.java
* @run main/othervm Test
*/
import
javax.xml.bind.JAXBContext
;
import
javax.xml.bind.Marshaller
;
import
javax.xml.bind.Unmarshaller
;
import
java.io.File
;
import
java.io.StringWriter
;
/**
* Test for marshalling and unmarshalling mixed and unmixed content
*/
public
class
Test
{
private
static
final
String
EXPECTED
=
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><main><Root>\n"
+
" <SomeTag>\n"
+
" <AChildTag>\n"
+
" <AnotherChildTag/>\n"
+
" <AnotherChildTag/>\n"
+
" </AChildTag>\n"
+
" </SomeTag>\n"
+
" </Root><Good><VeryGood><TheBest><MegaSuper/><MegaSuper/>\n"
+
" </TheBest>\n"
+
" </VeryGood></Good></main>"
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
JAXBContext
jc
=
JAXBContext
.
newInstance
(
"testjaxbcontext"
);
Unmarshaller
u
=
jc
.
createUnmarshaller
();
Object
result
=
u
.
unmarshal
(
new
File
(
System
.
getProperty
(
"test.src"
,
"."
)
+
"/test.xml"
));
StringWriter
sw
=
new
StringWriter
();
Marshaller
m
=
jc
.
createMarshaller
();
m
.
marshal
(
result
,
sw
);
System
.
out
.
println
(
"Expected:"
+
EXPECTED
);
System
.
out
.
println
(
"Observed:"
+
sw
.
toString
());
if
(!
EXPECTED
.
equals
(
sw
.
toString
()))
{
throw
new
Exception
(
"Unmarshal/Marshal generates different content"
);
}
}
}
test/javax/xml/bind/marshal/8036981/test.xml
0 → 100644
浏览文件 @
22dcfe2e
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<main>
<Root>
<SomeTag>
<AChildTag>
<AnotherChildTag/>
<AnotherChildTag/>
</AChildTag>
</SomeTag>
</Root>
<Good>
<VeryGood>
<TheBest>
<MegaSuper/>
<MegaSuper/>
</TheBest>
</VeryGood>
</Good>
</main>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录