Skip to content
This repository was archived by the owner on Oct 22, 2023. It is now read-only.

XTTE1020 error w/ html report; missing class "apply" #90

Open
mkienenb opened this issue Mar 9, 2020 · 2 comments
Open

XTTE1020 error w/ html report; missing class "apply" #90

mkienenb opened this issue Mar 9, 2020 · 2 comments

Comments

@mkienenb
Copy link

mkienenb commented Mar 9, 2020

So I'm testing my PR[1] port from findbugs which allowed findbugs/spotbugs to handle arbitrarily large argument lists with ant/CLI against my application. I've been using this code with findbugs for years, and it was easy to port it to spotbugs.

However. there's a couple of odd errors being returned.[2] I've verified that the same ant task running findbugs instead of spotbugs still works so it's not a bad environment.

The first error seems to be a problem with the html report. Changing it to "xml" doesn't generate the error.

The second issue is a vague error, maybe warning, that doesn't tell me what's wrong:

 [spotbugs] The following classes needed for analysis were missing:
 [spotbugs]   apply

For what it's worth, my ant task call is here:

    <spotbugs
            reportLevel="low"
            effort="max"
            failOnError="false"
            errorProperty="spotbugs-had-error"
            warningsProperty="spotbugs-had-warning"
            home="${spotbugs.home}"
            output="html"
            outputFile="${spotbugs-report-name}"
		>
			<excludePath>
				<!-- If any of these directories are missing, spotbugs fails without generating an report file but claims it did. -->
			  	<fileset dir="${src.dir}" includes="**/spotbugs-*-exclude-filter.xml"/>
			  	<fileset dir="${test-src.dir}" includes="**/spotbugs-*-exclude-filter.xml"/>
			  	<fileset dir="../../personal" includes="**/spotbugs-*-exclude-filter.xml"/>
          	</excludePath>
            <auxClasspath  refid="compile.classpath" />
            <sourcePath>
			  	<fileset dir="${src.dir}"/>
            </sourcePath>
            <class location="${classes.dir}" />
            <pluginList location="${lib-build.dir}/findsecbugs-plugin-1.4.6.jar" />
    </spotbugs>

[1]
Allow any ant task or command-line user to specify large values or many arguments #1098
spotbugs/spotbugs#1098

[2]

spotbugs-main:
 [spotbugs] Executing SpotBugs FindBugsTask from ant task
 [spotbugs] Running SpotBugs...
 [spotbugs] Type error evaluating ((./Class)/@classname) in xsl:sort/@select on line 285 column 41 of default.xsl:
 [spotbugs]   XTTE1020: A sequence of more than one item is not allowed as the @select attribute of
 [spotbugs]   xsl:sort (@classname="com.xyz.applications.epay.cayenne._EbppDAOCayenne",
 [spotbugs]   @classname="com.xyz.cayenne.ebpp.entity.generated._Account") 
 [spotbugs] at template generateWarningTable on line 275 of default.xsl:
 [spotbugs]      invoked by xsl:call-template at file:///home/mkienenb/workspaces/xyz-oxygen/APPLICATION/building/default.xsl#203
 [spotbugs]      invoked by unknown caller (class net.sf.saxon.expr.instruct.ForEach) at file:///home/mkienenb/workspaces/xyz-oxygen/APPLICATION/building/default.xsl#198
 [spotbugs]   In template rule with match="/" on line 69 of default.xsl
 [spotbugs] The following errors occurred during analysis:
 [spotbugs]   Could not generate HTML output
 [spotbugs]     net.sf.saxon.trans.XPathException: A sequence of more than one item is not allowed as the @select attribute of xsl:sort (@classname="com.xyz.applications.epay.cayenne._EbppDAOCayenne", @classname="com.xyz.cayenne.ebpp.entity.generated._Account") 
 [spotbugs]       At net.sf.saxon.expr.Expression.typeError(Expression.java:1464)
 [spotbugs]       At net.sf.saxon.expr.SingletonAtomizer.evaluateItem(SingletonAtomizer.java:221)
 [spotbugs]       At net.sf.saxon.expr.SingletonAtomizer.evaluateItem(SingletonAtomizer.java:31)
 [spotbugs]       At net.sf.saxon.expr.sort.SortExpression.evaluateSortKey(SortExpression.java:394)
 [spotbugs]       At net.sf.saxon.expr.sort.SortedIterator.buildArray(SortedIterator.java:215)
 [spotbugs]       At net.sf.saxon.expr.sort.SortedIterator.doSort(SortedIterator.java:231)
 [spotbugs]       At net.sf.saxon.expr.sort.SortedIterator.next(SortedIterator.java:148)
 [spotbugs]       At net.sf.saxon.om.FocusTrackingIterator.next(FocusTrackingIterator.java:73)
 [spotbugs]       At net.sf.saxon.trans.Mode.applyTemplates(Mode.java:455)
 [spotbugs]       At net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:300)
 [spotbugs]       At net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:255)
 [spotbugs]       At net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:735)
 [spotbugs]       At net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:132)
 [spotbugs]       At net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
 [spotbugs]       At net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:299)
 [spotbugs]       At net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:735)
 [spotbugs]       At net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:243)
 [spotbugs]       At net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:353)
 [spotbugs]       At net.sf.saxon.expr.LetExpression.process(LetExpression.java:608)
 [spotbugs]       At net.sf.saxon.expr.instruct.ForEach.lambda$processLeavingTail$0(ForEach.java:484)
 [spotbugs]       At net.sf.saxon.om.SequenceIterator.forEachOrFail(SequenceIterator.java:128)
 [spotbugs]       At net.sf.saxon.expr.instruct.ForEach.processLeavingTail(ForEach.java:484)
 [spotbugs]       At net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:735)
 [spotbugs]       At net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:132)
 [spotbugs]       At net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
 [spotbugs]       At net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:299)
 [spotbugs]       At net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:721)
 [spotbugs]       At net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:735)
 [spotbugs]       At net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:132)
 [spotbugs]       At net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:352)
 [spotbugs]       At net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:299)
 [spotbugs]       At net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:352)
 [spotbugs]       At net.sf.saxon.trans.Mode.applyTemplates(Mode.java:532)
 [spotbugs]       At net.sf.saxon.trans.XsltController.applyTemplates(XsltController.java:747)
 [spotbugs]       At net.sf.saxon.s9api.AbstractXsltTransformer.applyTemplatesToSource(AbstractXsltTransformer.java:347)
 [spotbugs]       At net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:349)
 [spotbugs]       At net.sf.saxon.jaxp.TransformerImpl.transform(TransformerImpl.java:71)
 [spotbugs]       At edu.umd.cs.findbugs.HTMLBugReporter.finish(HTMLBugReporter.java:73)
 [spotbugs]       At edu.umd.cs.findbugs.DelegatingBugReporter.finish(DelegatingBugReporter.java:89)
 [spotbugs]       At edu.umd.cs.findbugs.DelegatingBugReporter.finish(DelegatingBugReporter.java:89)
 [spotbugs]       At edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:1165)
 [spotbugs]       At edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:309)
 [spotbugs]       At edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:395)
 [spotbugs]       At edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1231)
 [spotbugs] The following classes needed for analysis were missing:
 [spotbugs]   apply
 [spotbugs] 
 [spotbugs] Java Result: 1
 [spotbugs] Output saved to ../deploying/dist/spotbugs-report-2020-03-09-18-16-51.html
