OPENJPA-2911 move BytecodeWriter to openjpa-kernel

had no usage in openjpa-lib but introduced dependeny to Serp over there
This commit is contained in:
Mark Struberg 2023-07-17 10:08:39 +02:00
parent 96a64bceba
commit bcb00d8909
4 changed files with 10 additions and 14 deletions

View File

@ -32,7 +32,7 @@ import java.util.Set;
import org.apache.openjpa.conf.OpenJPAConfiguration; import org.apache.openjpa.conf.OpenJPAConfiguration;
import org.apache.openjpa.lib.log.Log; import org.apache.openjpa.lib.log.Log;
import org.apache.openjpa.lib.util.BytecodeWriter; import org.apache.openjpa.util.asm.BytecodeWriter;
import org.apache.openjpa.lib.util.Files; import org.apache.openjpa.lib.util.Files;
import org.apache.openjpa.lib.util.Localizer; import org.apache.openjpa.lib.util.Localizer;
import org.apache.openjpa.lib.util.Localizer.Message; import org.apache.openjpa.lib.util.Localizer.Message;

View File

@ -62,7 +62,7 @@ import org.apache.openjpa.conf.OpenJPAConfigurationImpl;
import org.apache.openjpa.lib.conf.Configurations; import org.apache.openjpa.lib.conf.Configurations;
import org.apache.openjpa.lib.log.Log; import org.apache.openjpa.lib.log.Log;
import org.apache.openjpa.lib.meta.ClassArgParser; import org.apache.openjpa.lib.meta.ClassArgParser;
import org.apache.openjpa.lib.util.BytecodeWriter; import org.apache.openjpa.util.asm.BytecodeWriter;
import org.apache.openjpa.lib.util.ClassUtil; import org.apache.openjpa.lib.util.ClassUtil;
import org.apache.openjpa.lib.util.Files; import org.apache.openjpa.lib.util.Files;
import org.apache.openjpa.lib.util.J2DoPrivHelper; import org.apache.openjpa.lib.util.J2DoPrivHelper;
@ -124,16 +124,13 @@ public class PCEnhancer {
public static final int ENHANCER_VERSION; public static final int ENHANCER_VERSION;
public static final Type TYPE_OBJECT = Type.getType(Object.class); public static final Type TYPE_OBJECT = Type.getType(Object.class);
boolean _addVersionInitFlag = true;
public static final int ENHANCE_NONE = 0; public static final int ENHANCE_NONE = 0;
public static final int ENHANCE_AWARE = 2 << 0; public static final int ENHANCE_AWARE = 2 << 0;
public static final int ENHANCE_INTERFACE = 2 << 1; public static final int ENHANCE_INTERFACE = 2 << 1;
public static final int ENHANCE_PC = 2 << 2; public static final int ENHANCE_PC = 2 << 2;
public static final String PRE = "pc"; public static final String PRE = "pc";
public static final String ISDETACHEDSTATEDEFINITIVE = PRE public static final String ISDETACHEDSTATEDEFINITIVE = PRE + "isDetachedStateDefinitive";
+ "isDetachedStateDefinitive";
private static final Class<?> PCTYPE = PersistenceCapable.class; private static final Class<?> PCTYPE = PersistenceCapable.class;
private static final String SM = PRE + "StateManager"; private static final String SM = PRE + "StateManager";
@ -149,10 +146,8 @@ public class PCEnhancer {
private static final String VERSION_INIT_STR = PRE + "VersionInit"; private static final String VERSION_INIT_STR = PRE + "VersionInit";
private static final Localizer _loc = Localizer.forPackage private static final Localizer _loc = Localizer.forPackage(PCEnhancer.class);
(PCEnhancer.class); private static final String REDEFINED_ATTRIBUTE = PCEnhancer.class.getName() + "#redefined-type";
private static final String REDEFINED_ATTRIBUTE
= PCEnhancer.class.getName() + "#redefined-type";
private static final AuxiliaryEnhancer[] _auxEnhancers; private static final AuxiliaryEnhancer[] _auxEnhancers;
@ -200,6 +195,8 @@ public class PCEnhancer {
private BCClass _pc; private BCClass _pc;
private final BCClass _managedType; private final BCClass _managedType;
private final MetaDataRepository _repos; private final MetaDataRepository _repos;
boolean _addVersionInitFlag = true;
/** /**
* represents the managed type. * represents the managed type.

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
package org.apache.openjpa.lib.util; package org.apache.openjpa.util.asm;
import java.io.IOException; import java.io.IOException;

View File

@ -27,7 +27,7 @@ import java.util.List;
import org.apache.openjpa.conf.OpenJPAConfiguration; import org.apache.openjpa.conf.OpenJPAConfiguration;
import org.apache.openjpa.conf.OpenJPAConfigurationImpl; import org.apache.openjpa.conf.OpenJPAConfigurationImpl;
import org.apache.openjpa.lib.conf.Configurations; import org.apache.openjpa.lib.conf.Configurations;
import org.apache.openjpa.lib.util.BytecodeWriter; import org.apache.openjpa.util.asm.BytecodeWriter;
import org.apache.openjpa.lib.util.J2DoPrivHelper; import org.apache.openjpa.lib.util.J2DoPrivHelper;
import org.apache.openjpa.lib.util.Options; import org.apache.openjpa.lib.util.Options;
import org.apache.openjpa.meta.MetaDataRepository; import org.apache.openjpa.meta.MetaDataRepository;
@ -136,8 +136,7 @@ public class TestEnhancementWithMultiplePUs
@Override @Override
public void write(BCClass type) throws IOException { public void write(BCClass type) throws IOException {
assertTrue(Arrays.asList(type.getInterfaceNames()).contains( assertTrue(Arrays.asList(type.getInterfaceNames()).contains(PersistenceCapable.class.getName()));
PersistenceCapable.class.getName()));
written.add(type.getName()); written.add(type.getName());
} }
}; };