Skip to content

'Store<M>.Record record' is changed to 'Store.<M>Record record' #752

@ArLau

Description

@ArLau

Prettier-Java 2.7.1

It worked fine with 2.6.8.

prettier "**/*.(yaml|yml|md|ts|tsx|java)" --write

Input:

    private void handleRecordChangeEvent(final StoreRecordChangeEvent<Channel> event) {
        final ValueProvider<? super Channel, ?> valueProvider = event.getProperty();
        final String path = valueProvider.getPath();
        final Store<Channel>.Record record = event.getRecord();
        final Store.Change<Channel, ?> change = record.getChange(valueProvider);
  }

Output:

    private void handleRecordChangeEvent(final StoreRecordChangeEvent<Channel> event) {
        final ValueProvider<? super Channel, ?> valueProvider = event.getProperty();
        final String path = valueProvider.getPath();
        final Store.<Channel>Record record = event.getRecord();
        final Store.Change<Channel, ?> change = record.getChange(valueProvider);
  }

Expected behavior:

The information for the generic type should not be changed.

This change even results in

prettier \"**/*.(yaml|yml|md|ts|tsx|java)\" --check

failing with:

[error] FileName.java: Error: Sad sad panda, parsing errors detected in line: 184, column: 21!
[error] Expecting token of type --> Identifier <-- but found --> '<' <--!
[error] 	->compilationUnit
[error] 	->ordinaryCompilationUnit
[error] 	->typeDeclaration
[error] 	->classDeclaration
[error] 	->normalClassDeclaration
[error] 	->classBody
[error] 	->classBodyDeclaration
[error] 	->classMemberDeclaration
[error] 	->methodDeclaration
[error] 	->methodBody
[error] 	->block
[error] 	->blockStatements
[error] 	->blockStatement
[error] 	->localVariableDeclarationStatement
[error] 	->localVariableDeclaration
[error] 	->localVariableType
[error] 	->unannType
[error] 	->unannReferenceType
[error] 	->unannClassOrInterfaceType
[error] 	->unannClassType
[error]     at lexAndParse ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions