-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#89 Super call with overriden method results in infinite loop
- Loading branch information
1 parent
be27579
commit 98de2f4
Showing
5 changed files
with
83 additions
and
269 deletions.
There are no files selected for viewing
132 changes: 0 additions & 132 deletions
132
core/src/main/java/de/mirkosertic/bytecoder/optimizer/InlineGotoOptimizer.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
core/src/test/java/de/mirkosertic/bytecoder/core/MethodOverwriteCallTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright 2019 Mirko Sertic | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package de.mirkosertic.bytecoder.core; | ||
|
||
import de.mirkosertic.bytecoder.unittest.BytecoderUnitTestRunner; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
@RunWith(BytecoderUnitTestRunner.class) | ||
public class MethodOverwriteCallTest { | ||
|
||
public class Parent { | ||
|
||
Map<String, Object> data = new HashMap<>(); | ||
|
||
public void add(final String key, final String aValue) { | ||
data.remove(key); | ||
} | ||
|
||
public void add(final String aKey, final Object aValue) { | ||
add(aKey, aValue.toString()); | ||
} | ||
} | ||
|
||
public class Child extends Parent { | ||
|
||
public void add(final String aKey, final String aValue) { | ||
data.put(aKey, aValue); | ||
} | ||
|
||
public Object get(final String aValue) { | ||
return data.get(aValue); | ||
} | ||
} | ||
|
||
@Test | ||
public void testCall() { | ||
final Child c = new Child(); | ||
c.add("key", Integer.valueOf(10)); | ||
Assert.assertEquals("10", c.get("key")); | ||
} | ||
} |
134 changes: 0 additions & 134 deletions
134
core/src/test/java/de/mirkosertic/bytecoder/optimizer/InlineGotoOptimizerTest.java
This file was deleted.
Oops, something went wrong.