Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isEnum support in JavaClass #6

Merged
merged 1 commit into from
May 19, 2017
Merged

Conversation

storozhukBM
Copy link
Contributor

No description provided.

Copy link
Collaborator

@codecholeric codecholeric left a comment

Choose a reason for hiding this comment

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

Looks good :-) I might switch assertThat(namesOf(allInterfaces)) to the custom class assertion...

@codecholeric codecholeric merged commit 40e3301 into TNG:master May 19, 2017
codecholeric added a commit to crizzis/ArchUnit that referenced this pull request Mar 27, 2022
…e three try catch blocks start from a handler label.

At least with my JDK 7 it looks like this:

```
private void method(int, boolean);
    descriptor: (IZ)V
    flags: (0x0002) ACC_PRIVATE
    Code:
      stack=4, locals=6, args_size=3
         0: new           TNG#3                  // class java/net/Socket
         3: dup
         4: ldc           TNG#4                  // String
         6: iconst_0
         7: invokespecial TNG#5                  // Method java/net/Socket."<init>":(Ljava/lang/String;I)V
        10: astore_3
        11: new           TNG#6                  // class java/io/BufferedReader
        14: dup
        15: aconst_null
        16: invokespecial TNG#7                  // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;)V
        19: astore        4
        21: aload         4
        23: invokevirtual TNG#8                  // Method java/io/BufferedReader.close:()V
        26: return
        27: astore        5
        29: aload         4
        31: invokevirtual TNG#8                  // Method java/io/BufferedReader.close:()V
        34: aload         5
        36: athrow
        37: astore_3
        38: return
      Exception table:
         from    to  target type
            27    29    27   any
             0    26    37   Class java/lang/Exception
            27    37    37   Class java/lang/Exception
```

We can possibly ignore this, since we will drop JDK 7 support soon anyway, but let's maybe ponder about it, why it looks so different. That of the two declared try-catch-blocks only one try catch block is visible is definitely strange (and worse than having 3 try-catch-blocks where one is synthetic). But this example is anyway quite strange, because the bytecode immediately changes e.g. if we remove one of the unused method parameters.

Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants