Skip to content

Commit

Permalink
fixed warnings in eclipse
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainlaurent committed Oct 27, 2017
1 parent 23ec97c commit a0a6023
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 14 deletions.
9 changes: 7 additions & 2 deletions .settings/org.eclipse.jdt.ui.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,17 @@ sp_cleanup.always_use_blocks=true
sp_cleanup.always_use_parentheses_in_expressions=false
sp_cleanup.always_use_this_for_non_static_field_access=false
sp_cleanup.always_use_this_for_non_static_method_access=false
sp_cleanup.convert_functional_interfaces=false
sp_cleanup.convert_to_enhanced_for_loop=false
sp_cleanup.correct_indentation=true
sp_cleanup.format_source_code=true
sp_cleanup.format_source_code_changes_only=false
sp_cleanup.insert_inferred_type_arguments=false
sp_cleanup.make_local_variable_final=true
sp_cleanup.make_parameters_final=true
sp_cleanup.make_private_fields_final=true
sp_cleanup.make_type_abstract_if_missing_method=false
sp_cleanup.make_variable_declarations_final=true
sp_cleanup.make_variable_declarations_final=false
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
sp_cleanup.on_save_use_additional_actions=true
Expand All @@ -95,6 +97,7 @@ sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=
sp_cleanup.qualify_static_member_accesses_with_declaring_class=true
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
sp_cleanup.remove_private_constructors=true
sp_cleanup.remove_redundant_type_arguments=false
sp_cleanup.remove_trailing_whitespaces=true
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
Expand All @@ -108,10 +111,12 @@ sp_cleanup.remove_unused_private_methods=true
sp_cleanup.remove_unused_private_types=true
sp_cleanup.sort_members=false
sp_cleanup.sort_members_all=false
sp_cleanup.use_anonymous_class_creation=false
sp_cleanup.use_blocks=true
sp_cleanup.use_blocks_only_for_return_and_throw=false
sp_cleanup.use_lambda=false
sp_cleanup.use_parentheses_in_expressions=false
sp_cleanup.use_this_for_non_static_field_access=true
sp_cleanup.use_this_for_non_static_field_access=false
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
sp_cleanup.use_this_for_non_static_method_access=false
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
package com.github.sylvainlaurent.maven.swaggervalidator;

import static com.google.common.collect.Lists.newArrayList;

import java.util.ArrayList;
import java.util.List;

import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;

public class ValidationResult {
private final Throwable exc;
private final List<String> messages = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,28 @@ public abstract class AbstractModelVisitor implements ModelVisitor {

protected VisitedItemsHolder holder = new VisitedItemsHolder();

@Override
public void visit(ModelImplWrapper modelImplWrapper) {
holder.push(modelImplWrapper);
handle(modelImplWrapper);
holder.pop();
}

@Override
public void visit(RefModelWrapper refModelWrapper) {
holder.push(refModelWrapper);
handle(refModelWrapper);
holder.pop();
}

@Override
public void visit(ArrayModelWrapper arrayModelWrapper) {
holder.push(arrayModelWrapper);
handle(arrayModelWrapper);
holder.pop();
}

@Override
public void visit(ComposedModelWrapper composedModelWrapper) {
holder.push(composedModelWrapper);
handle(composedModelWrapper);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,49 @@ public abstract class AbstractVisitor implements ModelVisitor, PropertyVisitor {

protected VisitedItemsHolder holder = new VisitedItemsHolder();

@Override
public void visit(ModelImplWrapper modelImplWrapper) {
holder.push(modelImplWrapper);
handle(modelImplWrapper);
holder.pop();
}

@Override
public void visit(RefModelWrapper refModelWrapper) {
holder.push(refModelWrapper);
handle(refModelWrapper);
holder.pop();
}

@Override
public void visit(ArrayModelWrapper arrayModelWrapper) {
holder.push(arrayModelWrapper);
handle(arrayModelWrapper);
holder.pop();
}

@Override
public void visit(ComposedModelWrapper composedModelWrapper) {
holder.push(composedModelWrapper);
handle(composedModelWrapper);
holder.pop();
}

@Override
public void visit(ObjectPropertyWrapper objectProperty) {
holder.push(objectProperty);
handle(objectProperty);
holder.pop();
}

@Override
public void visit(ArrayPropertyWrapper arrayProperty) {
holder.push(arrayProperty);
handle(arrayProperty);
holder.pop();
}

@Override
public void visit(RefPropertyWrapper refPropertyWrapper) {
holder.push(refPropertyWrapper);
handle(refPropertyWrapper);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public String getModelName() {
return modelName;
}

@Override
public void accept(ModelVisitor modelVisitor) {
modelVisitor.visit(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.swagger.models.properties.ArrayProperty;
import io.swagger.models.properties.Property;

@SuppressWarnings("hiding")
public class ArrayPropertyWrapper extends ArrayProperty implements VisitableProperty {

private final ArrayProperty arrayProperty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public String getModelName() {
return modelName;
}

@Override
public void accept(ModelVisitor modelVisitor) {
modelVisitor.visit(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public ModelImplWrapper(String name, ModelImpl model) {
this.model = model;
}

@SuppressWarnings("unchecked")
@Override
public List<String> getRequired() {
try {
Expand Down Expand Up @@ -310,6 +311,7 @@ public Object clone() {
return model.clone();
}

@Override
public void accept(ModelVisitor modelVisitor) {
modelVisitor.visit(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import io.swagger.models.properties.ObjectProperty;
import io.swagger.models.properties.Property;

@SuppressWarnings("hiding")
public class ObjectPropertyWrapper extends ObjectProperty implements VisitableProperty {

private final ObjectProperty objectProperty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public String getModelName() {
return modelName;
}

@Override
public void accept(ModelVisitor modelVisitor) {
modelVisitor.visit(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public RefProperty asDefault(String ref) {
}

@Override
public RefProperty description(String description) {
public RefProperty description(@SuppressWarnings("hiding") String description) {
return refProperty.description(description);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ public boolean equals(Object o) {
return false;
}

Path path = (Path) o;
Path otherPath = (Path) o;

return pathElements != null ? pathElements.equals(path.pathElements) : path.pathElements == null;
return pathElements != null ? pathElements.equals(otherPath.pathElements) : otherPath.pathElements == null;
}

@Override
Expand Down Expand Up @@ -261,16 +261,16 @@ public int hashCode() {
}
}

private List<PathElement> tokenize(String path) {
private List<PathElement> tokenize(String inpath) {

List<PathElement> pathPathElements = new ArrayList<>();

String result = path;
String result = inpath;
if (result.startsWith(SLASH)) {
result = path.substring(1, path.length());
result = inpath.substring(1, inpath.length());
}
if (result.endsWith(SLASH)) {
result = result.substring(0, path.length() - 1);
result = result.substring(0, inpath.length() - 1);
}

List<String> tokens = asList(result.split(SLASH));
Expand Down

0 comments on commit a0a6023

Please sign in to comment.