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

Simple name of local class is wrong #216

Closed
rweisleder opened this issue Aug 20, 2019 · 0 comments · Fixed by #217
Closed

Simple name of local class is wrong #216

rweisleder opened this issue Aug 20, 2019 · 0 comments · Fixed by #217
Assignees
Labels

Comments

@rweisleder
Copy link
Contributor

Test:

@Test
void simpleNameOfLocalClass() {
    class LocalClass {
    }

    JavaClass javaClass = new ClassFileImporter().importClass(LocalClass.class);
    System.out.println(javaClass.getSimpleName());
    System.out.println(javaClass.getName());

    System.out.println(LocalClass.class.getSimpleName());
    System.out.println(LocalClass.class.getName());
}

Output:

1LocalClass
org.dummy.ExampleTest$1LocalClass
LocalClass
org.dummy.ExampleTest$1LocalClass

I would expect that the output of javaClass.getSimpleName() is also LocalClass.

rweisleder added a commit to rweisleder/ArchUnit that referenced this issue Aug 20, 2019
rweisleder added a commit to rweisleder/ArchUnit that referenced this issue Aug 20, 2019
Resolves TNG#216

Signed-off-by: Roland Weisleder <roland.weisleder@googlemail.com>
codecholeric pushed a commit to rweisleder/ArchUnit that referenced this issue Aug 29, 2019
Resolves TNG#216

Signed-off-by: Roland Weisleder <roland.weisleder@googlemail.com>
@codecholeric codecholeric self-assigned this Aug 29, 2019
codecholeric added a commit that referenced this issue Aug 31, 2019
Ensure correct simple name for local classes
codecholeric pushed a commit that referenced this issue Feb 21, 2021
Resolves #216

Signed-off-by: Roland Weisleder <roland.weisleder@googlemail.com>
codecholeric added a commit that referenced this issue Feb 21, 2021
Ensure correct simple name for local classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants