Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ public final class CanonicalNameConstants {
public static final String LONG = Long.class.getCanonicalName();
public static final String ARRAYLIST = ArrayList.class.getCanonicalName();
public static final String SERIALIZABLE = Serializable.class.getCanonicalName();
public static final String BYTE = Byte.class.getCanonicalName();
public static final String SHORT = Short.class.getCanonicalName();
public static final String CHAR = Character.class.getCanonicalName();
public static final String DOUBLE = Double.class.getCanonicalName();

/*
* Android
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void validate(ExecutableElement executableElement, ElementValidation vali
}

protected void invalidate(ElementValidation validation) {
validation.addError("%s can only have the following parameter: " + parameterRequirement);
validation.addError("method annotated with %s can only have the following parameter: " + parameterRequirement);
}
}

Expand All @@ -120,7 +120,7 @@ public V extendsType(String qualifiedName) {
}

public V anyType() {
return extendsType(CanonicalNameConstants.OBJECT);
return param(new AnyTypeParameterRequirement());
}

public V annotatedWith(Class<? extends Annotation> annotationClass) {
Expand Down Expand Up @@ -222,8 +222,9 @@ private boolean validate(VariableElement parameter) {
}
if (currentParameterRequirement.isSatisfied(parameter)) {
satisfiedParameterRequirements.add(currentParameterRequirement);
} else if (!currentParameterRequirement.multiple()) {
nextParameterRequirement();
if (!currentParameterRequirement.multiple()) {
nextParameterRequirement();
}
} else {
if (currentParameterRequirement.required() && !satisfiedParameterRequirements.contains(currentParameterRequirement)) {
return false;
Expand Down Expand Up @@ -405,12 +406,17 @@ private String getWrapperType() {
case INT:
return CanonicalNameConstants.INTEGER;
case BYTE:
return CanonicalNameConstants.BYTE;
case SHORT:
return CanonicalNameConstants.SHORT;
case LONG:
return CanonicalNameConstants.LONG;
case CHAR:
return CanonicalNameConstants.CHAR;
case FLOAT:
return CanonicalNameConstants.FLOAT;
case DOUBLE:
throw new UnsupportedOperationException("This primitive is not handled yet");
return CanonicalNameConstants.DOUBLE;
default:
throw new IllegalArgumentException("The TypeKind passed does not represent a primitive");
}
Expand Down
Loading