mirror of
https://github.com/revanced/smali.git
synced 2025-05-09 19:04:32 +02:00
Fix some nullability problems in SmaliMethodReference
This commit is contained in:
parent
24b1063e50
commit
a0149307bd
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
package org.jf.smalidea.psi.impl;
|
package org.jf.smalidea.psi.impl;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.intellij.openapi.util.TextRange;
|
import com.intellij.openapi.util.TextRange;
|
||||||
import com.intellij.psi.PsiClass;
|
import com.intellij.psi.PsiClass;
|
||||||
import com.intellij.psi.PsiElement;
|
import com.intellij.psi.PsiElement;
|
||||||
@ -108,7 +109,7 @@ public class SmaliMethodReference extends SmaliCompositeElement implements PsiRe
|
|||||||
public List<PsiType> getParameterTypes() {
|
public List<PsiType> getParameterTypes() {
|
||||||
SmaliMethodReferenceParamList paramList = findChildByClass(SmaliMethodReferenceParamList.class);
|
SmaliMethodReferenceParamList paramList = findChildByClass(SmaliMethodReferenceParamList.class);
|
||||||
if (paramList == null) {
|
if (paramList == null) {
|
||||||
return null;
|
return Lists.newArrayList();
|
||||||
}
|
}
|
||||||
|
|
||||||
SmaliTypeElement[] parameterElements = paramList.getParameterTypes();
|
SmaliTypeElement[] parameterElements = paramList.getParameterTypes();
|
||||||
@ -144,7 +145,12 @@ public class SmaliMethodReference extends SmaliCompositeElement implements PsiRe
|
|||||||
pattern.addParameter("", type);
|
pattern.addParameter("", type);
|
||||||
}
|
}
|
||||||
|
|
||||||
pattern.setMethodReturnType(getReturnType().getType());
|
SmaliTypeElement returnTypeElement = getReturnType();
|
||||||
|
if (returnTypeElement == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
pattern.setMethodReturnType(returnTypeElement.getType());
|
||||||
|
|
||||||
// TODO: what about static constructor?
|
// TODO: what about static constructor?
|
||||||
pattern.setConstructor(memberName.getText().equals("<init>"));
|
pattern.setConstructor(memberName.getText().equals("<init>"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user