com.google.javascript.refactoring.SuggestedFix$Builder.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of closure-compiler-unshaded Show documentation
Show all versions of closure-compiler-unshaded Show documentation
Closure Compiler is a JavaScript optimizing compiler. It parses your
JavaScript, analyzes it, removes dead code and rewrites and minimizes
what's left. It also checks syntax, variable references, and types, and
warns about common JavaScript pitfalls. It is used in many of Google's
JavaScript apps, including Gmail, Google Web Search, Google Maps, and
Google Docs.
The newest version!
???? 7K
java/lang/Object ()V
6com/google/javascript/refactoring/SuggestedFix$Builder matchedNodeInfo @Lcom/google/javascript/refactoring/SuggestedFix$MatchedNodeInfo;
.com/google/common/collect/ImmutableSetMultimap builder :()Lcom/google/common/collect/ImmutableSetMultimap$Builder; replacements 8Lcom/google/common/collect/ImmutableSetMultimap$Builder;
'com/google/common/collect/ImmutableList 3()Lcom/google/common/collect/ImmutableList$Builder; alternatives 1Lcom/google/common/collect/ImmutableList$Builder; ! " # description Ljava/lang/String; % .com/google/javascript/refactoring/NodeMetadata
$ ' ( 2(Lcom/google/javascript/jscomp/AbstractCompiler;)V
* + , - . 2com/google/javascript/refactoring/RefactoringUtils isInClosurizedFile U(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/refactoring/NodeMetadata;)Z
0 1 2 3 4 >com/google/javascript/refactoring/SuggestedFix$MatchedNodeInfo create e(Lcom/google/javascript/rhino/Node;Z)Lcom/google/javascript/refactoring/SuggestedFix$MatchedNodeInfo;
6 7 8 9 : .com/google/javascript/refactoring/SuggestedFix getNonDefaultAlternatives +()Lcom/google/common/collect/ImmutableList;
< = > isEmpty ()Z @ @Alternative SuggestedFix must have no alternatives of their own.
B C D E F $com/google/common/base/Preconditions
checkState (ZLjava/lang/Object;)V
H I J K L /com/google/common/collect/ImmutableList$Builder add E(Ljava/lang/Object;)Lcom/google/common/collect/ImmutableList$Builder;
N O P Q R com/google/javascript/rhino/Node getSourceOffset ()I
N T U V getSourceFileName ()Ljava/lang/String;
X Y Z 3 [ 1com/google/javascript/refactoring/CodeReplacement I(IILjava/lang/String;)Lcom/google/javascript/refactoring/CodeReplacement;
] ^ _ ` a 6com/google/common/collect/ImmutableSetMultimap$Builder put ^(Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/common/collect/ImmutableSetMultimap$Builder;
N c d > isBlock f 7addChildToFront is only supported for BLOCK statements. h i j makeConcatWithConstants &(Ljava/lang/String;)Ljava/lang/String;
N l m R getLength o
q r s insertBefore ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/AbstractCompiler;Ljava/lang/String;)Lcom/google/javascript/refactoring/SuggestedFix$Builder;
u v w generateCode e(Lcom/google/javascript/jscomp/AbstractCompiler;Lcom/google/javascript/rhino/Node;)Ljava/lang/String;
y r z ?(Lcom/google/javascript/rhino/Node;Ljava/lang/String;Ljava/lang/String;)Lcom/google/javascript/refactoring/SuggestedFix$Builder;
6 | } ~ *getStartPositionForNodeConsideringComments %(Lcom/google/javascript/rhino/Node;)I ? No source file name for node: %s
B ? ? ? checkNotNull J(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
X ? 3 ? [(IILjava/lang/String;Ljava/lang/String;)Lcom/google/javascript/refactoring/CodeReplacement;
? ? ? delete ](Lcom/google/javascript/rhino/Node;Z)Lcom/google/javascript/refactoring/SuggestedFix$Builder;
N ? ? ? getNext $()Lcom/google/javascript/rhino/Node;
? ? ? ? ? %com/google/javascript/jscomp/NodeUtil getBestJSDocInfo K(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/JSDocInfo;
N ? ? ? getNonJSDocComment /()Lcom/google/javascript/rhino/NonJSDocComment;
N ? ? > isName
N ? ? ? getParent
? ? ? ? isNameDeclaration %(Lcom/google/javascript/rhino/Node;)Z
N ? ? > isStringKey
N ? ? > hasChildren
N ? ? ?
getFirstChild
N ? ? ? getLastChild
N ? ? ? getPrevious
N ? ? > isScript
? ? ? rename o(Lcom/google/javascript/rhino/Node;Ljava/lang/String;Z)Lcom/google/javascript/refactoring/SuggestedFix$Builder; ? ? ? ? ? 0com/google/javascript/refactoring/SuggestedFix$1 ,$SwitchMap$com$google$javascript$rhino$Token [I
N ? ? ? getToken %()Lcom/google/javascript/rhino/Token;
? ? ? ? R !com/google/javascript/rhino/Token ordinal
? ? ? subtreeRangeOfIdentifier F(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
N ? ? > isGetProp ? 'java/lang/UnsupportedOperationException ? i ? 6(Lcom/google/javascript/rhino/Node;)Ljava/lang/String;
? ? ? (Ljava/lang/String;)V
B ? E ? (Z)V
N ? ? > isExprResult ?
? ? ? ? ? java/lang/String endsWith (Ljava/lang/String;)Z
? ? ? R length
? ? ? ? substring (II)Ljava/lang/String;
N ? ? > isModuleBody ? ;
? ? ? ? ? com/google/javascript/rhino/IR mayBeExpression
N ? ? > hasOneChild
N ? ? ? getOnlyChild
? ? ?
precedence &(Lcom/google/javascript/rhino/Token;)I ? CALL #Lcom/google/javascript/rhino/Token; h i 8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
N
> isCast
B
?
checkArgument
N getJSDocInfo )()Lcom/google/javascript/rhino/JSDocInfo;
R %com/google/javascript/rhino/JSDocInfo getOriginalCommentPosition
V getOriginalCommentString
4com/google/javascript/jscomp/parsing/JsDocInfoParser parseTypeString 6(Ljava/lang/String;)Lcom/google/javascript/rhino/Node;" Invalid type: %s$ ,com/google/javascript/rhino/JSTypeExpression& jsflume
#( ) 7(Lcom/google/javascript/rhino/Node;Ljava/lang/String;)V
+,-./ -com/google/javascript/jscomp/AbstractCompiler getTypeRegistry 5()Lcom/google/javascript/rhino/jstype/JSTypeRegistry;
#123 evaluate ?(Lcom/google/javascript/rhino/jstype/StaticTypedScope;Lcom/google/javascript/rhino/jstype/JSTypeRegistry;)Lcom/google/javascript/rhino/jstype/JSType;5 java/lang/RuntimeException h
4 ?9 @(type) *\{?[^@\s}]+\}?
;<=>? java/util/regex/Pattern compile -(Ljava/lang/String;)Ljava/util/regex/Pattern;
ABC replaceTypePattern P(Lcom/google/javascript/rhino/Node;Ljava/lang/String;Ljava/util/regex/Pattern;)VE B@(export|package|private|protected|public|const|return) *\{[^}]+\}G 0Node %s does not have JS Doc associated with it.
;IJK matcher 3(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
MNOP > java/util/regex/Matcher find
MRS R start
MUV R end
MXYZ group (I)Ljava/lang/String;
N]^ > isCall` :insertArguments is only applicable to function call nodes.
Bb F
Nde ? getSecondChildg AThe specified position must be less than the number of arguments.i ,
klmno com/google/common/base/Joiner on 3(Ljava/lang/String;)Lcom/google/common/base/Joiner;
kqrs join '([Ljava/lang/Object;)Ljava/lang/String; h h
Nwx > isNewz 9deleteArgument is only applicable to function call nodes.
N|} R
getChildCount DdeleteArgument() cannot be used on a function call with no arguments ??? ? D$SwitchMap$com$google$javascript$refactoring$SuggestedFix$ImportType
? ?? 9com/google/javascript/refactoring/SuggestedFix$ImportType? require? requireType? java/lang/AssertionError
? ? goog
??? name
???? getprop X(Lcom/google/javascript/rhino/Node;Ljava/lang/String;)Lcom/google/javascript/rhino/Node;
??? string
???? call i(Lcom/google/javascript/rhino/Node;[Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
???? constNode h(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/rhino/Node;
??? ?
exprResult ???? REQUIRE ;Lcom/google/javascript/refactoring/SuggestedFix$ImportType;
??? addImport ?(Lcom/google/javascript/refactoring/Match;Ljava/lang/String;Lcom/google/javascript/refactoring/SuggestedFix$ImportType;Lcom/google/javascript/refactoring/ScriptMetadata;)Lcom/google/javascript/refactoring/SuggestedFix$Builder; ???? REQUIRE_TYPE
???? > 0com/google/javascript/refactoring/ScriptMetadata supportsRequireAliases
??? j getAlias
???? indexOf (I)I
????? 7com/google/javascript/refactoring/RequireAliasGenerator over ((Ljava/lang/String;)Ljava/lang/Iterable;
????? !com/google/common/collect/Streams stream /(Ljava/lang/Iterable;)Ljava/util/stream/Stream; ??? test R(Lcom/google/javascript/refactoring/ScriptMetadata;)Ljava/util/function/Predicate;????? java/util/stream/Stream filter 9(Ljava/util/function/Predicate;)Ljava/util/stream/Stream;???? findFirst ()Ljava/util/Optional; ??? get ()Ljava/util/function/Supplier;
????? java/util/Optional orElseThrow 1(Ljava/util/function/Supplier;)Ljava/lang/Object;
???? addAlias '(Ljava/lang/String;Ljava/lang/String;)V
????? 'com/google/javascript/refactoring/Match getMetadata 2()Lcom/google/javascript/refactoring/NodeMetadata;
??? ? getNode
??? findGoogRequireNode ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/refactoring/NodeMetadata;Ljava/lang/String;)Lcom/google/javascript/rhino/Node;? goog.forwardDeclare
???? isCallTo 7(Lcom/google/javascript/rhino/Node;Ljava/lang/String;)Z
??? createImportNode ?(Lcom/google/javascript/refactoring/SuggestedFix$ImportType;Ljava/lang/String;Ljava/lang/String;)Lcom/google/javascript/rhino/Node;
N?? ? cloneTree
$?? getCompiler 1()Lcom/google/javascript/jscomp/AbstractCompiler;
replace ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/AbstractCompiler;)Lcom/google/javascript/refactoring/SuggestedFix$Builder;
? ? getScript
*com/google/javascript/refactoring/Matchers
googModule -()Lcom/google/javascript/refactoring/Matcher; . )com/google/javascript/refactoring/Matcher matches
? ?
isExprCall
googModuleOrProvide
googRequirelike
N > isStringLit
N ! V getString
?#$% compareTo (Ljava/lang/String;)I
N'( ? getFirstFirstChild
N*+ V getOriginalName
-./ %deleteWithoutRemovingWhitespaceBefore \(Lcom/google/javascript/rhino/Node;)Lcom/google/javascript/refactoring/SuggestedFix$Builder;
+12
getScriptNode
45 ?(Ljava/lang/String;)Lcom/google/javascript/refactoring/Matcher;
N78 > isDestructuringLhs: Support other identifier nodes
?<= ? empty
N?@A getStaticSourceFile 0()Lcom/google/javascript/rhino/StaticSourceFile;
NCDE setStaticSourceFile R(Lcom/google/javascript/rhino/StaticSourceFile;)Lcom/google/javascript/rhino/Node;
NGH R getLineno
NJK R getCharno
NMNO setLinenoCharno &(II)Lcom/google/javascript/rhino/Node;
NQRS setLength (I)V ?UV SCRIPT
NXYZ setToken &(Lcom/google/javascript/rhino/Token;)V\ ,com/google/javascript/jscomp/CompilerOptions
[
[_` ? setPreferSingleQuotes
[bc ? setUseOriginalNamesInOutput
[ef ? setPreserveNonJSDocComments
[hi ? setTrustedStringsk 0com/google/javascript/jscomp/CodePrinter$Builder
jm n %(Lcom/google/javascript/rhino/Node;)V
jpqr setCompilerOptions b(Lcom/google/javascript/jscomp/CompilerOptions;)Lcom/google/javascript/jscomp/CodePrinter$Builder;
jtuv setTypeRegistry g(Lcom/google/javascript/rhino/jstype/JSTypeRegistry;)Lcom/google/javascript/jscomp/CodePrinter$Builder;
jxyz setPrettyPrint 5(Z)Lcom/google/javascript/jscomp/CodePrinter$Builder;
j|}z setLineBreak
j?z setOutputTypes
j?? V build
]??? 2()Lcom/google/common/collect/ImmutableSetMultimap;
H?? :
6? ? ?(Lcom/google/javascript/refactoring/SuggestedFix$MatchedNodeInfo;Lcom/google/common/collect/SetMultimap;Ljava/lang/String;Lcom/google/common/collect/ImmutableList;)V
??? ? usesName RuntimeVisibleTypeAnnotations #Lorg/jspecify/annotations/Nullable; Signature Lcom/google/common/collect/ImmutableSetMultimap$Builder; cLcom/google/common/collect/ImmutableList$Builder; Code LineNumberTable LocalVariableTable this 8Lcom/google/javascript/refactoring/SuggestedFix$Builder; attachMatchedNodeInfo ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/AbstractCompiler;)Lcom/google/javascript/refactoring/SuggestedFix$Builder; node "Lcom/google/javascript/rhino/Node; compiler /Lcom/google/javascript/jscomp/AbstractCompiler; MethodParameters addAlternative j(Lcom/google/javascript/refactoring/SuggestedFix;)Lcom/google/javascript/refactoring/SuggestedFix$Builder; alternative 0Lcom/google/javascript/refactoring/SuggestedFix; replaceText o(Lcom/google/javascript/rhino/Node;ILjava/lang/String;)Lcom/google/javascript/refactoring/SuggestedFix$Builder; I
newContent
startPosition addChildToFront n(Lcom/google/javascript/rhino/Node;Ljava/lang/String;)Lcom/google/javascript/refactoring/SuggestedFix$Builder;
parentNode content insertAfter text position nodeToInsertBefore n sortKey child startPositionDiff previousSibling previousSiblingEndPosition deleteWhitespaceBefore Z startOffsetWithoutComments parent
StackMapTable deleteWithoutRemovingWhitespace range replaceNameSubtree replaceRange ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/rhino/Node;Ljava/lang/String;)Lcom/google/javascript/refactoring/SuggestedFix$Builder; first last outer inner newInner replacement original newNode newCode needsSemicolon addCast ?(Lcom/google/javascript/rhino/Node;Lcom/google/javascript/jscomp/AbstractCompiler;Ljava/lang/String;)Lcom/google/javascript/refactoring/SuggestedFix$Builder; type
removeCast jsDoc 'Lcom/google/javascript/rhino/JSDocInfo; addOrReplaceJsDoc newJsDoc offset changeJsDocType typeNode typeExpr .Lcom/google/javascript/rhino/JSTypeExpression; newJsType +Lcom/google/javascript/rhino/jstype/JSType;? )com/google/javascript/rhino/jstype/JSType m Ljava/util/regex/Matcher; pattern Ljava/util/regex/Pattern; info originalComment originalPosition insertArguments p(Lcom/google/javascript/rhino/Node;I[Ljava/lang/String;)Lcom/google/javascript/refactoring/SuggestedFix$Builder; args [Ljava/lang/String; argument i? deleteArgument ](Lcom/google/javascript/rhino/Node;I)Lcom/google/javascript/refactoring/SuggestedFix$Builder; numArguments startOfArgumentToRemove endOfArgumentToRemove lengthOfArgumentToRemove
requireFlavor
importType alias namespace callNode addGoogRequire ?(Lcom/google/javascript/refactoring/Match;Ljava/lang/String;Lcom/google/javascript/refactoring/ScriptMetadata;)Lcom/google/javascript/refactoring/SuggestedFix$Builder; )Lcom/google/javascript/refactoring/Match; scriptMetadata 2Lcom/google/javascript/refactoring/ScriptMetadata; addGoogRequireType
existingAlias
grandchild requireName originalName nodeToInsertAfter metadata 0Lcom/google/javascript/refactoring/NodeMetadata; existingNode script lastModuleOrProvideNode lastGoogRequireNode
newImportNode removeGoogRequire u(Lcom/google/javascript/refactoring/Match;Ljava/lang/String;)Lcom/google/javascript/refactoring/SuggestedFix$Builder; googRequireNode leftmost result compilerOptions .Lcom/google/javascript/jscomp/CompilerOptions; setDescription L(Ljava/lang/String;)Lcom/google/javascript/refactoring/SuggestedFix$Builder; 2()Lcom/google/javascript/refactoring/SuggestedFix; lambda$addImport$0 G(Lcom/google/javascript/refactoring/ScriptMetadata;Ljava/lang/String;)Z a
SourceFile SuggestedFix.java NestHost BootstrapMethods
i $java/lang/invoke/StringConcatFactory ?(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;
! /Rename is not implemented for this node type: # ()% /** @type {} */ ()' &JS Compiler does not recognize type: ) @ {}+ , - , /
01234 "java/lang/invoke/LambdaMetafactory metafactory ?(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;6 (Ljava/lang/Object;)Z8
9 ?< ()Ljava/lang/Object;?? ()Ljava/lang/AssertionError; InnerClasses Builder MatchedNodeInfo
ImportTypeE (com/google/javascript/jscomp/CodePrinterG %java/lang/invoke/MethodHandles$LookupI java/lang/invoke/MethodHandles Lookup 1 ? ? ? ? ? ? " # ? ? $ ? [ *? *? *?
? *? ? *? ? ? ? ? ?
? ? ?? ?? ?? ? ` *++? $Y,? &? )? /? *? ? ? ? ? ?? ?? ?? ?? ? ? ? ?? ? [ +? 5? ;?? A*? +? GW*? ? ? ? ? ? ?? ?? ?? ? ? ?? ? } +? M6*? +? S-? W? \W*? ? ? ? ? ? ?? 4 ?? ?? ?? ? # ?? ?
? ? ? ?? ? ? )+? be? A+? M`>*? +? S,? g ? W? \W*? ? " ? ? ? ? ? ? # ? ' ?? * )?? )?? )? # ?? ? ? ? ?? ? n +? M+? k`>*? +? S,? W? \W*? ? ?
? ?? * ?? ?? ? #
?? ? ? ? r ? R
*+,-n? p? ? ?? *
??
??
??
?? ?
? ? ? r s ? ` *+*-,? t? x? ? ?? 4 ?? ?? ?? ?? ? # ? ? ? ? ? r? ? G *+,n? x? ? ?? ?? ?? ? # ? ? ? r z ? ? '+? {6+? S+? ?W*? +? S,-? ?? \W*? ? ? ? ? ? ? ! ? % ?? 4 '?? '?? '? # '? # !?? ?
? ? ? ?/ ? ; *+? ?? ? ?? ?? ?? ? ? ? ? ? ? B+? {>+? M6d+? k`6+? ?? "+? ?? ?? +? ?? ?? +? ?? Md6+? ??
+? ?? ??
+? ?? ?+? ?? +? ?? {d6? +? ?? +? ?:? M? k`d6+? ?? ?+? \++? ?? ?? Q+? ?:? ?? (? ?:? M? k`d6d>`6? ? M? k`d6d>`6+? ?:? <? 7? ?? ? b? '+? ?:? ? M? k`6d`6>*? +? Sn? W? \W*? ? ? $ ? ? ? ? ? ( ? 1 ? <