You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/06/03 21:17:56 UTC
[commons-bcel] branch master updated: [BCEL-369] org.apache.bcel.verifier.exc.AssertionViolatedException from method return in subroutine
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-bcel.git
The following commit(s) were added to refs/heads/master by this push:
new 99863daf [BCEL-369] org.apache.bcel.verifier.exc.AssertionViolatedException from method return in subroutine
99863daf is described below
commit 99863daf9d7a9f06d3003a73bb0e54caca40869d
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jun 3 17:17:39 2023 -0400
[BCEL-369]
org.apache.bcel.verifier.exc.AssertionViolatedException from method
return in subroutine
Add passing test case.
---
.../apache/bcel/verifier/JiraBcel369TestCase.java | 31 +++++++++++++++++++
.../bcel/verifier/JiraBcel369TestFixture.java | 35 ++++++++++++++++++++++
2 files changed, 66 insertions(+)
diff --git a/src/test/java/org/apache/bcel/verifier/JiraBcel369TestCase.java b/src/test/java/org/apache/bcel/verifier/JiraBcel369TestCase.java
new file mode 100644
index 00000000..bc628463
--- /dev/null
+++ b/src/test/java/org/apache/bcel/verifier/JiraBcel369TestCase.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.bcel.verifier;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests BCEL-369.
+ */
+public class JiraBcel369TestCase {
+
+ @Test
+ public void testBcel369() throws ClassNotFoundException {
+ Verifier.verifyType(org.apache.bcel.verifier.JiraBcel369TestFixture.class.getName());
+ }
+}
diff --git a/src/test/java/org/apache/bcel/verifier/JiraBcel369TestFixture.java b/src/test/java/org/apache/bcel/verifier/JiraBcel369TestFixture.java
new file mode 100644
index 00000000..dae9e712
--- /dev/null
+++ b/src/test/java/org/apache/bcel/verifier/JiraBcel369TestFixture.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.bcel.verifier;
+
+class JiraBcel369TestFixture {
+
+ public JiraBcel369TestFixture(int i) {
+ try {
+ i++;
+ } finally {
+ if (i == 0) {
+ return;
+ }
+ int u = 7;
+ u += 9;
+ }
+ i++;
+ }
+
+}