@mkienenb
Copy link
Author

It looks to me like the html transform doesn't know how to handle errors for bug types which span multiple classes, such as NM_CONFUSING where the error is that two classes have methods that differ by capitalization.

I don't remember enough about xml transforms to fix it. I'll open a Spotbugs issue later.

I'm having issues with spotbugs ignoring my findbugs exclude files, so I want to track that down first to see what else might be affected by this after I exclude NM_CONFUSING

  <BugInstance type="NM_CONFUSING" priority="3" rank="19" abbrev="Nm" category="BAD_PRACTICE">
    <Class classname="com.xyz.applications.epay.cayenne._EbppDAOCayenne">
      <SourceLine classname="com.xyz.applications.epay.cayenne._EbppDAOCayenne" start="62" end="858" sourcefile="_EbppDAOCayenne.java" sourcepath="com/xyz/applications/epay/cayenne/_EbppDAOCayenne.java"/>
    </Class>
    <Method classname="com.xyz.applications.epay.cayenne._EbppDAOCayenne" name="getACHProcessingQueueList" signature="()Ljava/util/List;" isStatic="false">
      <SourceLine classname="com.xyz.applications.epay.cayenne._EbppDAOCayenne" start="67" end="67" startBytecode="0" endBytecode="48" sourcefile="_EbppDAOCayenne.java" sourcepath="com/xyz/applications/epay/cayenne/_EbppDAOCayenne.java"/>
    </Method>
    <Class classname="com.xyz.cayenne.ebpp.entity.generated._Account">
      <SourceLine classname="com.xyz.cayenne.ebpp.entity.generated._Account" start="26" end="246" sourcefile="_Account.java" sourcepath="com/xyz/cayenne/ebpp/entity/generated/_Account.java"/>
    </Class>
    <Method classname="com.xyz.cayenne.ebpp.entity.generated._Account" name="getAchProcessingQueueList" signature="()Ljava/util/List;" isStatic="false">
      <SourceLine classname="com.xyz.cayenne.ebpp.entity.generated._Account" start="131" end="131" startBytecode="0" endBytecode="51" sourcefile="_Account.java" sourcepath="com/xyz/cayenne/ebpp/entity/generated/_Account.java"/>
    </Method>
  </BugInstance>

@mkienenb
Copy link
Author

There's already an existing spotbugs issue for the html problem, which I've updated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant