java.lang.IllegalArgumentException

expected one element but was: <BlockStatement, BlockStatement>

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web18

  • via Unknown by Ilya Martynov,
  • Stack trace

    • java.lang.IllegalArgumentException: expected one element but was: <BlockStatement, BlockStatement> at com.google.common.collect.Iterators.getOnlyElement(Iterators.java:317) at com.google.common.collect.Iterables.getOnlyElement(Iterables.java:289) at net.sourceforge.pmd.lang.apex.rule.apexunit.ApexUnitTestClassShouldHaveAsserts.checkForAssertStatements(ApexUnitTestClassShouldHaveAsserts.java:32) at net.sourceforge.pmd.lang.apex.rule.apexunit.ApexUnitTestClassShouldHaveAsserts.visit(ApexUnitTestClassShouldHaveAsserts.java:27) at net.sourceforge.pmd.lang.apex.ast.ASTMethod.jjtAccept(ASTMethod.java:15) at net.sourceforge.pmd.lang.apex.ast.AbstractApexNode.childrenAccept(AbstractApexNode.java:101) at net.sourceforge.pmd.lang.apex.rule.AbstractApexRule.visit(AbstractApexRule.java:132) at net.sourceforge.pmd.lang.apex.rule.AbstractApexRule.visit(AbstractApexRule.java:143) at net.sourceforge.pmd.lang.apex.rule.apexunit.AbstractApexUnitTestRule.visit(AbstractApexUnitTestRule.java:30) at net.sourceforge.pmd.lang.apex.rule.AbstractApexRule.visitAll(AbstractApexRule.java:121) at net.sourceforge.pmd.lang.apex.rule.AbstractApexRule.apply(AbstractApexRule.java:115) at net.sourceforge.pmd.RuleSet.apply(RuleSet.java:306) at net.sourceforge.pmd.RuleSets.apply(RuleSets.java:125) at net.sourceforge.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.java:146) at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:76) at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:43) at net.sourceforge.pmd.processor.PmdRunnable.call(PmdRunnable.java:79) at net.sourceforge.pmd.processor.PmdRunnable.call(PmdRunnable.java:25) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown visitor
    Unknown visitorOnce,
    arturgajowyarturgajowy
    Once,