java.lang.AssertionError

tip

Check your pattern declaration or check your assert declaration.


rafael

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

  • GitHub comment 180#250072901
    via GitHub by yossigil
    ,
  • Soften Graph Generator Tests
    via GitHub by spmallette
    ,
    • java.lang.AssertionError: Cannot parse ' /** Retrieve all operands, including parenthesized ones, under an expression * @param x JD * @return a {@link List} of all operands to the parameter */ public static List<Expression> allOperands(final InfixExpression x) { assert x != null; return hop.operands(flatten.of(x)); } ********* I tried the following options: * Attempt 1: Statement * I = <package p;public final class C{public void m(){/**Retrieve all operands,including parenthesized ones,under an expression*@param x JD*@return a{@link List}of all operands to the parameter*/public static List<Expression>allOperands(final InfixExpression x){assert x!=null;return hop.operands(flatten.of(x));}}}>; * O = <package p;public final class C{public void m(){}}>; **** PARSED= package p; public final class C { public void m(){ } } * AST=org.eclipse.jdt.core.dom.AST@5035c23c **** INPUT= package p; public final class C { public void m(){ /** Retrieve all operands, including parenthesized ones, under an expression * @param x JD * @return a {@link List} of all operands to the parameter */ public static List<Expression> allOperands(final InfixExpression x) { assert x != null; return hop.operands(flatten.of(x)); }} // END m } // END p **** OUTPUT= package p; public final class C { public void m(){ } } * Attempt 2: Expression * I = <package p;public final class C{public void m(){while(/**Retrieve all operands,including parenthesized ones,under an expression*@param x JD*@return a{@link List}of all operands to the parameter*/public static List<Expression>allOperands(final InfixExpression x){assert x!=null;return hop.operands(flatten.of(x));});}}>; * O = <package p;public final class C{public void m(){}}>; **** PARSED= package p; public final class C { public void m(){ } } * AST=org.eclipse.jdt.core.dom.AST@6e92f150 **** INPUT= package p; public final class C { public void m(){ while (/** Retrieve all operands, including parenthesized ones, under an expression * @param x JD * @return a {@link List} of all operands to the parameter */ public static List<Expression> allOperands(final InfixExpression x) { assert x != null; return hop.operands(flatten.of(x)); }); } // END m } // END p **** OUTPUT= package p; public final class C { public void m(){ } } * Attempt 3: Method * I = <package p;public final class C{/**Retrieve all operands,including parenthesized ones,under an expression*@param x JD*@return a{@link List}of all operands to the parameter*/public static List<Expression>allOperands(final InfixExpression x){assert x!=null;return hop.operands(flatten.of(x));}}>; * O = <package p;public final class C{/***Retrieve all operands,including parenthesized ones,under an expression*@param x JD*@return a{@link List}of all operands to the parameter*/public static List<Expression>allOperands(final InfixExpression x){assert x!=null;return hop.operands(flatten.of(x));}}>; **** PARSED= package p; public final class C { /** * Retrieve all operands, including parenthesized ones, under an expression * @param x JD * @return a {@link List} of all operands to the parameter */ public static List<Expression> allOperands( final InfixExpression x){ assert x != null; return hop.operands(flatten.of(x)); } } * AST=org.eclipse.jdt.core.dom.AST@4268c16 **** INPUT= package p; public final class C { /** Retrieve all operands, including parenthesized ones, under an expression * @param x JD * @return a {@link List} of all operands to the parameter */ public static List<Expression> allOperands(final InfixExpression x) { assert x != null; return hop.operands(flatten.of(x)); }} // END p **** OUTPUT= package p; public final class C { /** * Retrieve all operands, including parenthesized ones, under an expression * @param x JD * @return a {@link List} of all operands to the parameter */ public static List<Expression> allOperands( final InfixExpression x){ assert x != null; return hop.operands(flatten.of(x)); } } * Attempt 4: OUTER * I = <package p;/**Retrieve all operands,including parenthesized ones,under an expression*@param x JD*@return a{@link List}of all operands to the parameter*/public static List<Expression>allOperands(final InfixExpression x){assert x!=null;return hop.operands(flatten.of(x));}>; * O = <package p;>; **** PARSED= package p; * AST=org.eclipse.jdt.core.dom.AST@50a2034c **** INPUT= package p; // BEGIN PACKAGE /** Retrieve all operands, including parenthesized ones, under an expression * @param x JD * @return a {@link List} of all operands to the parameter */ public static List<Expression> allOperands(final InfixExpression x) { assert x != null; return hop.operands(flatten.of(x)); } // END PACKAGE **** OUTPUT= package p; at org.junit.Assert.fail(Assert.java:88) at il.org.spartan.azzert.fail(azzert.java:201) at il.org.spartan.spartanizer.spartanizations.Wrap.find(Wrap.java:46) at il.org.spartan.spartanizer.tippers.TrimmerTestsUtils$Operand.gives(TrimmerTestsUtils.java:67) at il.org.spartan.spartanizer.tippers.Issue180.renameToCentRealWorld(Issue180.java:26) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

    Users with the same issue

    Andreas Häber
    8 times, last one,
    osvzs
    2 times, last one,
    Casper
    2 times, last one,
    marcbouvierdav
    1 times, last one,
    rsprangemeijer
    1 times, last one,
    94 more bugmates