/* (non-Javadoc)
@see com.ibm.jaggr.core.resource.IResource#asVisitorResource()
553380
@Override
	public Resource asVisitorResource() {
		return new IResourceVisitor.Resource() {

			/* (non-Javadoc)
			 * @see com.ibm.jaggr.core.resource.IResourceVisitor.Resource#newResource()
			 */
			@Override
			public IResource newResource(IAggregator aggregator) {
				throw new UnsupportedOperationException();
			}

			/* (non-Javadoc)
			 * @see com.ibm.jaggr.core.resource.IResourceVisitor.Resource#lastModified()
			 */
			@Override
			public long lastModified() {
				return AbstractResourceBase.this.lastModified();
			}

			/* (non-Javadoc)
			 * @see com.ibm.jaggr.core.resource.IResourceVisitor.Resource#isFolder()
			 */
			@Override
			public boolean isFolder() {
				return AbstractResourceBase.this.isFolder();
			}

			/* (non-Javadoc)
			 * @see com.ibm.jaggr.core.resource.IResourceVisitor.Resource#getURI()
			 */
			@Override
			public URI getURI() {
				return AbstractResourceBase.this.getURI();
			}
		};
	}
493727
@Override
    public final T addAsManifestResource(String resourceName) {
        Validate.notNull(resourceName, "ResourceName should be specified");
        return addAsManifestResource(fileFromResource(resourceName), resourceName);
    }
1282084
public void addNameSourceListener( NameSource.Listener listener ) {
        if ( nameSourceListeners == null )
            nameSourceListeners = new ArrayList();
        nameSourceListeners.add( listener );
    }
978492
@Override
    public void accept(ClientlibVisitor visitor, ClientlibVisitor.VisitorMode mode, ClientlibResourceFolder parent) {
        visitor.visit(this, ClientlibVisitor.VisitorMode.DEPENDS, parent);
    }
74881
@SuppressWarnings("static-method")
	public IJavaElement getSelectedResource(IStructuredSelection selection) {
		IJavaElement elem = null;
		if (selection != null && !selection.isEmpty()) {
			final Object object = selection.getFirstElement();
			if (object instanceof IAdaptable) {
				final IAdaptable adaptable = (IAdaptable) object;
				elem = adaptable.getAdapter(IJavaElement.class);
				if (elem == null) {
					elem = getPackage(adaptable);
				}
			}
		}
		if (elem == null) {
			final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
			IWorkbenchPart part = activePage.getActivePart();
			if (part instanceof ContentOutline) {
				part = activePage.getActiveEditor();
			}
			if (part instanceof XtextEditor) {
				final IXtextDocument doc = ((XtextEditor) part).getDocument();
				final IFile file = doc.getAdapter(IFile.class);
				elem = getPackage(file);
			}
		}
		if (elem == null || elem.getElementType() == IJavaElement.JAVA_MODEL) {
			try {
				final IJavaProject[] projects = JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects();
				if (projects.length == 1) {
					elem = projects[0];
				}
			} catch (JavaModelException e) {
				throw new RuntimeException(e.getMessage());
			}
		}
		return elem;
	}
609131
@Override
    public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) {
        // Add to observed methods list
        visitedMethods.add(new Method(name, descriptor));

        // Make sure the class is annotated.
        ensureAnnotated();

        // Chain to the appropriate RAS method adapter
        MethodVisitor mv = super.visitMethod(access, name, descriptor, signature, exceptions);
        if (isInstrumentableClass() && isInstrumentableMethod(access, name, descriptor)) {
            MethodVisitor rasMethodAdapter = createRasMethodAdapter(mv, access, name, descriptor, signature, exceptions);
            mv = (rasMethodAdapter != null) ? rasMethodAdapter : mv;
        }
        return mv;
    }
935902
public void callASTVisitors(JavacAST ast, long priority) {
		for (VisitorContainer container : visitorHandlers) try {
			if (container.getPriority() == priority) ast.traverse(container.visitor);
		} catch (Throwable t) {
			javacError(String.format("Lombok visitor handler %s failed", container.visitor.getClass()), t);
		}
	}
