@Override public Void visitTypeDeclaration(final TypeDeclaration typeDeclaration, final Void p) { final TypeDefinition type = typeDeclaration.getUserData(Keys.TYPE_DEFINITION); if (type != null && (isLocalOrAnonymous(type) || type.isAnonymous())) { _localTypes.put(type, typeDeclaration); } return super.visitTypeDeclaration(typeDeclaration, p); } }
@Override public Void visitAnonymousObjectCreationExpression(final AnonymousObjectCreationExpression node, final Void p) { super.visitAnonymousObjectCreationExpression(node, p); final TypeDefinition resolvedType = node.getTypeDeclaration().getUserData(Keys.TYPE_DEFINITION); if (resolvedType != null && isLocalOrAnonymous(resolvedType)) { List<ObjectCreationExpression> instantiations = _instantiations.get(resolvedType); if (instantiations == null) { _instantiations.put(resolvedType, instantiations = new ArrayList<>()); } instantiations.add(node); } return null; }
private static void rewriteThisReferences( final DecompilerContext context, final TypeDeclaration declaration, final Map<String, Expression> initializers) { final TypeDefinition innerClass = declaration.getUserData(Keys.TYPE_DEFINITION); if (innerClass != null) { final ContextTrackingVisitor<Void> thisRewriter = new ThisReferenceReplacingVisitor(context, innerClass); for (final Expression e : initializers.values()) { thisRewriter.run(e); } } }
@Override public Void visitTypeDeclaration(final TypeDeclaration typeDeclaration, final Void _) { final TypeDefinition type = typeDeclaration.getUserData(Keys.TYPE_DEFINITION); if (type != null && (isLocalOrAnonymous(type) || type.isAnonymous())) { _localTypes.put(type, typeDeclaration); } return super.visitTypeDeclaration(typeDeclaration, _); } }
@Override public Void visitTypeDeclaration(final TypeDeclaration node, final Void _) { final TypeDefinition type = node.getUserData(Keys.TYPE_DEFINITION); if (type != null) { if (!_visitedTypes.add(type.getInternalName())) { return null; } } return super.visitTypeDeclaration(node, _); }
@Override public Void visitTypeDeclaration(final TypeDeclaration node, final Void p) { final TypeDefinition type = node.getUserData(Keys.TYPE_DEFINITION); if (type != null) { if (!_visitedTypes.add(type.getInternalName())) { return null; } } return super.visitTypeDeclaration(node, p); }
@Override public Void visitTypeDeclaration(final TypeDeclaration node, final Void _) { final TypeDefinition type = node.getUserData(Keys.TYPE_DEFINITION); if (type != null) { if (!_visitedTypes.add(type.getInternalName())) { return null; } } return super.visitTypeDeclaration(node, _); }
@Override public Void visitTypeDeclaration(final TypeDeclaration typeDeclaration, final Void _) { final TypeDefinition type = typeDeclaration.getUserData(Keys.TYPE_DEFINITION); if (type != null && (isLocalOrAnonymous(type) || type.isAnonymous())) { _localTypes.put(type, typeDeclaration); } return super.visitTypeDeclaration(typeDeclaration, _); } }
private static void rewriteThisReferences( final DecompilerContext context, final TypeDeclaration declaration, final Map<String, Expression> initializers) { final TypeDefinition innerClass = declaration.getUserData(Keys.TYPE_DEFINITION); if (innerClass != null) { final ContextTrackingVisitor<Void> thisRewriter = new ThisReferenceReplacingVisitor(context, innerClass); for (final Expression e : initializers.values()) { thisRewriter.run(e); } } }
private static void rewriteThisReferences( final DecompilerContext context, final TypeDeclaration declaration, final Map<String, Expression> initializers) { final TypeDefinition innerClass = declaration.getUserData(Keys.TYPE_DEFINITION); if (innerClass != null) { final ContextTrackingVisitor<Void> thisRewriter = new ThisReferenceReplacingVisitor(context, innerClass); for (final Expression e : initializers.values()) { thisRewriter.run(e); } } }
@Override public Void visitAnonymousObjectCreationExpression(final AnonymousObjectCreationExpression node, final Void _) { super.visitAnonymousObjectCreationExpression(node, _); final TypeDefinition resolvedType = node.getTypeDeclaration().getUserData(Keys.TYPE_DEFINITION); if (resolvedType != null && isLocalOrAnonymous(resolvedType)) { List<ObjectCreationExpression> instantiations = _instantiations.get(resolvedType); if (instantiations == null) { _instantiations.put(resolvedType, instantiations = new ArrayList<>()); } instantiations.add(node); } return null; }
@Override public Void visitAnonymousObjectCreationExpression(final AnonymousObjectCreationExpression node, final Void _) { super.visitAnonymousObjectCreationExpression(node, _); final TypeDefinition resolvedType = node.getTypeDeclaration().getUserData(Keys.TYPE_DEFINITION); if (resolvedType != null && isLocalOrAnonymous(resolvedType)) { List<ObjectCreationExpression> instantiations = _instantiations.get(resolvedType); if (instantiations == null) { _instantiations.put(resolvedType, instantiations = new ArrayList<>()); } instantiations.add(node); } return null; }
@Override public Set<Object> visitLocalTypeDeclarationStatement(final LocalTypeDeclarationStatement node, final String name) { final TypeDeclaration typeDeclaration = node.getTypeDeclaration(); if (typeDeclaration.isNull()) { return Collections.emptySet(); } if (StringUtilities.equals(typeDeclaration.getName(), name)) { final TypeDefinition type = typeDeclaration.getUserData(Keys.TYPE_DEFINITION); if (type != null) { return Collections.<Object>singleton(type); } } return searchUpScope( name, typeDeclaration.getUserData(Keys.TYPE_DEFINITION), new LinkedHashSet<String>(), true ); }
@Override public Void visitTypeDeclaration(final TypeDeclaration node, final Void p) { if (!(node.getParent() instanceof CompilationUnit)) { final TypeDefinition type = node.getUserData(Keys.TYPE_DEFINITION); if (type != null && AstBuilder.isMemberHidden(type, context)) { node.remove(); return null; } } return super.visitTypeDeclaration(node, p); }
@Override public Void visitTypeDeclaration(final TypeDeclaration node, final Void _) { if (!(node.getParent() instanceof CompilationUnit)) { final TypeDefinition type = node.getUserData(Keys.TYPE_DEFINITION); if (type != null && AstBuilder.isMemberHidden(type, context)) { node.remove(); return null; } } return super.visitTypeDeclaration(node, _); }
@Override public Void visitTypeDeclaration(final TypeDeclaration node, final Void _) { if (!(node.getParent() instanceof CompilationUnit)) { final TypeDefinition type = node.getUserData(Keys.TYPE_DEFINITION); if (type != null && AstBuilder.isMemberHidden(type, context)) { node.remove(); return null; } } return super.visitTypeDeclaration(node, _); }
private void tryAddDeprecatedAnnotationToType(final TypeDeclaration node) { if (any(node.getAnnotations(), IS_DEPRECATED_ANNOTATION)) { return; } final TypeDefinition type = node.getUserData(Keys.TYPE_DEFINITION); if (type == null || (type.getFlags() & Flags.DEPRECATED) != Flags.DEPRECATED) { return; } if (type.getCompilerMajorVersion() < CompilerTarget.JDK1_5.majorVersion) { return; } addAnnotation(node, type.getResolver(), DEPRECATED_ANNOTATION_NAME); }
public TResult visitTypeDeclaration(final TypeDeclaration typeDeclaration, final Void _) { final TypeDefinition oldType = context.getCurrentType(); final MethodDefinition oldMethod = context.getCurrentMethod(); try { context.setCurrentType(typeDeclaration.getUserData(Keys.TYPE_DEFINITION)); context.setCurrentMethod(null); return super.visitTypeDeclaration(typeDeclaration, _); } finally { context.setCurrentType(oldType); context.setCurrentMethod(oldMethod); } }
public TResult visitTypeDeclaration(final TypeDeclaration typeDeclaration, final Void _) { final TypeDefinition oldType = context.getCurrentType(); final MethodDefinition oldMethod = context.getCurrentMethod(); try { context.setCurrentType(typeDeclaration.getUserData(Keys.TYPE_DEFINITION)); context.setCurrentMethod(null); return super.visitTypeDeclaration(typeDeclaration, _); } finally { context.setCurrentType(oldType); context.setCurrentMethod(oldMethod); } }
public TResult visitTypeDeclaration(final TypeDeclaration typeDeclaration, final Void p) { final TypeDefinition oldType = context.getCurrentType(); final MethodDefinition oldMethod = context.getCurrentMethod(); try { context.setCurrentType(typeDeclaration.getUserData(Keys.TYPE_DEFINITION)); context.setCurrentMethod(null); return super.visitTypeDeclaration(typeDeclaration, p); } finally { context.setCurrentType(oldType); context.setCurrentMethod(oldMethod); } }