From 0f9c87c235dd562151c80dbb410988cb3713f493 Mon Sep 17 00:00:00 2001 From: markt Date: Mon, 7 Dec 2009 16:56:00 +0000 Subject: [PATCH] More BCEL pruning git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@887998 13f79535-47bb-0310-9956-ffa450edef68 --- .../util/bcel/generic/BranchInstruction.java | 9 +- java/org/apache/tomcat/util/bcel/generic/IFEQ.java | 48 ----- java/org/apache/tomcat/util/bcel/generic/IFGE.java | 48 ----- java/org/apache/tomcat/util/bcel/generic/IFGT.java | 48 ----- java/org/apache/tomcat/util/bcel/generic/IFLE.java | 48 ----- java/org/apache/tomcat/util/bcel/generic/IFLT.java | 48 ----- java/org/apache/tomcat/util/bcel/generic/IFNE.java | 48 ----- .../apache/tomcat/util/bcel/generic/IFNONNULL.java | 48 ----- .../apache/tomcat/util/bcel/generic/IFNULL.java | 48 ----- .../apache/tomcat/util/bcel/generic/IF_ACMPEQ.java | 48 ----- .../apache/tomcat/util/bcel/generic/IF_ACMPNE.java | 48 ----- .../apache/tomcat/util/bcel/generic/IF_ICMPEQ.java | 48 ----- .../apache/tomcat/util/bcel/generic/IF_ICMPGE.java | 48 ----- .../apache/tomcat/util/bcel/generic/IF_ICMPGT.java | 48 ----- .../apache/tomcat/util/bcel/generic/IF_ICMPLE.java | 48 ----- .../apache/tomcat/util/bcel/generic/IF_ICMPLT.java | 48 ----- .../apache/tomcat/util/bcel/generic/IF_ICMPNE.java | 48 ----- .../tomcat/util/bcel/generic/IfInstruction.java | 48 ----- .../tomcat/util/bcel/generic/LocalVariableGen.java | 1 - .../apache/tomcat/util/bcel/generic/MethodGen.java | 200 --------------------- .../tomcat/util/bcel/generic/StackConsumer.java | 28 --- 21 files changed, 1 insertion(+), 1053 deletions(-) delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IFEQ.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IFGE.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IFGT.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IFLE.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IFLT.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IFNE.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IFNONNULL.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IFNULL.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IF_ACMPEQ.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IF_ACMPNE.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IF_ICMPEQ.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IF_ICMPGE.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IF_ICMPGT.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IF_ICMPLE.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IF_ICMPLT.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IF_ICMPNE.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/IfInstruction.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/MethodGen.java delete mode 100644 java/org/apache/tomcat/util/bcel/generic/StackConsumer.java diff --git a/java/org/apache/tomcat/util/bcel/generic/BranchInstruction.java b/java/org/apache/tomcat/util/bcel/generic/BranchInstruction.java index 2e48b98c9..a08444b43 100644 --- a/java/org/apache/tomcat/util/bcel/generic/BranchInstruction.java +++ b/java/org/apache/tomcat/util/bcel/generic/BranchInstruction.java @@ -43,14 +43,7 @@ public abstract class BranchInstruction extends Instruction implements Instructi } - /** Common super constructor - * @param opcode Instruction opcode - * @param target instruction to branch to - */ - protected BranchInstruction(short opcode, InstructionHandle target) { - super(opcode, (short) 3); - setTarget(target); - } + /** diff --git a/java/org/apache/tomcat/util/bcel/generic/IFEQ.java b/java/org/apache/tomcat/util/bcel/generic/IFEQ.java deleted file mode 100644 index 21a907889..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IFEQ.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IFEQ - Branch if int comparison with zero succeeds - * - *
Stack: ..., value -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IFEQ extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IFEQ() { - } - - - public IFEQ(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IFEQ, target); - } - - - /** - * @return negation of instruction, e.g. IFEQ.negate() == IFNE - */ - public IfInstruction negate() { - return new IFNE(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IFGE.java b/java/org/apache/tomcat/util/bcel/generic/IFGE.java deleted file mode 100644 index 65098baec..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IFGE.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IFGE - Branch if int comparison with zero succeeds - * - *
Stack: ..., value -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IFGE extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IFGE() { - } - - - public IFGE(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IFGE, target); - } - - - /** - * @return negation of instruction - */ - public IfInstruction negate() { - return new IFLT(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IFGT.java b/java/org/apache/tomcat/util/bcel/generic/IFGT.java deleted file mode 100644 index 6f800d053..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IFGT.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IFGT - Branch if int comparison with zero succeeds - * - *
Stack: ..., value -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IFGT extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IFGT() { - } - - - public IFGT(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IFGT, target); - } - - - /** - * @return negation of instruction - */ - public IfInstruction negate() { - return new IFLE(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IFLE.java b/java/org/apache/tomcat/util/bcel/generic/IFLE.java deleted file mode 100644 index 160f8bb25..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IFLE.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IFLE - Branch if int comparison with zero succeeds - * - *
Stack: ..., value -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IFLE extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IFLE() { - } - - - public IFLE(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IFLE, target); - } - - - /** - * @return negation of instruction - */ - public IfInstruction negate() { - return new IFGT(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IFLT.java b/java/org/apache/tomcat/util/bcel/generic/IFLT.java deleted file mode 100644 index 88677eea6..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IFLT.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IFLT - Branch if int comparison with zero succeeds - * - *
Stack: ..., value -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IFLT extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IFLT() { - } - - - public IFLT(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IFLT, target); - } - - - /** - * @return negation of instruction - */ - public IfInstruction negate() { - return new IFGE(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IFNE.java b/java/org/apache/tomcat/util/bcel/generic/IFNE.java deleted file mode 100644 index eaa946307..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IFNE.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IFNE - Branch if int comparison with zero succeeds - * - *
Stack: ..., value -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IFNE extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IFNE() { - } - - - public IFNE(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IFNE, target); - } - - - /** - * @return negation of instruction - */ - public IfInstruction negate() { - return new IFEQ(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IFNONNULL.java b/java/org/apache/tomcat/util/bcel/generic/IFNONNULL.java deleted file mode 100644 index ae11e6654..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IFNONNULL.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IFNONNULL - Branch if reference is not null - * - *
Stack: ..., reference -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IFNONNULL extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IFNONNULL() { - } - - - public IFNONNULL(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IFNONNULL, target); - } - - - /** - * @return negation of instruction - */ - public IfInstruction negate() { - return new IFNULL(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IFNULL.java b/java/org/apache/tomcat/util/bcel/generic/IFNULL.java deleted file mode 100644 index 9c244bd62..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IFNULL.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IFNULL - Branch if reference is not null - * - *
Stack: ..., reference -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IFNULL extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IFNULL() { - } - - - public IFNULL(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IFNULL, target); - } - - - /** - * @return negation of instruction - */ - public IfInstruction negate() { - return new IFNONNULL(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IF_ACMPEQ.java b/java/org/apache/tomcat/util/bcel/generic/IF_ACMPEQ.java deleted file mode 100644 index 8ce1b29e0..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IF_ACMPEQ.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IF_ACMPEQ - Branch if reference comparison succeeds - * - *
Stack: ..., value1, value2 -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IF_ACMPEQ extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IF_ACMPEQ() { - } - - - public IF_ACMPEQ(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IF_ACMPEQ, target); - } - - - /** - * @return negation of instruction - */ - public IfInstruction negate() { - return new IF_ACMPNE(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IF_ACMPNE.java b/java/org/apache/tomcat/util/bcel/generic/IF_ACMPNE.java deleted file mode 100644 index 08776f37a..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IF_ACMPNE.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IF_ACMPNE - Branch if reference comparison doesn't succeed - * - *
Stack: ..., value1, value2 -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IF_ACMPNE extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IF_ACMPNE() { - } - - - public IF_ACMPNE(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IF_ACMPNE, target); - } - - - /** - * @return negation of instruction - */ - public IfInstruction negate() { - return new IF_ACMPEQ(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IF_ICMPEQ.java b/java/org/apache/tomcat/util/bcel/generic/IF_ICMPEQ.java deleted file mode 100644 index 02227dde0..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IF_ICMPEQ.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IF_ICMPEQ - Branch if int comparison succeeds - * - *
Stack: ..., value1, value2 -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IF_ICMPEQ extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IF_ICMPEQ() { - } - - - public IF_ICMPEQ(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IF_ICMPEQ, target); - } - - - /** - * @return negation of instruction - */ - public IfInstruction negate() { - return new IF_ICMPNE(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IF_ICMPGE.java b/java/org/apache/tomcat/util/bcel/generic/IF_ICMPGE.java deleted file mode 100644 index 383b940c0..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IF_ICMPGE.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IF_ICMPGE - Branch if int comparison succeeds - * - *
Stack: ..., value1, value2 -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IF_ICMPGE extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IF_ICMPGE() { - } - - - public IF_ICMPGE(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IF_ICMPGE, target); - } - - - /** - * @return negation of instruction - */ - public IfInstruction negate() { - return new IF_ICMPLT(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IF_ICMPGT.java b/java/org/apache/tomcat/util/bcel/generic/IF_ICMPGT.java deleted file mode 100644 index f1c817e16..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IF_ICMPGT.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IF_ICMPGT - Branch if int comparison succeeds - * - *
Stack: ..., value1, value2 -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IF_ICMPGT extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IF_ICMPGT() { - } - - - public IF_ICMPGT(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IF_ICMPGT, target); - } - - - /** - * @return negation of instruction - */ - public IfInstruction negate() { - return new IF_ICMPLE(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IF_ICMPLE.java b/java/org/apache/tomcat/util/bcel/generic/IF_ICMPLE.java deleted file mode 100644 index caf761628..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IF_ICMPLE.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IF_ICMPLE - Branch if int comparison succeeds - * - *
Stack: ..., value1, value2 -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IF_ICMPLE extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IF_ICMPLE() { - } - - - public IF_ICMPLE(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IF_ICMPLE, target); - } - - - /** - * @return negation of instruction - */ - public IfInstruction negate() { - return new IF_ICMPGT(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IF_ICMPLT.java b/java/org/apache/tomcat/util/bcel/generic/IF_ICMPLT.java deleted file mode 100644 index 6ff23c07d..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IF_ICMPLT.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IF_ICMPLT - Branch if int comparison succeeds - * - *
Stack: ..., value1, value2 -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IF_ICMPLT extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IF_ICMPLT() { - } - - - public IF_ICMPLT(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IF_ICMPLT, target); - } - - - /** - * @return negation of instruction - */ - public IfInstruction negate() { - return new IF_ICMPGE(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IF_ICMPNE.java b/java/org/apache/tomcat/util/bcel/generic/IF_ICMPNE.java deleted file mode 100644 index f0a9172de..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IF_ICMPNE.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * IF_ICMPNE - Branch if int comparison doesn't succeed - * - *
Stack: ..., value1, value2 -> ...
- * - * @version $Id$ - * @author M. Dahm - */ -public class IF_ICMPNE extends IfInstruction { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IF_ICMPNE() { - } - - - public IF_ICMPNE(InstructionHandle target) { - super(org.apache.tomcat.util.bcel.Constants.IF_ICMPNE, target); - } - - - /** - * @return negation of instruction - */ - public IfInstruction negate() { - return new IF_ICMPEQ(target); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/IfInstruction.java b/java/org/apache/tomcat/util/bcel/generic/IfInstruction.java deleted file mode 100644 index df8895000..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/IfInstruction.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * Super class for the IFxxx family of instructions. - * - * @version $Id$ - * @author M. Dahm - */ -public abstract class IfInstruction extends BranchInstruction implements StackConsumer { - - /** - * Empty constructor needed for the Class.newInstance() statement in - * Instruction.readInstruction(). Not to be used otherwise. - */ - IfInstruction() { - } - - - /** - * @param opcode opcode of instruction - * @param target Target instruction to branch to - */ - protected IfInstruction(short opcode, InstructionHandle target) { - super(opcode, target); - } - - - /** - * @return negation of instruction, e.g. IFEQ.negate() == IFNE - */ - public abstract IfInstruction negate(); -} diff --git a/java/org/apache/tomcat/util/bcel/generic/LocalVariableGen.java b/java/org/apache/tomcat/util/bcel/generic/LocalVariableGen.java index 97ebeb8a8..1e9ca620d 100644 --- a/java/org/apache/tomcat/util/bcel/generic/LocalVariableGen.java +++ b/java/org/apache/tomcat/util/bcel/generic/LocalVariableGen.java @@ -27,7 +27,6 @@ import org.apache.tomcat.util.bcel.classfile.LocalVariable; * @version $Id$ * @author M. Dahm * @see LocalVariable - * @see MethodGen */ public class LocalVariableGen implements InstructionTargeter, NamedAndTyped, Cloneable, java.io.Serializable { diff --git a/java/org/apache/tomcat/util/bcel/generic/MethodGen.java b/java/org/apache/tomcat/util/bcel/generic/MethodGen.java deleted file mode 100644 index d6f8599f7..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/MethodGen.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import org.apache.tomcat.util.bcel.classfile.Attribute; -import org.apache.tomcat.util.bcel.classfile.Code; -import org.apache.tomcat.util.bcel.classfile.ExceptionTable; -import org.apache.tomcat.util.bcel.classfile.LocalVariable; -import org.apache.tomcat.util.bcel.classfile.LocalVariableTable; -import org.apache.tomcat.util.bcel.classfile.Method; -import org.apache.tomcat.util.bcel.classfile.Utility; -import org.apache.tomcat.util.bcel.util.BCELComparator; - -/** - * Template class for building up a method. This is done by defining exception - * handlers, adding thrown exceptions, local variables and attributes, whereas - * the `LocalVariableTable' and `LineNumberTable' attributes will be set - * automatically for the code. Use stripAttributes() if you don't like this. - * - * While generating code it may be necessary to insert NOP operations. You can - * use the `removeNOPs' method to get rid off them. - * The resulting method object can be obtained via the `getMethod()' method. - * - * @version $Id$ - * @author M. Dahm - * @author Patrick C. Beard [setMaxStack()] - * @see InstructionList - * @see Method - */ -public class MethodGen extends FieldGenOrMethodGen { - - private Type[] arg_types; - private InstructionList il; - private List variable_vec = new ArrayList(); - private List throws_vec = new ArrayList(); - - private static BCELComparator _cmp = new BCELComparator() { - - public boolean equals( Object o1, Object o2 ) { - MethodGen THIS = (MethodGen) o1; - MethodGen THAT = (MethodGen) o2; - return THIS.getName().equals(THAT.getName()) - && THIS.getSignature().equals(THAT.getSignature()); - } - - - public int hashCode( Object o ) { - MethodGen THIS = (MethodGen) o; - return THIS.getSignature().hashCode() ^ THIS.getName().hashCode(); - } - }; - - - /** - * Sort local variables by index - */ - private static final void sort( LocalVariableGen[] vars, int l, int r ) { - int i = l, j = r; - int m = vars[(l + r) / 2].getIndex(); - LocalVariableGen h; - do { - while (vars[i].getIndex() < m) { - i++; - } - while (m < vars[j].getIndex()) { - j--; - } - if (i <= j) { - h = vars[i]; - vars[i] = vars[j]; - vars[j] = h; // Swap elements - i++; - j--; - } - } while (i <= j); - if (l < j) { - sort(vars, l, j); - } - if (i < r) { - sort(vars, i, r); - } - } - - - /* - * If the range of the variable has not been set yet, it will be set to be valid from - * the start to the end of the instruction list. - * - * @return array of declared local variables sorted by index - */ - public LocalVariableGen[] getLocalVariables() { - int size = variable_vec.size(); - LocalVariableGen[] lg = new LocalVariableGen[size]; - variable_vec.toArray(lg); - for (int i = 0; i < size; i++) { - if (lg[i].getStart() == null) { - lg[i].setStart(il.getStart()); - } - if (lg[i].getEnd() == null) { - lg[i].setEnd(il.getEnd()); - } - } - if (size > 1) { - sort(lg, 0, size - 1); - } - return lg; - } - - - /** - * @return `LocalVariableTable' attribute of all the local variables of this method. - */ - public LocalVariableTable getLocalVariableTable( ConstantPoolGen cp ) { - LocalVariableGen[] lg = getLocalVariables(); - int size = lg.length; - LocalVariable[] lv = new LocalVariable[size]; - for (int i = 0; i < size; i++) { - lv[i] = lg[i].getLocalVariable(cp); - } - return new LocalVariableTable(cp.addUtf8("LocalVariableTable"), 2 + lv.length * 10, lv, cp - .getConstantPool()); - } - - - public String getSignature() { - return Type.getMethodSignature(type, arg_types); - } - - - /** - * Return string representation close to declaration format, - * `public static void main(String[]) throws IOException', e.g. - * - * @return String representation of the method. - */ - public final String toString() { - String access = Utility.accessToString(access_flags); - String signature = Type.getMethodSignature(type, arg_types); - signature = Utility.methodSignatureToString(signature, name, access, true, - getLocalVariableTable(cp)); - StringBuffer buf = new StringBuffer(signature); - for (int i = 0; i < getAttributes().length; i++) { - Attribute a = getAttributes()[i]; - if (!((a instanceof Code) || (a instanceof ExceptionTable))) { - buf.append(" [").append(a.toString()).append("]"); - } - } - - if (throws_vec.size() > 0) { - for (Iterator e = throws_vec.iterator(); e.hasNext();) { - buf.append("\n\t\tthrows ").append(e.next()); - } - } - return buf.toString(); - } - - - - - - - /** - * Return value as defined by given BCELComparator strategy. - * By default two MethodGen objects are said to be equal when - * their names and signatures are equal. - * - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals( Object obj ) { - return _cmp.equals(this, obj); - } - - - /** - * Return value as defined by given BCELComparator strategy. - * By default return the hashcode of the method's name XOR signature. - * - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return _cmp.hashCode(this); - } -} diff --git a/java/org/apache/tomcat/util/bcel/generic/StackConsumer.java b/java/org/apache/tomcat/util/bcel/generic/StackConsumer.java deleted file mode 100644 index b02cce443..000000000 --- a/java/org/apache/tomcat/util/bcel/generic/StackConsumer.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2000-2009 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.tomcat.util.bcel.generic; - -/** - * Denote an instruction that may consume a value from the stack. - * - * @version $Id$ - * @author M. Dahm - */ -public interface StackConsumer { - - -} -- 2.11.0