(BodyDeclaration<?> decl)
| 187 | } |
| 188 | |
| 189 | private static int getTypeIdx(BodyDeclaration<?> decl) { |
| 190 | // order: enum-cst mth/ctor/annotation static-init/static-field inst-init/inst-field inst-type static-type |
| 191 | // note: static-init <-> fields and inst-init <-> inst-field can't be reordered with each other as their order determines execution order |
| 192 | |
| 193 | if (decl.isEnumConstantDeclaration()) { |
| 194 | return 0; |
| 195 | } else if (decl.isAnnotationMemberDeclaration() || decl.isCallableDeclaration() || decl.isCompactConstructorDeclaration()) { |
| 196 | return 1; |
| 197 | } else if (decl.isFieldDeclaration()) { |
| 198 | return ((FieldDeclaration) decl).hasModifier(Keyword.STATIC) ? 2 : 3; |
| 199 | } else if (decl.isInitializerDeclaration()) { |
| 200 | return ((InitializerDeclaration) decl).isStatic() ? 2 : 3; |
| 201 | } else if (decl.isTypeDeclaration()) { |
| 202 | if (decl.isClassOrInterfaceDeclaration() && ((ClassOrInterfaceDeclaration) decl).isInterface() || ((TypeDeclaration<?>) decl).isStatic()) { |
| 203 | return 5; |
| 204 | } else { |
| 205 | return 4; |
| 206 | } |
| 207 | } else { |
| 208 | throw new RuntimeException("unknown body decl type: "+decl.getClass().getName()); |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | @Override |
| 213 | protected void printTypeArgs(final NodeWithTypeArguments<?> nodeWithTypeArguments, final Void arg) { |
nothing calls this directly
no test coverage detected