Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
348669a2
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看板
提交
348669a2
编写于
9月 01, 2014
作者:
D
dwanvik
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
1876b7d4
87e4dcec
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
826 addition
and
35 deletion
+826
-35
src/aix/classes/sun/awt/fontconfigs/aix.fontconfig.properties
...aix/classes/sun/awt/fontconfigs/aix.fontconfig.properties
+377
-35
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
未找到文件。
src/aix/classes/sun/awt/fontconfigs/aix.fontconfig.properties
浏览文件 @
348669a2
此差异已折叠。
点击以展开。
test/javax/xml/bind/marshal/8036981/Good.java
0 → 100644
浏览文件 @
348669a2
/*
* 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
浏览文件 @
348669a2
/*
* 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
浏览文件 @
348669a2
/*
* 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
浏览文件 @
348669a2
/*
* 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
浏览文件 @
348669a2
/*
* 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
浏览文件 @
348669a2
<?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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录