Esempio n. 1
0
 @Override
 public void run(final IRToolService service, final IProgressMonitor monitor)
     throws CoreException {
   final ICombinedRDataAdapter r = (ICombinedRDataAdapter) service;
   if (this.stamp != 0 && this.stamp != r.getChangeStamp()) {
     return;
   }
   final int loadOptions;
   synchronized (this) {
     this.state = STARTING;
     loadOptions = this.loadOptions;
   }
   final RWorkspace workspace = r.getWorkspaceData();
   if (this.reference != null) {
     this.resolvedElement =
         workspace.resolve(this.reference, RWorkspace.RESOLVE_UPTODATE, loadOptions, monitor);
   } else {
     this.resolvedElement =
         workspace.resolve(this.name, RWorkspace.RESOLVE_UPTODATE, loadOptions, monitor);
   }
 }
Esempio n. 2
0
  public static boolean isAccessAllowed(final RElementName name, final RWorkspace rWorkspace) {
    final Set<String> excludePkgs = LOAD_PKG_EXCLUDE_LIST;
    if (excludePkgs.isEmpty()) {
      return true;
    }

    final String pkgName;
    if (RElementName.isPackageFacetScopeType(name.getType())) {
      pkgName = name.getSegmentName();
    } else if (name.getScope() != null
        && RElementName.isPackageFacetScopeType(name.getScope().getType())) {
      pkgName = name.getScope().getSegmentName();
    } else {
      return true;
    }

    return (!(excludePkgs.contains("*") || excludePkgs.contains(pkgName)) // $NON-NLS-1$
        || rWorkspace.isNamespaceLoaded(pkgName));
  }