Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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 @@ -255,6 +255,12 @@ public String[] extractAnnotationResNameParameter(Element element, String annota
* Annotation resName() parameter can be a String or a String[]
*/
Object annotationResName = extractAnnotationParameter(element, annotationName, "resName");
if (annotationResName == null) {
// This case happened during refactoring, if the id has been changed
// in the layout and compiler throws an error on the annotation
// because the constant doesn't exists anymore
return new String[0];
}

String[] resNames;
if (annotationResName.getClass().isArray()) {
Expand All @@ -271,6 +277,12 @@ public int[] extractAnnotationResIdValueParameter(Element element, String annota
* Annotation value() parameter can be an int or an int[]
*/
Object annotationValue = extractAnnotationParameter(element, annotationName, "value");
if (annotationValue == null) {
// This case happened during refactoring, if the id has been changed
// in the layout and compiler throws an error on the annotation
// because the constant doesn't exists anymore
return new int[0];
}

int[] values;
if (annotationValue.getClass().isArray()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@ public void process(Element element, JCodeModel codeModel, EBeanHolder holder) {
processParameters(listenerMethod, call, parameters);

for (JFieldRef idRef : idsRefs) {
ViewChangedHolder onViewChanged = holder.onViewChanged();
if (idRef != null) {
ViewChangedHolder onViewChanged = holder.onViewChanged();

JBlock block = onViewChanged.body().block();
JInvocation view = onViewChanged.findViewById(idRef);

block._if(view.ne(_null()))._then().invoke(castWidget(view), getSetterName()).arg(_new(listenerAnonymousClass));
JBlock block = onViewChanged.body().block();
JInvocation view = onViewChanged.findViewById(idRef);
block._if(view.ne(_null()))._then().invoke(castWidget(view), getSetterName()).arg(_new(listenerAnonymousClass));
}
}
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.