forked from eclipse-ee4j/jaxb-ri
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert optimization removal (eclipse-ee4j#1352)
* Revert optimization removal javaee/jaxb-v2#1157 * Keep optimization for Java versions older then 9 with multi-release jar * Add noOptimization flag for possible compatibility issues Signed-off-by: Daniel Kec <daniel.kec@oracle.com>
- Loading branch information
Showing
22 changed files
with
1,299 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ime/impl/src/main/java-mr/9/com/sun/xml/bind/v2/runtime/reflect/opt/AccessorInjector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Distribution License v. 1.0, which is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
package com.sun.xml.bind.v2.runtime.reflect.opt; | ||
|
||
import java.io.InputStream; | ||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
|
||
import com.sun.xml.bind.Utils; | ||
import com.sun.xml.bind.v2.bytecode.ClassTailor; | ||
|
||
/** | ||
* Stub version of {@link AccessorInjector} for java versions >= 9 | ||
* | ||
* @author Daniel Kec | ||
*/ | ||
class AccessorInjector { | ||
|
||
protected static final boolean noOptimize = true; | ||
|
||
public static Class<?> prepare( | ||
Class beanClass, String templateClassName, String newClassName, String... replacements) { | ||
return null; | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
...-ri/runtime/impl/src/main/java-mr/9/com/sun/xml/bind/v2/runtime/reflect/opt/Injector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Distribution License v. 1.0, which is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
package com.sun.xml.bind.v2.runtime.reflect.opt; | ||
|
||
/** | ||
* Stub version of {@link Injector} for java versions >= 9 | ||
* | ||
* @author Daniel Kec | ||
*/ | ||
final class Injector { | ||
|
||
/** | ||
* Injects a new class into the given class loader. | ||
* | ||
* @return null | ||
* if it fails to inject. | ||
*/ | ||
static Class inject(ClassLoader cl, String className, byte[] image) { | ||
return null; | ||
} | ||
|
||
/** | ||
* Returns the already injected class, or null. | ||
*/ | ||
static Class find(ClassLoader cl, String className) { | ||
return null; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
.../src/main/java-mr/9/com/sun/xml/bind/v2/runtime/reflect/opt/OptimizedAccessorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Distribution License v. 1.0, which is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
package com.sun.xml.bind.v2.runtime.reflect.opt; | ||
|
||
import com.sun.xml.bind.v2.runtime.reflect.Accessor; | ||
|
||
import java.util.logging.Logger; | ||
|
||
import java.lang.reflect.Method; | ||
import java.lang.reflect.Field; | ||
|
||
import java.util.logging.Logger; | ||
|
||
/** | ||
* Stub version of {@link OptimizedAccessorFactory} for java versions >= 9 | ||
* | ||
* @author Daniel Kec | ||
*/ | ||
public abstract class OptimizedAccessorFactory { | ||
private OptimizedAccessorFactory() {} // no instantiation please | ||
|
||
private static final Logger logger = Logger.getLogger(OptimizedAccessorFactory.class.getName()); | ||
|
||
|
||
public static <B, V> Accessor<B, V> get(Method param1, Method param2) { | ||
return getStub(); | ||
} | ||
|
||
public static <B, V> Accessor<B, V> get(Field param) { | ||
return getStub(); | ||
} | ||
|
||
private static <B, V> Accessor<B, V> getStub(){ | ||
logger.finer("Optimization is not available since java 9"); | ||
return null; | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
...java-mr/9/com/sun/xml/bind/v2/runtime/reflect/opt/OptimizedTransducedAccessorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Distribution License v. 1.0, which is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
package com.sun.xml.bind.v2.runtime.reflect.opt; | ||
|
||
import com.sun.xml.bind.v2.model.runtime.RuntimePropertyInfo; | ||
import com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor; | ||
|
||
import java.util.logging.Logger; | ||
|
||
/** | ||
* Stub version of {@link OptimizedTransducedAccessorFactory} for java versions >= 9 | ||
* | ||
* @author Daniel Kec | ||
*/ | ||
public abstract class OptimizedTransducedAccessorFactory { | ||
private OptimizedTransducedAccessorFactory() {} // no instantiation please | ||
|
||
private static final Logger logger = Logger.getLogger(OptimizedTransducedAccessorFactory.class.getName()); | ||
|
||
public static final TransducedAccessor get(RuntimePropertyInfo prop) { | ||
logger.finer("Optimization is not available since java 9"); | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.