1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Removed unnecessary synchronization.

This commit is contained in:
Sergey Prigogin 2012-09-06 15:31:46 -07:00
parent 3bdad542ef
commit c7e3993dbc

View file

@ -20,14 +20,14 @@ import java.io.IOException;
* symbolic links is undesirable. The default is to use File.getCanonicalPath.
*/
public abstract class PathCanonicalizationStrategy {
private static PathCanonicalizationStrategy instance;
private static volatile PathCanonicalizationStrategy instance;
static {
setPathCanonicalization(true);
}
public static String getCanonicalPath(File file) {
return getInstance().getCanonicalPathInternal(file);
return instance.getCanonicalPathInternal(file);
}
/**
@ -38,7 +38,7 @@ public abstract class PathCanonicalizationStrategy {
* @param canonicalize <code>true</code> to use File.getCanonicalPath, <code>false</code>
* to use File.getAbsolutePath.
*/
public static synchronized void setPathCanonicalization(boolean canonicalize) {
public static void setPathCanonicalization(boolean canonicalize) {
if (canonicalize) {
instance = new PathCanonicalizationStrategy() {
@Override
@ -60,9 +60,5 @@ public abstract class PathCanonicalizationStrategy {
}
}
private static synchronized PathCanonicalizationStrategy getInstance() {
return instance;
}
protected abstract String getCanonicalPathInternal(File file);
}