Repository navigation
Conversation
|
I have read the CLA Document and I hereby sign the CLA Tom Tourwe seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces type names written out in full in the code by their simple name plus an import, for example
java.util.List<String> list = new java.util.ArrayList<>()becomesList<String> list = new ArrayList<>()with
import java.util.ArrayList;andimport java.util.List;. The change is mechanical, made with an automatedimport refactoring.
The two commits
cc1694b6c): unused imports are removed, and every import block is sorted in one order.No code line changes.
9adc92436): a type name written in full becomes its simple name and the importis added. A nested type keeps its enclosing type (
java.util.Map.EntrybecomesMap.Entry, importingjava.util.Map); a static member keeps its class (java.util.Collections.emptyList()becomesCollections.emptyList()); no static import is added. Comments, javadoc and string literals are left as they are.A name stays qualified where its simple name would mean another type in that file: another type of that simple
name is imported, declared or written in the file, or two on-demand imports would both provide it.
Verification
./gradlew testpasses, with no failures.Classes that keep qualified names
These classes in
maddi-aapi-archivedeclare stand-ins for types of two libraries that share simple names (forexample
java.util.Listandio.vavr.collection.List), so one of the two stays qualified:java.util.Optionalin fullio.vavr.collection.Mapin fulljava.util.Listin fullio.vavr.concurrent.Futurein fullThese other classes keep a qualified name because its simple name already means another type there (for example
org.slf4j.Loggerbeside an import ofch.qos.logback.classic.Logger):maddi-callgraph: CommonTest.java, line 49 writesorg.slf4j.Loggerin fullmaddi-inspection-integration: JavaInspectorImpl.java, line 436 writesjava.lang.Runtimein fullmaddi-inspection-integration: CommonTest.java, line 52 writesorg.slf4j.Loggerin fullmaddi-inspection-integration: CommonTest2.java, line 45 writesorg.slf4j.Loggerin fullmaddi-inspection-integration: TestCompilationProblem.java, line 38 writesorg.slf4j.Loggerin fullmaddi-inspection-integration: TestModuleInfo.java, line 54 writesorg.slf4j.Loggerin fullmaddi-inspection-openjdk: JavaInspectorImpl.java, line 689 writesjava.lang.Runtimein fullmaddi-java-openjdk: ClassSymbolScanner.java, line 2645 writescom.sun.tools.javac.util.Listin fullmaddi-java-openjdk: ScanCompilationUnits.java, line 269 writesjavax.lang.model.element.Elementin fullmaddi-java-openjdk: CommonTest.java, line 162 writesjava.lang.Runtimein fullmaddi-java-parser: CommonParse.java, line 256 writesorg.parsers.java.ast.TypeParameterin fullmaddi-java-parser: ParseBlock.java, line 54 writesio.codelaser.maddi.cst.api.statement.Statementin fullmaddi-java-parser: ParseCompilationUnit.java, line 50 writesio.codelaser.maddi.cst.api.element.CompilationUnitin fullmaddi-java-parser: ParseConstructorCall.java, line 190 writesio.codelaser.maddi.cst.api.expression.ArrayInitializerin fullmaddi-java-parser: ParseExpression.java, line 105 writesorg.parsers.java.ast.Expressionin fullmaddi-java-parser: ParseHelperImpl.java, line 116 writesio.codelaser.maddi.cst.api.statement.ExplicitConstructorInvocationin fullmaddi-java-parser: ParseLambdaExpression.java, line 114 writesorg.parsers.java.ast.Expressionin fullmaddi-java-parser: ParseMethodDeclaration.java, line 168 writesio.codelaser.maddi.cst.api.statement.Statementin fullmaddi-java-parser: ParseRecordPattern.java, line 47 writesorg.parsers.java.ast.RecordPatternin fullmaddi-java-parser: ParseStatement.java, line 73 writesio.codelaser.maddi.cst.api.statement.Statementin fullmaddi-java-parser: ScanCompilationUnit.java, line 56 writesio.codelaser.maddi.cst.api.element.CompilationUnitin fullmaddi-run-kotlin: TestOneEntryPoint.java, line 66 writesio.codelaser.maddi.run.openjdkmain.Mainin fullmaddi-run-main: RunAnalyzer.java, line 112 writesch.qos.logback.classic.Loggerin fullmodule-info.java, line 14 writes
uses io.codelaser.maddi.analysis.api.AnalysisEngine;, which stays as it is.