提交 e671762e 编写于 作者: A asaha

Merge

......@@ -471,6 +471,8 @@ ed9e7ba6a419a80cbcdc60f4634388af054bdc76 jdk8u65-b10
22ae2d11ff54b758b648b5fcd6ea90e03a4c6781 jdk8u65-b11
7eb9c6cf007cc6176ccb700f995a3e9b81746bfd jdk8u65-b12
64ac5b0b4b9e7a587fc0606fada354c6fa4a7a86 jdk8u65-b13
d26fd80f684d44fd9b16e84e585dda3757d4a19c jdk8u65-b14
64c3b5808a701b6328c18028d1c98bc41679f718 jdk8u65-b15
e9f82302d5fdef8a0976640e09363895e9dcde3c jdk8u66-b00
64d7bd4e98150447916f210e3bfd6875a4c2728a jdk8u66-b01
d8210091911b14930192abd3138ee37c281fb632 jdk8u66-b02
......@@ -481,4 +483,6 @@ fe6a3b134c1d4288a5bcb6152632edca1833ab58 jdk8u66-b10
e77c306d8ce409a65166813cc3b5e9403f96246b jdk8u66-b11
6f5b22ffd9626ea1bb2879cfe93f4baafce3d644 jdk8u66-b12
e951c898bb6ca7be2ce49ac23f8442c0bccad4e9 jdk8u66-b13
371fc17e38ccf9a729e34c518f6942162ba6c225 jdk8u66-b14
ea602badedd0cd0c352c072220a884e8f1335e33 jdk8u66-b15
be5faa9c77042f202106c18f4e8ea211137b4a3b jdk8u72-b00
......@@ -388,7 +388,7 @@ $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin:
JAVAC_FLAGS := -cp $(JDK_OUTPUTDIR)/classes, \
SRC := $(JDK_OUTPUTDIR)/gensrc_ab/legacy, \
BIN := $(JDK_OUTPUTDIR)/classes_ab/legacy, \
HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers_ab/legacy))
HEADERS := $(JDK_OUTPUTDIR)/gensrc_headers_ab/LEGACY))
$(BUILD_ACCESSBRIDGE_LEGACY): $(BUILD_JDK)
......
......@@ -219,7 +219,7 @@ endif
ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
$(eval $(call SetupAccessBridge,-32,I386,32))
$(eval $(call SetupAccessBridge,,I386,legacy))
$(eval $(call SetupAccessBridge,,I386,LEGACY))
else
$(eval $(call SetupAccessBridge,-64,X64,64))
endif
......
......@@ -855,7 +855,6 @@ public class ObjectStreamClass implements Serializable {
* types only. Returns matching field, or null if no match found.
*/
ObjectStreamField getField(String name, Class<?> type) {
requireInitialized();
for (int i = 0; i < fields.length; i++) {
ObjectStreamField f = fields[i];
if (f.getName().equals(name)) {
......
/*
* Copyright (c) 2015, 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
* @bug 8135043
* @summary ObjectStreamClass.getField(String) too restrictive
*/
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamClass;
import java.io.Serializable;
public class TestObjectStreamClass {
public static void main(String[] args) throws Exception {
ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
ObjectOutputStream output = new ObjectOutputStream(byteOutput);
output.writeObject(new TestClass());
ByteArrayInputStream bais = new ByteArrayInputStream(byteOutput.toByteArray());
TestObjectInputStream input = new TestObjectInputStream(bais);
input.readObject();
ObjectStreamClass osc = input.getDescriptor();
// All OSC public API methods should complete without throwing.
osc.getName();
osc.forClass();
osc.getField("str");
osc.getFields();
osc.getSerialVersionUID();
osc.toString();
}
static class TestClass implements Serializable {
String str = "hello world";
}
static class TestObjectInputStream extends ObjectInputStream {
private ObjectStreamClass objectStreamClass;
public TestObjectInputStream(InputStream in) throws IOException {
super(in);
}
public ObjectStreamClass getDescriptor()
throws IOException, ClassNotFoundException
{
return objectStreamClass;
}
public ObjectStreamClass readClassDescriptor()
throws IOException, ClassNotFoundException
{
objectStreamClass = super.readClassDescriptor();
return objectStreamClass;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册