Skip to content

Commit 1234280

Browse files
committed
Use more safe getJClass instead of JCodeModel.ref
1 parent fd79396 commit 1234280

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/helper/BundleHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public IJExpression getExpressionToRestoreFromBundle(AbstractJClass variableClas
234234
}
235235

236236
if (parcelerBean) {
237-
expressionToRestore = environment.getCodeModel().ref(CanonicalNameConstants.PARCELS_UTILITY_CLASS).staticInvoke("unwrap").arg(expressionToRestore);
237+
expressionToRestore = environment.getJClass(CanonicalNameConstants.PARCELS_UTILITY_CLASS).staticInvoke("unwrap").arg(expressionToRestore);
238238
}
239239

240240
if (restoreCallNeedCastStatement) {
@@ -250,7 +250,7 @@ public IJExpression getExpressionToRestoreFromBundle(AbstractJClass variableClas
250250
public IJStatement getExpressionToSaveFromField(IJExpression saveStateBundleParam, IJExpression fieldName, IJExpression variableRef) {
251251
IJExpression refExpression = variableRef;
252252
if (parcelerBean) {
253-
refExpression = environment.getCodeModel().ref(CanonicalNameConstants.PARCELS_UTILITY_CLASS).staticInvoke("wrap").arg(refExpression);
253+
refExpression = environment.getJClass(CanonicalNameConstants.PARCELS_UTILITY_CLASS).staticInvoke("wrap").arg(refExpression);
254254
}
255255
return JExpr.invoke(saveStateBundleParam, methodNameToSave).arg(fieldName).arg(refExpression);
256256
}

AndroidAnnotations/androidannotations-core/androidannotations/src/main/java/org/androidannotations/internal/core/helper/IntentBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public JInvocation getSuperPutExtraInvocation(TypeMirror elementType, JVar extra
149149
extraParameterArg = cast(environment.getClasses().PARCELABLE, extraParameterArg);
150150
}
151151
} else if (!BundleHelper.METHOD_SUFFIX_BY_TYPE_NAME.containsKey(elementType.toString()) && parcelerHelper.isParcelType(elementType)) {
152-
extraParameterArg = environment.getCodeModel().ref(CanonicalNameConstants.PARCELS_UTILITY_CLASS).staticInvoke("wrap").arg(extraParameterArg);
152+
extraParameterArg = environment.getJClass(CanonicalNameConstants.PARCELS_UTILITY_CLASS).staticInvoke("wrap").arg(extraParameterArg);
153153
} else {
154154
TypeMirror stringType = elementUtils.getTypeElement(STRING).asType();
155155
if (!typeUtils.isSubtype(elementType, stringType)) {

0 commit comments

Comments
 (0)