stack = new Stack<>();
33 |
34 | public boolean empty() {
35 | return stack.empty();
36 | }
37 |
38 | public JavaClass pop() {
39 | return stack.pop();
40 | }
41 |
42 | public void push(final JavaClass clazz) {
43 | stack.push(clazz);
44 | }
45 |
46 | public JavaClass top() {
47 | return stack.peek();
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/bcel/util/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * Utility classes for the Apache Byte Code Engineering Library (BCEL), namely:
22 | *
23 | * - Collection classes for JavaClass objects
24 | * - A converter for class files to HTML
25 | * - A tool to find instructions patterns via regular expressions
26 | * - A class to find classes as defined in the CLASSPATH
27 | * - A class loader that allows to create classes at run time
28 | *
29 | */
30 | package org.apache.bcel.util;
31 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/bcel/verifier/VerifierFactoryObserver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier;
20 |
21 | /**
22 | * VerifierFactoryObserver instances are notified when new Verifier instances are created.
23 | *
24 | *
25 | * @see VerifierFactory#getVerifier(String)
26 | * @see VerifierFactory#getVerifiers()
27 | * @see VerifierFactory#attach(VerifierFactoryObserver)
28 | * @see VerifierFactory#detach(VerifierFactoryObserver)
29 | */
30 | public interface VerifierFactoryObserver {
31 |
32 | /**
33 | * VerifierFactoryObserver instances are notified invoking this method. The String argument is the fully qualified class
34 | * name of a class a new Verifier instance created by the VerifierFactory operates on.
35 | */
36 | void update(String s);
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/bcel/verifier/exc/InvalidMethodException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.exc;
20 |
21 | /**
22 | * Instances of this class are thrown by BCEL's class file verifier "JustIce" when the verification of a method is
23 | * requested that does not exist.
24 | */
25 | public class InvalidMethodException extends RuntimeException {
26 |
27 | private static final long serialVersionUID = -7060302743724808051L;
28 |
29 | /** Constructs an InvalidMethodException with the specified detail message. */
30 | public InvalidMethodException(final String message) {
31 | super(message);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/bcel/verifier/exc/Utility.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.exc;
20 |
21 | import java.io.PrintWriter;
22 | import java.io.StringWriter;
23 |
24 | /**
25 | * A utility class providing convenience methods concerning Throwable instances.
26 | *
27 | * @see Throwable
28 | */
29 | public final class Utility {
30 | /** This method returns the stack trace of a Throwable instance as a String. */
31 | public static String getStackTrace(final Throwable t) {
32 | final StringWriter sw = new StringWriter();
33 | final PrintWriter pw = new PrintWriter(sw);
34 | t.printStackTrace(pw);
35 | return sw.toString();
36 | }
37 |
38 | /** This class is not instantiable. */
39 | private Utility() {
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/bcel/verifier/exc/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * Exception classes used by JustIce, mostly used internally. You don't need to bother with them.
22 | * Package Specification
23 | *
24 | * Contained in this package are Exception classes for use with the JustIce verifier.
25 | *
26 | */
27 | package org.apache.bcel.verifier.exc;
28 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/bcel/verifier/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * BCEL's verifier JustIce is there to help you dump correct Java class files created or modified with BCEL.
22 | * Package Specification
23 | *
24 | * This is the top-level package of the JustIce verifier. To actually use it, have a look at the VerifierFactory and Verifier classes.
25 | *
26 | */
27 | package org.apache.bcel.verifier;
28 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/bcel/verifier/statics/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * PassVerifier classes used internally by JustIce. You don't need to bother with them.
22 | * Package Specification
23 | *
24 | * Contained in this package are PassVerifier classes for use with the JustIce verifier. Only the passes performing what Sun calls 'static constraints' have
25 | * PassVerifier classes here.
26 | *
27 | */
28 | package org.apache.bcel.verifier.statics;
29 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/bcel/verifier/structurals/GenericArray.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.structurals;
20 |
21 | import java.io.Serializable;
22 |
23 | /**
24 | * A placeholder class that can be used to create an ObjectType of which has some of the properties arrays have. They
25 | * implement {@link Cloneable} and {@link Serializable} and they extend {@link Object}.
26 | */
27 | public class GenericArray implements Cloneable, Serializable {
28 |
29 | private static final long serialVersionUID = 1991183963515237894L;
30 |
31 | @Override
32 | protected Object clone() throws CloneNotSupportedException {
33 | return super.clone();
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/org/apache/bcel/verifier/structurals/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * A PassVerifier class mostly used internally by JustIce, yielding a control flow graph for public use as a nice side effect.
22 | * Package Specification
23 | *
24 | * This package contains a PassVerifier class for use with the JustIce verifier and its utility classes. Only the pass performing what Sun calls "Structural
25 | * Constraints on Java Virtual Machine Code" has a PassVerifier class here. JustIce calls this pass "Pass 3b".
26 | *
27 | */
28 | package org.apache.bcel.verifier.structurals;
29 |
--------------------------------------------------------------------------------
/src/site/resources/download_bcel.cgi:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Just call the standard mirrors.cgi script. It will use download.html
3 | # as the input template.
4 | exec /www/www.apache.org/dyn/mirrors/mirrors.cgi $*
--------------------------------------------------------------------------------
/src/site/resources/images/bcel-logo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/bcel-logo.gif
--------------------------------------------------------------------------------
/src/site/resources/images/classfile.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/classfile.gif
--------------------------------------------------------------------------------
/src/site/resources/images/classgen.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/classgen.gif
--------------------------------------------------------------------------------
/src/site/resources/images/classloader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/classloader.gif
--------------------------------------------------------------------------------
/src/site/resources/images/constantpool.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/constantpool.gif
--------------------------------------------------------------------------------
/src/site/resources/images/il.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/il.gif
--------------------------------------------------------------------------------
/src/site/resources/images/instructions.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/instructions.gif
--------------------------------------------------------------------------------
/src/site/resources/images/javaclass.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/javaclass.gif
--------------------------------------------------------------------------------
/src/site/resources/images/jvm.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/jvm.gif
--------------------------------------------------------------------------------
/src/site/resources/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/site/resources/images/logo.png
--------------------------------------------------------------------------------
/src/site/resources/profile.jacoco:
--------------------------------------------------------------------------------
1 | // Licensed to the Apache Software Foundation (ASF) under one
2 | // or more contributor license agreements. See the NOTICE file
3 | // distributed with this work for additional information
4 | // regarding copyright ownership. The ASF licenses this file
5 | // to you under the Apache License, Version 2.0 (the
6 | // "License"); you may not use this file except in compliance
7 | // with the License. You may obtain a copy of the License at
8 | //
9 | // https://www.apache.org/licenses/LICENSE-2.0
10 | //
11 | // Unless required by applicable law or agreed to in writing,
12 | // software distributed under the License is distributed on an
13 | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | // KIND, either express or implied. See the License for the
15 | // specific language governing permissions and limitations
16 | // under the License.
17 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/NanoTimer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel;
21 |
22 | public class NanoTimer {
23 |
24 | private long timeNanos;
25 |
26 | public void reset() {
27 | timeNanos = 0;
28 | }
29 |
30 | public NanoTimer start() {
31 | timeNanos -= System.nanoTime();
32 | return this;
33 | }
34 |
35 | public void stop() {
36 | timeNanos += System.nanoTime();
37 | }
38 |
39 | public void subtract(final NanoTimer o) {
40 | timeNanos -= o.timeNanos;
41 | }
42 |
43 | /**
44 | * May ony be called after stop has been called as many times as start.
45 | */
46 | @Override
47 | public String toString() {
48 | return (double) timeNanos / 1000000000 + " s";
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/classfile/CodeExceptionTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.classfile;
20 |
21 | import org.apache.bcel.Constants;
22 | import org.junit.jupiter.api.Test;
23 |
24 | public class CodeExceptionTestCase {
25 |
26 | /**
27 | * Tests that we do not break binary compatibility with BCEL-330.
28 | */
29 | @Test
30 | public void testReferenceToConstant() {
31 | @SuppressWarnings("unused")
32 | final short referenceToConstant = Constants.AALOAD;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/classfile/ConstantTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.classfile;
21 |
22 | import static org.junit.jupiter.api.Assertions.assertFalse;
23 | import static org.junit.jupiter.api.Assertions.assertTrue;
24 |
25 | import org.junit.jupiter.api.Test;
26 |
27 | /**
28 | * Tests {@link Constant}.
29 | */
30 | public class ConstantTest {
31 |
32 | @Test
33 | public void testBCELComparator() throws Exception {
34 | final Constant obj = new ConstantClass(1);
35 | assertTrue(Constant.getComparator().equals(null, null));
36 | assertTrue(Constant.getComparator().equals(obj, obj));
37 | assertFalse(Constant.getComparator().equals(obj, null));
38 | assertFalse(Constant.getComparator().equals(null, obj));
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/classfile/FieldTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.classfile;
21 |
22 | import static org.junit.jupiter.api.Assertions.assertFalse;
23 | import static org.junit.jupiter.api.Assertions.assertTrue;
24 |
25 | import org.junit.jupiter.api.Test;
26 |
27 | /**
28 | * Tests {@link Field}.
29 | */
30 | public class FieldTest {
31 |
32 | @Test
33 | public void testBCELComparator() throws Exception {
34 | final Field obj = new Field(1, 1, 1, null, null);
35 | assertTrue(Field.getComparator().equals(null, null));
36 | assertTrue(Field.getComparator().equals(obj, obj));
37 | assertFalse(Field.getComparator().equals(obj, null));
38 | assertFalse(Field.getComparator().equals(null, obj));
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/classfile/LocalVariableTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.classfile;
20 |
21 | import org.apache.bcel.Constants;
22 | import org.junit.jupiter.api.Test;
23 |
24 | public class LocalVariableTestCase {
25 |
26 | /**
27 | * Tests that we do not break binary compatibility with BCEL-330.
28 | */
29 | @Test
30 | public void testReferenceToConstant() {
31 | @SuppressWarnings("unused")
32 | final short referenceToConstant = Constants.AALOAD;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/classfile/StackMapTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.classfile;
21 |
22 | import static org.junit.jupiter.api.Assertions.assertArrayEquals;
23 |
24 | import org.junit.jupiter.api.Test;
25 |
26 | /**
27 | * Tests {@link StackMap}.
28 | */
29 | public class StackMapTest {
30 |
31 | @Test
32 | public void testSetStackMap() {
33 | final StackMap stackMap = new StackMap(0, 0, StackMapEntry.EMPTY_ARRAY, new ConstantPool(new Constant[] { new ConstantLong(0) }));
34 | // No NPE
35 | stackMap.setStackMap(null);
36 | assertArrayEquals(StackMapEntry.EMPTY_ARRAY, stackMap.getStackMap());
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/AnnotatedFields.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | public class AnnotatedFields {
23 | @SimpleAnnotation(id = 1)
24 | int i;
25 |
26 | @SimpleAnnotation(id = 2)
27 | String s;
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/AnnotatedWithCombinedAnnotation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | @CombinedAnnotation({@SimpleAnnotation(id = 4)})
23 | public class AnnotatedWithCombinedAnnotation {
24 | public AnnotatedWithCombinedAnnotation(final int param1, @SimpleAnnotation(id = 42) final int param2) {
25 | }
26 |
27 | @CombinedAnnotation({@SimpleAnnotation(id = 1, fruit = "apples"), @SimpleAnnotation(id = 2, fruit = "oranges")})
28 | public void methodWithArrayOfTwoAnnotations() {
29 | }
30 |
31 | @CombinedAnnotation({})
32 | public void methodWithArrayOfZeroAnnotations() {
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/AnnotatedWithEnumClass.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | @AnnotationEnumElement(enumval = SimpleEnum.Red)
23 | public class AnnotatedWithEnumClass {
24 | }
25 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/AnnotationEnumElement.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.RetentionPolicy;
24 |
25 | @Retention(RetentionPolicy.RUNTIME)
26 | public @interface AnnotationEnumElement {
27 | SimpleEnum enumval();
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/AnonymousClassTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | public class AnonymousClassTest {
23 | final class X {
24 | }
25 |
26 | static class Y {
27 | }
28 |
29 | public void foo() {
30 | new Runnable() {
31 | @Override
32 | public void run() {
33 | }
34 | }.run();
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/AttributeTestClassEM01.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | public class AttributeTestClassEM01 {
23 | public static void main(final String[] argv) {
24 | @SuppressWarnings("unused")
25 | final class S {
26 | public void sayhello() {
27 | System.err.println("hello");
28 | }
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/AttributeTestClassEM02.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | public class AttributeTestClassEM02 {
23 | public static void main(final String[] argv) {
24 | }
25 |
26 | Runnable r = new Runnable() {
27 | @Override
28 | public void run() {
29 | System.err.println("hello");
30 | }
31 | };
32 | }
33 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/CombinedAnnotation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.RetentionPolicy;
24 |
25 | @Retention(RetentionPolicy.RUNTIME)
26 | public @interface CombinedAnnotation {
27 | SimpleAnnotation[] value();
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/ComplexAnnotatedClass.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | @ComplexAnnotation(ival = 4, bval = 2, cval = '5', fval = 3.0f, dval = 33.4, zval = false, jval = 56, sval = 99)
23 | public class ComplexAnnotatedClass {
24 | }
25 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/ComplexAnnotation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.RetentionPolicy;
24 |
25 | @Retention(RetentionPolicy.RUNTIME)
26 | public @interface ComplexAnnotation {
27 | byte bval();
28 |
29 | char cval();
30 |
31 | double dval();
32 |
33 | float fval();
34 |
35 | int ival();
36 |
37 | long jval();
38 |
39 | short sval();
40 |
41 | boolean zval();
42 | }
43 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/EmptyClass.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | public class EmptyClass {
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/MarkedType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | @MarkerAnnotationInvisible
23 | @MarkerAnnotation
24 | public class MarkedType {
25 | }
26 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/MarkerAnnotation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.RetentionPolicy;
24 |
25 | @Retention(RetentionPolicy.RUNTIME)
26 | public @interface MarkerAnnotation {
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/MarkerAnnotationInvisible.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.RetentionPolicy;
24 |
25 | @Retention(RetentionPolicy.CLASS)
26 | public @interface MarkerAnnotationInvisible {
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/PLSETestClass.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | import java.util.ArrayList;
23 |
24 | public class PLSETestClass {
25 | public void meth1(final int arg1) {
26 | @SuppressWarnings("unused")
27 | final int local1 = arg1;
28 | }
29 |
30 | public void meth2(final int arg1, final ArrayList arg2, final int arg3) {
31 | @SuppressWarnings("unused")
32 | final int local1 = arg1;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/PLSETestClass2.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | public class PLSETestClass2 {
23 | public static void main(final String[] args) {
24 | @SuppressWarnings("unused")
25 | int t = 0;
26 |
27 | for (int i = 0; i < 100; i++) {
28 | t += i;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/PLSETestEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | public enum PLSETestEnum {
23 | TEST_VALUE
24 | }
25 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/SimpleAnnotatedClass.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | @SimpleAnnotation(id = 4)
23 | public class SimpleAnnotatedClass {
24 | }
25 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/SimpleAnnotation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | import java.lang.annotation.Retention;
23 | import java.lang.annotation.RetentionPolicy;
24 |
25 | @Retention(RetentionPolicy.RUNTIME)
26 | public @interface SimpleAnnotation {
27 | String fruit() default "bananas";
28 |
29 | int id();
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/SimpleClass.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | public class SimpleClass {
23 | public static void main(final String[] argv) {
24 | // Nothing unusual in this class
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/SimpleClassHasMethodIncludeGenericArgument.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.data;
20 |
21 | import java.util.List;
22 |
23 | public class SimpleClassHasMethodIncludeGenericArgument {
24 | public static void a(final String a1, final List a2) {
25 | }
26 |
27 | public static void b(final String b1, @SuppressWarnings("rawtypes") final List b2) {
28 | }
29 |
30 | public static void c(final String c1, final String c2) {
31 | }
32 |
33 | public static void d(final List d1, final String d2) {
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/SimpleClassWithDefaultConstructor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | public class SimpleClassWithDefaultConstructor {
23 |
24 | public SimpleClassWithDefaultConstructor() {
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/data/SimpleEnum.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.data;
21 |
22 | public enum SimpleEnum {
23 | Red, Orange, Yellow, Green, Blue, Indigo, Violet
24 | }
25 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/BREAKPOINTTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class BREAKPOINTTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final BREAKPOINT breakpoint = new BREAKPOINT();
30 | breakpoint.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setBreakpoint(1);
33 | assertEquals(expected, countVisitor);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/D2FTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class D2FTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final D2F d2f = new D2F();
30 | d2f.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setConversionInstruction(1);
36 | expected.setD2F(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/D2ITestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class D2ITestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final D2I d2i = new D2I();
30 | d2i.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setConversionInstruction(1);
36 | expected.setD2I(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/D2LTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class D2LTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final D2L d2l = new D2L();
30 | d2l.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setConversionInstruction(1);
36 | expected.setD2L(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/DADDTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class DADDTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final DADD dadd = new DADD();
30 | dadd.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setArithmeticInstruction(1);
36 | expected.setDadd(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/DDIVTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class DDIVTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final DDIV ddiv = new DDIV();
30 | ddiv.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setArithmeticInstruction(1);
36 | expected.setDdiv(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/DMULTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class DMULTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final DMUL dmul = new DMUL();
30 | dmul.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setArithmeticInstruction(1);
36 | expected.setDmul(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/DNEGTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class DNEGTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final DNEG dneg = new DNEG();
30 | dneg.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setArithmeticInstruction(1);
36 | expected.setDneg(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/DREMTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class DREMTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final DREM drem = new DREM();
30 | drem.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setArithmeticInstruction(1);
36 | expected.setDrem(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/DSUBTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class DSUBTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final DSUB dsub = new DSUB();
30 | dsub.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setArithmeticInstruction(1);
36 | expected.setDsub(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/EmptyStaticInit.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | /**
22 | */
23 | public class EmptyStaticInit {
24 |
25 | static {
26 | // empty
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/F2DTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class F2DTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final F2D f2d = new F2D();
30 | f2d.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setConversionInstruction(1);
36 | expected.setF2D(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/F2ITestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class F2ITestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final F2I f2i = new F2I();
30 | f2i.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setConversionInstruction(1);
36 | expected.setF2I(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/F2LTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class F2LTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final F2L f2l = new F2L();
30 | f2l.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setConversionInstruction(1);
36 | expected.setF2L(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/FADDTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class FADDTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final FADD fadd = new FADD();
30 | fadd.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setArithmeticInstruction(1);
36 | expected.setFadd(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/FDIVTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class FDIVTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final FDIV fdiv = new FDIV();
30 | fdiv.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setArithmeticInstruction(1);
36 | expected.setFdiv(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/I2BTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class I2BTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final I2B i2b = new I2B();
30 | i2b.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setConversionInstruction(1);
36 | expected.setI2B(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/I2CTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class I2CTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final I2C i2c = new I2C();
30 | i2c.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setConversionInstruction(1);
36 | expected.setI2C(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/I2DTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class I2DTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final I2D i2d = new I2D();
30 | i2d.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setConversionInstruction(1);
36 | expected.setI2D(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/I2FTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class I2FTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final I2F i2f = new I2F();
30 | i2f.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setConversionInstruction(1);
36 | expected.setI2F(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/I2LTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class I2LTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final I2L i2l = new I2L();
30 | i2l.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setConversionInstruction(1);
36 | expected.setI2L(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/I2STestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class I2STestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final I2S i2s = new I2S();
30 | i2s.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setConversionInstruction(1);
36 | expected.setI2S(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/IMPDEP1TestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class IMPDEP1TestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final IMPDEP1 impdep1 = new IMPDEP1();
30 | impdep1.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setImpdep1(1);
33 | assertEquals(expected, countVisitor);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/IMPDEP2TestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class IMPDEP2TestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final IMPDEP2 impdep2 = new IMPDEP2();
30 | impdep2.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setImpdep2(1);
33 | assertEquals(expected, countVisitor);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/IORTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class IORTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final IOR ior = new IOR();
30 | ior.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setArithmeticInstruction(1);
36 | expected.setIor(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/L2DTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class L2DTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final L2D l2d = new L2D();
30 | l2d.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setConversionInstruction(1);
36 | expected.setL2D(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/L2FTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class L2FTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final L2F l2f = new L2F();
30 | l2f.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setConversionInstruction(1);
36 | expected.setL2F(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/L2ITestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class L2ITestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final L2I l2i = new L2I();
30 | l2i.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setConversionInstruction(1);
36 | expected.setL2I(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/LCMPTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class LCMPTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final LCMP lcmp = new LCMP();
30 | lcmp.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setLcmp(1);
36 | assertEquals(expected, countVisitor);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/LORTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.generic;
20 |
21 | import static org.junit.jupiter.api.Assertions.assertEquals;
22 |
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class LORTestCase {
26 | @Test
27 | public void testAccept() {
28 | final CountingVisitor countVisitor = new CountingVisitor();
29 | final LOR lor = new LOR();
30 | lor.accept(countVisitor);
31 | final CountingVisitor expected = new CountingVisitor();
32 | expected.setTypedInstruction(1);
33 | expected.setStackProducer(1);
34 | expected.setStackConsumer(1);
35 | expected.setArithmeticInstruction(1);
36 | expected.setLor(1);
37 | assertEquals(expected, countVisitor);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/generic/ObjectTypeTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.generic;
21 |
22 | import static org.junit.jupiter.api.Assertions.assertEquals;
23 |
24 | import java.math.BigDecimal;
25 |
26 | import org.junit.jupiter.api.Test;
27 |
28 | public class ObjectTypeTest {
29 |
30 | @Test
31 | public void testGetClassName() {
32 | final String className = BigDecimal.class.getName();
33 | final ObjectType objectType = ObjectType.getInstance(className);
34 | assertEquals(className, objectType.getClassName());
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/JiraBcel291TestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.verifier;
21 |
22 | import org.junit.jupiter.api.Disabled;
23 | import org.junit.jupiter.api.Test;
24 |
25 | @Disabled
26 | public class JiraBcel291TestCase {
27 |
28 | @Test
29 | public void test() throws ClassNotFoundException {
30 | Verifier.verifyType("org.apache.bcel.verifier.tests.JiraBcel291TestFixture");
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/JiraBcel369TestFixture.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier;
20 |
21 | final class JiraBcel369TestFixture {
22 |
23 | JiraBcel369TestFixture(int i) {
24 | try {
25 | i++;
26 | } finally {
27 | if (i == 0) {
28 | return;
29 | }
30 | int u = 7;
31 | u += 9;
32 | }
33 | i++;
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/VerifierThrowTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.verifier;
21 |
22 | import java.io.IOException;
23 |
24 | import org.apache.bcel.verifier.tests.TestThrow01Creator;
25 | import org.junit.jupiter.api.Test;
26 |
27 | public class VerifierThrowTestCase extends AbstractVerifierTestCase {
28 | @Test
29 | public void testThrowEmptyStack() throws IOException, ClassNotFoundException {
30 | new TestThrow01Creator().create();
31 | assertVerifyRejected("TestThrow01", "Verification of a method with ATHROW instruction on an empty stack must fail.");
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/VerifyJavaMathTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.verifier;
21 |
22 | import static org.junit.jupiter.api.Assertions.assertTrue;
23 |
24 | import org.junit.jupiter.api.Disabled;
25 | import org.junit.jupiter.api.Test;
26 |
27 | public class VerifyJavaMathTestCase extends AbstractVerifierTestCase {
28 |
29 | @Test
30 | @Disabled
31 | //@EnabledOnJre(JRE.JAVA_8)
32 | public void testBigDecimal() throws ClassNotFoundException {
33 | assertTrue(doAllPasses("java.math.BigDecimal"));
34 | }
35 |
36 | @Disabled
37 | @Test
38 | public void testBigInteger() throws ClassNotFoundException {
39 | assertTrue(doAllPasses("java.math.BigInteger"));
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/input/FieldVerifierSuperClass.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.verifier.input;
21 |
22 | public class FieldVerifierSuperClass {
23 |
24 | public int publicField;
25 | private final int privateField;
26 | protected int protectedField;
27 | int packagePrivateField;
28 |
29 | public FieldVerifierSuperClass(final int publicField, final int privateField, final int protectedField, final int packagePrivateField) {
30 | this.publicField = publicField;
31 | this.privateField = privateField;
32 | this.protectedField = protectedField;
33 | this.packagePrivateField = packagePrivateField;
34 | }
35 |
36 | public int getPrivateField() {
37 | return privateField;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/statics/Pass2VerifierTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.verifier.statics;
21 |
22 | import org.apache.bcel.Constants;
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class Pass2VerifierTestCase {
26 |
27 | /**
28 | * Tests that we do not break binary compatibility with BCEL-330.
29 | */
30 | @Test
31 | public void testReferenceToConstant() {
32 | @SuppressWarnings("unused")
33 | final short referenceToConstant = Constants.AALOAD;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/structurals/UninitializedObjectTypeTestCase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.verifier.structurals;
21 |
22 | import org.apache.bcel.Constants;
23 | import org.junit.jupiter.api.Test;
24 |
25 | public class UninitializedObjectTypeTestCase {
26 |
27 | /**
28 | * Tests that we do not break binary compatibility with BCEL-330.
29 | */
30 | @Test
31 | public void testReferenceToConstant() {
32 | @SuppressWarnings("unused")
33 | final short referenceToConstant = Constants.AALOAD;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/JiraBcel291TestFixture.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.verifier.tests;
21 |
22 | public class JiraBcel291TestFixture {
23 |
24 | public static Object[] bug(final Object[] arg) {
25 | return arg.clone();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestArrayAccess01.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | public class TestArrayAccess01 extends XTestArray01 {
22 |
23 | public static void test() {
24 | final XTestArray01[] array = new TestArrayAccess01[1];
25 | array[0] = new XTestArray01();
26 | }
27 |
28 | }
29 |
30 | class XTestArray01 {
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestArrayAccess04DoubleCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.verifier.tests;
21 |
22 | import org.apache.bcel.generic.Type;
23 |
24 | public class TestArrayAccess04DoubleCreator extends TestArrayAccess04Creator {
25 |
26 | public TestArrayAccess04DoubleCreator() {
27 | super(Type.DOUBLE, "Double");
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestArrayAccess04FloatCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.verifier.tests;
21 |
22 | import org.apache.bcel.generic.Type;
23 |
24 | public class TestArrayAccess04FloatCreator extends TestArrayAccess04Creator {
25 |
26 | public TestArrayAccess04FloatCreator() {
27 | super(Type.FLOAT, "Float");
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestArrayAccess04IntCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.verifier.tests;
21 |
22 | import org.apache.bcel.generic.Type;
23 |
24 | public class TestArrayAccess04IntCreator extends TestArrayAccess04Creator {
25 |
26 | public TestArrayAccess04IntCreator() {
27 | super(Type.INT, "Int");
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestArrayAccess04LongCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.verifier.tests;
21 |
22 | import org.apache.bcel.generic.Type;
23 |
24 | public class TestArrayAccess04LongCreator extends TestArrayAccess04Creator {
25 |
26 | public TestArrayAccess04LongCreator() {
27 | super(Type.LONG, "Long");
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestArrayAccess04ShortCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.verifier.tests;
21 |
22 | import org.apache.bcel.generic.Type;
23 |
24 | public class TestArrayAccess04ShortCreator extends TestArrayAccess04Creator {
25 |
26 | public TestArrayAccess04ShortCreator() {
27 | super(Type.SHORT, "Short");
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestArrayAccess04UnknownCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package org.apache.bcel.verifier.tests;
21 |
22 | import org.apache.bcel.generic.Type;
23 |
24 | public class TestArrayAccess04UnknownCreator extends TestArrayAccess04Creator {
25 |
26 | public TestArrayAccess04UnknownCreator() {
27 | super(Type.UNKNOWN, null);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestLegalInvokeInterface01.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | interface Interface01 extends Runnable {
22 |
23 | }
24 |
25 | public class TestLegalInvokeInterface01 {
26 |
27 | public static void test1(final Interface01 t) {
28 | t.run();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestLegalInvokeSpecial01.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | public class TestLegalInvokeSpecial01 {
22 |
23 | public static void test1() {
24 | new TestLegalInvokeSpecial01().getClass();
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestLegalInvokeSpecial02.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | public abstract class TestLegalInvokeSpecial02 implements Runnable {
22 |
23 | public static void test1(final TestLegalInvokeSpecial02 t, final int i) {
24 | if (i > 0) {
25 | t.run();
26 | }
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestLegalInvokeStatic01.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | public class TestLegalInvokeStatic01 extends Thread {
22 |
23 | public static void test1() throws InterruptedException {
24 | Thread.sleep(0);
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestLegalInvokeVirtual01.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | public class TestLegalInvokeVirtual01 {
22 |
23 | public static void test1() {
24 | new TestLegalInvokeVirtual01().toString();
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestLegalInvokeVirtual02.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | public abstract class TestLegalInvokeVirtual02 implements Runnable {
22 |
23 | public static void test1(final TestLegalInvokeVirtual02 t, final int i) {
24 | if (i > 0) {
25 | t.run();
26 | }
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestReturn03BooleanCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | import org.apache.bcel.generic.Type;
22 |
23 | public class TestReturn03BooleanCreator extends TestReturn03Creator {
24 |
25 | public TestReturn03BooleanCreator() {
26 | super(Type.BOOLEAN, "Boolean");
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestReturn03ByteCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | import org.apache.bcel.generic.Type;
22 |
23 | public class TestReturn03ByteCreator extends TestReturn03Creator {
24 |
25 | public TestReturn03ByteCreator() {
26 | super(Type.BYTE, "Byte");
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestReturn03DoubleCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | import org.apache.bcel.generic.Type;
22 |
23 | public class TestReturn03DoubleCreator extends TestReturn03Creator {
24 |
25 | public TestReturn03DoubleCreator() {
26 | super(Type.DOUBLE, "Double");
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestReturn03FloatCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | import org.apache.bcel.generic.Type;
22 |
23 | public class TestReturn03FloatCreator extends TestReturn03Creator {
24 |
25 | public TestReturn03FloatCreator() {
26 | super(Type.FLOAT, "Float");
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestReturn03IntCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | import org.apache.bcel.generic.Type;
22 |
23 | public class TestReturn03IntCreator extends TestReturn03Creator {
24 |
25 | public TestReturn03IntCreator() {
26 | super(Type.INT, "Int");
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestReturn03LongCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | import org.apache.bcel.generic.Type;
22 |
23 | public class TestReturn03LongCreator extends TestReturn03Creator {
24 |
25 | public TestReturn03LongCreator() {
26 | super(Type.LONG, "Long");
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestReturn03ObjectCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | import org.apache.bcel.generic.Type;
22 |
23 | public class TestReturn03ObjectCreator extends TestReturn03Creator {
24 |
25 | public TestReturn03ObjectCreator() {
26 | super(Type.OBJECT, "Object");
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestReturn03ShortCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | import org.apache.bcel.generic.Type;
22 |
23 | public class TestReturn03ShortCreator extends TestReturn03Creator {
24 |
25 | public TestReturn03ShortCreator() {
26 | super(Type.SHORT, "Short");
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/java/org/apache/bcel/verifier/tests/TestReturn03UnknownCreator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 | package org.apache.bcel.verifier.tests;
20 |
21 | import org.apache.bcel.generic.Type;
22 |
23 | public class TestReturn03UnknownCreator extends TestReturn03Creator {
24 |
25 | public TestReturn03UnknownCreator() {
26 | super(Type.UNKNOWN, null);
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/test/resources/Java4Example.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/Java4Example.class
--------------------------------------------------------------------------------
/src/test/resources/Java8Example.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/Java8Example.class
--------------------------------------------------------------------------------
/src/test/resources/Java8Example.java:
--------------------------------------------------------------------------------
1 | import java.util.*;
2 | import java.util.stream.*;
3 |
4 | public interface Java8Example {
5 |
6 | default void hello() {
7 | List words = Arrays.asList("Hello", "World", "hi");
8 | System.out.println(words);
9 |
10 | List words2 = words.stream().filter((String s) -> s.length() > 2).collect(Collectors. toList());
11 | System.out.println(words2);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/test/resources/Java8Example2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/Java8Example2.class
--------------------------------------------------------------------------------
/src/test/resources/StackMapExample.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/StackMapExample.class
--------------------------------------------------------------------------------
/src/test/resources/StackMapExample.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Example to check if BCELifier generates the stack map table
3 | * so that the generated class passes the Java verifier checks.
4 | */
5 | public abstract class StackMapExample {
6 |
7 | protected abstract void someAbstractMethod();
8 |
9 | public static void main(final String[] args) {
10 | switch (args[0]) {
11 | case "Hello":
12 | System.out.println("Hello World");
13 | break;
14 | default:
15 | break;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/test/resources/StackMapExample2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/StackMapExample2.class
--------------------------------------------------------------------------------
/src/test/resources/StackMapExample2.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Another version of StackMapExample using 2 types of locals String and int
3 | * instead of just String.
4 | */
5 | public class StackMapExample2 {
6 |
7 | public static void main(String[] args) {
8 | if (args.length == 1 && "Hello".equals(args[0])) {
9 | System.out.println("Hello World");
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/test/resources/com/foo/Foo.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/com/foo/Foo.class
--------------------------------------------------------------------------------
/src/test/resources/com/puppycrawl/tools/checkstyle/grammar/java/JavaLanguageParser$ClassBlockContext.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/com/puppycrawl/tools/checkstyle/grammar/java/JavaLanguageParser$ClassBlockContext.class
--------------------------------------------------------------------------------
/src/test/resources/issue303/example/A.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue303/example/A.classx
--------------------------------------------------------------------------------
/src/test/resources/issue307/example/A.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue307/example/A.classx
--------------------------------------------------------------------------------
/src/test/resources/issue308/Hello.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue308/Hello.classx
--------------------------------------------------------------------------------
/src/test/resources/issue309/Hello.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue309/Hello.classx
--------------------------------------------------------------------------------
/src/test/resources/issue310/Hello.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue310/Hello.classx
--------------------------------------------------------------------------------
/src/test/resources/issue311/Hello.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue311/Hello.classx
--------------------------------------------------------------------------------
/src/test/resources/issue312/Hello.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue312/Hello.classx
--------------------------------------------------------------------------------
/src/test/resources/issue313/Hello.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue313/Hello.classx
--------------------------------------------------------------------------------
/src/test/resources/issue337/example/A.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue337/example/A.classx
--------------------------------------------------------------------------------
/src/test/resources/issue362/Bcel362.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue362/Bcel362.class
--------------------------------------------------------------------------------
/src/test/resources/issue362/Bcel362.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | package issue362;
21 |
22 | /**
23 | * Compile to Java 11 byte code, then instrument with JaCoCo in order to add
24 | * condy (constant dynamic) instructions
25 | */
26 | public class Bcel362 {
27 | public static void main(String[] args) {
28 | System.out.println("Hello world!");
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/test/resources/issue369/Test.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/issue369/Test.class
--------------------------------------------------------------------------------
/src/test/resources/jira368/Test.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/jira368/Test.class
--------------------------------------------------------------------------------
/src/test/resources/jpms/java11/commons-io/module-info.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/jpms/java11/commons-io/module-info.class
--------------------------------------------------------------------------------
/src/test/resources/jpms/java17/commons-io/module-info.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/jpms/java17/commons-io/module-info.class
--------------------------------------------------------------------------------
/src/test/resources/jpms/java18/commons-io/module-info.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/jpms/java18/commons-io/module-info.class
--------------------------------------------------------------------------------
/src/test/resources/jpms/java19-ea/commons-io/module-info.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/jpms/java19-ea/commons-io/module-info.class
--------------------------------------------------------------------------------
/src/test/resources/kotlin/test$method name with () in it$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/kotlin/test$method name with () in it$1.class
--------------------------------------------------------------------------------
/src/test/resources/ossfuzz/issue51980/Test.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue51980/Test.classx
--------------------------------------------------------------------------------
/src/test/resources/ossfuzz/issue51989/Test.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue51989/Test.classx
--------------------------------------------------------------------------------
/src/test/resources/ossfuzz/issue52168/Test.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue52168/Test.classx
--------------------------------------------------------------------------------
/src/test/resources/ossfuzz/issue53543/Test.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue53543/Test.classx
--------------------------------------------------------------------------------
/src/test/resources/ossfuzz/issue53544a/Test.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue53544a/Test.classx
--------------------------------------------------------------------------------
/src/test/resources/ossfuzz/issue53620/Test.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue53620/Test.classx
--------------------------------------------------------------------------------
/src/test/resources/ossfuzz/issue53676/Test.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue53676/Test.classx
--------------------------------------------------------------------------------
/src/test/resources/ossfuzz/issue54119/Test.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue54119/Test.classx
--------------------------------------------------------------------------------
/src/test/resources/ossfuzz/issue54254/Test.classx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/ossfuzz/issue54254/Test.classx
--------------------------------------------------------------------------------
/src/test/resources/ossfuzz/readme.txt:
--------------------------------------------------------------------------------
1 |
19 | Class names here use non-".class" suffix so that Maven plugins like surefire do not try to read the file and fail the build.
20 |
--------------------------------------------------------------------------------
/src/test/resources/record/SimpleRecord.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/commons-bcel/abd3ba5a622a4800a19b2de55e02bc7f805e9177/src/test/resources/record/SimpleRecord.class
--------------------------------------------------------------------------------
/src/test/resources/record/SimpleRecord.java:
--------------------------------------------------------------------------------
1 | import javax.annotation.Nonnull;
2 |
3 | public record SimpleRecord(int aNumber,@Nonnull String aString) {
4 |
5 | }
6 |
--------------------------------------------------------------------------------