Package org.eclipse.jdt.internal.core.JavaModelManager

Examples of org.eclipse.jdt.internal.core.JavaModelManager.PerProjectInfo


  }

  private void readRawClasspath(JavaProject javaProject) {
    // force to (re)read the .classpath file
    try {
      PerProjectInfo perProjectInfo = javaProject.getPerProjectInfo();
      if (!perProjectInfo.writtingRawClasspath) // to avoid deadlock, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=221680
        perProjectInfo.readAndCacheClasspath(javaProject);
    } catch (JavaModelException e) {
      if (VERBOSE) {
        e.printStackTrace();
      }
    }
View Full Code Here


  JavadocContents javadocContents = getJavadocContents(monitor);
  if (javadocContents == null) return null;
  return javadocContents.getTypeDoc();
}
public JavadocContents getJavadocContents(IProgressMonitor monitor) throws JavaModelException {
  PerProjectInfo projectInfo = JavaModelManager.getJavaModelManager().getPerProjectInfoCheckExistence(getJavaProject().getProject());
  JavadocContents cachedJavadoc = null;
  synchronized (projectInfo.javadocCache) {
    cachedJavadoc = (JavadocContents) projectInfo.javadocCache.get(this);
  }
 
View Full Code Here

    DeltaProcessor deltaProcessor = state.getDeltaProcessor();
    IClasspathEntry[] newResolvedClasspath = null;
    IPath newOutputLocation = null;
    int result = NO_DELTA;
    try {
      PerProjectInfo perProjectInfo = this.project.getPerProjectInfo();

      // get new info
      this.project.resolveClasspath(perProjectInfo, false/*don't use previous session values*/, addClasspathChange);
      IClasspathEntry[] newRawClasspath;

      // use synchronized block to ensure consistency
      synchronized (perProjectInfo) {
        newRawClasspath = perProjectInfo.rawClasspath;
        newResolvedClasspath = perProjectInfo.getResolvedClasspath();
        newOutputLocation = perProjectInfo.outputLocation;
      }

      if (newResolvedClasspath == null) {
        // another thread reset the resolved classpath, use a temporary PerProjectInfo
        PerProjectInfo temporaryInfo = this.project.newTemporaryInfo();
        this.project.resolveClasspath(temporaryInfo, false/*don't use previous session values*/, addClasspathChange);
        newRawClasspath = temporaryInfo.rawClasspath;
        newResolvedClasspath = temporaryInfo.getResolvedClasspath();
        newOutputLocation = temporaryInfo.outputLocation;
      }

      // check if raw classpath has changed
      if (this.oldRawClasspath != null && !JavaProject.areClasspathsEqual(this.oldRawClasspath, newRawClasspath, this.oldOutputLocation, newOutputLocation)) {
View Full Code Here

   */
  protected void executeOperation() throws JavaModelException {
    checkCanceled();
    try {
      // set raw classpath and null out resolved info
      PerProjectInfo perProjectInfo = this.project.getPerProjectInfo();
      ClasspathChange classpathChange = perProjectInfo.setRawClasspath(this.newRawClasspath, this.referencedEntries, this.newOutputLocation, JavaModelStatus.VERIFIED_OK/*format is ok*/);

      // if needed, generate delta, update project ref, create markers, ...
      classpathChanged(classpathChange, true/*refresh if external linked folder already exists*/);

      // write .classpath file
      if (this.canChangeResources && perProjectInfo.writeAndCacheClasspath(this.project, this.newRawClasspath, this.newOutputLocation))
        setAttribute(HAS_MODIFIED_RESOURCE_ATTR, TRUE);
    } finally {
      done();
    }
  }
View Full Code Here

}
/*
* @see IJavaElement#getAttachedJavadoc(IProgressMonitor)
*/
public String getAttachedJavadoc(IProgressMonitor monitor) throws JavaModelException {
  PerProjectInfo projectInfo = JavaModelManager.getJavaModelManager().getPerProjectInfoCheckExistence(getJavaProject().getProject());
  String cachedJavadoc = null;
  synchronized (projectInfo.javadocCache) {
    cachedJavadoc = (String) projectInfo.javadocCache.get(this);
  }
  if (cachedJavadoc != null) {
View Full Code Here

    if ((modifiers & ClassFileConstants.AccSynthetic) != 0) {
      return this.parameterNames = getRawParameterNames(paramCount);
    }
    JavadocContents javadocContents = null;
    IType declaringType = getDeclaringType();
    PerProjectInfo projectInfo = JavaModelManager.getJavaModelManager().getPerProjectInfoCheckExistence(getJavaProject().getProject());
    synchronized (projectInfo.javadocCache) {
      javadocContents = (JavadocContents) projectInfo.javadocCache.get(declaringType);
      if (javadocContents == null) {
        projectInfo.javadocCache.put(declaringType, BinaryType.EMPTY_JAVADOC);
      }
View Full Code Here

   * @return IClasspathEntry
   * @throws JavaModelException
   */
  public IClasspathEntry getClasspathEntryFor(IPath path) throws JavaModelException {
    getResolvedClasspath(); // force resolution
    PerProjectInfo perProjectInfo = getPerProjectInfo();
    if (perProjectInfo == null)
      return null;
    Map rootPathToResolvedEntries = perProjectInfo.rootPathToResolvedEntries;
    if (rootPathToResolvedEntries == null)
      return null;
View Full Code Here

    return projectPrerequisites(getResolvedClasspath());
  }

  public IClasspathEntry[] getResolvedClasspath() throws JavaModelException {
    PerProjectInfo perProjectInfo = getPerProjectInfo();
    IClasspathEntry[] resolvedClasspath = perProjectInfo.getResolvedClasspath();
    if (resolvedClasspath == null) {
      resolveClasspath(perProjectInfo, false/*don't use previous session values*/, true/*add classpath change*/);
      resolvedClasspath = perProjectInfo.getResolvedClasspath();
      if (resolvedClasspath == null) {
        // another thread reset the resolved classpath, use a temporary PerProjectInfo
        PerProjectInfo temporaryInfo = newTemporaryInfo();
        resolveClasspath(temporaryInfo, false/*don't use previous session values*/, true/*add classpath change*/);
        resolvedClasspath = temporaryInfo.getResolvedClasspath();
      }
    }
    return resolvedClasspath;
  }
View Full Code Here

    if  (JavaModelManager.getJavaModelManager().isClasspathBeingResolved(this)) {
      if (JavaModelManager.CP_RESOLVE_VERBOSE_ADVANCED)
        verbose_reentering_classpath_resolution();
        return RESOLUTION_IN_PROGRESS;
    }
    PerProjectInfo perProjectInfo = getPerProjectInfo();

    // use synchronized block to ensure consistency
    IClasspathEntry[] resolvedClasspath;
    IJavaModelStatus unresolvedEntryStatus;
    synchronized (perProjectInfo) {
      resolvedClasspath = perProjectInfo.getResolvedClasspath();
      unresolvedEntryStatus = perProjectInfo.unresolvedEntryStatus;
    }

    if (resolvedClasspath == null
        || (unresolvedEntryStatus != null && !unresolvedEntryStatus.isOK())) { // force resolution to ensure initializers are run again
      resolveClasspath(perProjectInfo, false/*don't use previous session values*/, true/*add classpath change*/);
      synchronized (perProjectInfo) {
        resolvedClasspath = perProjectInfo.getResolvedClasspath();
        unresolvedEntryStatus = perProjectInfo.unresolvedEntryStatus;
      }
      if (resolvedClasspath == null) {
        // another thread reset the resolved classpath, use a temporary PerProjectInfo
        PerProjectInfo temporaryInfo = newTemporaryInfo();
        resolveClasspath(temporaryInfo, false/*don't use previous session values*/, true/*add classpath change*/);
        resolvedClasspath = temporaryInfo.getResolvedClasspath();
        unresolvedEntryStatus = temporaryInfo.unresolvedEntryStatus;
      }
    }
    if (!ignoreUnresolvedEntry && unresolvedEntryStatus != null && !unresolvedEntryStatus.isOK())
      throw new JavaModelException(unresolvedEntryStatus);
View Full Code Here

   * Returns a PerProjectInfo that doesn't register classpath change
   * and that should be used as a temporary info.
   */
  public PerProjectInfo newTemporaryInfo() {
    return
      new PerProjectInfo(this.project.getProject()) {
        protected ClasspathChange addClasspathChange() {
          return null;
        }
    };
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.core.JavaModelManager.PerProjectInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.