You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2016/11/07 16:44:10 UTC
svn commit: r1768551 - in
/uima/uimaj/branches/experiment-v3-jcas/unused-saved/src:
org/apache/uima/jcasgen/ org/apache/uima/jcasgen/impl/ study/ study/asm/
study/asm/decompiled/
Author: schor
Date: Mon Nov 7 16:44:10 2016
New Revision: 1768551
URL: http://svn.apache.org/viewvc?rev=1768551&view=rev
Log:
[UIMA-5172] remove unused fragment of dynamic runtime gen of jcas cover classes, save in unused-saved
Added:
uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/
uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/JCasClassDefinition.java
uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/impl/
uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/impl/JCasClassConversion.java
uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/impl/package.html
uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/package.html
uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/study/
uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/study/asm/
uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/study/asm/decompiled/
uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/study/asm/decompiled/AnnotationDumpV3.java
Added: uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/JCasClassDefinition.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/JCasClassDefinition.java?rev=1768551&view=auto
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/JCasClassDefinition.java (added)
+++ uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/JCasClassDefinition.java Mon Nov 7 16:44:10 2016
@@ -0,0 +1,67 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.uima.jcasgen;
+
+import java.net.URI;
+
+import org.apache.uima.cas.impl.TypeImpl;
+
+/**
+ * Information about one JCas Class definition.
+ * There may be multiple definitions for the same UIMA type name, but
+ * they will have different pathToDefinition values.
+ */
+public interface JCasClassDefinition {
+ /**
+ * The UIMA type name for this definition. Note that mutliple TypeImpls with this name may be
+ * associated at run time with the same JCas definition.
+ *
+ * @return the Uima Type name this definition goes with
+ *
+ */
+ String getUimaTypeName();
+
+ /**
+ * The path to the definition
+ */
+ URI getPathToDefinition();
+
+ boolean isV2();
+ boolean isV3();
+
+ /**
+ * @return true if this class can be converted from v2 to v3 automatically; this means it has
+ * either no customization, or simple customization.
+ */
+ boolean isConvertable();
+
+ /**
+ * @return the class file defining this JCas class
+ */
+ byte[] getBytes();
+
+ /**
+ * Reasons:
+ * not public class
+ *
+ */
+ void setInvalidJCasDefinition();
+
+
+}
Added: uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/impl/JCasClassConversion.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/impl/JCasClassConversion.java?rev=1768551&view=auto
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/impl/JCasClassConversion.java (added)
+++ uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/impl/JCasClassConversion.java Mon Nov 7 16:44:10 2016
@@ -0,0 +1,236 @@
+package org.apache.uima.jcasgen.impl;
+
+import java.util.List;
+
+import org.apache.uima.jcasgen.JCasClassDefinition;
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.Handle;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+import org.objectweb.asm.TypePath;
+
+
+public class JCasClassConversion implements Opcodes {
+
+ final private String classname; // e.g. "org/apache/uima/jcas/tcas/Annotation"
+ final private ClassVisitor cv;
+ final List<String> fieldNames;
+ final List<String> fieldJavaTypes;
+
+ JCasClassConversion(String classname, ClassVisitor cv, List<String> fieldNames, List<String> fieldJavaTypes) {
+ this.classname = classname;
+ this.cv = cv;
+ this.fieldNames = fieldNames;
+ this.fieldJavaTypes = fieldJavaTypes;
+ }
+
+ void generatePFS_I(String name) {
+ cv.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, name, "I", null, null).visitEnd();
+ }
+
+ void generateV3StandardFields() {
+ generatePFS_I("typeIndexID");
+ generatePFS_I("type");
+ }
+
+ void generateV3_FI_fields() {
+ fieldNames.stream().forEachOrdered(
+ name -> cv.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "_FI_" + name, "I", null, null).visitEnd());
+ }
+
+ void generateV3StandardMethods() {
+ MethodVisitor mv = cv.visitMethod(ACC_PUBLIC, "getTypeIndexID", "()I", null, null);
+ mv.visitCode();
+ mv.visitFieldInsn(GETSTATIC, "org/apache/uima/jcas/tcas/Annotation", "typeIndexID", "I");
+ mv.visitInsn(IRETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+
+ void generateV3_local_data() { // type is "I" etc
+ final int size = fieldNames.size();
+ for (int i = 0; i < size; i++) {
+ cv.visitField(ACC_PRIVATE, "_F_" + fieldNames.get(i), fieldJavaTypes.get(i), null, null).visitEnd();
+ }
+ }
+
+ void genv3_classInit() {
+ MethodVisitor mv = cv.visitMethod(ACC_STATIC, "<clinit>", "()V", null, null);
+ genv3_commonStaticFieldInit(mv);
+ genv3_registerFeatures(mv);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 0);
+ mv.visitEnd();
+ }
+
+ void genv3_commonStaticFieldInit(MethodVisitor mv) {
+ mv.visitCode();
+ mv.visitLdcInsn(Type.getType("Lorg/apache/uima/jcas/tcas/Annotation;"));
+ mv.visitMethodInsn(INVOKESTATIC, "org/apache/uima/jcas/JCasRegistry", "register",
+ "(Ljava/lang/Class;)I", false);
+ mv.visitFieldInsn(PUTSTATIC, "org/apache/uima/jcas/tcas/Annotation", "typeIndexID", "I");
+ mv.visitFieldInsn(GETSTATIC, "org/apache/uima/jcas/tcas/Annotation", "typeIndexID", "I");
+ mv.visitFieldInsn(PUTSTATIC, "org/apache/uima/jcas/tcas/Annotation", "type", "I");
+ }
+
+ void genv3_registerFeatures(MethodVisitor mv) {
+ fieldNames.stream().forEachOrdered(
+ name -> {
+ mv.visitFieldInsn(GETSTATIC, "org/apache/uima/jcas/tcas/Annotation", "typeIndexID", "I");
+ mv.visitMethodInsn(INVOKESTATIC, "org/apache/uima/jcas/JCasRegistry", "registerFeature",
+ "(I)I", false);
+ mv.visitFieldInsn(PUTSTATIC, "org/apache/uima/jcas/tcas/Annotation", "_FI_" + name, "I");
+ });
+ }
+
+ /**
+ * @param superclass eg "org/apache/uima/jcas/cas/AnnotationBase"
+ */
+ void genv3_0_arg_constructor(String superclass) {
+ MethodVisitor mv = cv.visitMethod(ACC_PROTECTED, "<init>", "()V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKESPECIAL, superclass, "<init>", "()V", false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+
+ /**
+ * @param superclass eg "org/apache/uima/jcas/cas/AnnotationBase"
+ */
+ void genv3_jcas_constructor(String superclass) {
+ MethodVisitor mv = cv.visitMethod(ACC_PUBLIC, "<init>", "(Lorg/apache/uima/jcas/JCas;)V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKESPECIAL, superclass, "<init>", "(Lorg/apache/uima/jcas/JCas;)V", false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(2, 2);
+ mv.visitEnd();
+ }
+
+ void genv3_2_arg_constructor(String superclass) {
+ MethodVisitor mv = cv.visitMethod(ACC_PUBLIC, "<init>",
+ "(Lorg/apache/uima/cas/impl/TypeImpl;"
+ + "Lorg/apache/uima/cas/impl/CASImpl;)V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitMethodInsn(INVOKESPECIAL, superclass, "<init>",
+ "(Lorg/apache/uima/cas/impl/TypeImpl;"
+ + "Lorg/apache/uima/cas/impl/CASImpl;)V", false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(3, 3);
+ mv.visitEnd();
+ }
+
+ /**
+ *
+ * @param name name of field, e.g. begin
+ * @param type Java type, eg. "I"
+ */
+ void genv3_getter(String name, String type) {
+ MethodVisitor mv = cv.visitMethod(ACC_PUBLIC, "get" + up1st(name), "()" + type, null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, classname, "_F_" + name, type);
+ mv.visitInsn(IRETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+
+ void genv3_setter(String name, String type) {
+ MethodVisitor mv = cv.visitMethod(ACC_PUBLIC, "set" + up1st(name), "(" + type + ")V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, classname, "_casView", "Lorg/apache/uima/cas/impl/CASImpl;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETSTATIC, classname, "_FI_" + name, "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ILOAD, 1);
+ mv.visitInvokeDynamicInsn("run",
+ "(Lorg/apache/uima/jcas/tcas/Annotation;I)Ljava/lang/Runnable;",
+ new Handle(Opcodes.H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", "metafactory",
+ "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;"
+ + "Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"),
+ new Object[] {
+ Type.getType("()V"),
+ new Handle(Opcodes.H_INVOKESPECIAL,
+ "org/apache/uima/jcas/tcas/Annotation",
+ "lambda$0",
+ "(I)V"),
+ Type.getType("()V") });
+ mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/uima/cas/impl/CASImpl",
+ "setWithCheckAndJournalJFRI", "(Lorg/apache/uima/jcas/cas/TOP;ILjava/lang/Runnable;)V",
+ false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(5, 2);
+ mv.visitEnd();
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// public static byte[] convert2to3(JCasClassDefinition jd) {
+// ClassReader cr = new ClassReader(jd.getBytes());
+// ClassWriter cw = new ClassWriter(0);
+//
+// ClassVisitor cv = new ClassVisitor(ASM5, cw) {
+//
+// @Override
+// public void visit(int version, int access, String name, String signature, String superName,
+// String[] interfaces) {
+// if (access != (ACC_PUBLIC + ACC_SUPER) || signature != null) {
+// jd.setInvalidJCasDefinition();
+// throw new RuntimeException();
+// }
+// super.visit(version, access, name, signature, superName, interfaces);
+// }
+//
+// @Override
+// public FieldVisitor visitField(int access, String name, String desc, String signature,
+// Object value) {
+//
+// return super.visitField(access, name, desc, signature, value);
+// }
+//
+// @Override
+// public MethodVisitor visitMethod(int access, String name, String desc, String signature,
+// String[] exceptions) {
+// // TODO Auto-generated method stub
+// return super.visitMethod(access, name, desc, signature, exceptions);
+// }
+//
+// @Override
+// public void visitEnd() {
+// // TODO Auto-generated method stub
+// super.visitEnd();
+// }
+//
+// };
+//
+//
+// }
+
+ private String up1st(String s) {
+ return Character.toUpperCase(s.charAt(0)) + s.substring(1);
+ }
+}
Added: uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/impl/package.html
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/impl/package.html?rev=1768551&view=auto
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/impl/package.html (added)
+++ uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/impl/package.html Mon Nov 7 16:44:10 2016
@@ -0,0 +1,36 @@
+ <!--
+ ***************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ***************************************************************
+ -->
+ <!-- edit using tinymce -->
+<html>
+
+<head>
+<title>Interfaces for classes supporting the dynamic handling of JCasGen'd classes</title>
+</head>
+
+<body lang=EN-US>
+<h1>Generating JCas bytecode</h1>
+<h2>General approaches - using visitor approach</h2>
+<p>Global visitor instances: one for fields (fv), one for methods (mv).</p>
+<p>Items coming from source that need no modification are passed by default to the output,
+by not having a visitor method for that item. Example: AnnotationVisitor for "deprecated" annotations.</p>
+</body>
+
+</html>
Added: uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/package.html
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/package.html?rev=1768551&view=auto
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/package.html (added)
+++ uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/org/apache/uima/jcasgen/package.html Mon Nov 7 16:44:10 2016
@@ -0,0 +1,38 @@
+ <!--
+ ***************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ***************************************************************
+ -->
+ <!-- edit using tinymce -->
+<html>
+
+<head>
+<title>Interfaces for classes supporting the dynamic handling of JCasGen'd classes</title>
+</head>
+
+<body lang=EN-US>
+<h1>Interfaces for classes supporting the dynamic handling of JCasGen'd classes</h1>
+<h2>Definition information for each found JCas Class</h2>
+<p>Possibly multiple definitions for the same UIMA type-name. (Note that multiple type systems may share common JCas classes).</p>
+<h2>Conversion and Expansion </h2>
+<p>These are byte-code to byte-code transformations, which can be done at run-time (startup time).</p>
+<h2>Decompilation</h2>
+<p>These are for reporting purposes</p>
+</body>
+
+</html>
Added: uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/study/asm/decompiled/AnnotationDumpV3.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/study/asm/decompiled/AnnotationDumpV3.java?rev=1768551&view=auto
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/study/asm/decompiled/AnnotationDumpV3.java (added)
+++ uima/uimaj/branches/experiment-v3-jcas/unused-saved/src/study/asm/decompiled/AnnotationDumpV3.java Mon Nov 7 16:44:10 2016
@@ -0,0 +1,266 @@
+package asm.decompiled;
+
+import java.util.*;
+import org.objectweb.asm.*;
+
+public class AnnotationDumpV3 implements Opcodes {
+
+ public static byte[] dump() throws Exception {
+
+ ClassWriter cw = new ClassWriter(0);
+ FieldVisitor fv;
+ MethodVisitor mv;
+ AnnotationVisitor av0;
+
+ cw.visit(52, ACC_PUBLIC + ACC_SUPER, "org/apache/uima/jcas/tcas/Annotation", null,
+ "org/apache/uima/jcas/cas/AnnotationBase",
+ new String[] { "org/apache/uima/cas/text/AnnotationFS" });
+
+ cw.visitInnerClass("java/lang/invoke/MethodHandles$Lookup", "java/lang/invoke/MethodHandles",
+ "Lookup", ACC_PUBLIC + ACC_FINAL + ACC_STATIC);
+
+ {
+ fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "typeIndexID", "I", null, null);
+ fv.visitEnd();
+ }
+ {
+ fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "type", "I", null, null);
+ fv.visitEnd();
+ }
+ {
+ fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "_FI_begin", "I", null, null);
+ fv.visitEnd();
+ }
+ {
+ fv = cw.visitField(ACC_PUBLIC + ACC_FINAL + ACC_STATIC, "_FI_end", "I", null, null);
+ fv.visitEnd();
+ }
+ {
+ fv = cw.visitField(ACC_PRIVATE, "_F_begin", "I", null, null);
+ fv.visitEnd();
+ }
+ {
+ fv = cw.visitField(ACC_PRIVATE, "_F_end", "I", null, null);
+ fv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_STATIC, "<clinit>", "()V", null, null);
+ mv.visitCode();
+ mv.visitLdcInsn(Type.getType("Lorg/apache/uima/jcas/tcas/Annotation;"));
+ mv.visitMethodInsn(INVOKESTATIC, "org/apache/uima/jcas/JCasRegistry", "register",
+ "(Ljava/lang/Class;)I", false);
+ mv.visitFieldInsn(PUTSTATIC, "org/apache/uima/jcas/tcas/Annotation", "typeIndexID", "I");
+ mv.visitFieldInsn(GETSTATIC, "org/apache/uima/jcas/tcas/Annotation", "typeIndexID", "I");
+ mv.visitFieldInsn(PUTSTATIC, "org/apache/uima/jcas/tcas/Annotation", "type", "I");
+ mv.visitFieldInsn(GETSTATIC, "org/apache/uima/jcas/tcas/Annotation", "typeIndexID", "I");
+ mv.visitMethodInsn(INVOKESTATIC, "org/apache/uima/jcas/JCasRegistry", "registerFeature",
+ "(I)I", false);
+ mv.visitFieldInsn(PUTSTATIC, "org/apache/uima/jcas/tcas/Annotation", "_FI_begin", "I");
+ mv.visitFieldInsn(GETSTATIC, "org/apache/uima/jcas/tcas/Annotation", "typeIndexID", "I");
+ mv.visitMethodInsn(INVOKESTATIC, "org/apache/uima/jcas/JCasRegistry", "registerFeature",
+ "(I)I", false);
+ mv.visitFieldInsn(PUTSTATIC, "org/apache/uima/jcas/tcas/Annotation", "_FI_end", "I");
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 0);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PUBLIC, "getTypeIndexID", "()I", null, null);
+ mv.visitCode();
+ mv.visitFieldInsn(GETSTATIC, "org/apache/uima/jcas/tcas/Annotation", "typeIndexID", "I");
+ mv.visitInsn(IRETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PROTECTED, "<init>", "()V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKESPECIAL, "org/apache/uima/jcas/cas/AnnotationBase", "<init>", "()V",
+ false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PUBLIC, "<init>", "(Lorg/apache/uima/jcas/JCas;)V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKESPECIAL, "org/apache/uima/jcas/cas/AnnotationBase", "<init>",
+ "(Lorg/apache/uima/jcas/JCas;)V", false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(2, 2);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PUBLIC, "<init>",
+ "(Lorg/apache/uima/cas/impl/TypeImpl;Lorg/apache/uima/cas/impl/CASImpl;)V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ALOAD, 2);
+ mv.visitMethodInsn(INVOKESPECIAL, "org/apache/uima/jcas/cas/AnnotationBase", "<init>",
+ "(Lorg/apache/uima/cas/impl/TypeImpl;Lorg/apache/uima/cas/impl/CASImpl;)V", false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(3, 3);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PUBLIC, "getBegin", "()I", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "org/apache/uima/jcas/tcas/Annotation", "_F_begin", "I");
+ mv.visitInsn(IRETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PUBLIC, "setBegin", "(I)V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "org/apache/uima/jcas/tcas/Annotation", "_casView",
+ "Lorg/apache/uima/cas/impl/CASImpl;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETSTATIC, "org/apache/uima/jcas/tcas/Annotation", "_FI_begin", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ILOAD, 1);
+ mv.visitInvokeDynamicInsn("run",
+ "(Lorg/apache/uima/jcas/tcas/Annotation;I)Ljava/lang/Runnable;",
+ new Handle(Opcodes.H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", "metafactory",
+ "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;"
+ + "Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"),
+ new Object[] {
+ Type.getType("()V"), new Handle(Opcodes.H_INVOKESPECIAL,
+ "org/apache/uima/jcas/tcas/Annotation", "lambda$0", "(I)V"),
+ Type.getType("()V") });
+ mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/uima/cas/impl/CASImpl",
+ "setWithCheckAndJournalJFRI", "(Lorg/apache/uima/jcas/cas/TOP;ILjava/lang/Runnable;)V",
+ false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(5, 2);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PUBLIC, "getEnd", "()I", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "org/apache/uima/jcas/tcas/Annotation", "_F_end", "I");
+ mv.visitInsn(IRETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PUBLIC, "setEnd", "(I)V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "org/apache/uima/jcas/tcas/Annotation", "_casView",
+ "Lorg/apache/uima/cas/impl/CASImpl;");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETSTATIC, "org/apache/uima/jcas/tcas/Annotation", "_FI_end", "I");
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ILOAD, 1);
+ mv.visitInvokeDynamicInsn("run",
+ "(Lorg/apache/uima/jcas/tcas/Annotation;I)Ljava/lang/Runnable;",
+ new Handle(Opcodes.H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", "metafactory",
+ "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"),
+ new Object[] {
+ Type.getType("()V"), new Handle(Opcodes.H_INVOKESPECIAL,
+ "org/apache/uima/jcas/tcas/Annotation", "lambda$1", "(I)V"),
+ Type.getType("()V") });
+ mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/uima/cas/impl/CASImpl",
+ "setWithCheckAndJournalJFRI", "(Lorg/apache/uima/jcas/cas/TOP;ILjava/lang/Runnable;)V",
+ false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(5, 2);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PUBLIC, "<init>", "(Lorg/apache/uima/jcas/JCas;II)V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitMethodInsn(INVOKESPECIAL, "org/apache/uima/jcas/tcas/Annotation", "<init>",
+ "(Lorg/apache/uima/jcas/JCas;)V", false);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ILOAD, 2);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/uima/jcas/tcas/Annotation", "setBegin", "(I)V",
+ false);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ILOAD, 3);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/uima/jcas/tcas/Annotation", "setEnd", "(I)V",
+ false);
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(2, 4);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PUBLIC, "getCoveredText", "()Ljava/lang/String;", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitFieldInsn(GETFIELD, "org/apache/uima/jcas/tcas/Annotation", "_casView",
+ "Lorg/apache/uima/cas/impl/CASImpl;");
+ mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/uima/cas/impl/CASImpl", "getDocumentText",
+ "()Ljava/lang/String;", false);
+ mv.visitVarInsn(ASTORE, 1);
+ mv.visitVarInsn(ALOAD, 1);
+ Label l0 = new Label();
+ mv.visitJumpInsn(IFNONNULL, l0);
+ mv.visitInsn(ACONST_NULL);
+ mv.visitInsn(ARETURN);
+ mv.visitLabel(l0);
+ mv.visitFrame(Opcodes.F_APPEND, 1, new Object[] { "java/lang/String" }, 0, null);
+ mv.visitVarInsn(ALOAD, 1);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/uima/jcas/tcas/Annotation", "getBegin", "()I",
+ false);
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/uima/jcas/tcas/Annotation", "getEnd", "()I",
+ false);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "substring", "(II)Ljava/lang/String;",
+ false);
+ mv.visitInsn(ARETURN);
+ mv.visitMaxs(3, 2);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PUBLIC + ACC_DEPRECATED, "getStart", "()I", null, null);
+ {
+ av0 = mv.visitAnnotation("Ljava/lang/Deprecated;", true);
+ av0.visitEnd();
+ }
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitMethodInsn(INVOKEVIRTUAL, "org/apache/uima/jcas/tcas/Annotation", "getBegin", "()I",
+ false);
+ mv.visitInsn(IRETURN);
+ mv.visitMaxs(1, 1);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PRIVATE + ACC_SYNTHETIC, "lambda$0", "(I)V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ILOAD, 1);
+ mv.visitInsn(DUP_X1);
+ mv.visitFieldInsn(PUTFIELD, "org/apache/uima/jcas/tcas/Annotation", "_F_begin", "I");
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(3, 2);
+ mv.visitEnd();
+ }
+ {
+ mv = cw.visitMethod(ACC_PRIVATE + ACC_SYNTHETIC, "lambda$1", "(I)V", null, null);
+ mv.visitCode();
+ mv.visitVarInsn(ALOAD, 0);
+ mv.visitVarInsn(ILOAD, 1);
+ mv.visitInsn(DUP_X1);
+ mv.visitFieldInsn(PUTFIELD, "org/apache/uima/jcas/tcas/Annotation", "_F_end", "I");
+ mv.visitInsn(RETURN);
+ mv.visitMaxs(3, 2);
+ mv.visitEnd();
+ }
+ cw.visitEnd();
+
+ return cw.toByteArray();
+ }
+}