X Tutup
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
@@ -1,8 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
Expand Down
8 changes: 0 additions & 8 deletions AndroidAnnotations/androidannotations-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public void onWrongBgSerial(String currentSerial, String... expectedSerials) {

private static WrongThreadListener wrongThreadListener = DEFAULT_WRONG_THREAD_LISTENER;

private static final List<Task> TASKS = new ArrayList<Task>();
private static final ThreadLocal<String> CURRENT_SERIAL = new ThreadLocal<String>();
private static final List<Task> TASKS = new ArrayList<>();
private static final ThreadLocal<String> CURRENT_SERIAL = new ThreadLocal<>();

private BackgroundExecutor() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void handleMessage(Message msg) {
}
};

private static final Map<String, Token> TOKENS = new HashMap<String, Token>();
private static final Map<String, Token> TOKENS = new HashMap<>();

private UiThreadExecutor() {
// should not be instantiated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ public class ViewServer implements Runnable {
private Thread mThread;
private ExecutorService mThreadPool;

private final List<WindowListener> mListeners = new CopyOnWriteArrayList<ViewServer.WindowListener>();
private final List<WindowListener> mListeners = new CopyOnWriteArrayList<>();

private final Map<View, String> mWindows = new HashMap<View, String>();
private final Map<View, String> mWindows = new HashMap<>();
private final ReentrantReadWriteLock mWindowsLock = new ReentrantReadWriteLock();

private View mFocusedWindow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,8 @@ public static void callInjectViews(Object activity) {
Method injectViewsMethod = viewMembersInjectorClass.getDeclaredMethod("injectViews", Object.class);
injectViewsMethod.setAccessible(true);
injectViewsMethod.invoke(null, activity);
} catch (ClassNotFoundException e) {
propagateRuntimeException(e);
} catch (NoSuchMethodException e) {
propagateRuntimeException(e);
} catch (SecurityException e) {
propagateRuntimeException(e);
} catch (IllegalAccessException e) {
propagateRuntimeException(e);
} catch (IllegalArgumentException e) {
propagateRuntimeException(e);
} catch (InvocationTargetException e) {
propagateRuntimeException(e);
} catch (ClassNotFoundException | InvocationTargetException | IllegalArgumentException | IllegalAccessException | SecurityException | NoSuchMethodException e) {
throw new RuntimeException("Could not invoke RoboGuice method!", e);
}
}

