Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 380386 - org.eclipse.core.internal.resources.PathVariableManager.validateValue(URI) always returns null
Summary: org.eclipse.core.internal.resources.PathVariableManager.validateValue(URI) al...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.3 M1   Edit
Assignee: Szymon Brandys CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 384585
  Show dependency tree
 
Reported: 2012-05-23 08:49 EDT by Mikael Åsberg CLA
Modified: 2012-07-09 05:37 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Åsberg CLA 2012-05-23 08:49:03 EDT
Hello, consider this simple test program which does not work as expected since org.eclipse.core.internal.resources.PathVariableManager.validateValue(URI) always returns null. I see this problem on Eclipse 3.7 and 3.8-prereleases.

try {
  String path = "C:\\temp";
  java.net.URI value = new java.io.File(path).toURI();
  IPathVariableManager pathManager = 
    ResourcesPlugin.getWorkspace().getPathVariableManager();
  String name = "somename";
  IStatus statusName = pathManager.validateName(name);
  IStatus statusValue = pathManager.validateValue(value);

  if (statusName == null || statusValue == null) {
    System.err.println("statusName is " + (statusName == null ? "null" : 
                       ("not null: '" + statusName + "'.")));
    System.err.println("statusValue is " + (statusValue == null ? "null" :
                       ("not null: '" + statusValue + "'.")));
  }
  else if (statusName.isOK() && statusValue.isOK()) {
    pathManager.setURIValue(name, value);
    System.out.println("Everything is fine");
  }
  else {
    if (!statusName.isOK()) {
      System.err.println("statusName is not OK.");
    }
    if (!statusValue.isOK()) {
      System.err.println("statusValue is not OK.");
    }
 }
}
catch (CoreException e) {
  System.err.println("CoreException: " + e.getMessage());
}

Output from program:
statusName is not null: 'Status OK: unknown code=0 OK null'.
statusValue is null

See also http://stackoverflow.com/questions/9831280/ipathvariablemanager-validatevalueuri-returns-null where I first asked about this problem and was told to file a bug report (sorry for delaying so long in doing so). Hope this problem can be fixed, bye!
Comment 1 Szymon Brandys CLA 2012-06-04 07:12:55 EDT
Pushed to Gerrit https://git.eclipse.org/r/6233
Comment 2 Daniel Froemmel CLA 2012-06-05 09:38:25 EDT
i confirm the report, i found it too right at this moment...
Comment 3 Szymon Brandys CLA 2012-07-09 05:34:49 EDT
Fixed with 57d034980475e3937a5cb5efe00b39797bc3026e.
Comment 4 Szymon Brandys CLA 2012-07-09 05:37:35 EDT
Marking FIXED.