Skip to content

Commit

Permalink
Merge branch '0101' into 'master'
Browse files Browse the repository at this point in the history
Fix static Platform usage

See merge request maketech-oss/chromium.swt!10
  • Loading branch information
gzunino committed Jul 30, 2019
2 parents 2406493 + 56d5576 commit 8eeb34a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import java.io.InputStream;
import java.util.function.Function;

import org.eclipse.swt.SWT;
import org.eclipse.swt.internal.Library;
import org.eclipse.swt.internal.Platform;

// TODO: copied from org.eclipse.swt.internal.Library, when merged into SWT thi
// can be removed by allowing findResource to not look into internal OSGi resource url
Expand Down Expand Up @@ -58,7 +58,7 @@ public static File findResource(String subDir, String resourceName, boolean mapR
String maybeSubDirPath = subDir != null ? subDir + SEPARATOR : ""; // e.g: subdir/ or ""
String maybeSubDirPathWithPrefix = subDir != null ? SEPARATOR + maybeSubDirPath : ""; // e.g: /subdir/ or ""
final String finalResourceName = mapResourceName ?
System.mapLibraryName(resourceName + "-" + Platform.PLATFORM) // e.g libMyLib-gtk-3826.so
System.mapLibraryName(resourceName + "-" + SWT.getPlatform()) // e.g libMyLib-gtk-3826.so
: resourceName;

// 1) Look for the resource in the java/swt library path(s)
Expand Down Expand Up @@ -116,7 +116,7 @@ public static File findResource(String subDir, String resourceName, boolean mapR
}
}
}
throw new UnsatisfiedLinkError("Could not find resource" + resourceName + (subDir != null ? " (in subdirectory: " + subDir + " )" : ""));
throw new UnsatisfiedLinkError("Could not find resource " + finalResourceName + (subDir != null ? " (in subdirectory: " + subDir + " )" : ""));
}

/**
Expand Down

0 comments on commit 8eeb34a

Please sign in to comment.