Skip to content

Commit

Permalink
Use isEmpty for check
Browse files Browse the repository at this point in the history
  • Loading branch information
Ao-senXiong committed Jun 1, 2024
1 parent d6e76f5 commit 6f242e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public AnnotatedDeclaredType getSelfType(Tree tree) {
AnnotatedDeclaredType type = getAnnotatedType(enclosingClass);

MethodTree enclosingMethod = TreePathUtil.enclosingMethod(path);
if (enclosingClass.getSimpleName().length() != 0 && enclosingMethod != null) {
if (!enclosingClass.getSimpleName().isEmpty() && enclosingMethod != null) {
AnnotatedTypeMirror.AnnotatedDeclaredType methodReceiver;
if (TreeUtils.isConstructor(enclosingMethod)) {
methodReceiver =
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/pico/inference/PICOVariableAnnotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public void storeElementType(Element element, AnnotatedTypeMirror atm) {
// Copied from super implementation
@Override
protected boolean handleWasRawDeclaredTypes(AnnotatedDeclaredType adt) {
if (adt.isUnderlyingTypeRaw() && adt.getTypeArguments().size() != 0) {
if (adt.isUnderlyingTypeRaw() && !adt.getTypeArguments().isEmpty()) {
// the type arguments should be wildcards AND if I get the real type of "tree"
// it corresponds to the declaration of adt.getUnderlyingType
Element declarationEle = adt.getUnderlyingType().asElement();
Expand Down

0 comments on commit 6f242e7

Please sign in to comment.