Skip to content

Commit

Permalink
Get rid of infuriating useless <?> on Type
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny van Bruggen committed Dec 15, 2016
1 parent e0ca592 commit a8f6c6d
Show file tree
Hide file tree
Showing 41 changed files with 273 additions and 234 deletions.
Expand Up @@ -51,12 +51,12 @@
public final class AnnotationMemberDeclaration extends BodyDeclaration<AnnotationMemberDeclaration> implements
NodeWithJavaDoc<AnnotationMemberDeclaration>,
NodeWithSimpleName<AnnotationMemberDeclaration>,
NodeWithType<AnnotationMemberDeclaration, Type<?>>,
NodeWithType<AnnotationMemberDeclaration, Type>,
NodeWithModifiers<AnnotationMemberDeclaration> {

private EnumSet<Modifier> modifiers;

private Type<?> type;
private Type type;

private SimpleName name;

Expand All @@ -71,7 +71,7 @@ public AnnotationMemberDeclaration() {
null);
}

public AnnotationMemberDeclaration(EnumSet<Modifier> modifiers, Type<?> type, String name, Expression defaultValue) {
public AnnotationMemberDeclaration(EnumSet<Modifier> modifiers, Type type, String name, Expression defaultValue) {
this(null,
modifiers,
new NodeList<>(),
Expand All @@ -80,7 +80,7 @@ public AnnotationMemberDeclaration(EnumSet<Modifier> modifiers, Type<?> type, St
defaultValue);
}

public AnnotationMemberDeclaration(EnumSet<Modifier> modifiers, NodeList<AnnotationExpr> annotations, Type<?> type, SimpleName name,
public AnnotationMemberDeclaration(EnumSet<Modifier> modifiers, NodeList<AnnotationExpr> annotations, Type type, SimpleName name,
Expression defaultValue) {
this(null,
modifiers,
Expand Down Expand Up @@ -130,7 +130,7 @@ public SimpleName getName() {
}

@Override
public Type<?> getType() {
public Type getType() {
return type;
}

Expand Down Expand Up @@ -162,7 +162,7 @@ public AnnotationMemberDeclaration setName(SimpleName name) {
}

@Override
public AnnotationMemberDeclaration setType(Type<?> type) {
public AnnotationMemberDeclaration setType(Type type) {
notifyPropertyChange(ObservableProperty.TYPE, this.type, type);
this.type = assertNotNull(type);
setAsParentNodeOf(type);
Expand Down
Expand Up @@ -65,7 +65,7 @@ public final class ConstructorDeclaration extends BodyDeclaration<ConstructorDec

private NodeList<Parameter> parameters;

private NodeList<ReferenceType<?>> thrownExceptions;
private NodeList<ReferenceType> thrownExceptions;

private BlockStmt body;

Expand Down Expand Up @@ -93,7 +93,7 @@ public ConstructorDeclaration(EnumSet<Modifier> modifiers, String name) {

public ConstructorDeclaration(EnumSet<Modifier> modifiers, NodeList<AnnotationExpr> annotations,
NodeList<TypeParameter> typeParameters,
SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType<?>> thrownExceptions,
SimpleName name, NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions,
BlockStmt block) {
this(null,
modifiers,
Expand All @@ -107,7 +107,7 @@ public ConstructorDeclaration(EnumSet<Modifier> modifiers, NodeList<AnnotationEx

public ConstructorDeclaration(Range range, EnumSet<Modifier> modifiers,
NodeList<AnnotationExpr> annotations, NodeList<TypeParameter> typeParameters, SimpleName name,
NodeList<Parameter> parameters, NodeList<ReferenceType<?>> thrownExceptions, BlockStmt block) {
NodeList<Parameter> parameters, NodeList<ReferenceType> thrownExceptions, BlockStmt block) {
super(range, annotations);
setModifiers(modifiers);
setTypeParameters(typeParameters);
Expand Down Expand Up @@ -149,7 +149,7 @@ public NodeList<Parameter> getParameters() {
}

@Override
public NodeList<ReferenceType<?>> getThrownExceptions() {
public NodeList<ReferenceType> getThrownExceptions() {
return thrownExceptions;
}

Expand Down Expand Up @@ -180,7 +180,7 @@ public ConstructorDeclaration setParameters(NodeList<Parameter> parameters) {
}

@Override
public ConstructorDeclaration setThrownExceptions(NodeList<ReferenceType<?>> thrownExceptions) {
public ConstructorDeclaration setThrownExceptions(NodeList<ReferenceType> thrownExceptions) {
notifyPropertyChange(ObservableProperty.THROWN_TYPES, this.thrownExceptions, thrownExceptions);
this.thrownExceptions = assertNotNull(thrownExceptions);
setAsParentNodeOf(this.thrownExceptions);
Expand Down
Expand Up @@ -105,7 +105,7 @@ public FieldDeclaration(Range range, EnumSet<Modifier> modifiers, NodeList<Annot
* @param type type
* @param name field name
*/
public FieldDeclaration(EnumSet<Modifier> modifiers, Type<?> type, String name) {
public FieldDeclaration(EnumSet<Modifier> modifiers, Type type, String name) {
this(assertNotNull(modifiers), new VariableDeclarator(type, assertNotNull(name)));
}

Expand Down
Expand Up @@ -54,7 +54,7 @@ public final class MethodDeclaration extends BodyDeclaration<MethodDeclaration>
NodeWithJavaDoc<MethodDeclaration>,
NodeWithDeclaration,
NodeWithSimpleName<MethodDeclaration>,
NodeWithType<MethodDeclaration, Type<?>>,
NodeWithType<MethodDeclaration, Type>,
NodeWithModifiers<MethodDeclaration>,
NodeWithParameters<MethodDeclaration>,
NodeWithThrownExceptions<MethodDeclaration>,
Expand All @@ -69,13 +69,13 @@ public final class MethodDeclaration extends BodyDeclaration<MethodDeclaration>

private NodeList<Parameter> parameters;

private NodeList<ReferenceType<?>> thrownExceptions;
private NodeList<ReferenceType> thrownExceptions;

private BlockStmt body;

private boolean isDefault;

private Type<?> type;
private Type type;

public MethodDeclaration() {
this(null,
Expand All @@ -90,7 +90,7 @@ public MethodDeclaration() {
new BlockStmt());
}

public MethodDeclaration(final EnumSet<Modifier> modifiers, final Type<?> type, final String name) {
public MethodDeclaration(final EnumSet<Modifier> modifiers, final Type type, final String name) {
this(null,
modifiers,
new NodeList<>(),
Expand All @@ -103,7 +103,7 @@ public MethodDeclaration(final EnumSet<Modifier> modifiers, final Type<?> type,
new BlockStmt());
}

public MethodDeclaration(final EnumSet<Modifier> modifiers, final String name, final Type<?> type,
public MethodDeclaration(final EnumSet<Modifier> modifiers, final String name, final Type type,
final NodeList<Parameter> parameters) {
this(null,
modifiers,
Expand All @@ -120,11 +120,11 @@ public MethodDeclaration(final EnumSet<Modifier> modifiers, final String name, f
public MethodDeclaration(final EnumSet<Modifier> modifiers,
final NodeList<AnnotationExpr> annotations,
final NodeList<TypeParameter> typeParameters,
final Type<?> type,
final Type type,
final SimpleName name,
final boolean isDefault,
final NodeList<Parameter> parameters,
final NodeList<ReferenceType<?>> thrownExceptions,
final NodeList<ReferenceType> thrownExceptions,
final BlockStmt body) {
this(null,
modifiers,
Expand All @@ -142,11 +142,11 @@ public MethodDeclaration(Range range,
final EnumSet<Modifier> modifiers,
final NodeList<AnnotationExpr> annotations,
final NodeList<TypeParameter> typeParameters,
final Type<?> type,
final Type type,
final SimpleName name,
final boolean isDefault,
final NodeList<Parameter> parameters,
final NodeList<ReferenceType<?>> thrownExceptions,
final NodeList<ReferenceType> thrownExceptions,
final BlockStmt body) {
super(range, annotations);
setModifiers(modifiers);
Expand Down Expand Up @@ -196,7 +196,7 @@ public NodeList<Parameter> getParameters() {
}

@Override
public NodeList<ReferenceType<?>> getThrownExceptions() {
public NodeList<ReferenceType> getThrownExceptions() {
return thrownExceptions;
}

Expand Down Expand Up @@ -243,20 +243,20 @@ public MethodDeclaration setParameters(final NodeList<Parameter> parameters) {
}

@Override
public MethodDeclaration setThrownExceptions(final NodeList<ReferenceType<?>> thrownExceptions) {
public MethodDeclaration setThrownExceptions(final NodeList<ReferenceType> thrownExceptions) {
notifyPropertyChange(ObservableProperty.THROWN_TYPES, this.thrownExceptions, thrownExceptions);
this.thrownExceptions = assertNotNull(thrownExceptions);
setAsParentNodeOf(this.thrownExceptions);
return this;
}

@Override
public Type<?> getType() {
public Type getType() {
return type;
}

@Override
public MethodDeclaration setType(Type<?> type) {
public MethodDeclaration setType(Type type) {
notifyPropertyChange(ObservableProperty.TYPE, this.type, type);
this.type = type;
setAsParentNodeOf(this.type);
Expand Down Expand Up @@ -347,7 +347,7 @@ public String getDeclarationAsString(boolean includingModifiers, boolean includi
sb.append(")");
if (includingThrows) {
boolean firstThrow = true;
for (ReferenceType<?> thr : getThrownExceptions()) {
for (ReferenceType thr : getThrownExceptions()) {
if (firstThrow) {
firstThrow = false;
sb.append(" throws ");
Expand Down
Expand Up @@ -48,12 +48,12 @@
* @author Julio Vilmar Gesser
*/
public final class Parameter extends Node implements
NodeWithType<Parameter,Type<?>>,
NodeWithType<Parameter,Type>,
NodeWithAnnotations<Parameter>,
NodeWithSimpleName<Parameter>,
NodeWithModifiers<Parameter> {

private Type<?> type;
private Type type;

private boolean isVarArgs;

Expand All @@ -72,7 +72,7 @@ public Parameter() {
new SimpleName());
}

public Parameter(Type<?> type, SimpleName name) {
public Parameter(Type type, SimpleName name) {
this(null,
EnumSet.noneOf(Modifier.class),
new NodeList<>(),
Expand All @@ -87,7 +87,7 @@ public Parameter(Type<?> type, SimpleName name) {
* @param type type of the parameter
* @param name name of the parameter
*/
public Parameter(Type<?> type, String name) {
public Parameter(Type type, String name) {
this(null,
EnumSet.noneOf(Modifier.class),
new NodeList<>(),
Expand All @@ -96,7 +96,7 @@ public Parameter(Type<?> type, String name) {
new SimpleName(name));
}

public Parameter(EnumSet<Modifier> modifiers, Type<?> type, SimpleName name) {
public Parameter(EnumSet<Modifier> modifiers, Type type, SimpleName name) {
this(null,
modifiers,
new NodeList<>(),
Expand All @@ -108,7 +108,7 @@ public Parameter(EnumSet<Modifier> modifiers, Type<?> type, SimpleName name) {
public Parameter(final Range range,
EnumSet<Modifier> modifiers,
NodeList<AnnotationExpr> annotations,
Type<?> type,
Type type,
boolean isVarArgs,
SimpleName name) {
super(range);
Expand All @@ -130,7 +130,7 @@ public <A> void accept(VoidVisitor<A> v, A arg) {
}

@Override
public Type<?> getType() {
public Type getType() {
return type;
}

Expand All @@ -139,7 +139,7 @@ public boolean isVarArgs() {
}

@Override
public Parameter setType(Type<?> type) {
public Parameter setType(Type type) {
notifyPropertyChange(ObservableProperty.TYPE, this.type, type);
this.type = type;
setAsParentNodeOf(this.type);
Expand Down
Expand Up @@ -44,24 +44,24 @@
* @author Julio Vilmar Gesser
*/
public final class VariableDeclarator extends Node implements
NodeWithType<VariableDeclarator, Type<?>>,
NodeWithType<VariableDeclarator, Type>,
NodeWithSimpleName<VariableDeclarator> {

private SimpleName name;

private Expression initializer;

private Type<?> type;
private Type type;

public VariableDeclarator() {
this(null, new SimpleName(), null);
}

public VariableDeclarator(Type<?> type, SimpleName name) {
public VariableDeclarator(Type type, SimpleName name) {
this(null, type, name, null);
}

public VariableDeclarator(Type<?> type, String variableName) {
public VariableDeclarator(Type type, String variableName) {
this(null, type, new SimpleName(variableName), null);
}

Expand All @@ -72,15 +72,15 @@ public VariableDeclarator(Type<?> type, String variableName) {
* @param initializer What this variable should be initialized to. An {@link com.github.javaparser.ast.expr.AssignExpr}
* is unnecessary as the <code>=</code> operator is already added.
*/
public VariableDeclarator(Type<?> type, SimpleName name, Expression initializer) {
public VariableDeclarator(Type type, SimpleName name, Expression initializer) {
this(null, type, name, initializer);
}

public VariableDeclarator(Type<?> type, String variableName, Expression initializer) {
public VariableDeclarator(Type type, String variableName, Expression initializer) {
this(null, type, new SimpleName(variableName), initializer);
}

public VariableDeclarator(Range range, Type<?> type, SimpleName name, Expression initializer) {
public VariableDeclarator(Range range, Type type, SimpleName name, Expression initializer) {
super(range);
setName(name);
setInitializer(initializer);
Expand Down Expand Up @@ -138,12 +138,12 @@ public VariableDeclarator setInitializer(String init) {
}

@Override
public Type<?> getType() {
public Type getType() {
return type;
}

@Override
public VariableDeclarator setType(Type<?> type) {
public VariableDeclarator setType(Type type) {
notifyPropertyChange(ObservableProperty.TYPE, this.type, type);
this.type = type;
setAsParentNodeOf(this.type);
Expand Down

0 comments on commit a8f6c6d

Please sign in to comment.