diff --git a/README.md b/README.md index fc1457e..2ac7d89 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # jakarta-bcel +This is a version of Apache's Byte Code Engineering Library (BCEL) that has been modified by the findbugs developers. The modifications add some new functionality, and also introduce a number of performance optimizations to address findbugs performance problems. Some of the performance optimizations induce API changes, so this version of BCEL is not compatible with the vanilla upstream version + diff --git a/jakarta-bcel-5.2-bcel.diff b/jakarta-bcel-5.2-bcel.diff new file mode 100644 index 0000000..351b707 --- /dev/null +++ b/jakarta-bcel-5.2-bcel.diff @@ -0,0 +1,1007 @@ +Property changes on: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2 +___________________________________________________________________ +Name: svn:ignore + - bin +velocity.log +*~ + + bin +velocity.log +*~ +bcel.jar + + +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/.classpath +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/.classpath (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/.classpath (working copy) +@@ -1,7 +1,6 @@ + + + +- + + + +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/.settings/org.eclipse.jdt.core.prefs +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/.settings/org.eclipse.jdt.core.prefs (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/.settings/org.eclipse.jdt.core.prefs (working copy) +@@ -1,12 +1,12 @@ +-#Tue Jan 24 00:19:24 EST 2006 ++#Fri Feb 23 10:19:35 EST 2007 + eclipse.preferences.version=1 +-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled +-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 ++org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled ++org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 + org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +-org.eclipse.jdt.core.compiler.compliance=1.4 ++org.eclipse.jdt.core.compiler.compliance=1.5 + org.eclipse.jdt.core.compiler.debug.lineNumber=generate + org.eclipse.jdt.core.compiler.debug.localVariable=generate + org.eclipse.jdt.core.compiler.debug.sourceFile=generate +-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning +-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning +-org.eclipse.jdt.core.compiler.source=1.3 ++org.eclipse.jdt.core.compiler.problem.assertIdentifier=error ++org.eclipse.jdt.core.compiler.problem.enumIdentifier=error ++org.eclipse.jdt.core.compiler.source=1.5 +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/build.xml +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/build.xml (revision 0) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/build.xml (revision 0) +@@ -0,0 +1,39 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/AbstractLocalVariableTable.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/AbstractLocalVariableTable.java (revision 0) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/AbstractLocalVariableTable.java (revision 0) +@@ -0,0 +1,187 @@ ++/* ++ * Copyright 2000-2004 The Apache Software Foundation ++ * ++ * Licensed 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.bcel.classfile; ++ ++import java.io.DataInputStream; ++import java.io.DataOutputStream; ++import java.io.IOException; ++import org.apache.bcel.Constants; ++ ++/** ++ * This class represents colection of local variables in a ++ * method. This attribute is contained in the Code attribute. ++ * ++ * @version $Id: bcel.diff,v 1.1 2009/01/29 03:59:00 jjames Exp $ ++ * @author M. Dahm ++ * @see Code ++ * @see LocalVariable ++ */ ++abstract public class AbstractLocalVariableTable extends Attribute { ++ ++ private int local_variable_table_length; // Table of local ++ private LocalVariable[] local_variable_table; // variables ++ ++ ++ /** ++ * Initialize from another object. Note that both objects use the same ++ * references (shallow copy). Use copy() for a physical copy. ++ */ ++ public AbstractLocalVariableTable(AbstractLocalVariableTable c) { ++ this(c.getNameIndex(), c.getLength(), c.getLocalVariableTable(), c.getConstantPool()); ++ } ++ ++ ++ /** ++ * @param name_index Index in constant pool to `LocalVariableTable' ++ * @param length Content length in bytes ++ * @param local_variable_table Table of local variables ++ * @param constant_pool Array of constants ++ */ ++ public AbstractLocalVariableTable(int name_index, int length, LocalVariable[] local_variable_table, ++ ConstantPool constant_pool) { ++ super(Constants.ATTR_LOCAL_VARIABLE_TABLE, name_index, length, constant_pool); ++ setLocalVariableTable(local_variable_table); ++ } ++ ++ ++ /** ++ * Construct object from file stream. ++ * @param name_index Index in constant pool ++ * @param length Content length in bytes ++ * @param file Input stream ++ * @param constant_pool Array of constants ++ * @throws IOException ++ */ ++ AbstractLocalVariableTable(int name_index, int length, DataInputStream file, ConstantPool constant_pool) ++ throws IOException { ++ this(name_index, length, (LocalVariable[]) null, constant_pool); ++ local_variable_table_length = (file.readUnsignedShort()); ++ local_variable_table = new LocalVariable[local_variable_table_length]; ++ for (int i = 0; i < local_variable_table_length; i++) { ++ local_variable_table[i] = new LocalVariable(file, constant_pool); ++ } ++ } ++ ++ ++ ++ ++ /** ++ * Dump local variable table attribute to file stream in binary format. ++ * ++ * @param file Output file stream ++ * @throws IOException ++ */ ++ public final void dump( DataOutputStream file ) throws IOException { ++ super.dump(file); ++ file.writeShort(local_variable_table_length); ++ for (int i = 0; i < local_variable_table_length; i++) { ++ local_variable_table[i].dump(file); ++ } ++ } ++ ++ ++ /** ++ * @return Array of local variables of method. ++ */ ++ public final LocalVariable[] getLocalVariableTable() { ++ return local_variable_table; ++ } ++ ++ ++ /** ++ * @return first matching variable using index ++ * ++ * @param index the variable slot ++ * ++ * @return the first LocalVariable that matches the slot or null if not found ++ * ++ * @deprecated since 5.2 because multiple variables can share the ++ * same slot, use getLocalVariable(int index, int pc) instead. ++ */ ++ public final LocalVariable getLocalVariable( int index ) { ++ for (int i = 0; i < local_variable_table_length; i++) { ++ if (local_variable_table[i].getIndex() == index) { ++ return local_variable_table[i]; ++ } ++ } ++ return null; ++ } ++ ++ ++ /** ++ * @return matching variable using index when variable is used at supplied pc ++ * ++ * @param index the variable slot ++ * @param pc the current pc that this variable is alive ++ * ++ * @return the LocalVariable that matches or null if not found ++ */ ++ public final LocalVariable getLocalVariable( int index, int pc ) { ++ for (int i = 0; i < local_variable_table_length; i++) { ++ if (local_variable_table[i].getIndex() == index) { ++ int start_pc = local_variable_table[i].getStartPC(); ++ int end_pc = start_pc + local_variable_table[i].getLength(); ++ if ((pc >= start_pc) && (pc < end_pc)) { ++ return local_variable_table[i]; ++ } ++ } ++ } ++ return null; ++ } ++ ++ ++ public final void setLocalVariableTable( LocalVariable[] local_variable_table ) { ++ this.local_variable_table = local_variable_table; ++ local_variable_table_length = (local_variable_table == null) ++ ? 0 ++ : local_variable_table.length; ++ } ++ ++ ++ /** ++ * @return String representation. ++ */ ++ public final String toString() { ++ StringBuffer buf = new StringBuffer(""); ++ for (int i = 0; i < local_variable_table_length; i++) { ++ buf.append(local_variable_table[i].toString()); ++ if (i < local_variable_table_length - 1) { ++ buf.append('\n'); ++ } ++ } ++ return buf.toString(); ++ } ++ ++ ++ /** ++ * @return deep copy of this attribute ++ */ ++ public Attribute copy( ConstantPool _constant_pool ) { ++ AbstractLocalVariableTable c = (AbstractLocalVariableTable) clone(); ++ c.local_variable_table = new LocalVariable[local_variable_table_length]; ++ for (int i = 0; i < local_variable_table_length; i++) { ++ c.local_variable_table[i] = local_variable_table[i].copy(); ++ } ++ c.constant_pool = _constant_pool; ++ return c; ++ } ++ ++ ++ public final int getTableLength() { ++ return local_variable_table_length; ++ } ++} +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/Attribute.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/Attribute.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/Attribute.java (working copy) +@@ -159,7 +159,9 @@ + return new LineNumberTable(name_index, length, file, constant_pool); + case Constants.ATTR_LOCAL_VARIABLE_TABLE: + return new LocalVariableTable(name_index, length, file, constant_pool); +- case Constants.ATTR_INNER_CLASSES: ++ case Constants.ATTR_LOCAL_VARIABLE_TYPE_TABLE: ++ return new LocalVariableTypeTable(name_index, length, file, constant_pool); ++ case Constants.ATTR_INNER_CLASSES: + return new InnerClasses(name_index, length, file, constant_pool); + case Constants.ATTR_SYNTHETIC: + return new Synthetic(name_index, length, file, constant_pool); +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/Constant.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/Constant.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/Constant.java (working copy) +@@ -141,7 +141,7 @@ + case Constants.CONSTANT_NameAndType: + return new ConstantNameAndType(file); + case Constants.CONSTANT_Utf8: +- return new ConstantUtf8(file); ++ return ConstantUtf8.getInstance(file); + default: + throw new ClassFormatException("Invalid byte tag in constant pool: " + b); + } +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/ConstantUtf8.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/ConstantUtf8.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/ConstantUtf8.java (working copy) +@@ -19,7 +19,14 @@ + import java.io.DataInputStream; + import java.io.DataOutputStream; + import java.io.IOException; ++import java.util.HashMap; ++import java.util.LinkedHashMap; ++import java.util.Map; ++ + import org.apache.bcel.Constants; ++import org.apache.bcel.generic.ObjectType; ++ ++import com.sun.org.apache.xerces.internal.impl.io.UTF8Reader; + + /** + * This class is derived from the abstract +@@ -32,9 +39,60 @@ + */ + public final class ConstantUtf8 extends Constant { + +- private String bytes; ++ private final String bytes; ++ ++ private static final int MAX_CACHE_ENTRIES = 20000; ++ private static final int INITIAL_CACHE_CAPACITY = (int)(MAX_CACHE_ENTRIES/0.75); ++ private static HashMap cache; ++ private static int considered = 0; ++ private static int hits = 0; ++ private static int skipped = 0; ++ private static int created = 0; ++ final static boolean BCEL_STATISTICS = Boolean.getBoolean("bcel.statistics"); ++ final static boolean BCEL_DONT_CACHE = Boolean.getBoolean("bcel.dontCache"); ++ ++ static { ++ if (BCEL_STATISTICS) ++ Runtime.getRuntime().addShutdownHook(new Thread() { ++ public void run() { ++ System.err.println("Cache hit " + hits + "/" + considered +", " ++ + skipped + " skipped"); ++ System.err.println("Total of " + created + " ConstantUtf8 objects created"); ++ } ++ }); ++ } ++ public static synchronized ConstantUtf8 getCachedInstance(String s) { ++ if (BCEL_DONT_CACHE || s.length() > 200) { ++ skipped++; ++ return new ConstantUtf8(s); ++ } ++ considered++; ++ if (cache == null) { ++ cache = new LinkedHashMap(INITIAL_CACHE_CAPACITY, 0.75f, true) { ++ ++ protected boolean removeEldestEntry(Map.Entry eldest) { ++ return size() > MAX_CACHE_ENTRIES; ++ } ++ ++ }; ++ } ++ ConstantUtf8 result = cache.get(s); ++ if (result != null) { ++ hits++; ++ return result; ++ } ++ result = new ConstantUtf8(s); ++ cache.put(s, result); ++ return result; ++ } + ++ public static ConstantUtf8 getInstance(String s) { ++ return getCachedInstance(s); ++ } + ++ public static ConstantUtf8 getInstance (DataInputStream file) throws IOException { ++ return getInstance(file.readUTF()); ++ } + /** + * Initialize from another object. + */ +@@ -52,6 +110,7 @@ + ConstantUtf8(DataInputStream file) throws IOException { + super(Constants.CONSTANT_Utf8); + bytes = file.readUTF(); ++ created++; + } + + +@@ -64,6 +123,7 @@ + throw new IllegalArgumentException("bytes must not be null!"); + } + this.bytes = bytes; ++ created++; + } + + +@@ -101,9 +161,10 @@ + + /** + * @param bytes the raw bytes of this Utf-8 ++ * @deprecated + */ + public final void setBytes( String bytes ) { +- this.bytes = bytes; ++ throw new UnsupportedOperationException(); + } + + +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/DescendingVisitor.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/DescendingVisitor.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/DescendingVisitor.java (working copy) +@@ -185,6 +185,9 @@ + } + stack.pop(); + } ++ public void visitLocalVariableTypeTable( LocalVariableTypeTable table ) { ++ ++ } + + + public void visitStackMap( StackMap table ) { +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/EmptyVisitor.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/EmptyVisitor.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/EmptyVisitor.java (working copy) +@@ -158,4 +158,10 @@ + + public void visitStackMapEntry( StackMapEntry obj ) { + } ++ ++ ++ public void visitLocalVariableTypeTable(LocalVariableTypeTable obj) { ++ // TODO Auto-generated method stub ++ ++ } + } +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/LineNumber.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/LineNumber.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/LineNumber.java (working copy) +@@ -32,8 +32,8 @@ + */ + public final class LineNumber implements Cloneable, Node, Serializable { + +- private int start_pc; // Program Counter (PC) corresponds to line +- private int line_number; // number in source file ++ private short start_pc; // Program Counter (PC) corresponds to line ++ private short line_number; // number in source file + + + /** +@@ -59,8 +59,8 @@ + * @param line_number line number in source file + */ + public LineNumber(int start_pc, int line_number) { +- this.start_pc = start_pc; +- this.line_number = line_number; ++ this.start_pc = (short) start_pc; ++ this.line_number = (short)line_number; + } + + +@@ -92,7 +92,7 @@ + * @return Corresponding source line + */ + public final int getLineNumber() { +- return line_number; ++ return 0xffff & line_number; + } + + +@@ -100,7 +100,7 @@ + * @return PC in code + */ + public final int getStartPC() { +- return start_pc; ++ return 0xffff & start_pc; + } + + +@@ -108,7 +108,7 @@ + * @param line_number the source line number + */ + public final void setLineNumber( int line_number ) { +- this.line_number = line_number; ++ this.line_number = (short) line_number; + } + + +@@ -116,7 +116,7 @@ + * @param start_pc the pc for this line number + */ + public final void setStartPC( int start_pc ) { +- this.start_pc = start_pc; ++ this.start_pc = (short) start_pc; + } + + +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/LocalVariableTable.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/LocalVariableTable.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/LocalVariableTable.java (working copy) +@@ -30,11 +30,7 @@ + * @see Code + * @see LocalVariable + */ +-public class LocalVariableTable extends Attribute { +- +- private int local_variable_table_length; // Table of local +- private LocalVariable[] local_variable_table; // variables +- ++public class LocalVariableTable extends AbstractLocalVariableTable { + + /** + * Initialize from another object. Note that both objects use the same +@@ -53,8 +49,7 @@ + */ + public LocalVariableTable(int name_index, int length, LocalVariable[] local_variable_table, + ConstantPool constant_pool) { +- super(Constants.ATTR_LOCAL_VARIABLE_TABLE, name_index, length, constant_pool); +- setLocalVariableTable(local_variable_table); ++ super(name_index,length, local_variable_table, constant_pool); + } + + +@@ -68,12 +63,7 @@ + */ + LocalVariableTable(int name_index, int length, DataInputStream file, ConstantPool constant_pool) + throws IOException { +- this(name_index, length, (LocalVariable[]) null, constant_pool); +- local_variable_table_length = (file.readUnsignedShort()); +- local_variable_table = new LocalVariable[local_variable_table_length]; +- for (int i = 0; i < local_variable_table_length; i++) { +- local_variable_table[i] = new LocalVariable(file, constant_pool); +- } ++ super(name_index,length, file, constant_pool); + } + + +@@ -87,111 +77,4 @@ + public void accept( Visitor v ) { + v.visitLocalVariableTable(this); + } +- +- +- /** +- * Dump local variable table attribute to file stream in binary format. +- * +- * @param file Output file stream +- * @throws IOException +- */ +- public final void dump( DataOutputStream file ) throws IOException { +- super.dump(file); +- file.writeShort(local_variable_table_length); +- for (int i = 0; i < local_variable_table_length; i++) { +- local_variable_table[i].dump(file); +- } +- } +- +- +- /** +- * @return Array of local variables of method. +- */ +- public final LocalVariable[] getLocalVariableTable() { +- return local_variable_table; +- } +- +- +- /** +- * @return first matching variable using index +- * +- * @param index the variable slot +- * +- * @return the first LocalVariable that matches the slot or null if not found +- * +- * @deprecated since 5.2 because multiple variables can share the +- * same slot, use getLocalVariable(int index, int pc) instead. +- */ +- public final LocalVariable getLocalVariable( int index ) { +- for (int i = 0; i < local_variable_table_length; i++) { +- if (local_variable_table[i].getIndex() == index) { +- return local_variable_table[i]; +- } +- } +- return null; +- } +- +- +- /** +- * @return matching variable using index when variable is used at supplied pc +- * +- * @param index the variable slot +- * @param pc the current pc that this variable is alive +- * +- * @return the LocalVariable that matches or null if not found +- */ +- public final LocalVariable getLocalVariable( int index, int pc ) { +- for (int i = 0; i < local_variable_table_length; i++) { +- if (local_variable_table[i].getIndex() == index) { +- int start_pc = local_variable_table[i].getStartPC(); +- int end_pc = start_pc + local_variable_table[i].getLength(); +- if ((pc >= start_pc) && (pc < end_pc)) { +- return local_variable_table[i]; +- } +- } +- } +- return null; +- } +- +- +- public final void setLocalVariableTable( LocalVariable[] local_variable_table ) { +- this.local_variable_table = local_variable_table; +- local_variable_table_length = (local_variable_table == null) +- ? 0 +- : local_variable_table.length; +- } +- +- +- /** +- * @return String representation. +- */ +- public final String toString() { +- StringBuffer buf = new StringBuffer(""); +- for (int i = 0; i < local_variable_table_length; i++) { +- buf.append(local_variable_table[i].toString()); +- if (i < local_variable_table_length - 1) { +- buf.append('\n'); +- } +- } +- return buf.toString(); +- } +- +- +- /** +- * @return deep copy of this attribute +- */ +- public Attribute copy( ConstantPool _constant_pool ) { +- LocalVariableTable c = (LocalVariableTable) clone(); +- c.local_variable_table = new LocalVariable[local_variable_table_length]; +- for (int i = 0; i < local_variable_table_length; i++) { +- c.local_variable_table[i] = local_variable_table[i].copy(); +- } +- c.constant_pool = _constant_pool; +- return c; +- } +- +- +- public final int getTableLength() { +- return local_variable_table_length; +- } + } +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/LocalVariableTypeTable.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/LocalVariableTypeTable.java (revision 0) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/LocalVariableTypeTable.java (revision 0) +@@ -0,0 +1,22 @@ ++package org.apache.bcel.classfile; ++ ++import java.io.DataInputStream; ++import java.io.IOException; ++ ++public class LocalVariableTypeTable extends AbstractLocalVariableTable { ++ ++ public LocalVariableTypeTable(int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException { ++ super(name_index, length, file, constant_pool); ++ } ++ ++ /** ++ * Called by objects that are traversing the nodes of the tree implicitely ++ * defined by the contents of a Java class. I.e., the hierarchy of methods, ++ * fields, attributes, etc. spawns a tree of objects. ++ * ++ * @param v Visitor object ++ */ ++ public void accept( Visitor v ) { ++ v.visitLocalVariableTypeTable(this); ++ } ++} +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/Visitor.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/Visitor.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/classfile/Visitor.java (working copy) +@@ -103,6 +103,7 @@ + + + public void visitLocalVariableTable( LocalVariableTable obj ); ++ public void visitLocalVariableTypeTable( LocalVariableTypeTable obj ); + + + public void visitMethod( Method obj ); +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/Constants.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/Constants.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/Constants.java (working copy) +@@ -729,13 +729,16 @@ + public static final byte ATTR_PMG = 9; + public static final byte ATTR_SIGNATURE = 10; + public static final byte ATTR_STACK_MAP = 11; +- public static final byte ATTR_RUNTIMEVISIBLE_ANNOTATIONS = 12; +- public static final byte ATTR_RUNTIMEINVISIBLE_ANNOTATIONS = 13; +- public static final byte ATTR_RUNTIMEVISIBLE_PARAMETER_ANNOTATIONS = 14; +- public static final byte ATTR_RUNTIMEINVISIBLE_PARAMETER_ANNOTATIONS = 15; +- public static final byte ATTR_ANNOTATION_DEFAULT = 16; ++ public static final byte ATTR_LOCAL_VARIABLE_TYPE_TABLE = 12; ++ public static final byte ATTR_RUNTIMEVISIBLE_ANNOTATIONS = 13; ++ public static final byte ATTR_RUNTIMEINVISIBLE_ANNOTATIONS = 14; ++ public static final byte ATTR_RUNTIMEVISIBLE_PARAMETER_ANNOTATIONS = 15; ++ public static final byte ATTR_RUNTIMEINVISIBLE_PARAMETER_ANNOTATIONS = 16; ++ public static final byte ATTR_ANNOTATION_DEFAULT = 17; ++ ++ + +- public static final short KNOWN_ATTRIBUTES = 12;//should be 17 ++ public static final short KNOWN_ATTRIBUTES = 13;//should be 17 + + public static final String[] ATTRIBUTE_NAMES = { + "SourceFile", "ConstantValue", "Code", "Exceptions", +@@ -741,7 +744,7 @@ + "SourceFile", "ConstantValue", "Code", "Exceptions", + "LineNumberTable", "LocalVariableTable", + "InnerClasses", "Synthetic", "Deprecated", +- "PMGClass", "Signature", "StackMap", ++ "PMGClass", "Signature", "StackMap", "LocalVariableTypeTable", + "RuntimeVisibleAnnotations", "RuntimeInvisibleAnnotations", + "RuntimeVisibleParameterAnnotations", "RuntimeInvisibleParameterAnnotations", + "AnnotationDefault" +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/ArrayType.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/ArrayType.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/ArrayType.java (working copy) +@@ -46,7 +46,7 @@ + * @param class_name complete name of class (java.lang.String, e.g.) + */ + public ArrayType(String class_name, int dimensions) { +- this(new ObjectType(class_name), dimensions); ++ this(ObjectType.getInstance(class_name), dimensions); + } + + +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/FieldGen.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/FieldGen.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/FieldGen.java (working copy) +@@ -107,7 +107,7 @@ + * by the JVM automatically. + */ + public void setInitValue( String str ) { +- checkType(new ObjectType("java.lang.String")); ++ checkType( ObjectType.getInstance("java.lang.String")); + if (str != null) { + value = str; + } +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/FieldOrMethod.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/FieldOrMethod.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/FieldOrMethod.java (working copy) +@@ -94,7 +94,7 @@ + * getReferenceType() instead. + */ + public ObjectType getClassType( ConstantPoolGen cpg ) { +- return new ObjectType(getClassName(cpg)); ++ return ObjectType.getInstance(getClassName(cpg)); + } + + +@@ -115,7 +115,7 @@ + return (ArrayType) Type.getType(className); + } else { + className = className.replace('/', '.'); +- return new ObjectType(className); ++ return ObjectType.getInstance(className); + } + } + +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/InstructionFactory.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/InstructionFactory.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/InstructionFactory.java (working copy) +@@ -616,7 +616,7 @@ + + + public NEW createNew( String s ) { +- return createNew(new ObjectType(s)); ++ return createNew(ObjectType.getInstance(s)); + } + + +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/MethodGen.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/MethodGen.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/MethodGen.java (working copy) +@@ -122,7 +122,7 @@ + /* Add local variables, namely the implicit `this' and the arguments + */ + if (!isStatic() && (class_name != null)) { // Instance method -> `this' is local var 0 +- addLocalVariable("this", new ObjectType(class_name), start, end); ++ addLocalVariable("this", ObjectType.getInstance(class_name), start, end); + } + } + if (arg_types != null) { +@@ -183,7 +183,7 @@ + if (type > 0) { + String cen = m.getConstantPool().getConstantString(type, + Constants.CONSTANT_Class); +- c_type = new ObjectType(cen); ++ c_type = ObjectType.getInstance(cen); + } + int end_pc = ce.getEndPC(); + int length = m.getCode().getCode().length; +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/ObjectType.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/ObjectType.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/ObjectType.java (working copy) +@@ -16,6 +16,10 @@ + */ + package org.apache.bcel.generic; + ++import java.util.HashMap; ++import java.util.LinkedHashMap; ++import java.util.Map; ++ + import org.apache.bcel.Constants; + import org.apache.bcel.Repository; + import org.apache.bcel.classfile.JavaClass; +@@ -20,6 +24,7 @@ + import org.apache.bcel.Repository; + import org.apache.bcel.classfile.JavaClass; + ++ + /** + * Denotes reference such as java.lang.String. + * +@@ -28,8 +33,27 @@ + */ + public class ObjectType extends ReferenceType { + +- private String class_name; // Class name of type ++ private static final int MAX_CACHE_ENTRIES = 200; ++ private static final int INITIAL_CACHE_CAPACITY = (int)(MAX_CACHE_ENTRIES/0.75); ++ private static HashMap cache; ++ public synchronized static ObjectType getInstance(String class_name) { ++ if (cache == null) ++ cache = new LinkedHashMap(INITIAL_CACHE_CAPACITY, 0.75f, true) { ++ ++ ++ protected boolean removeEldestEntry(Map.Entry eldest) { ++ return size() > MAX_CACHE_ENTRIES; ++ } ++ ++ }; ++ ObjectType result = cache.get(class_name); ++ if (result != null) return result; ++ result = new ObjectType(class_name); ++ cache.put(class_name, result); ++ return result; ++ } + ++ final private String class_name; // Class name of type + + /** + * @param class_name fully qualified class name, e.g. java.lang.String +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/ReferenceType.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/ReferenceType.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/ReferenceType.java (working copy) +@@ -162,7 +162,7 @@ + // 'java.io.Serializable'" + if ((T instanceof ObjectType) && (((ObjectType) T).referencesInterfaceExact())) { + for (int ii = 0; ii < Constants.INTERFACES_IMPLEMENTED_BY_ARRAYS.length; ii++) { +- if (T.equals(new ObjectType(Constants.INTERFACES_IMPLEMENTED_BY_ARRAYS[ii]))) { ++ if (T.equals(ObjectType.getInstance(Constants.INTERFACES_IMPLEMENTED_BY_ARRAYS[ii]))) { + return true; + } + } +@@ -248,7 +248,7 @@ + for (int i = 0; i < t_sups.length; i++) { + for (int j = 0; j < this_sups.length; j++) { + if (this_sups[j].equals(t_sups[i])) { +- return new ObjectType(this_sups[j].getClassName()); ++ return ObjectType.getInstance(this_sups[j].getClassName()); + } + } + } +@@ -320,7 +320,7 @@ + for (int i = 0; i < t_sups.length; i++) { + for (int j = 0; j < this_sups.length; j++) { + if (this_sups[j].equals(t_sups[i])) { +- return new ObjectType(this_sups[j].getClassName()); ++ return ObjectType.getInstance(this_sups[j].getClassName()); + } + } + } +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/Type.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/Type.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/generic/Type.java (working copy) +@@ -31,7 +31,7 @@ + */ + public abstract class Type implements java.io.Serializable { + +- protected byte type; ++ final protected byte type; + protected String signature; // signature for the type + /** Predefined constants + */ +@@ -44,11 +44,11 @@ + public static final BasicType DOUBLE = new BasicType(Constants.T_DOUBLE); + public static final BasicType FLOAT = new BasicType(Constants.T_FLOAT); + public static final BasicType CHAR = new BasicType(Constants.T_CHAR); +- public static final ObjectType OBJECT = new ObjectType("java.lang.Object"); +- public static final ObjectType CLASS = new ObjectType("java.lang.Class"); +- public static final ObjectType STRING = new ObjectType("java.lang.String"); +- public static final ObjectType STRINGBUFFER = new ObjectType("java.lang.StringBuffer"); +- public static final ObjectType THROWABLE = new ObjectType("java.lang.Throwable"); ++ public static final ObjectType OBJECT = ObjectType.getInstance("java.lang.Object"); ++ public static final ObjectType CLASS = ObjectType.getInstance("java.lang.Class"); ++ public static final ObjectType STRING = ObjectType.getInstance("java.lang.String"); ++ public static final ObjectType STRINGBUFFER = ObjectType.getInstance("java.lang.StringBuffer"); ++ public static final ObjectType THROWABLE = ObjectType.getInstance("java.lang.Throwable"); + public static final Type[] NO_ARGS = new Type[0]; + public static final ReferenceType NULL = new ReferenceType() { + }; +@@ -190,7 +190,7 @@ + } + //corrected concurrent private static field acess + wrap(consumed_chars, index + 1); // "Lblabla;" `L' and `;' are removed +- return new ObjectType(signature.substring(1, index).replace('/', '.')); ++ return ObjectType.getInstance(signature.substring(1, index).replace('/', '.')); + } + } + +@@ -278,7 +278,7 @@ + throw new IllegalStateException("Ooops, what primitive type is " + cl); + } + } else { // "Real" class +- return new ObjectType(cl.getName()); ++ return ObjectType.getInstance(cl.getName()); + } + } + +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/verifier/structurals/InstConstraintVisitor.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/verifier/structurals/InstConstraintVisitor.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/verifier/structurals/InstConstraintVisitor.java (working copy) +@@ -52,7 +52,7 @@ + */ + public class InstConstraintVisitor extends EmptyVisitor implements org.apache.bcel.generic.Visitor{ + +- private static ObjectType GENERIC_ARRAY = new ObjectType("org.apache.bcel.verifier.structurals.GenericArray"); ++ private static ObjectType GENERIC_ARRAY = ObjectType.getInstance("org.apache.bcel.verifier.structurals.GenericArray"); + + /** + * The constructor. Constructs a new instance of this class. +@@ -1207,7 +1207,7 @@ + + if (f.isProtected()){ + ObjectType classtype = o.getClassType(cpg); +- ObjectType curr = new ObjectType(mg.getClassName()); ++ ObjectType curr = ObjectType.getInstance(mg.getClassName()); + + if ( classtype.equals(curr) || + curr.subclassOf(classtype) ){ +@@ -2531,7 +2531,7 @@ + + if (f.isProtected()){ + ObjectType classtype = o.getClassType(cpg); +- ObjectType curr = new ObjectType(mg.getClassName()); ++ ObjectType curr = ObjectType.getInstance(mg.getClassName()); + + if ( classtype.equals(curr) || + curr.subclassOf(classtype) ){ +Index: /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/verifier/structurals/Pass3bVerifier.java +=================================================================== +--- /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/verifier/structurals/Pass3bVerifier.java (revision 510968) ++++ /Users/pugh/Documents/eclipse/workspace/jakarta-bcel-5.2/src/java/org/apache/bcel/verifier/structurals/Pass3bVerifier.java (working copy) +@@ -301,7 +301,7 @@ + Frame f = new Frame(mg.getMaxLocals(),mg.getMaxStack()); + if ( !mg.isStatic() ){ + if (mg.getName().equals(Constants.CONSTRUCTOR_NAME)){ +- Frame._this = new UninitializedObjectType(new ObjectType(jc.getClassName())); ++ Frame._this = new UninitializedObjectType(ObjectType.getInstance(jc.getClassName())); + f.getLocals().set(0, Frame._this); + } + else{ +@@ -306,7 +306,7 @@ + } + else{ + Frame._this = null; +- f.getLocals().set(0, new ObjectType(jc.getClassName())); ++ f.getLocals().set(0, ObjectType.getInstance(jc.getClassName())); + } + } + Type[] argtypes = mg.getArgumentTypes(); diff --git a/jakarta-bcel-5.2-build.xml b/jakarta-bcel-5.2-build.xml new file mode 100644 index 0000000..6e7db4a --- /dev/null +++ b/jakarta-bcel-5.2-build.xml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ================================= WARNING ================================ + Junit isn't present in your ${ANT_HOME}/lib directory. Tests not executed. + ========================================================================== + + + + + + + + + + + + + + + + + + + + + + + + + + + Proxy used : + Proxy host [${proxy.host}] + Proxy port [${proxy.port}] + Proxy user [${proxy.username}] + + + + Proxy not used. + + + + + + + + + + + + + + + + + + + + + + + + The Jakarta-Site2 module is not present! Please check + to make sure that you have checked it out from CVS. + + <http://jakarta.apache.org/site/jakarta-site2.html> + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jakarta-bcel-5.2-project_properties.patch b/jakarta-bcel-5.2-project_properties.patch new file mode 100644 index 0000000..73734fb --- /dev/null +++ b/jakarta-bcel-5.2-project_properties.patch @@ -0,0 +1,11 @@ +--- project.properties.sav 2007-06-26 15:21:10.000000000 +0200 ++++ project.properties 2007-06-26 15:21:35.000000000 +0200 +@@ -42,7 +42,7 @@ + + maven.changes.issue.template = %URL%/bugzilla/show_bug.cgi?id=%ISSUE% + +-maven.xdoc.jsl = ../commons-build/commons-site.jsl ++maven.xdoc.jsl = file:${basedir}/commons-build/commons-site.jsl + maven.xdoc.date = left + maven.xdoc.poweredby.image = maven-feather.png + maven.xdoc.version = ${pom.currentVersion} diff --git a/jakarta-bcel-5.2.pom b/jakarta-bcel-5.2.pom new file mode 100644 index 0000000..02a5b6e --- /dev/null +++ b/jakarta-bcel-5.2.pom @@ -0,0 +1,11 @@ + + 4.0.0 + bcel + bcel + 5.2 + + regexp + regexp + 1.4 + + diff --git a/jakarta-bcel.spec b/jakarta-bcel.spec new file mode 100644 index 0000000..87abd7e --- /dev/null +++ b/jakarta-bcel.spec @@ -0,0 +1,222 @@ +%define javahome %{_jvmdir}/jdk +%define bootstrap 1 +Name: jakarta-bcel +Version: 5.2 +Release: 11mamba +Summary: Apache's Byte Code Engineering Library (BCEL) +Group: Development/Libraries/Java +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://jakarta.apache.org/bcel/ +#Source0: http://mirror.soluzionisis.com/apache/jakarta/bcel/source/bcel-%{version}-src.tar.gz +#svn export https://svn.apache.org/repos/asf/jakarta/bcel/tags/BCEL_5_2 +#tar czvf BCEL-5.2-src-svn.tar.gz BCEL_5_2 +Source0: BCEL-5.2-src-svn.tar.gz +Source1: jakarta-bcel-5.2-bcel.diff +Source2: jakarta-bcel-5.2-build.xml +# http://cvs.fedoraproject.org/repo/dist/bcel/ +Source3: bcel-jakarta-site2.tar.gz +Source4: jakarta-bcel-5.2.pom +Patch0: jakarta-bcel-5.2-project_properties.patch +License: Apache Software License 2.0 +BuildRequires: antlr +%if ! %bootstrap +BuildRequires: apache-anakia +%endif +BuildRequires: apache-ant +%if "%{stage1}" != "1" +BuildRequires: apache-ant-regexp +BuildRequires: jakarta-commons-collections +BuildRequires: jakarta-oro +BuildRequires: java-dom +BuildRequires: java-excalibur-avalon-logkit +BuildRequires: jakarta-regexp +BuildRequires: java-velocity +BuildRequires: werken-xpath +%endif +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: jpackage-utils +BuildRequires: libgcc +BuildRequires: libgcj4-devel +BuildRequires: libz-devel +## AUTOBUILDREQ-END +Requires: jpackage-utils +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +This is a version of Apache's Byte Code Engineering Library (BCEL) that has been modified by the findbugs developers. The modifications add some new functionality, and also introduce a number of performance optimizations to address findbugs performance problems. Some of the performance optimizations induce API changes, so this version of BCEL is not compatible with the vanilla upstream version + +%package javadoc +Group: Documentation +Summary: Manual for %{name} + +%description javadoc +Apache's Byte Code Engineering Library (BCEL) + +This package contains API documentation for %{name}. + +%package manual +Group: Documentation +Summary: Javadoc for %{name} + +%description manual +Apache's Byte Code Engineering Library (BCEL) + +This package contains documentation for %{name}. + +%prep +%setup -q -n BCEL_5_2 + +gzip -dc %{SOURCE3} | tar xf - + +for j in $(find . -name "*.jar"); do + mv $j $j.no +done + +cp %{SOURCE2} build.xml +mkdir jakarta-site2/lib +pushd jakarta-site2/lib/ +%if "%{stage1}" != "1" + ln -sf $(build-classpath jdom) . + ln -sf $(build-classpath velocity) . + ln -sf $(build-classpath commons-collections) . + ln -sf $(build-classpath excalibur/avalon-logkit) . + ln -sf $(build-classpath werken-xpath) . +%endif +popd +%patch0 -b .sav +#ln -s %{_javadir}/regexp-1.5.jar regexp.jar + +sed -i 's/\r//' docs/verifier/V_API_SD.eps docs/eps/classloader.fig + +%build +export JAVA_HOME=%{javahome} + +export CLASSPATH="" +%if ! %bootstrap +CLASSPATH=$CLASSPATH:$(build-classpath anakia) +%endif +%if "%{stage1}" != "1" +CLASSPATH=$CLASSPATH:$(build-classpath antlr commons-collections excalibur/avalon-logkit) +CLASSPATH=$CLASSPATH:$(build-classpath junit-3.8.2 jdom oro velocity werken-xpath ant/ant-apache-regexp) +%else +CLASSPATH=$CLASSPATH:$(build-classpath junit-3.8.2) +%endif +ant \ + -Dbuild.dest=build/classes \ + -Dbuild.dir=build \ + -Ddocs.dest=docs \ + -Ddocs.src=xdocs \ + -Djakarta.site2=jakarta-site2 \ + -Djdom.jar="file://$(build-classpath jdom)" \ + -Dregexp.jar="file://$(build-classpath regexp)" \ + dist xdocs test + +# -Dbuild.dest=build/classes -Dbuild.dir=build -Ddocs.dest=docs \ +# -Ddocs.src=xdocs -Djdom.jar=$(build-classpath jdom) \ +# -Dregexp.jar="file://$(build-classpath regexp)" \ +# jar javadoc + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +mkdir -p %{buildroot}%{_javadir} +mkdir -p %{buildroot}%{_datadir}/maven2/poms + +install -m 644 dist/bcel-%{version}.jar \ + %{buildroot}%{_javadir}/bcel-%{version}.jar + +%add_to_maven_depmap bcel bcel %{version} JPP bcel +%add_to_maven_depmap org.apache.bcel bcel %{version} JPP bcel + +install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/maven2/poms/JPP-bcel.pom + +( + cd %{buildroot}%{_javadir} + for jar in *-%{version}*; do + ln -s ${jar} `echo $jar | %{__sed} "s|-%{version}||g"` + done +) + +mkdir -p %{buildroot}%{_javadocdir}/bcel-%{version} +cp -pr dist/docs/api/* %{buildroot}%{_javadocdir}/bcel-%{version} +ln -s bcel-%{version} %{buildroot}%{_javadocdir}/bcel + +%if "%{stage1}" != "1" +sed -i "s|./api/index.html|%{_javadocdir}/bcel-%{version}/index.html|" docs/index.html +%{_bindir}/aot-compile-rpm +%endif + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post +%update_maven_depmap +if [ -x %{_bindir}/rebuild-gcj-db ]; then + %{_bindir}/rebuild-gcj-db +fi + +%postun +%update_maven_depmap +if [ -x %{_bindir}/rebuild-gcj-db ]; then + %{_bindir}/rebuild-gcj-db +fi + +%files +%defattr(-,root,root) +%{_javadir}/bcel-%{version}.jar +%{_javadir}/bcel.jar +%if "%{stage1}" != "1" +%{_libdir}/gcj/jakarta-bcel/bcel-%{version}.jar.db +%{_libdir}/gcj/jakarta-bcel/bcel-%{version}.jar.so +%endif +%{_datadir}/maven2/poms +%{_mavendepmapfragdir} +%doc dist/*.txt dist/README.html + +%files javadoc +%defattr(-,root,root) +%{_javadocdir}/bcel-%{version} +%{_javadocdir}/bcel + +%files manual +%defattr(-,root,root) +%doc docs/* + +%changelog +* Wed Mar 12 2014 Silvan Calarco 5.2-11mamba +- build.xml: fix for encoding error with sun-java/openjdk 7 + +* Wed Mar 23 2011 gil 5.2-10mamba +- rebuilt with java-openjdk & java-gcj-compat support + +* Thu Nov 04 2010 gil 5.2-9mamba +- rebuilt devel + +* Thu Dec 10 2009 gil 5.2-8mamba +- rebuilt with anakia support + +* Sat Oct 03 2009 gil 5.2-7mamba +- added new subpackage: manual +- edit the API link in the index.html file in the subpackage manual +- added %%post %%postun ( ,javadoc) + +* Sat Oct 03 2009 gil 5.2-6mamba +- rebuilt with system excalibur-avalon-logkit + +* Wed Mar 18 2009 gil 5.2-5mamba +- used cvs source + +* Sat Mar 14 2009 gil 5.2-4mamba +- rebuilt + +* Mon Mar 09 2009 gil 5.2-3mamba +- rebuilt + +* Mon Mar 09 2009 gil 5.2-2mamba +- rebuilt + +* Wed Feb 18 2009 gil 5.2-1mamba +- package created by autospec