Skip to content

Commit

Permalink
Merge pull request #27 from palantir/feature/duplicate-method-names-c…
Browse files Browse the repository at this point in the history
…onfig

fix bug with previous commit
  • Loading branch information
ryanmcnamara committed Feb 26, 2016
2 parents 0f6bd37 + db1abf8 commit ebf03a0
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ public Result processType(Type javaType, Context context) {
}

public void emitTypescriptClass() {
Set<String> duplicateEndpointNames = getDuplicateEndpointNames();
Set<String> endpointsToWarnAboutDuplicateNames = Sets.newHashSet();
if (!this.settings.emitDuplicateJavaMethodNames()) {
endpointsToWarnAboutDuplicateNames = getDuplicateEndpointNames();
}
writer.writeLine("");
// Adding "Impl" ensures the class name is different from the impl name, which is a compilation requirement.
writer.writeLine("export class " + model.name() + "Impl" + " implements " + settings.getSettings().addTypeNamePrefix + model.name() + " {");
Expand All @@ -96,7 +99,7 @@ public void emitTypescriptClass() {
writer.writeLine("}");

for (ServiceEndpointModel endpointModel: model.endpointModels()) {
if (duplicateEndpointNames.contains(endpointModel.endpointName())) {
if (endpointsToWarnAboutDuplicateNames.contains(endpointModel.endpointName())) {
// don't output any duplicates
continue;
}
Expand Down

0 comments on commit ebf03a0

Please sign in to comment.