Skip to content

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Aug 30, 2020

WhiteSource Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
java-parser 0.3.2 -> 0.8.2 age adoption passing confidence

Release Notes

jhipster/prettier-java

v0.8.2

Compare Source

Fixes

  • Revert: Parsing of unannPrimitiveType in primary (#​421).
    It was causing a breaking change in the java-parser

  • uses exact dependencies when releasing a new version of java-parser and prettier-plugin-java

v0.8.1

Compare Source

Enhancements

  • Generated a type definition for the Java parser (#​422)

Fixes

  • Wrong indent in some chained methods invocation (#​404)
// Input
class Indent {

  void indetMethod() {
    assertThat(
      useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
      useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
      useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa
    );

    assertThat(
        useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
        useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
        useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa
      )
      .isEqualTo();

    assertThat(
        useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
        useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
        useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa
      )
      .isEqualTo()
      .anotherInvocation(
        useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
        useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
        useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa
      );

    myInstanceObject
      .assertThat(
        useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa
      )
      .isEqualTo();

  }
}

// Output
class Indent {

  void indetMethod() {
    assertThat(
      useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
      useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
      useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa
    );

    assertThat(
      useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
      useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
      useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa
    )
      .isEqualTo();

    assertThat(
      useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
      useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
      useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa
    )
      .isEqualTo()
      .anotherInvocation(
        useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
        useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa,
        useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa
      );

    myInstanceObject
      .assertThat(
        useraaaaaaaaaaojzapjzpozjapjzpoajzpozaaaaaaaaaaaMapperlaaaaaaaaaaaaaaaaaaaaaaaa
      )
      .isEqualTo();
  }
}
  • Parsing of unannPrimitiveType in primary (#​421)
// Throws in Prettier 0.8.0
double[][]::new

// Prettier 0.9.0
double[][]::new

v0.8.0

Compare Source

Enhancements

  • Possibility to run the Prettier Java package on every entrypoint defined in the following list (#​395):
    [
      "variableInitializerList",
      "block",
      "blockStatements",
      "blockStatement",
      "localVariableDeclarationStatement",
      "localVariableDeclaration",
      "localVariableType",
      "statement",
      "statementWithoutTrailingSubstatement",
      "emptyStatement",
      "labeledStatement",
      "expressionStatement",
      "statementExpression",
      "ifStatement",
      "assertStatement",
      "switchStatement",
      "switchBlock",
      "switchCase",
      "switchLabel",
      "enumConstantName",
      "whileStatement",
      "doStatement",
      "forStatement",
      "basicForStatement",
      "forInit",
      "forUpdate",
      "statementExpressionList",
      "enhancedForStatement",
      "breakStatement",
      "continueStatement",
      "returnStatement",
      "throwStatement",
      "synchronizedStatement",
      "tryStatement",
      "catches",
      "catchClause",
      "catchFormalParameter",
      "catchType",
      "finally",
      "tryWithResourcesStatement",
      "resourceSpecification",
      "resourceList",
      "resource",
      "resourceInit",
      "variableAccess",
      "isBasicForStatement",
      "isLocalVariableDeclaration",
      "classDeclaration",
      "normalClassDeclaration",
      "classModifier",
      "typeParameters",
      "typeParameterList",
      "superclass",
      "superinterfaces",
      "interfaceTypeList",
      "classBody",
      "classBodyDeclaration",
      "classMemberDeclaration",
      "fieldDeclaration",
      "fieldModifier",
      "variableDeclaratorList",
      "variableDeclarator",
      "variableDeclaratorId",
      "variableInitializer",
      "unannType",
      "unannPrimitiveType",
      "unannReferenceType",
      "unannClassOrInterfaceType",
      "unannClassType",
      "unannInterfaceType",
      "unannTypeVariable",
      "methodDeclaration",
      "methodModifier",
      "methodHeader",
      "result",
      "methodDeclarator",
      "receiverParameter",
      "formalParameterList",
      "formalParameter",
      "variableParaRegularParameter",
      "variableArityParameter",
      "variableModifier",
      "throws",
      "exceptionTypeList",
      "exceptionType",
      "methodBody",
      "instanceInitializer",
      "staticInitializer",
      "constructorDeclaration",
      "constructorModifier",
      "constructorDeclarator",
      "simpleTypeName",
      "constructorBody",
      "explicitConstructorInvocation",
      "unqualifiedExplicitConstructorInvocation",
      "qualifiedExplicitConstructorInvocation",
      "enumDeclaration",
      "enumBody",
      "enumConstantList",
      "enumConstant",
      "enumConstantModifier",
      "enumBodyDeclarations",
      "isClassDeclaration",
      "identifyClassBodyDeclarationType",
      "isDims",
      "constantExpression",
      "expression",
      "lambdaExpression",
      "lambdaParameters",
      "lambdaParametersWithBraces",
      "lambdaParameterList",
      "inferredLambdaParameterList",
      "explicitLambdaParameterList",
      "lambdaParameter",
      "regularLambdaParameter",
      "lambdaParameterType",
      "lambdaBody",
      "ternaryExpression",
      "binaryExpression",
      "unaryExpression",
      "unaryExpressionNotPlusMinus",
      "primary",
      "primaryPrefix",
      "primarySuffix",
      "fqnOrRefType",
      "fqnOrRefTypePartRest",
      "fqnOrRefTypePartCommon",
      "fqnOrRefTypePartFirst",
      "parenthesisExpression",
      "castExpression",
      "primitiveCastExpression",
      "referenceTypeCastExpression",
      "newExpression",
      "unqualifiedClassInstanceCreationExpression",
      "classOrInterfaceTypeToInstantiate",
      "typeArgumentsOrDiamond",
      "diamond",
      "methodInvocationSuffix",
      "argumentList",
      "arrayCreationExpression",
      "arrayCreationDefaultInitSuffix",
      "arrayCreationExplicitInitSuffix",
      "dimExprs",
      "dimExpr",
      "classLiteralSuffix",
      "arrayAccessSuffix",
      "methodReferenceSuffix",
      "identifyNewExpressionType",
      "isLambdaExpression",
      "isCastExpression",
      "isPrimitiveCastExpression",
      "isReferenceTypeCastExpression",
      "isRefTypeInMethodRef",
      "interfaceDeclaration",
      "normalInterfaceDeclaration",
      "interfaceModifier",
      "extendsInterfaces",
      "interfaceBody",
      "interfaceMemberDeclaration",
      "constantDeclaration",
      "constantModifier",
      "interfaceMethodDeclaration",
      "interfaceMethodModifier",
      "annotationTypeDeclaration",
      "annotationTypeBody",
      "annotationTypeMemberDeclaration",
      "annotationTypeElementDeclaration",
      "annotationTypeElementModifier",
      "defaultValue",
      "annotation",
      "elementValuePairList",
      "elementValuePair",
      "elementValue",
      "elementValueArrayInitializer",
      "elementValueList",
      "identifyInterfaceBodyDeclarationType",
      "identifyAnnotationBodyDeclarationType",
      "isSimpleElementValueAnnotation",
      "literal",
      "integerLiteral",
      "floatingPointLiteral",
      "booleanLiteral",
      "moduleName",
      "packageName",
      "typeName",
      "expressionName",
      "methodName",
      "packageOrTypeName",
      "ambiguousName",
      "compilationUnit",
      "ordinaryCompilationUnit",
      "modularCompilationUnit",
      "packageDeclaration",
      "packageModifier",
      "importDeclaration",
      "typeDeclaration",
      "moduleDeclaration",
      "moduleDirective",
      "requiresModuleDirective",
      "exportsModuleDirective",
      "opensModuleDirective",
      "usesModuleDirective",
      "providesModuleDirective",
      "requiresModifier",
      "isModuleCompilationUnit",
      "primitiveType",
      "numericType",
      "integralType",
      "floatingPointType",
      "referenceType",
      "classOrInterfaceType",
      "classType",
      "interfaceType",
      "typeVariable",
      "dims",
      "typeParameter",
      "typeParameterModifier",
      "typeBound",
      "additionalBound",
      "typeArguments",
      "typeArgumentList",
      "typeArgument",
      "wildcard",
      "wildcardBounds"
    ]

Fixes

Re-Writer
  • Fix formatting of empty enums to not insert commas when trailing-comma is enabled #​385)
    // Input
    public enum Enum {
    }
    
    // Prettier v0.7.1
    public enum Enum {
      ,
    }
    
    // Prettier v0.8.0
    public enum Enum {}
  • Fix formatting of enum with comments #​385)

Miscellaneous

v0.7.1

Compare Source

Fixes

Re-Writer
  • Fix stable formatting for fields and methods with annotations (#​369)

Miscellaneous

v0.7.0

Compare Source

Enhancements

Re-Writer
  • Add support for trailing commas option (#​354)

    For enumerations:

    // Input
    public enum Enum {
      ONE, TWO, THREE
    }
    
    // Output
    public enum Enum {
      ONE,
      TWO,
      THREE,
    }

    For arrays:

    // Input
    public class T {
      void t() {
        int[] ints = { 1, 2, 3, };
        int[] ints = { aVeryLongArrayValue, anotherVeryLongArrayValue, andYetAnotherVeryLongArrayValue };
      }
    }
    
    // Output
    public class T {
      void t() {
        int[] ints = { 1, 2, 3 };
        int[] ints = {
          aVeryLongArrayValue,
          anotherVeryLongArrayValue,
          andYetAnotherVeryLongArrayValue,
        };
      }
    }
  • By default, remove trailing comma in arrays (#​354)

    // Input
    public class T {
      void t() {
        int[] ints = { 1, 2, 3, };
      }
    }
    
    // Output
    public class T {
      void t() {
        int[] ints = { 1, 2, 3 };
      }
    }
  • Allow blank lines in enumerations' constant list (#​350)

    // Input
    public enum OtherEnum {
      ONE, TWO,
    
      THREE,
    
      FOUR,
      /* Five */
      FIVE,
    
      /* Six */
      SIX
    
    }
    
    // Output
    public enum OtherEnum {
      ONE,
      TWO,
    
      THREE,
    
      FOUR,
      /* Five */
      FIVE,
    
      /* Six */
      SIX
    }
  • Always add a blank line between an enumeration's constants and declarations (#​351)

    // This input
    public enum EnumWithExtraCommaAndEnumBodyDeclarations {
      THIS_IS_GOOD("abc"),
      THIS_IS_FINE("abc");
      public static final String thisWillBeDeleted = "DELETED";
    }
    
    // will be formatted to this output
    public enum EnumWithExtraCommaAndEnumBodyDeclarations {
      THIS_IS_GOOD("abc"),
      THIS_IS_FINE("abc");
    
      public static final String thisWillBeDeleted = "DELETED";
    }

Fixes

Re-Writer
  • Fix blank lines with empty statements (#​360)

    // Input
    public class Test {
      public TestField testField;;
    
      @​Override
      public void someMethod() {}
    }
    
    // Output (v0.6.0)
    public class Test {
      public TestField testField;
      @​Override
      public void someMethod() {}
    }
    
    // Output (v0.7.0)
    public class Test {
      public TestField testField;
    
      @​Override
      public void someMethod() {}
    }
  • Fix line wrapping in switch statements (#​359)

    // Input
    public String shouldWrapEvenForSmallSwitchCases() {
      switch (answer) { case "YES": return "YES"; default: return "NO"; }
    }
    // Output (v0.6.0)
    public String shouldWrapEvenForSmallSwitchCases() {
      switch (answer) { case "YES": return "YES"; default: return "NO"; }
    }
    
    // Output (v0.7.0)
    public String shouldWrapEvenForSmallSwitchCases() {
      switch (answer) {
        case "YES":
          return "YES";
        default:
          return "NO";
      }
    }
  • Fix stable reformating of comments in binary expression (#​353)

    // Input
    public boolean binaryOperationWithComments() {
      boolean a = one || two >> 1 // one
        // two
        // three
        || // five
        // four
        three;
    
      boolean b = one || two >> 1 // one
        // two
        // three
        ||
        three;
    
      boolean c = one || two >> 1 // one
        // two
        // three
        || three;
    
      return a || b || c;
    }
    
    // Output (v0.6.0)
    public boolean binaryOperationWithComments() {
      boolean a =
        one ||
        two >> 1 // two // one
        // three
        || // five
        // four
        three;
    
      boolean b =
        one ||
        two >> 1 // two // one
        // three
        ||
        three;
    
      boolean c =
        one ||
        two >> 1 // two // one
        // three
        ||
        three;
    
      return a || b || c;
    }
    
    // Output (v0.7.0)
    public boolean binaryOperationWithComments() {
      boolean a =
        one ||
        two >> 1 || // one
        // five
        // two
        // three
        // four
        three;
    
      boolean b =
        one ||
        two >> 1 || // one
        // two
        // three
        three;
    
      boolean c =
        one ||
        two >> 1 || // one
        // two
        // three
        three;
    
      return a || b || c;
    }
  • Fix comments indentation when they are at the end of a block: indent the comments based on the block they are in (#​345)

    // Input
    public class T {
      int i;
      // comment
    }
    
    // Output (v0.6.0)
    public class T {
      int i;
    // comment
    }
    
    // Output (v0.7.0)
    public class T {
      int i;
      // comment
    }
  • Fix respect of blank lines with comments (#​348)

    // Input
    void t() {
      int i;
      // comment
      int j;
    }
    
    // Output (v0.6.0)
    void t() {
      int i;
    
      // comment
      int j;
    }
    
    // Output (v0.7.0)
    void t() {
      int i;
      // comment
      int j;
    }

v0.6.0

Compare Source

Enhancements

Parser
  • Optimize parser performance by reducing the global maxLookahead to 1 (#​321)
Re-Writer
  • Support // formater-off and // formater-on comments to disable formating on some parts of the code (#​323)

    // Input
    // @​formatter:off
    public class PrettierIgnoreClass {
      public void myMethod(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10) {
    
      }
    }
    // @​formatter:on
    public class PrettierIgnoreClass {
      public void myMethod(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10) {
    
      }
    }
    // Output
    // @​formatter:off
    public class PrettierIgnoreClass {
      public void myMethod(int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10) {
    
      }
    }
    
    // @​formatter:on
    public class PrettierIgnoreClass {
    
      public void myMethod(
        int param1,
        int param2,
        int param3,
        int param4,
        int param5,
        int param6,
        int param7,
        int param8,
        int param9,
        int param10
      ) {}
    }
  • Print enums' values on their own line (#​319)

    // Input
    public enum Enum {
      SOME_ENUM, ANOTHER_ENUM, LAST_ENUM
    }
    
    // Output
    public enum Enum {
      SOME_ENUM,
      ANOTHER_ENUM,
      LAST_ENUM
    }
  • Remove extra comma in enums (#​319)

    // Input
    public enum EnumWithExtraComma {
      SOME_ENUM, ANOTHER_ENUM, LAST_ENUM,
    }
    
    // Output
    public enum Enum {
      SOME_ENUM,
      ANOTHER_ENUM,
      LAST_ENUM
    }
  • Respect case when sorting imports (#​330)

    // Input
    import java.util.ArrayList;
    import java.util.function.Consumer;
    import java.util.functioN.Consumer;
    import java.util.function.ConsumerTwo;
    import java.util.List;
    import java.util.concurrent.Semaphore;
    import java.util.concurrent.*;
    import java.util.Map;
    
    // Output
    import java.util.ArrayList;
    import java.util.List;
    import java.util.Map;
    import java.util.concurrent.*;
    import java.util.concurrent.Semaphore;
    import java.util.functioN.Consumer;
    import java.util.function.Consumer;
    import java.util.function.ConsumerTwo;
  • Improve formatting of lambda expressions when they break (#​333)

    // Input && v0.5.1
    public void lambdaWithoutBracesWhichBreak() {
      call(x -> foo.isVeryVeryVeryLongConditionTrue() &&
      foo.isAnotherVeryVeryLongConditionTrue());
    }
    
    // Output
    public void lambdaWithoutBracesWhichBreak() {
      call(
        x ->
          foo.isVeryVeryVeryLongConditionTrue() &&
          foo.isAnotherVeryVeryLongConditionTrue()
      );
    }
  • Don't indent binary operators (#​329)

    // Input && v0.5.1
    @​Annotation(
      "This operation with two very long string should break" +
        "in a very nice way"
    )
    public void method() {}
    
    // Output
    @​Annotation(
      "This operation with two very long string should break" +
      "in a very nice way"
    )
    public void method() {}
  • Improve ternary expression line wrapping (#​318)

    // Input && v0.5.1
    return (columnIndex == null) ? ImmutableMap.<R, V>of()
      : new Column(columnIndex);
    
    // Output
    return (columnIndex == null)
      ? ImmutableMap.<R, V>of()
      : new Column(columnIndex);
  • Improve formatting of variable initialization with methods (#​332)

    // Input && v0.5.1
    boolean willDrop = predictDropResponse.getSendResult().isIgnorableFailure() || predictDropResponse.getSendResult().isFatalError();
    
    // Output
    boolean willDrop =
      predictDropResponse.getSendResult().isIgnorableFailure() ||
      predictDropResponse.getSendResult().isFatalError();

Fixes

Parser
  • Fix brackets considered as a cast with byte shifting or comparison
    (e.g. (left) << right or (left) < right). The parser is now able to parse completely the ElasticSearch Repository (#​325)
Re-Writer
  • Fix stable reformating of variable declaration with comments (#​336)

    // Input && v0.5.1
    Map<String, String> map =
      // there is a random comment on this line up here
      // and then there is a separate comment on this line down here
      new HashMap<>(someMethodThatReturnsAMap());
    
    // Output
    Map<String, String> map =
      // there is a random comment on this line up here
      // and then there is a separate comment on this line down here
      new HashMap<>(someMethodThatReturnsAMap());

Miscellaneous

  • Check stable reformating for repositories in tests (#​335)
  • Add template for submitting an issue (#​340)

v0.5.1

Compare Source

Fixes

  • Fix parsing and printing of variable arity parameters with dims (#​310)
  • Fix package size (#​317)

v0.5.0

Compare Source

Enhancements

Parser
  • Optimize parser initialisation (#​295)
Re-Writer
  • Sort class, method and field modifiers (#​302). See this doc for more information

    // Input
    final private static @&#8203;Annotation String S = "abc";
    
    // Output
    @&#8203;Annotation
    private static final String S = "abc";

Fixes

Parser
  • Fix lexer gap: align use of transitive keyword with the specs (#​297)
Re-Writer
  • Fix enforcement of printWidth for nodes with leading comments (#​278)
  • Fix switch statements indentation with comments (#​278)
  • Fix unstable formating when wrapping in return statements (#​294)
  • Fix variable arity parameters formating (#​304)

Miscellaneous

  • Drop testing on Node 8 and add testing on Node 13

v0.4.0

Compare Source

Enhancements

  • Upgrade Chevrotain to 6.5.0 (#​268)

  • Split enum to one constant per line if too long (#​266)

public enum EnumWhichBreak {

  ONE_VALUE, TWO_VALUE, THREE_VALUE, FOUR_VALUE, FIVE_VALUE, SIX_VALUE, SEVEN_VALUE, EIGHT_VALUE, NINE_VALUE,
  TEN_VALUE

}

would be transformed in:

public enum EnumWhichBreak {
  ONE_VALUE,
  TWO_VALUE,
  THREE_VALUE,
  FOUR_VALUE,
  FIVE_VALUE,
  SIX_VALUE,
  SEVEN_VALUE,
  EIGHT_VALUE,
  NINE_VALUE,
  TEN_VALUE
}

When

public enum EnumWhichNotBreak {
  SOME_ENUM, ANOTHER_ENUM, LAST_ENUM
}

would be kept as it is:

public enum EnumWhichNotBreak {
  SOME_ENUM, ANOTHER_ENUM, LAST_ENUM
}
  • Remove extra semicolons in enums when possible (#​266)
public enum EnumWhichNotBreak {
  SOME_ENUM, ANOTHER_ENUM, LAST_ENUM;
}

would be transformed in:

public enum EnumWhichNotBreak {
  SOME_ENUM, ANOTHER_ENUM, LAST_ENUM
}

when the following is kept as it is:

public enum Enum {
  THIS_IS_GOOD("abc"), THIS_IS_FINE("abc");
  public static final String thisWillBeDeleted = "DELETED";

  private final String value;

  public Enum(String value) {
    this.value = value;
  }

  public String toString() {
    return "STRING";
  }
package my.own.pkg;

import something.Different;
import java.utils.*;;;
import abc.def.Something;
import abc.def.Another;;;
import abc.def;
import static abc.def;
import  static something.Different;
import static  java.utils.*;;;
import static abc.def.Something;
import static abc.def.Another;;;
import one.last;;;

public class PackageAndImports {}

is transformed in:

package my.own.pkg;

import static abc.def;
import static abc.def.Another;
import static abc.def.Something;
import static java.utils.*;
import static something.Different;

import abc.def;
import abc.def.Another;
import abc.def.Something;
import java.utils.*;
import one.last;
import something.Different;

public class PackageAndImports {}
  • Better display of local variable declarations (#​283)
public boolean localVariableDeclarationWhichBreak() {
  @&#8203;Nullable final BackupStatus lastStatus = BackupStatus.fromDbValue(backupRepository.getLastStatus());

  final BackupStatus lastStatus = BackupStatus.fromDbValue(backupRepository.getLastStatus());

  @&#8203;Nullable BackupStatus lastStatus = BackupStatus.fromDbValue(backupRepository.getLastStatus());

  BackupStatus lastStatus = BackupStatus.fromDbValue(backupRepository.getLastStatus());
}

public boolean localVariableDeclarationWhichDoNotBreak() {
  @&#8203;Nullable final BackupStatus lastStatus = value;

  final BackupStatus lastStatus = value;

  @&#8203;Nullable BackupStatus lastStatus = value;

  BackupStatus lastStatus = value;
}

is transformed in:

public boolean localVariableDeclarationWhichBreak() {
  @&#8203;Nullable
  final BackupStatus lastStatus = BackupStatus.fromDbValue(
    backupRepository.getLastStatus()
  );

  final BackupStatus lastStatus = BackupStatus.fromDbValue(
    backupRepository.getLastStatus()
  );

  @&#8203;Nullable
  BackupStatus lastStatus = BackupStatus.fromDbValue(
    backupRepository.getLastStatus()
  );

  BackupStatus lastStatus = BackupStatus.fromDbValue(
    backupRepository.getLastStatus()
  );
}

public boolean localVariableDeclarationWhichDoNotBreak() {
  @&#8203;Nullable
  final BackupStatus lastStatus = value;

  final BackupStatus lastStatus = value;

  @&#8203;Nullable
  BackupStatus lastStatus = value;

  BackupStatus lastStatus = value;
}
  • Improve binary operations indentation (#​255):
Obj newObject = new Object().something().more().and().that().as().well().but().not().something();

Object.test.creation thisObject = classWithName.invocationOne().invocationTwo();

Object.test.creation thisObject1 = classWithName.invocationOne(argument1, argument2, argument3);

Object.test.creation thisObject2 = classWithName.invocationOne(argument1, argument2, argument3).invocationTwo();

Object.test.creation thisObject3 = classWithName.invocationOne().invocationTwo(argument1, argument2, argument3);

Object.test.creation thisObject4 = classWithName.invocationOne(argument1, argument2, argument3).invocationTwo(argument1, argument2);

Object.test.creation thisObject5 = classWithName.invocationOne(argument1WithAVeryVeryVeryVeryLongName, argument2, argument3).attributeOne.attributeTwo
    .invocationTwo(argument1, argument2).attributeThree.invocationThree();

Object.test.creation thisObject6 = classWithName.invocationOne(argument1, argument2,
    argument3).attributeOne.attributeTwo.invocationTwo(argument1, argument2).attributeThree.invocationThree();

is transformed in:

Obj newObject = new Object()
  .something()
  .more()
  .and()
  .that()
  .as()
  .well()
  .but()
  .not()
  .something();

Object.test.creation thisObject = classWithName
  .invocationOne()
  .invocationTwo();

Object.test.creation thisObject1 = classWithName.invocationOne(
  argument1,
  argument2,
  argument3
);

Object.test.creation thisObject2 = classWithName
  .invocationOne(argument1, argument2, argument3)
  .invocationTwo();

Object.test.creation thisObject3 = classWithName
  .invocationOne()
  .invocationTwo(argument1, argument2, argument3);

Object.test.creation thisObject4 = classWithName
  .invocationOne(argument1, argument2, argument3)
  .invocationTwo(argument1, argument2);

Object.test.creation thisObject5 = classWithName
  .invocationOne(
    argument1WithAVeryVeryVeryVeryLongName,
    argument2,
    argument3
  )
  .attributeOne.attributeTwo.invocationTwo(argument1, argument2)
  .attributeThree.invocationThree();

Object.test.creation thisObject6 = classWithName
  .invocationOne(argument1, argument2, argument3)
  .attributeOne.attributeTwo.invocationTwo(argument1, argument2)
  .attributeThree.invocationThree();
  • Improve return statement rendering (#​255)
Object returnSomethingWhichDoNotBreak() {
  return oneVariable + secondVariable;
}

Object returnSomethingWhichBreak() {
  return oneVariable + secondVariable + thirdVariable + fourthVariable + fifthVariable + sixthVariable + seventhVariable;
}

Object returnSomethingWhichBreakAndAlreadyInParenthesis() {
  return (
      oneVariable +
          secondVariable +
          thirdVariable +
          fourthVariable +
          fifthVariable +
          sixthVariable +
          seventhVariable
  );
}

is transformed in:

Object returnSomethingWhichDoNotBreak() {
  return oneVariable + secondVariable;
}

Object returnSomethingWhichBreak() {
  return (
    oneVariable +
    secondVariable +
    thirdVariable +
    fourthVariable +
    fifthVariable +
    sixthVariable +
    seventhVariable
  );
}

Object returnSomethingWhichBreakAndAlreadyInParenthesis() {
  return (
    oneVariable +
    secondVariable +
    thirdVariable +
    fourthVariable +
    fifthVariable +
    sixthVariable +
    seventhVariable
  );
}

Fixed

  • Add missing lodash dependency (#​265)
  • Fix blocks comments formatting (#​280)

Configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box.

This PR has been generated by WhiteSource Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/java-parser-0.x branch from 05a4e9b to 58a5921 Compare August 31, 2020 09:42
@renovate renovate bot changed the title Update dependency java-parser to v0.8.1 Update dependency java-parser to v0.8.2 Aug 31, 2020
@renovate renovate bot force-pushed the renovate/java-parser-0.x branch from 58a5921 to aa33bc6 Compare February 1, 2021 17:51
@renovate renovate bot force-pushed the renovate/java-parser-0.x branch from aa33bc6 to 3372390 Compare February 20, 2021 10:46
@stale
Copy link

stale bot commented Aug 22, 2021

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix This will not be worked on label Aug 22, 2021
@stale stale bot closed this Jan 8, 2022
@renovate
Copy link
Author

renovate bot commented Jan 8, 2022

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update (0.8.2). You will get a PR once a newer version is released. To ignore this dependency forever, add it to the ignoreDeps array of your Renovate config.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

@renovate renovate bot deleted the renovate/java-parser-0.x branch January 8, 2022 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant