Skip to content

Commit

Permalink
Delete KeyFormatter. It has a well-defined toString(), which is all t…
Browse files Browse the repository at this point in the history
…his object does

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160981170
  • Loading branch information
ronshapiro committed Jul 5, 2017
1 parent 3a891dd commit 7649d68
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 38 deletions.
9 changes: 3 additions & 6 deletions java/dagger/internal/codegen/BindingDeclarationFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,9 @@ final class BindingDeclarationFormatter extends Formatter<BindingDeclaration> {
SYNTHETIC_RELEASABLE_REFERENCE_MANAGER, SYNTHETIC_RELEASABLE_REFERENCE_MANAGERS);

private final MethodSignatureFormatter methodSignatureFormatter;
private final KeyFormatter keyFormatter;

BindingDeclarationFormatter(
MethodSignatureFormatter methodSignatureFormatter, KeyFormatter keyFormatter) {
BindingDeclarationFormatter(MethodSignatureFormatter methodSignatureFormatter) {
this.methodSignatureFormatter = methodSignatureFormatter;
this.keyFormatter = keyFormatter;
}

/**
Expand Down Expand Up @@ -93,11 +90,11 @@ public String format(BindingDeclaration bindingDeclaration) {
case SYNTHETIC_RELEASABLE_REFERENCE_MANAGER:
return String.format(
"binding for %s from the scope declaration",
stripCommonTypePrefixes(keyFormatter.format(binding.key())));
stripCommonTypePrefixes(binding.key().toString()));
case SYNTHETIC_RELEASABLE_REFERENCE_MANAGERS:
return String.format(
"Dagger-generated binding for %s",
stripCommonTypePrefixes(keyFormatter.format(binding.key())));
stripCommonTypePrefixes(binding.key().toString()));
default:
break;
}
Expand Down
5 changes: 1 addition & 4 deletions java/dagger/internal/codegen/BindingGraphValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ final class BindingGraphValidator {
private final BindingDeclarationFormatter bindingDeclarationFormatter;
private final MethodSignatureFormatter methodSignatureFormatter;
private final DependencyRequestFormatter dependencyRequestFormatter;
private final KeyFormatter keyFormatter;
private final Key.Factory keyFactory;

BindingGraphValidator(
Expand All @@ -146,7 +145,6 @@ final class BindingGraphValidator {
BindingDeclarationFormatter bindingDeclarationFormatter,
MethodSignatureFormatter methodSignatureFormatter,
DependencyRequestFormatter dependencyRequestFormatter,
KeyFormatter keyFormatter,
Key.Factory keyFactory) {
this.elements = elements;
this.types = types;
Expand All @@ -156,7 +154,6 @@ final class BindingGraphValidator {
this.bindingDeclarationFormatter = bindingDeclarationFormatter;
this.methodSignatureFormatter = methodSignatureFormatter;
this.dependencyRequestFormatter = dependencyRequestFormatter;
this.keyFormatter = keyFormatter;
this.keyFactory = keyFactory;
}

Expand Down Expand Up @@ -1165,7 +1162,7 @@ private FluentIterable<ContributionBinding> provisionsDependingOnLatestRequest()
}

private String formatCurrentDependencyRequestKey() {
return keyFormatter.format(dependencyRequest().key());
return dependencyRequest().key().toString();
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions java/dagger/internal/codegen/ComponentProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,9 @@ protected Iterable<? extends ProcessingStep> initSteps() {
CompilerOptions compilerOptions = CompilerOptions.create(processingEnv, elements);
Filer filer = new FormattingFiler(processingEnv.getFiler());

KeyFormatter keyFormatter = new KeyFormatter();
MethodSignatureFormatter methodSignatureFormatter = new MethodSignatureFormatter(types);
BindingDeclarationFormatter bindingDeclarationFormatter =
new BindingDeclarationFormatter(methodSignatureFormatter, keyFormatter);
new BindingDeclarationFormatter(methodSignatureFormatter);
DependencyRequestFormatter dependencyRequestFormatter =
new DependencyRequestFormatter(types, elements);

Expand Down Expand Up @@ -187,7 +186,6 @@ protected Iterable<? extends ProcessingStep> initSteps() {
bindingDeclarationFormatter,
methodSignatureFormatter,
dependencyRequestFormatter,
keyFormatter,
keyFactory);

return ImmutableList.of(
Expand Down
25 changes: 0 additions & 25 deletions java/dagger/internal/codegen/KeyFormatter.java

This file was deleted.

0 comments on commit 7649d68

Please sign in to comment.