Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static boolean isLoadable () {
}

public static void exitIfNotLoadable() {
if (!Library.isLoadable ()) {
if (!Library.isLoadable (true)) {
System.err.println("Libraries for platform " + Platform.PLATFORM + " cannot be loaded because of incompatible environment");
System.exit(1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,10 @@
*******************************************************************************/
package org.eclipse.swt.internal;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.JarURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.jar.Attributes;
import java.io.*;
import java.net.*;
import java.nio.file.*;
import java.util.jar.*;

public class Library {

Expand Down Expand Up @@ -192,6 +187,10 @@ static boolean extract (String extractToFilePath, String mappedName) {
}

static boolean isLoadable () {
return isLoadable(false);
}

static boolean isLoadable (boolean ignoreMissingManifest) {
URL url = Platform.class.getClassLoader ().getResource ("org/eclipse/swt/internal/Library.class"); //$NON-NLS-1$
if (!url.getProtocol ().equals ("jar")) { //$NON-NLS-1$
/* SWT is presumably running in a development environment */
Expand All @@ -218,6 +217,9 @@ static boolean isLoadable () {
if (arch.equals (manifestArch) && os.equals (manifestOS)) {
return true;
}
if (manifestArch == null && manifestOS == null && ignoreMissingManifest) {
return true;
}

return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static boolean isLoadable () {
}

public static void exitIfNotLoadable() {
if (!Library.isLoadable ()) {
if (!Library.isLoadable (true)) {
System.err.println("Libraries for platform " + Platform.PLATFORM + " cannot be loaded because of incompatible environment");
System.exit(1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static boolean isLoadable () {
}

public static void exitIfNotLoadable() {
if (!Library.isLoadable ()) {
if (!Library.isLoadable (true)) {
System.err.println("Libraries for platform " + Platform.PLATFORM + " cannot be loaded because of incompatible environment");
System.exit(1);
}
Expand Down
Loading