Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Mar 15, 2024
2 parents 9fdd7a5 + 5507c2e commit 9ebbf1b
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 7 deletions.
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@ SOFTWARE.
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<pomExcludes>
<exclude>custom-transformations/pom.xml</exclude>
</pomExcludes>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2023 Objectionary.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.eolang.innerclasses;

public class Top {

public void print() {
new TopInnerStatic().print();
this.new TopInnerInstance().print();
}

private static class TopInnerStatic {
public void print() {
System.out.println("TopInnerStatic");
}
}

private class TopInnerInstance {
public void print() {
System.out.println("TopInnerInstance");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2023 Objectionary.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.eolang.spring;

public class SwitchInsideLoopCase {

public int example(byte x) {
for (int i = 0; i < 10; ++i) {
switch (x) {
case 1:
break;
default:
throw new IllegalArgumentException("Unexpected value: " + x);
}
}
return 2;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2023 Objectionary.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**
* This package contains all the cases that accidentaly broke `spring-fat` integration test.
* So, all the identified cases are placed here.
* @since 0.3
*/
package org.eolang.spring;
1 change: 1 addition & 0 deletions src/it/spring-fat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ SOFTWARE.
the test.
-->
<disabled>true</disabled>
<skipVerification>true</skipVerification>
</configuration>
<executions>
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private static void verify(final byte[] bytes) {
);
verifier.setClassLoader(Thread.currentThread().getContextClassLoader());
new Analyzer<>(verifier).analyze(clazz.name, method);
} catch (final AnalyzerException exception) {
} catch (final ClassFormatError | AnalyzerException exception) {
throw new IllegalStateException(
String.format(
"Bytecode verification failed for the class '%s' and method '%s'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import java.util.Iterator;
import org.eolang.jeo.representation.DefaultVersion;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.Handle;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
Expand All @@ -42,6 +41,14 @@
* Probably in this issue you will need to add some additional
* parsing logic.
* See {@link #visitInvokeDynamicInsn} method.
* @todo #488:90min Implement the rest of instruction mappings to XMIR directives.
* Currently we left several instructions unimplemented:
* {@link #visitLookupSwitchInsn},
* {@link #visitTableSwitchInsn},
* {@link #visitMultiANewArrayInsn},
* {@link #visitIincInsn}.
* We need to implement them and add tests for them.
* Don't forget to enable 'custom-transformations' integration test.
*/
@SuppressWarnings("PMD.TooManyMethods")
public final class DirectivesMethodVisitor extends MethodVisitor implements Iterable<Directive> {
Expand Down Expand Up @@ -155,11 +162,6 @@ public void visitTryCatchBlock(
super.visitTryCatchBlock(start, end, handler, type);
}

@Override
public AnnotationVisitor visitAnnotation(final String descriptor, final boolean visible) {
return super.visitAnnotation(descriptor, visible);
}

@Override
public Iterator<Directive> iterator() {
return this.method.iterator();
Expand Down

1 comment on commit 9ebbf1b

@0pdd
Copy link

@0pdd 0pdd commented on 9ebbf1b Mar 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 488-6e1a4d16 discovered in src/main/java/org/eolang/jeo/representation/directives/DirectivesMethodVisitor.java) and submitted as #509. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

Please sign in to comment.