Skip to content

Conversation

sarxos
Copy link
Contributor

@sarxos sarxos commented Apr 1, 2019

Hello @mkouba,

This is PR against FileNotFoundException when beans are located in a default package. Having them in a default package is a bad practice, but it should still be allowed since, from a Java perspective, default package does not differ in any way when compared to a non-default one.

Example stack trace before the fix:

java.lang.RuntimeException: java.io.FileNotFoundException: /SomeRefFactoryX_Bean.class (Permission denied)
    at io.quarkus.runner.RuntimeRunner.run(RuntimeRunner.java:134)
    at io.quarkus.test.junit.QuarkusTestExtension.doJavaStart(QuarkusTestExtension.java:196)
    at io.quarkus.test.junit.QuarkusTestExtension.beforeAll(QuarkusTestExtension.java:80)
    ...
Caused by: java.io.FileNotFoundException: /SomeRefFactoryX_Bean.class (Permission denied)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
    at io.quarkus.test.junit.QuarkusTestExtension$2.writeClass(QuarkusTestExtension.java:107)
    at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:114)
    at io.quarkus.runner.RuntimeRunner.run(RuntimeRunner.java:99)
    ... 39 more

After this PR is applied, the problem is fixed.

Copy link
Contributor

@mkouba mkouba 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 but we should use this method in ClientProxyGenerator, ObserverGenerator and InterceptorGenerator too. So I would make the method a protected method of the AbstractGenerator and add suffix as a method arg.

@sarxos
Copy link
Contributor Author

sarxos commented Apr 1, 2019

@mkouba Modified per request. Please review.

@mkouba
Copy link
Contributor

mkouba commented Apr 1, 2019

@sarxos Looks good but the code style check fails - https://github.com/quarkusio/quarkus/blob/master/CONTRIBUTING.md#ide-config-and-code-style. You should always run a full build before submitting a PR (the code is formatted automatically).

@sarxos
Copy link
Contributor Author

sarxos commented Apr 1, 2019

@mkouba It looks that Azure Pipeline is completed. Please let me know if I should do anything else in regards to this PR.

@mkouba mkouba merged commit 1465544 into quarkusio:master Apr 1, 2019
@mkouba
Copy link
Contributor

mkouba commented Apr 1, 2019

@sarxos Merged. Thanks for your contribution.

@gsmet gsmet added this to the 0.13.0 milestone Apr 2, 2019
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.

3 participants