Skip to content

Commit

Permalink
feat(objectionary#488): identify problem with loop and and swich stat…
Browse files Browse the repository at this point in the history
…ement intersection inside 'spring-fat' integration test
  • Loading branch information
volodya-lombrozo committed Mar 14, 2024
1 parent 74d5bea commit d9dd9a4
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 2 deletions.
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 justSwithcCase(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;
3 changes: 2 additions & 1 deletion src/it/spring-fat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ SOFTWARE.
support many java features. We need to implement them and enable
the test.
-->
<disabled>true</disabled>
<disabled>false</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

0 comments on commit d9dd9a4

Please sign in to comment.