com.google.javascript.refactoring.ApplySuggestedFixes.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!
???? 7? java/util/HashSet
()V
java/lang/Iterable iterator ()Ljava/util/Iterator; java/util/Iterator hasNext ()Z next ()Ljava/lang/Object; .com/google/javascript/refactoring/SuggestedFix
getReplacements )()Lcom/google/common/collect/SetMultimap; ! " %com/google/common/collect/SetMultimap keySet ()Ljava/util/Set; $ % & ' (
java/util/Set addAll (Ljava/util/Collection;)Z * java/util/HashMap
) $ . java/lang/String 0 java/io/File
/ 2 3 (Ljava/lang/String;)V 5 6 7 8 9 !java/nio/charset/StandardCharsets UTF_8 Ljava/nio/charset/Charset;
; < = > ? com/google/common/io/Files asCharSource K(Ljava/io/File;Ljava/nio/charset/Charset;)Lcom/google/common/io/CharSource;
A B C D E com/google/common/io/CharSource read ()Ljava/lang/String; G H I J K
java/util/Map put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
M N O P Q 5com/google/javascript/refactoring/ApplySuggestedFixes applySuggestedFixesToCode M(Ljava/lang/Iterable;Ljava/util/Map;)Lcom/google/common/collect/ImmutableMap;
S T U V W &com/google/common/collect/ImmutableMap entrySet *()Lcom/google/common/collect/ImmutableSet;
Y Z [ \ &com/google/common/collect/ImmutableSet 2()Lcom/google/common/collect/UnmodifiableIterator; ^ java/util/Map$Entry ] ` a getKey c "com/google/common/io/FileWriteMode
; e f g
asCharSink n(Ljava/io/File;Ljava/nio/charset/Charset;[Lcom/google/common/io/FileWriteMode;)Lcom/google/common/io/CharSink; ] i j getValue l java/lang/CharSequence
n o p q r com/google/common/io/CharSink write (Ljava/lang/CharSequence;)V
t u v w x #com/google/common/collect/Iterables isEmpty (Ljava/lang/Iterable;)Z
S z { | of *()Lcom/google/common/collect/ImmutableMap;
~ ? { ? 'com/google/common/collect/ImmutableList =(Ljava/lang/Object;)Lcom/google/common/collect/ImmutableList;
t ? ? ? getFirst :(Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/lang/Object;
? ? ? getAlternatives +()Lcom/google/common/collect/ImmutableList;
~ ? ? ? size ()I
? ? ? ? ? !com/google/common/collect/Streams stream /(Ljava/lang/Iterable;)Ljava/util/stream/Stream; ? ? ? apply ()Ljava/util/function/Function; ? ? ? ? ? java/util/stream/Stream map 8(Ljava/util/function/Function;)Ljava/util/stream/Stream;
? ? ? ? ? java/lang/Integer valueOf (I)Ljava/lang/Integer; ? ? ? ? ? java/util/function/Predicate isEqual 2(Ljava/lang/Object;)Ljava/util/function/Predicate; ? ? ? ? allMatch !(Ljava/util/function/Predicate;)Z ? aAll SuggestedFixAlternatives must offer an equal number of choices for this utility to make sense
? ? ? ? ? $com/google/common/base/Preconditions
checkArgument (ZLjava/lang/Object;)V ? ? ? ? ? java/util/stream/IntStream range (II)Ljava/util/stream/IntStream; ? ? ? E(Ljava/lang/Iterable;Ljava/util/Map;)Ljava/util/function/IntFunction; ? ? ? ? mapToObj ;(Ljava/util/function/IntFunction;)Ljava/util/stream/Stream;
~ ? ? ? toImmutableList ()Ljava/util/stream/Collector; ? ? ? ? collect 0(Ljava/util/stream/Collector;)Ljava/lang/Object; ? ? ? (I)Ljava/util/function/Function; ? Dcom/google/javascript/refactoring/ApplySuggestedFixes$ReplacementMap
?
? ? ? ? putIfNoOverlap 3(Lcom/google/javascript/refactoring/SuggestedFix;)V
S ? ? ? builder 2()Lcom/google/common/collect/ImmutableMap$Builder;
? ? V " G ? ? ? containsKey (Ljava/lang/Object;)Z ? "java/lang/IllegalArgumentException ? ? ? makeConcatWithConstants &(Ljava/lang/String;)Ljava/lang/String;
? 2 G ? ? ? get &(Ljava/lang/Object;)Ljava/lang/Object;
M ? ? ? applyCodeReplacements <(Ljava/util/Collection;Ljava/lang/String;)Ljava/lang/String;
? ? ? J ? .com/google/common/collect/ImmutableMap$Builder V(Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/common/collect/ImmutableMap$Builder;
? ? ? | buildOrThrow
? ? ? ? ? ,com/google/common/collect/ImmutableSortedSet copyOf F(Ljava/util/Collection;)Lcom/google/common/collect/ImmutableSortedSet;
M ? ? ? containsOverlaps 1(Lcom/google/common/collect/ImmutableSortedSet;)Z +Found overlap between code replacements:
%s M DOUBLE_LINE_JOINER Lcom/google/common/base/Joiner;
com/google/common/base/Joiner join ((Ljava/lang/Iterable;)Ljava/lang/String;
?
? ((ZLjava/lang/String;Ljava/lang/Object;)V java/lang/StringBuilder
? Z 1com/google/javascript/refactoring/CodeReplacement
? getStartPosition
append 5(Ljava/lang/CharSequence;II)Ljava/lang/StringBuilder;
E
getNewContent
! -(Ljava/lang/String;)Ljava/lang/StringBuilder;
#$ ? getEndPosition
-&' ? length
)* E toString
, - java/lang/Object
~/ ?0 (I)Ljava/lang/Object;
M234 applySuggestedFixChoicesToCode N(Ljava/lang/Iterable;ILjava/util/Map;)Lcom/google/common/collect/ImmutableMap;6
89: on 3(Ljava/lang/String;)Lcom/google/common/base/Joiner; applySuggestedFixesToFiles (Ljava/lang/Iterable;)V Code LineNumberTable LocalVariableTable fix 0Lcom/google/javascript/refactoring/SuggestedFix; filename Ljava/lang/String; entry Ljava/util/Map$Entry; fixes Ljava/lang/Iterable; filenames Ljava/util/Set; filenameToCodeMap Ljava/util/Map; newCode (Lcom/google/common/collect/ImmutableMap; LocalVariableTypeTable ;Ljava/util/Map$Entry; FLjava/lang/Iterable; #Ljava/util/Set; 5Ljava/util/Map; NLcom/google/common/collect/ImmutableMap;
StackMapTable
ExceptionsW java/io/IOException MethodParameters Signature I(Ljava/lang/Iterable;)V !applyAllSuggestedFixChoicesToCode N(Ljava/lang/Iterable;Ljava/util/Map;)Lcom/google/common/collect/ImmutableList;
fixChoices fileNameToCodeMap alternativeCount I ?(Ljava/lang/Iterable;Ljava/util/Map;)Lcom/google/common/collect/ImmutableList;>; choiceIndex chosenFixes )Lcom/google/common/collect/ImmutableList; [Lcom/google/common/collect/ImmutableList; ?(Ljava/lang/Iterable;ILjava/util/Map;)Lcom/google/common/collect/ImmutableMap; replacements FLcom/google/javascript/refactoring/ApplySuggestedFixes$ReplacementMap;
newCodeMap 0Lcom/google/common/collect/ImmutableMap$Builder; DLjava/util/Set; mLjava/util/Map$Entry;>; VLcom/google/common/collect/ImmutableMap$Builder; ?(Ljava/lang/Iterable;Ljava/util/Map;)Lcom/google/common/collect/ImmutableMap; replacement 3Lcom/google/javascript/refactoring/CodeReplacement; Ljava/util/Collection; code sortedReplacements .Lcom/google/common/collect/ImmutableSortedSet; sb Ljava/lang/StringBuilder; lastIndex KLjava/util/Collection; cLcom/google/common/collect/ImmutableSortedSet; q(Ljava/util/Collection;Ljava/lang/String;)Ljava/lang/String; start f(Lcom/google/common/collect/ImmutableSortedSet;)Z this 7Lcom/google/javascript/refactoring/ApplySuggestedFixes; 'lambda$applySuggestedFixChoicesToCode$2 c(ILcom/google/javascript/refactoring/SuggestedFix;)Lcom/google/javascript/refactoring/SuggestedFix; choices *lambda$applyAllSuggestedFixChoicesToCode$1 N(Ljava/lang/Iterable;Ljava/util/Map;I)Lcom/google/common/collect/ImmutableMap; i *lambda$applyAllSuggestedFixChoicesToCode$0 E(Lcom/google/javascript/refactoring/SuggestedFix;)Ljava/lang/Integer; f
SourceFile ApplySuggestedFixes.java NestMembers BootstrapMethods?
????? "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; ??
M????0?
M???? +(I)Lcom/google/common/collect/ImmutableMap;?
M??? b(Lcom/google/javascript/refactoring/SuggestedFix;)Lcom/google/javascript/refactoring/SuggestedFix;?
??? ?? $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;? *filenameToCodeMap missing code for file: InnerClasses Entry ReplacementMap Builder? %java/lang/invoke/MethodHandles$Lookup? java/lang/invoke/MethodHandles Lookup 1 M, ;<