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

Exception in JavadocMethod to get access to class in jdk9 #6606

Closed
romani opened this issue Mar 25, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@romani
Copy link
Member

commented Mar 25, 2019

Identified at checkstyle/eclipse-cs#80 (comment)

The following configuration in eclipse:

    <module name="JavadocMethod">
      <property name="suppressLoadErrors" value="true"/>
    </module>

produced the following exception on JDK9:

!ENTRY net.sf.eclipsecs.core 4 0 2018-05-22 13:17:39.345
!MESSAGE Checkstyle-Plugin: Exception was thrown while processing /Users/rwalker/Documents/workspace/vocabs-registry/src/test/java/au/org/ands/vocabs/toolkit/test/arquillian/SubscriptionTests.java
!STACK 0
com.puppycrawl.tools.checkstyle.api.CheckstyleException: Exception was thrown while processing /Users/rwalker/Documents/workspace/vocabs-registry/src/test/java/au/org/ands/vocabs/toolkit/test/arquillian/SubscriptionTests.java
        at com.puppycrawl.tools.checkstyle.Checker.processFiles(Checker.java:295)
        at com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:213)
        at net.sf.eclipsecs.core.builder.Auditor.runAudit(Auditor.java:158)
        at net.sf.eclipsecs.core.builder.CheckstyleBuilder.handleBuildSelection(CheckstyleBuilder.java:306)
        at net.sf.eclipsecs.core.builder.CheckstyleBuilder.build(CheckstyleBuilder.java:172)
        at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
        at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
        at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
        at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
        at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:142)
        at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:232)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: java.lang.SecurityException: Prohibited package name: java.sql
        at java.base/java.lang.ClassLoader.preDefineClass(ClassLoader.java:889)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1005)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
        at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:545)
        at java.base/java.net.URLClassLoader.access$100(URLClassLoader.java:83)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:453)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:447)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:446)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:563)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
        at net.sf.eclipsecs.core.builder.ProjectClassLoader.loadClass(ProjectClassLoader.java:142)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:375)
        at com.puppycrawl.tools.checkstyle.checks.javadoc.ClassResolver.safeLoad(ClassResolver.java:212)
        at com.puppycrawl.tools.checkstyle.checks.javadoc.ClassResolver.isLoadable(ClassResolver.java:190)
        at com.puppycrawl.tools.checkstyle.checks.javadoc.ClassResolver.resolveQualifiedName(ClassResolver.java:223)
        at com.puppycrawl.tools.checkstyle.checks.javadoc.ClassResolver.resolveMatchingExplicitImport(ClassResolver.java:130)
        at com.puppycrawl.tools.checkstyle.checks.javadoc.ClassResolver.resolve(ClassResolver.java:78)
        at com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractTypeAwareCheck.resolveClass(AbstractTypeAwareCheck.java:241)
        at com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractTypeAwareCheck.tryLoadClass(AbstractTypeAwareCheck.java:258)
        at com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractTypeAwareCheck$RegularClass.getClazz(AbstractTypeAwareCheck.java:470)
        at com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck$ExceptionInfo.getClazz(JavadocMethodCheck.java:1010)
        at com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck$ExceptionInfo.access$100(JavadocMethodCheck.java:968)
        at com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.isInThrows(JavadocMethodCheck.java:950)
        at com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.checkThrowsTags(JavadocMethodCheck.java:893)
        at com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.checkComment(JavadocMethodCheck.java:494)
        at com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.processAST(JavadocMethodCheck.java:354)
        at com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractTypeAwareCheck.visitToken(AbstractTypeAwareCheck.java:157)
        at com.puppycrawl.tools.checkstyle.TreeWalker.notifyVisit(TreeWalker.java:389)
        at com.puppycrawl.tools.checkstyle.TreeWalker.processIter(TreeWalker.java:500)
        at com.puppycrawl.tools.checkstyle.TreeWalker.walk(TreeWalker.java:329)
        at com.puppycrawl.tools.checkstyle.TreeWalker.processFiltered(TreeWalker.java:186)
        at com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck.process(AbstractFileSetCheck.java:81)
        at com.puppycrawl.tools.checkstyle.Checker.processFile(Checker.java:316)
        at com.puppycrawl.tools.checkstyle.Checker.processFiles(Checker.java:286)
        ... 16 more

Caused by: java.lang.SecurityException: Prohibited package name: java.sql
at com.puppycrawl.tools.checkstyle.checks.javadoc.ClassResolver.resolve(ClassResolver.java:78)

we need to catch all exceptions at https://github.com/checkstyle/checkstyle/blob/master/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractTypeAwareCheck.java#L237

@romani

This comment has been minimized.

Copy link
Member Author

commented Apr 3, 2019

@rnveach , are you ok, can you put label ?

@rnveach rnveach added the approved label Apr 3, 2019

rnveach added a commit to rnveach/checkstyle that referenced this issue Apr 6, 2019

rnveach added a commit to rnveach/checkstyle that referenced this issue Apr 6, 2019

rnveach added a commit to rnveach/checkstyle that referenced this issue Apr 20, 2019

rnveach added a commit that referenced this issue Apr 20, 2019

@rnveach

This comment has been minimized.

Copy link
Member

commented Apr 20, 2019

Fix was merged

@rnveach rnveach closed this Apr 20, 2019

@rnveach rnveach added the bug label Apr 20, 2019

@rnveach rnveach added this to the 8.20 milestone Apr 20, 2019

peterdemaeyer added a commit to peterdemaeyer/checkstyle that referenced this issue Apr 27, 2019

peterdemaeyer added a commit to peterdemaeyer/checkstyle that referenced this issue Apr 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.