30891
@Override
    protected void logResources() throws SystemException
    {
        final boolean traceOn = TraceComponent.isAnyTracingEnabled();

        if (traceOn && tc.isEntryEnabled())
            Tr.entry(tc, "logResources", _resourcesLogged);

        if (!_resourcesLogged)
        {
            if (_asyncResourceObjects != null)
            {
                for (JTAAsyncResourceBase resource : _asyncResourceObjects)
                {
                    if (resource.getResourceStatus() == StatefulResource.PREPARED)
                    {
                        recordLog(resource);
                    }
                }
            }

            super.logResources(); // this will set _resourcesLogged to true
        }

        if (traceOn && tc.isEntryEnabled())
            Tr.exit(tc, "logResources");
    }
796990
public static void addSource(SourceBuilder code, AnnotationMirror annotation) {
    new ValueSourceAdder(code).visitAnnotation(annotation, null);
  }
1310987
@Override
    public void visit(NodeVisitor v) {
        if (v.visit(this)) {
            for (XmlFragment frag : fragments) {
                frag.visit(v);
            }
        }
    }
466035
@Override
    public void visit(NodeVisitor v) {
        if (v.visit(this)) {
            varName.visit(v);
            if (catchCondition != null) {
                catchCondition.visit(v);
            }
            body.visit(v);
        }
    }
118257
public void addAsyncResource(JTAAsyncResourceBase resource) throws SystemException
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "addAsyncResource", new Object[] { this, resource });

        if (_asyncResourceObjects == null) {
            _asyncResourceObjects = new ArrayList<JTAAsyncResourceBase>();
        } else {
            for (JTAAsyncResourceBase asyncRes : _asyncResourceObjects) {
                if (resource.getKey().equals(asyncRes.getKey())) {
                    // Caller to determine appropriate action
                    final SystemException se = new SystemException("Cannot register two asynchronous resources with the same keys: " + asyncRes.getKey());
                    if (tc.isEntryEnabled())
                        Tr.exit(tc, "addAsyncResource", se);
                    throw se;
                }
            }
        }

        resource.setResourceStatus(StatefulResource.REGISTERED);
        _asyncResourceObjects.add(resource);

        if (tc.isEventEnabled())
            Tr.event(tc, "(SPI) SERVER registered with Transaction. TX: " + _transaction.getLocalTID() + ", Resource: " + resource);

        if (tc.isEntryEnabled())
            Tr.exit(tc, "addAsyncResource");
    }
686949
@Override
    public void visit(NodeVisitor v) {
        if (v.visit(this)) {
            expression.visit(v);
            statement.visit(v);
        }
    }
1004472
protected void notifyListenersResourceFound(HttpMessage message, int depth, String uri) {
		for (SpiderParserListener l : listeners) {
			l.resourceURIFound(message, depth, uri);
		}
	}
97686
private void setResourcesVisible(boolean visible) {

        m_noResources.setVisible(!visible);
        m_scrollPanel.setVisible(visible);
        m_topBar.getElement().getStyle().setVisibility(visible ? Visibility.VISIBLE : Visibility.HIDDEN);
        m_checkboxSiblings.setVisible(true);
        m_checkboxRelated.setVisible(true);
    }
535288
public void addCustomerSource(
            @NonNull String sourceId,
            @NonNull @Source.SourceType String sourceType,
            @Nullable SourceRetrievalListener listener) {
        final Map<String, Object> arguments = new HashMap<>();
        arguments.put(KEY_SOURCE, sourceId);
        arguments.put(KEY_SOURCE_TYPE, sourceType);

        final String operationId = UUID.randomUUID().toString();
        if (listener != null) {
            mSourceRetrievalListeners.put(operationId, listener);
        }
        mEphemeralKeyManager.retrieveEphemeralKey(operationId, ACTION_ADD_SOURCE, arguments);
    }
348842
@Override
    public void visit(NodeVisitor v) {
        if (v.visit(this)) {
            for (AstNode e : getElements()) {
                e.visit(v);
            }
        }
    }