private static void propagateRuntimeException(Throwable t) {
throw new RuntimeException("Could not invoke RoboGuice method!", t);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,27 @@ public final void apply() {
}

protected IntPrefEditorField<T> intField(String key) {
return new IntPrefEditorField<T>(cast(), key);
return new IntPrefEditorField<>(cast(), key);
}

protected StringPrefEditorField<T> stringField(String key) {
return new StringPrefEditorField<T>(cast(), key);
return new StringPrefEditorField<>(cast(), key);
}

protected StringSetPrefEditorField<T> stringSetField(String key) {
return new StringSetPrefEditorField<T>(cast(), key);
return new StringSetPrefEditorField<>(cast(), key);
}

protected BooleanPrefEditorField<T> booleanField(String key) {
return new BooleanPrefEditorField<T>(cast(), key);
return new BooleanPrefEditorField<>(cast(), key);
}

protected FloatPrefEditorField<T> floatField(String key) {
return new FloatPrefEditorField<T>(cast(), key);
return new FloatPrefEditorField<>(cast(), key);
}

protected LongPrefEditorField<T> longField(String key) {
return new LongPrefEditorField<T>(cast(), key);
return new LongPrefEditorField<>(cast(), key);
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,15 @@ public static String serialize(Set<String> set) {
serializer.endTag(NAMESPACE, SET_TAG) //
.endDocument();

} catch (IllegalArgumentException e) {

} catch (IllegalStateException e) {

} catch (IOException e) {
} catch (IllegalArgumentException | IOException | IllegalStateException e) {

}

return writer.toString();
}

public static Set<String> deserialize(String data) {
Set<String> stringSet = new TreeSet<String>();
Set<String> stringSet = new TreeSet<>();
XmlPullParser parser = Xml.newPullParser();

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,7 @@ public static <T> T invoke(Method method, Object obj, Object... args) throws NoS

try {
return (T) method.invoke(obj, args);
} catch (IllegalAccessException e) {
// fall through
} catch (IllegalArgumentException e) {
// fall through
} catch (InvocationTargetException e) {
} catch (IllegalAccessException | InvocationTargetException | IllegalArgumentException e) {
// fall through
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static void registerOnViewChangedListener(OnViewChangedListener listener)
}
}

private final Set<OnViewChangedListener> listeners = new LinkedHashSet<OnViewChangedListener>();
private final Set<OnViewChangedListener> listeners = new LinkedHashSet<>();

public void notifyViewChanged(HasViews hasViews) {
for (OnViewChangedListener listener : listeners) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
Expand Down
6 changes: 0 additions & 6 deletions AndroidAnnotations/androidannotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
Expand All @@ -67,8 +63,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@

public class AnnotationHandlers {

private List<AnnotationHandler<? extends GeneratedClassHolder>> annotationHandlers = new ArrayList<AnnotationHandler<? extends GeneratedClassHolder>>();
private List<GeneratingAnnotationHandler<? extends GeneratedClassHolder>> generatingAnnotationHandlers = new ArrayList<GeneratingAnnotationHandler<? extends GeneratedClassHolder>>();
private List<AnnotationHandler<? extends GeneratedClassHolder>> decoratingAnnotationHandlers = new ArrayList<AnnotationHandler<? extends GeneratedClassHolder>>();
private List<AnnotationHandler<? extends GeneratedClassHolder>> annotationHandlers = new ArrayList<>();
private List<GeneratingAnnotationHandler<? extends GeneratedClassHolder>> generatingAnnotationHandlers = new ArrayList<>();
private List<AnnotationHandler<? extends GeneratedClassHolder>> decoratingAnnotationHandlers = new ArrayList<>();
private Set<String> supportedAnnotationNames;
private OptionsHelper optionsHelper;

Expand Down Expand Up @@ -206,7 +206,7 @@ public void setProcessHolder(ProcessHolder processHolder) {

public Set<String> getSupportedAnnotationTypes() {
if (supportedAnnotationNames == null) {
Set<String> annotationNames = new HashSet<String>();
Set<String> annotationNames = new HashSet<>();
for (AnnotationHandler<?> annotationHandler : annotationHandlers) {
annotationNames.add(annotationHandler.getTarget());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private List<TypeMirror> extractListenerTypeMirrors(Element activityElement) {
AnnotationValue action = entry.getValue();
@SuppressWarnings("unchecked")
List<AnnotationValue> elements = (List<AnnotationValue>) action.getValue();
List<TypeMirror> listenerTypeMirrors = new ArrayList<TypeMirror>(elements.size());
List<TypeMirror> listenerTypeMirrors = new ArrayList<>(elements.size());

for (AnnotationValue annotationValue : elements) {
listenerTypeMirrors.add((TypeMirror) annotationValue.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ private static final class DefaultPrefInfo<T> {
private static final Map<String, DefaultPrefInfo<?>> DEFAULT_PREF_INFOS = new HashMap<String, SharedPrefHandler.DefaultPrefInfo<?>>() {
private static final long serialVersionUID = 1L;
{
put("boolean", new DefaultPrefInfo<Boolean>(DefaultBoolean.class, BooleanPrefField.class, IRClass.Res.BOOL, false, "booleanField"));
put("float", new DefaultPrefInfo<Float>(DefaultFloat.class, FloatPrefField.class, IRClass.Res.INTEGER, 0f, "floatField"));
put("int", new DefaultPrefInfo<Integer>(DefaultInt.class, IntPrefField.class, IRClass.Res.INTEGER, 0, "intField"));
put("long", new DefaultPrefInfo<Long>(DefaultLong.class, LongPrefField.class, IRClass.Res.INTEGER, 0L, "longField"));
put(CanonicalNameConstants.STRING, new DefaultPrefInfo<String>(DefaultString.class, StringPrefField.class, IRClass.Res.STRING, "", "stringField"));
put("boolean", new DefaultPrefInfo<>(DefaultBoolean.class, BooleanPrefField.class, IRClass.Res.BOOL, false, "booleanField"));
put("float", new DefaultPrefInfo<>(DefaultFloat.class, FloatPrefField.class, IRClass.Res.INTEGER, 0f, "floatField"));
put("int", new DefaultPrefInfo<>(DefaultInt.class, IntPrefField.class, IRClass.Res.INTEGER, 0, "intField"));
put("long", new DefaultPrefInfo<>(DefaultLong.class, LongPrefField.class, IRClass.Res.INTEGER, 0L, "longField"));
put(CanonicalNameConstants.STRING, new DefaultPrefInfo<>(DefaultString.class, StringPrefField.class, IRClass.Res.STRING, "", "stringField"));
put(CanonicalNameConstants.STRING_SET, new DefaultPrefInfo<Set<String>>(DefaultStringSet.class, StringSetPrefField.class, null, null, "stringSetField"));
}
};
Expand Down Expand Up @@ -176,15 +176,15 @@ private void generateConstructor(Element element, SharedPrefHolder holder) {
case ACTIVITY_DEFAULT: {
JMethod getLocalClassName = getLocalClassName(holder);
constructorSuperBlock.invoke("super") //
.arg(contextParam.invoke("getSharedPreferences") //
.arg(contextParam.invoke("getSharedPreferences") //
.arg(invoke(getLocalClassName).arg(contextParam)) //
.arg(lit(mode)));
break;
}
case ACTIVITY: {
JMethod getLocalClassName = getLocalClassName(holder);
constructorSuperBlock.invoke("super") //
.arg(contextParam.invoke("getSharedPreferences") //
.arg(contextParam.invoke("getSharedPreferences") //
.arg(invoke(getLocalClassName).arg(contextParam) //
.plus(lit("_" + interfaceSimpleName))) //
.arg(lit(mode)));
Expand Down Expand Up @@ -244,7 +244,7 @@ private void generateFieldMethodAndEditorFieldMethod(Element element, SharedPref
private List<ExecutableElement> getValidMethods(Element element) {
List<? extends Element> members = element.getEnclosedElements();
List<ExecutableElement> methods = ElementFilter.methodsIn(members);
List<ExecutableElement> validMethods = new ArrayList<ExecutableElement>();
List<ExecutableElement> validMethods = new ArrayList<>();
for (ExecutableElement method : methods) {
validMethods.add(method);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private JExpression getEnterMessage(JMethod method, ExecutableElement element) {

JClass arraysClass = refClass(Arrays.class);
StringBuilder paramStr = new StringBuilder();
List<JExpression> paramExpressions = new ArrayList<JExpression>();
List<JExpression> paramExpressions = new ArrayList<>();
for (int i = 0; i < params.size(); i++) {
if (i > 0) {
paramStr.append(", ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected JClass getMethodReturnClass(Element element, RestHolder holder) {

protected SortedMap<String, JVar> addMethodParams(ExecutableElement executableElement, RestHolder restHolder, JMethod method) {
List<? extends VariableElement> params = executableElement.getParameters();
SortedMap<String, JVar> methodParams = new TreeMap<String, JVar>();
SortedMap<String, JVar> methodParams = new TreeMap<>();
for (VariableElement parameter : params) {
String paramName = parameter.getSimpleName().toString();
String paramType = parameter.asType().toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private JClass typeMirrorToJClass(DeclaredType declaredType, GeneratedClassHolde

List<? extends TypeMirror> typeArguments = declaredType.getTypeArguments();

List<JClass> typeArgumentJClasses = new ArrayList<JClass>();
List<JClass> typeArgumentJClasses = new ArrayList<>();
for (TypeMirror typeArgument : typeArguments) {
typeArgumentJClasses.add(typeMirrorToJClass(typeArgument, holder, substitute));
}
Expand Down Expand Up @@ -136,13 +136,13 @@ private JClass typeMirrorToJClass(ArrayType arrayType, GeneratedClassHolder hold
}

private Map<String, TypeMirror> getActualTypes(Types typeUtils, DeclaredType baseClass, TypeMirror annotatedClass) {
List<TypeMirror> superTypes = new ArrayList<TypeMirror>();
List<TypeMirror> superTypes = new ArrayList<>();
superTypes.add(annotatedClass);
while (!superTypes.isEmpty()) {
TypeMirror x = superTypes.remove(0);
if (typeUtils.isSameType(typeUtils.erasure(x), typeUtils.erasure(baseClass))) {
DeclaredType type = (DeclaredType) x;
Map<String, TypeMirror> actualTypes = new HashMap<String, TypeMirror>();
Map<String, TypeMirror> actualTypes = new HashMap<>();
for (int i = 0; i < type.getTypeArguments().size(); i++) {
TypeMirror actualArg = type.getTypeArguments().get(i);
TypeMirror formalArg = baseClass.getTypeArguments().get(i);
Expand Down Expand Up @@ -177,7 +177,7 @@ public JMethod overrideAnnotatedMethod(ExecutableElement executableElement, Gene
Types typeUtils = holder.processingEnvironment().getTypeUtils();

Map<String, TypeMirror> actualTypes = getActualTypes(typeUtils, baseClass, annotatedClass);
Map<String, JClass> methodTypes = new LinkedHashMap<String, JClass>();
Map<String, JClass> methodTypes = new LinkedHashMap<>();

for (TypeParameterElement typeParameter : executableElement.getTypeParameters()) {
List<? extends TypeMirror> bounds = typeParameter.getBounds();
Expand Down Expand Up @@ -419,7 +419,7 @@ public JDefinedClass createDelegatingAnonymousRunnableClass(EComponentHolder hol
*/
public List<ExecutableElement> getMethods(TypeElement typeElement) {
List<? extends Element> enclosedElements = typeElement.getEnclosedElements();
List<ExecutableElement> methods = new ArrayList<ExecutableElement>(ElementFilter.methodsIn(enclosedElements));
List<ExecutableElement> methods = new ArrayList<>(ElementFilter.methodsIn(enclosedElements));

// Add methods of the interfaces. These will be valid as they have gone
// through the validator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private Option<AndroidManifest> parse(File androidManifestFile, boolean libraryP
NodeList providerNodes = documentElement.getElementsByTagName("provider");
List<String> providerQualifiedNames = extractComponentNames(applicationPackage, providerNodes);

List<String> componentQualifiedNames = new ArrayList<String>();
List<String> componentQualifiedNames = new ArrayList<>();
componentQualifiedNames.addAll(activityQualifiedNames);
componentQualifiedNames.addAll(serviceQualifiedNames);
componentQualifiedNames.addAll(receiverQualifiedNames);
Expand All @@ -218,7 +218,7 @@ private Option<AndroidManifest> parse(File androidManifestFile, boolean libraryP
NodeList usesPermissionNodes = documentElement.getElementsByTagName("uses-permission");
List<String> usesPermissionQualifiedNames = extractUsesPermissionNames(usesPermissionNodes);

List<String> permissionQualifiedNames = new ArrayList<String>();
List<String> permissionQualifiedNames = new ArrayList<>();
permissionQualifiedNames.addAll(usesPermissionQualifiedNames);

return Option.of(AndroidManifest.createManifest(applicationPackage, applicationClassQualifiedName, componentQualifiedNames, permissionQualifiedNames, minSdkVersion, maxSdkVersion, targetSdkVersion, applicationDebuggableMode));
Expand All @@ -239,7 +239,7 @@ private int extractAttributeIntValue(Node node, String attribute, int defaultVal
}

private List<String> extractComponentNames(String applicationPackage, NodeList componentNodes) {
List<String> componentQualifiedNames = new ArrayList<String>();
List<String> componentQualifiedNames = new ArrayList<>();

for (int i = 0; i < componentNodes.getLength(); i++) {
Node activityNode = componentNodes.item(i);
Expand Down Expand Up @@ -299,7 +299,7 @@ private String returnClassIfExistsOrNull(String className) {
}

private List<String> extractUsesPermissionNames(NodeList usesPermissionNodes) {
List<String> usesPermissionQualifiedNames = new ArrayList<String>();
List<String> usesPermissionQualifiedNames = new ArrayList<>();

for (int i = 0; i < usesPermissionNodes.getLength(); i++) {
Node usesPermissionNode = usesPermissionNodes.item(i);
Expand Down
Loading
X Tutup