Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2013-02-21 15:46:53 +0000
committerThomas Watson2013-02-21 15:46:53 +0000
commitdbfb9069de39e4b80e55685bb0081230bdf980ad (patch)
treede51d9b6c2c2b62c9a250907811466fe447ed89c /bundles
parenta8d99e014c05d32bd4d0084ad3b323e71c4835ed (diff)
parent0d5c40d55fff4174d33ec45c039837dcafa934a1 (diff)
downloadrt.equinox.framework-dbfb9069de39e4b80e55685bb0081230bdf980ad.tar.gz
rt.equinox.framework-dbfb9069de39e4b80e55685bb0081230bdf980ad.tar.xz
rt.equinox.framework-dbfb9069de39e4b80e55685bb0081230bdf980ad.zip
Merge branch 'master' into twatson/container
Conflicts: bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/BaseSecurityTest.java bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/PolicyHandler.java bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogServices.java bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/BundleHost.java
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.executable/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.executable/library/carbon/eclipseCarbon.c73
-rw-r--r--bundles/org.eclipse.equinox.executable/library/make_version.mak2
-rw-r--r--bundles/org.eclipse.equinox.launcher.carbon.macosx/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.cocoa.macosx.x86_64/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.cocoa.macosx/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.gtk.aix.ppc/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.gtk.aix.ppc64/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.gtk.hpux.ia64/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.gtk.hpux.ia64_32/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.gtk.linux.ppc/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.gtk.linux.ppc64/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.gtk.linux.s390/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.gtk.linux.s390x/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.gtk.linux.x86/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.gtk.linux.x86_64/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.gtk.solaris.sparc/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.gtk.solaris.x86/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.motif.aix.ppc/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.motif.hpux.ia64_32/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.motif.linux.x86/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.motif.solaris.sparc/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.win32.win32.ia64/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.win32.win32.x86/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.win32.win32.x86_64/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.launcher.wpf.win32.x86/build.properties2
-rw-r--r--bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java6
-rw-r--r--bundles/org.eclipse.osgi.tests/.classpath1
-rw-r--r--bundles/org.eclipse.osgi.tests/build.properties3
-rw-r--r--bundles/org.eclipse.osgi.tests/bundles_src/buddy.invalid.a/META-INF/MANIFEST.MF11
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ClassLoadingBundleTests.java11
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/BaseSecurityTest.java2
-rw-r--r--bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java56
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java7
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java77
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java24
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/PolicyHandler.java11
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogServices.java34
38 files changed, 214 insertions, 152 deletions
diff --git a/bundles/org.eclipse.equinox.executable/build.properties b/bundles/org.eclipse.equinox.executable/build.properties
index c52071562..f8fd12b9f 100644
--- a/bundles/org.eclipse.equinox.executable/build.properties
+++ b/bundles/org.eclipse.equinox.executable/build.properties
@@ -10,7 +10,7 @@
###############################################################################
#custom = true
p2.group.id = org.eclipse.equinox.executable
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
customBuildCallbacks=customBuildCallbacks.xml
bin.includes = bin/,\
feature.xml,\
diff --git a/bundles/org.eclipse.equinox.executable/library/carbon/eclipseCarbon.c b/bundles/org.eclipse.equinox.executable/library/carbon/eclipseCarbon.c
index 79bed9471..29348fc56 100644
--- a/bundles/org.eclipse.equinox.executable/library/carbon/eclipseCarbon.c
+++ b/bundles/org.eclipse.equinox.executable/library/carbon/eclipseCarbon.c
@@ -71,8 +71,11 @@ static char * findLib(char * command);
#define MAX_LOCATION_LENGTH 40 /* none of the jvmLocations strings should be longer than this */
#define MAX_JVMLIB_LENGTH 15 /* none of the jvmLibs strings should be longer than this */
static const char* jvmLocations[] = { "../lib/" JAVA_ARCH "/client",
- "../lib/" JAVA_ARCH "/server", "../jre/lib/" JAVA_ARCH "/client",
- "../jre/lib/" JAVA_ARCH "/server", NULL };
+ "../lib/" JAVA_ARCH "/server",
+ "../jre/lib/" JAVA_ARCH "/client",
+ "../jre/lib/" JAVA_ARCH "/server",
+ "../jre/lib/client",
+ "../jre/lib/server", NULL };
static const char* jvmLibs[] = { "libjvm.dylib", "libjvm.jnilib", "libjvm.so", NULL };
/* Define the window system arguments for the various Java VMs. */
@@ -474,43 +477,6 @@ char** getArgVM( char* vm )
return result;
}
-char * getJavaVersion(char* command) {
- FILE *fp;
- char buffer[4096];
- char *version = NULL, *firstChar;
- int numChars = 0;
- sprintf(buffer,"%s -version 2>&1", command);
- fp = popen(buffer, "r");
- if (fp == NULL) {
- return NULL;
- }
- while (fgets(buffer, sizeof(buffer)-1, fp) != NULL) {
- if (!version) {
- firstChar = (char *) (strchr(buffer, '"') + 1);
- if (firstChar != NULL)
- numChars = (int) (strrchr(buffer, '"') - firstChar);
-
- /* Allocate a buffer and copy the version string into it. */
- if (numChars > 0)
- {
- version = malloc( numChars + 1 );
- strncpy(version, firstChar, numChars);
- version[numChars] = '\0';
- }
- }
- if (strstr(buffer, "Java HotSpot(TM)") || strstr(buffer, "OpenJDK")) {
- isSUN = 1;
- break;
- }
- if (strstr(buffer, "IBM") != NULL) {
- isSUN = 0;
- break;
- }
- }
- pclose(fp);
- return version;
-}
-
char * getJavaHome() {
FILE *fp;
char path[4096];
@@ -534,8 +500,8 @@ char * getJavaHome() {
char * findVMLibrary( char* command ) {
char *start, *end;
- char *version;
- int length, isJDK7;
+ char *version, *result, *cmd;
+ int length;
/*check first to see if command already points to the library */
if (strcmp(command, JAVA_FRAMEWORK) == 0) {
@@ -561,29 +527,20 @@ char * findVMLibrary( char* command ) {
free(version);
}
}
- char *java_home = NULL, *cmd = command;
+ cmd = command;
if (strstr(cmd, "/JavaVM.framework/") != NULL && (strstr(cmd, "/Current/") != NULL || strstr(cmd, "/A/") != NULL)) {
- java_home = cmd = getJavaHome();
- }
- version = getJavaVersion(cmd);
- isJDK7 = version && versionCmp(version, "1.7.0") >= 0;
- if (version) free(version);
- if (isJDK7) {
- start = strstr(cmd, "/Contents/");
- if (start != NULL){
- start[0] = 0;
- return cmd;
- }
+ cmd = getJavaHome();
}
- if (java_home) free(java_home);
- if (strstr(command, "/JavaVM.framework/") == NULL) {
- char * lib = findLib(command);
+ result = JAVA_FRAMEWORK;
+ if (strstr(cmd, "/JavaVM.framework/") == NULL) {
+ char * lib = findLib(cmd);
if (lib != NULL) {
adjustLibraryPath(lib);
- return lib;
+ result = lib;
}
}
- return JAVA_FRAMEWORK;
+ if (cmd != command) free(cmd);
+ return result;
}
static char * findLib(char * command) {
diff --git a/bundles/org.eclipse.equinox.executable/library/make_version.mak b/bundles/org.eclipse.equinox.executable/library/make_version.mak
index 11832f6a7..41c9b799c 100644
--- a/bundles/org.eclipse.equinox.executable/library/make_version.mak
+++ b/bundles/org.eclipse.equinox.executable/library/make_version.mak
@@ -10,5 +10,5 @@
#*******************************************************************************
maj_ver=1
-min_ver=504
+min_ver=505
LIB_VERSION = $(maj_ver)$(min_ver)
diff --git a/bundles/org.eclipse.equinox.launcher.carbon.macosx/build.properties b/bundles/org.eclipse.equinox.launcher.carbon.macosx/build.properties
index 489bba3fa..31d6b5ced 100644
--- a/bundles/org.eclipse.equinox.launcher.carbon.macosx/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.carbon.macosx/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.cocoa.macosx.x86_64/build.properties b/bundles/org.eclipse.equinox.launcher.cocoa.macosx.x86_64/build.properties
index f66b407ca..02163d2cd 100644
--- a/bundles/org.eclipse.equinox.launcher.cocoa.macosx.x86_64/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.cocoa.macosx.x86_64/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.cocoa.macosx/build.properties b/bundles/org.eclipse.equinox.launcher.cocoa.macosx/build.properties
index dac0524c2..8ab53b830 100644
--- a/bundles/org.eclipse.equinox.launcher.cocoa.macosx/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.cocoa.macosx/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.gtk.aix.ppc/build.properties b/bundles/org.eclipse.equinox.launcher.gtk.aix.ppc/build.properties
index bfcd67952..af32010a3 100644
--- a/bundles/org.eclipse.equinox.launcher.gtk.aix.ppc/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.gtk.aix.ppc/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.gtk.aix.ppc64/build.properties b/bundles/org.eclipse.equinox.launcher.gtk.aix.ppc64/build.properties
index ef8d505b2..feca0b955 100644
--- a/bundles/org.eclipse.equinox.launcher.gtk.aix.ppc64/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.gtk.aix.ppc64/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237 \ No newline at end of file
+binaryTag=v20130213-1029 \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.launcher.gtk.hpux.ia64/build.properties b/bundles/org.eclipse.equinox.launcher.gtk.hpux.ia64/build.properties
index 4c52679df..9ad3f8b68 100644
--- a/bundles/org.eclipse.equinox.launcher.gtk.hpux.ia64/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.gtk.hpux.ia64/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.gtk.hpux.ia64_32/build.properties b/bundles/org.eclipse.equinox.launcher.gtk.hpux.ia64_32/build.properties
index 948d99dba..e811f5798 100644
--- a/bundles/org.eclipse.equinox.launcher.gtk.hpux.ia64_32/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.gtk.hpux.ia64_32/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.gtk.linux.ppc/build.properties b/bundles/org.eclipse.equinox.launcher.gtk.linux.ppc/build.properties
index 61b1080e6..e417eb061 100644
--- a/bundles/org.eclipse.equinox.launcher.gtk.linux.ppc/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.gtk.linux.ppc/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.gtk.linux.ppc64/build.properties b/bundles/org.eclipse.equinox.launcher.gtk.linux.ppc64/build.properties
index 034d952af..101bfbb8f 100644
--- a/bundles/org.eclipse.equinox.launcher.gtk.linux.ppc64/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.gtk.linux.ppc64/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.gtk.linux.s390/build.properties b/bundles/org.eclipse.equinox.launcher.gtk.linux.s390/build.properties
index 8c9bad618..55ffa6075 100644
--- a/bundles/org.eclipse.equinox.launcher.gtk.linux.s390/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.gtk.linux.s390/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237 \ No newline at end of file
+binaryTag=v20130213-1029 \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.launcher.gtk.linux.s390x/build.properties b/bundles/org.eclipse.equinox.launcher.gtk.linux.s390x/build.properties
index e78a585f0..9d41dca4c 100644
--- a/bundles/org.eclipse.equinox.launcher.gtk.linux.s390x/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.gtk.linux.s390x/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237 \ No newline at end of file
+binaryTag=v20130213-1029 \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.launcher.gtk.linux.x86/build.properties b/bundles/org.eclipse.equinox.launcher.gtk.linux.x86/build.properties
index 416719224..fd699b1ed 100644
--- a/bundles/org.eclipse.equinox.launcher.gtk.linux.x86/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.gtk.linux.x86/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.gtk.linux.x86_64/build.properties b/bundles/org.eclipse.equinox.launcher.gtk.linux.x86_64/build.properties
index 96b140c38..9cc227f98 100644
--- a/bundles/org.eclipse.equinox.launcher.gtk.linux.x86_64/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.gtk.linux.x86_64/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.gtk.solaris.sparc/build.properties b/bundles/org.eclipse.equinox.launcher.gtk.solaris.sparc/build.properties
index 2c78c084b..16cdbb1db 100644
--- a/bundles/org.eclipse.equinox.launcher.gtk.solaris.sparc/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.gtk.solaris.sparc/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.gtk.solaris.x86/build.properties b/bundles/org.eclipse.equinox.launcher.gtk.solaris.x86/build.properties
index 9486930cd..7aaebd77d 100644
--- a/bundles/org.eclipse.equinox.launcher.gtk.solaris.x86/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.gtk.solaris.x86/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.motif.aix.ppc/build.properties b/bundles/org.eclipse.equinox.launcher.motif.aix.ppc/build.properties
index 9620af474..048646444 100644
--- a/bundles/org.eclipse.equinox.launcher.motif.aix.ppc/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.motif.aix.ppc/build.properties
@@ -16,4 +16,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.motif.hpux.ia64_32/build.properties b/bundles/org.eclipse.equinox.launcher.motif.hpux.ia64_32/build.properties
index de6ce56ae..65910bdba 100644
--- a/bundles/org.eclipse.equinox.launcher.motif.hpux.ia64_32/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.motif.hpux.ia64_32/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.motif.linux.x86/build.properties b/bundles/org.eclipse.equinox.launcher.motif.linux.x86/build.properties
index 9d9078b98..ac02476d1 100644
--- a/bundles/org.eclipse.equinox.launcher.motif.linux.x86/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.motif.linux.x86/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.motif.solaris.sparc/build.properties b/bundles/org.eclipse.equinox.launcher.motif.solaris.sparc/build.properties
index 35fa94aae..060af8ced 100644
--- a/bundles/org.eclipse.equinox.launcher.motif.solaris.sparc/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.motif.solaris.sparc/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
customBuildCallbacks=customBuildCallbacks.xml
generateSourceBundle=false
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.win32.win32.ia64/build.properties b/bundles/org.eclipse.equinox.launcher.win32.win32.ia64/build.properties
index 448154dfb..e6e31281a 100644
--- a/bundles/org.eclipse.equinox.launcher.win32.win32.ia64/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.win32.win32.ia64/build.properties
@@ -14,4 +14,4 @@ bin.includes = META-INF/,\
about.html
generateSourceBundle=false
customBuildCallbacks=customBuildCallbacks.xml
-binaryTag=v20130117-1237 \ No newline at end of file
+binaryTag=v20130213-1029 \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.launcher.win32.win32.x86/build.properties b/bundles/org.eclipse.equinox.launcher.win32.win32.x86/build.properties
index 0c8b6d485..4c919e8b5 100644
--- a/bundles/org.eclipse.equinox.launcher.win32.win32.x86/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.win32.win32.x86/build.properties
@@ -14,4 +14,4 @@ bin.includes = META-INF/,\
about.html
generateSourceBundle=false
customBuildCallbacks=customBuildCallbacks.xml
-binaryTag=v20130117-1237 \ No newline at end of file
+binaryTag=v20130213-1029 \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.launcher.win32.win32.x86_64/build.properties b/bundles/org.eclipse.equinox.launcher.win32.win32.x86_64/build.properties
index d1a332cfd..a4632c110 100644
--- a/bundles/org.eclipse.equinox.launcher.win32.win32.x86_64/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.win32.win32.x86_64/build.properties
@@ -14,4 +14,4 @@ bin.includes = META-INF/,\
about.html
generateSourceBundle=false
customBuildCallbacks=customBuildCallbacks.xml
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.equinox.launcher.wpf.win32.x86/build.properties b/bundles/org.eclipse.equinox.launcher.wpf.win32.x86/build.properties
index 89b10b3a3..c95ab4558 100644
--- a/bundles/org.eclipse.equinox.launcher.wpf.win32.x86/build.properties
+++ b/bundles/org.eclipse.equinox.launcher.wpf.win32.x86/build.properties
@@ -15,4 +15,4 @@ bin.includes = META-INF/,\
about.html
generateSourceBundle=false
customBuildCallbacks=customBuildCallbacks.xml
-binaryTag=v20130117-1237
+binaryTag=v20130213-1029
diff --git a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java
index 1bbb00470..00269aec7 100644
--- a/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java
+++ b/bundles/org.eclipse.osgi.compatibility.state/src/org/eclipse/osgi/internal/resolver/NativeCodeSpecificationImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -119,7 +119,7 @@ public class NativeCodeSpecificationImpl extends VersionConstraintImpl implement
}
}
if (!match)
- return false;
+ continue;
match = false;
String[] languages = nativeSupplier.getLanguages();
@@ -134,7 +134,7 @@ public class NativeCodeSpecificationImpl extends VersionConstraintImpl implement
}
}
if (!match)
- return false;
+ continue;
match = false;
VersionRange[] osVersions = nativeSupplier.getOSVersions();
diff --git a/bundles/org.eclipse.osgi.tests/.classpath b/bundles/org.eclipse.osgi.tests/.classpath
index 0b829c1ed..0a20762af 100644
--- a/bundles/org.eclipse.osgi.tests/.classpath
+++ b/bundles/org.eclipse.osgi.tests/.classpath
@@ -30,6 +30,7 @@
<classpathentry kind="src" output="bundle_tests/buddy.dependent.a" path="bundles_src/buddy.dependent.a"/>
<classpathentry kind="src" output="bundle_tests/buddy.dependent.a.test1" path="bundles_src/buddy.dependent.a.test1"/>
<classpathentry kind="src" output="bundle_tests/buddy.dependent.a.test2" path="bundles_src/buddy.dependent.a.test2"/>
+ <classpathentry kind="src" output="bundle_tests/buddy.invalid.a" path="bundles_src/buddy.invalid.a"/>
<classpathentry kind="src" output="bundle_tests/nativetest.a1" path="bundles_src/nativetest.a1"/>
<classpathentry kind="src" output="bundle_tests/nativetest.a2" path="bundles_src/nativetest.a2"/>
<classpathentry kind="src" output="bundle_tests/nativetest.b1" path="bundles_src/nativetest.b1"/>
diff --git a/bundles/org.eclipse.osgi.tests/build.properties b/bundles/org.eclipse.osgi.tests/build.properties
index 0411ab395..05a120334 100644
--- a/bundles/org.eclipse.osgi.tests/build.properties
+++ b/bundles/org.eclipse.osgi.tests/build.properties
@@ -75,6 +75,8 @@ source.bundle_tests/buddy.dependent.a.test1.jar = bundles_src/buddy.dependent.a.
manifest.bundle_tests/buddy.dependent.a.test1.jar = META-INF/MANIFEST.MF
source.bundle_tests/buddy.dependent.a.test2.jar = bundles_src/buddy.dependent.a.test2/
manifest.bundle_tests/buddy.dependent.a.test2.jar = META-INF/MANIFEST.MF
+source.bundle_tests/buddy.invalid.a.jar = bundles_src/buddy.invalid.a/
+manifest.bundle_tests/buddy.invalid.a.jar = META-INF/MANIFEST.MF
source.bundle_tests/nativetest.a1.jar = bundles_src/nativetest.a1/
manifest.bundle_tests/nativetest.a1.jar = META-INF/MANIFEST.MF
source.bundle_tests/nativetest.a2.jar = bundles_src/nativetest.a2/
@@ -253,6 +255,7 @@ jars.compile.order = bundle_tests/ext.framework.b.jar,\
bundle_tests/buddy.dependent.a.jar,\
bundle_tests/buddy.dependent.a.test1.jar,\
bundle_tests/buddy.dependent.a.test2.jar,\
+ bundle_tests/buddy.invalid.a.jar,\
bundle_tests/nativetest.a1.jar,\
bundle_tests/nativetest.a2.jar,\
bundle_tests/nativetest.b1.jar,\
diff --git a/bundles/org.eclipse.osgi.tests/bundles_src/buddy.invalid.a/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi.tests/bundles_src/buddy.invalid.a/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..5180117d2
--- /dev/null
+++ b/bundles/org.eclipse.osgi.tests/bundles_src/buddy.invalid.a/META-INF/MANIFEST.MF
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: buddy.invalid.a
+Bundle-SymbolicName: buddy.invalid.a
+Bundle-Version: 1.0.0
+Bundle-Localization: plugin
+Import-Package:
+ org.eclipse.osgi.tests.bundles,
+ org.osgi.framework;version="1.3.0"
+Eclipse-BuddyPolicy: invalid
+
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ClassLoadingBundleTests.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ClassLoadingBundleTests.java
index fe28b6cdc..58404918c 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ClassLoadingBundleTests.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/bundles/ClassLoadingBundleTests.java
@@ -1488,6 +1488,17 @@ public class ClassLoadingBundleTests extends AbstractBundleTests {
}
}
+ public void testBuddyClassLoadingInvalid() throws Exception {
+ Bundle invalidA = installer.installBundle("buddy.invalid.a"); //$NON-NLS-1$
+ installer.resolveBundles(new Bundle[] {invalidA});
+ invalidA.getResource("doesNotExist");
+ try {
+ invalidA.loadClass("does.not.Exist");
+ } catch (ClassNotFoundException e) {
+ // expected
+ }
+ }
+
public void testBundleReference01() throws Exception {
Bundle test = installer.installBundle("test"); //$NON-NLS-1$
Class clazz = test.loadClass("test1.Activator"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/BaseSecurityTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/BaseSecurityTest.java
index dc6e03181..91b2b74d2 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/BaseSecurityTest.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/security/BaseSecurityTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java
index 44a973a23..e429667cd 100644
--- a/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java
+++ b/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/StateResolverTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2012 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -3944,6 +3944,60 @@ public class StateResolverTest extends AbstractStateTest {
assertTrue("1.0", testNativeBundle.isResolved()); //$NON-NLS-1$
}
+ public void testNativeCodeResolution05() throws BundleException {
+ State state = buildEmptyState();
+ Dictionary[] props = new Dictionary[] {new Hashtable(), new Hashtable(), new Hashtable()};
+
+ props[0].put("osgi.ws", "win32"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[0].put("osgi.os", "win32"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[0].put("osgi.arch", "x86"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[0].put("osgi.nl", "en_US"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ props[1].put("osgi.ws", "win32"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[1].put("osgi.os", "win32"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[1].put("osgi.arch", "x86_64"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[1].put("osgi.nl", "en_US"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ props[2].put("osgi.ws", "win32"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[2].put("osgi.os", "win32"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[2].put("osgi.arch", "x86"); //$NON-NLS-1$ //$NON-NLS-2$
+ props[2].put("osgi.nl", "fr_FR"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ state.setPlatformProperties(props);
+
+ Hashtable manifest = new Hashtable();
+ long bundleID = 0;
+
+ manifest.clear();
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "NativeBundle1"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_NATIVECODE, "Bundle-NativeCode: nativefile1.txt;processor=x86;osname=win32; language=en"); //$NON-NLS-1$
+ BundleDescription testNativeBundle1 = state.getFactory().createBundleDescription(state, manifest, "NativeBundle", bundleID++); //$NON-NLS-1$
+
+ manifest.clear();
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "NativeBundle2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_NATIVECODE, "Bundle-NativeCode: nativefile1.txt;processor=x86_64;osname=win32; language=en"); //$NON-NLS-1$
+ BundleDescription testNativeBundle2 = state.getFactory().createBundleDescription(state, manifest, "NativeBundle", bundleID++); //$NON-NLS-1$
+
+ manifest.clear();
+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "NativeBundle3"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); //$NON-NLS-1$
+ manifest.put(Constants.BUNDLE_NATIVECODE, "Bundle-NativeCode: nativefile1.txt;processor=x86;osname=win32; language=fr"); //$NON-NLS-1$
+ BundleDescription testNativeBundle3 = state.getFactory().createBundleDescription(state, manifest, "NativeBundle", bundleID++); //$NON-NLS-1$
+
+ state.addBundle(testNativeBundle1);
+ state.addBundle(testNativeBundle2);
+ state.addBundle(testNativeBundle3);
+ state.resolve();
+ assertTrue("1.0", testNativeBundle1.isResolved()); //$NON-NLS-1$
+ assertTrue("2.0", testNativeBundle2.isResolved()); //$NON-NLS-1$
+ assertTrue("3.0", testNativeBundle3.isResolved()); //$NON-NLS-1$
+ }
+
public void testMultiStateAdd01() throws BundleException {
State state1 = buildEmptyState();
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java
index 5649770d3..12fd02911 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java
@@ -819,6 +819,9 @@ public final class OSGiManifestBuilderFactory {
if (other == null) {
return -1;
}
+ if (other.highestFloor == null) {
+ return -1;
+ }
int compareVersions = this.highestFloor.compareTo(other.highestFloor);
if (compareVersions != 0) {
return -(compareVersions);
@@ -827,9 +830,9 @@ public final class OSGiManifestBuilderFactory {
return 1;
}
if (this.hasLanguage) {
- return other.hasLanguage ? other.manifestIndex - this.manifestIndex : 1;
+ return other.hasLanguage ? this.manifestIndex - other.manifestIndex : 1;
}
- return other.hasLanguage ? -1 : other.manifestIndex - this.manifestIndex;
+ return other.hasLanguage ? -1 : this.manifestIndex - other.manifestIndex;
}
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java
index c695ac2eb..95a811b2e 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java
@@ -441,17 +441,13 @@ public class BundleLoader implements ModuleLoader {
* Finds the resource for a bundle. This method is used for delegation by the bundle's classloader.
*/
public URL findResource(String name) {
- return findResource(name, true);
- }
-
- URL findResource(String name, boolean checkParent) {
if ((name.length() > 1) && (name.charAt(0) == '/')) /* if name has a leading slash */
name = name.substring(1); /* remove leading slash before search */
String pkgName = getResourcePackageName(name);
boolean bootDelegation = false;
// follow the OSGi delegation model
// First check the parent classloader for system resources, if it is a java resource.
- if (checkParent && parent != null) {
+ if (parent != null) {
if (pkgName.startsWith(JAVA_PACKAGE))
// 1) if startsWith "java." delegate to parent and terminate search
// we never delegate java resource requests past the parent
@@ -511,9 +507,9 @@ public class BundleLoader implements ModuleLoader {
result = policy.doBuddyResourceLoading(name);
if (result != null)
return result;
- // hack to support backwards compatibiility for bootdelegation
+ // hack to support backwards compatibility for bootdelegation
// or last resort; do class context trick to work around VM bugs
- if (parent != null && !bootDelegation && ((checkParent && container.getConfiguration().compatibiltyBootDelegation) || isRequestFromVM()))
+ if (parent != null && !bootDelegation && (container.getConfiguration().compatibiltyBootDelegation || isRequestFromVM()))
// we don't need to continue if the resource is not found here
return parent.getResource(name);
return result;
@@ -527,41 +523,57 @@ public class BundleLoader implements ModuleLoader {
if ((name.length() > 1) && (name.charAt(0) == '/')) /* if name has a leading slash */
name = name.substring(1); /* remove leading slash before search */
String pkgName = getResourcePackageName(name);
- Enumeration<URL> result = null;
+ Enumeration<URL> result = Collections.enumeration(Collections.<URL> emptyList());
+ boolean bootDelegation = false;
+ // follow the OSGi delegation model
+ // First check the parent classloader for system resources, if it is a java resource.
+ if (parent != null) {
+ if (pkgName.startsWith(JAVA_PACKAGE))
+ // 1) if startsWith "java." delegate to parent and terminate search
+ // we never delegate java resource requests past the parent
+ return parent.getResources(name);
+ else if (container.isBootDelegationPackage(pkgName)) {
+ // 2) if part of the bootdelegation list then delegate to parent and continue
+ result = compoundEnumerations(result, parent.getResources(name));
+ bootDelegation = true;
+ }
+ }
try {
- result = searchHooks(name, PRE_RESOURCES);
+ Enumeration<URL> hookResources = searchHooks(name, PRE_RESOURCES);
+ if (hookResources != null) {
+ return compoundEnumerations(result, hookResources);
+ }
} catch (ClassNotFoundException e) {
// will not happen
} catch (FileNotFoundException e) {
- return null;
- }
- if (result != null)
return result;
- // start at step 3 because of the comment above about ClassLoader#getResources
+ }
+
// 3) search the imported packages
PackageSource source = findImportedSource(pkgName, null);
if (source != null)
// 3) found import source terminate search at the source
- return source.getResources(name);
+ return compoundEnumerations(result, source.getResources(name));
// 4) search the required bundles
source = findRequiredSource(pkgName, null);
if (source != null)
// 4) attempt to load from source but continue on failure
- result = source.getResources(name);
+ result = compoundEnumerations(result, source.getResources(name));
// 5) search the local bundle
// compound the required source results with the local ones
Enumeration<URL> localResults = findLocalResources(name);
result = compoundEnumerations(result, localResults);
// 6) attempt to find a dynamic import source; only do this if a required source was not found
- if (result == null && source == null) {
+ if (source == null && !result.hasMoreElements()) {
source = findDynamicSource(pkgName);
if (source != null)
- return source.getResources(name);
+ return compoundEnumerations(result, source.getResources(name));
}
- if (result == null)
+ if (!result.hasMoreElements())
try {
- result = searchHooks(name, POST_RESOURCES);
+ Enumeration<URL> hookResources = searchHooks(name, POST_RESOURCES);
+ result = compoundEnumerations(result, hookResources);
} catch (ClassNotFoundException e) {
// will not happen
} catch (FileNotFoundException e) {
@@ -571,6 +583,13 @@ public class BundleLoader implements ModuleLoader {
Enumeration<URL> buddyResult = policy.doBuddyResourcesLoading(name);
result = compoundEnumerations(result, buddyResult);
}
+ // hack to support backwards compatibility for bootdelegation
+ // or last resort; do class context trick to work around VM bugs
+ if (!result.hasMoreElements()) {
+ if (parent != null && !bootDelegation && (container.getConfiguration().compatibiltyBootDelegation || isRequestFromVM()))
+ // we don't need to continue if the resource is not found here
+ return parent.getResources(name);
+ }
return result;
}
@@ -644,26 +663,6 @@ public class BundleLoader implements ModuleLoader {
return getModuleClassLoader().findEntries(path, filePattern, options);
}
- /*
- * This method is used by Bundle.getResources to do proper parent delegation.
- */
- public Enumeration<URL> getResources(String name) throws IOException {
- if ((name.length() > 1) && (name.charAt(0) == '/')) /* if name has a leading slash */
- name = name.substring(1); /* remove leading slash before search */
- String pkgName = getResourcePackageName(name);
- // follow the OSGi delegation model
- // First check the parent classloader for system resources, if it is a java resource.
- Enumeration<URL> result = null;
- if (pkgName.startsWith(JAVA_PACKAGE) || container.isBootDelegationPackage(pkgName)) {
- // 1) if startsWith "java." delegate to parent and terminate search
- // 2) if part of the bootdelegation list then delegate to parent and continue of failure
- result = parent == null ? null : parent.getResources(name);
- if (pkgName.startsWith(JAVA_PACKAGE))
- return result;
- }
- return compoundEnumerations(result, findResources(name));
- }
-
public static <E> Enumeration<E> compoundEnumerations(Enumeration<E> list1, Enumeration<E> list2) {
if (list2 == null || !list2.hasMoreElements())
return list1;
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java
index cbf0810e3..6a657041e 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java
@@ -164,16 +164,24 @@ public class ModuleClassLoader extends ClassLoader implements BundleReference {
}
/**
- * Finds all resources with the specified name. This method must call
- * delegate.findResources(name) to find all the resources.
- * @param name The resource path to find.
- * @return An Enumeration of all resources found or null if the resource.
- * @throws IOException
+ * Gets resources for the bundle. First delegate.findResources(name) is
+ * called. The delegate will query the system class loader, bundle imports,
+ * bundle local resources, bundle hosts and fragments. The delegate will
+ * call BundleClassLoader.findLocalResources(name) to find a resource local
+ * to this bundle.
+ * @param name The resource path to get.
+ * @return The Enumeration of the resource URLs.
*/
- protected Enumeration<URL> findResources(String name) throws IOException {
+ public Enumeration<URL> getResources(String name) throws IOException {
+ if (debug.DEBUG_LOADER) {
+ Debug.println("BundleClassLoader[" + delegate + "].getResources(" + name + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
Enumeration<URL> result = delegate.findResources(name);
- if (result == null)
- return EMPTY_ENUMERATION;
+ if (debug.DEBUG_LOADER) {
+ if (result == null || !result.hasMoreElements()) {
+ Debug.println("BundleClassLoader[" + delegate + "].getResources(" + name + ") failed."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ }
return result;
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/PolicyHandler.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/PolicyHandler.java
index a362e3c06..7aa516288 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/PolicyHandler.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/PolicyHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,6 +12,8 @@ package org.eclipse.osgi.internal.loader.buddy;
import java.net.URL;
import java.util.*;
+import org.eclipse.osgi.container.ModuleContainerAdaptor.ContainerEvent;
+import org.eclipse.osgi.internal.framework.EquinoxBundle;
import org.eclipse.osgi.internal.loader.BundleLoader;
import org.osgi.framework.*;
import org.osgi.service.packageadmin.PackageAdmin;
@@ -52,7 +54,7 @@ public class PolicyHandler implements SynchronousBundleListener {
while (tokens.hasMoreTokens()) {
String token = tokens.nextToken().trim();
if (!token.equals("")) //$NON-NLS-1$
- list.add(token);
+ list.add(token.toLowerCase());
}
return list.isEmpty() ? new Object[0] : list.toArray(new Object[list.size()]);
}
@@ -92,7 +94,10 @@ public class PolicyHandler implements SynchronousBundleListener {
policiesSnapshot[policyOrder] = new SystemPolicy(policedLoader.getParentClassLoader());
return (IBuddyPolicy) policiesSnapshot[policyOrder];
}
-
+ // Not a valid buddy policy
+ EquinoxBundle bundle = (EquinoxBundle) policedLoader.getModuleClassLoader().getBundle();
+ bundle.getModule().getContainer().getAdaptor().publishContainerEvent(ContainerEvent.ERROR, bundle.getModule(), new RuntimeException("Invalid buddy policy: " + buddyName));
+ policiesSnapshot[policyOrder] = null;
// //Buddy policy can be provided by service implementations
// BundleContext fwkCtx = policedLoader.bundle.framework.systemBundle.context;
// ServiceReference[] matchingBuddies = null;
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogServices.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogServices.java
index 5bb55e221..15d70f5a1 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogServices.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogServices.java
@@ -1,5 +1,9 @@
/*******************************************************************************
+<<<<<<< HEAD
* Copyright (c) 2006, 2012 IBM Corporation and others.
+=======
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
+>>>>>>> master
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,32 +41,38 @@ public class EquinoxLogServices {
private final FrameworkLog rootFrameworkLog;
public EquinoxLogServices(EquinoxConfiguration environmentInfo, Location configuration) {
- String logFileProp = environmentInfo.getConfiguration(EclipseStarter.PROP_LOGFILE);
- boolean enabled = "true".equals(environmentInfo.getConfiguration(PROP_LOG_ENABLED, "true")); //$NON-NLS-1$ //$NON-NLS-2$
- if (logFileProp != null) {
- logWriter = new EquinoxLogWriter(new File(logFileProp), EQUINOX_LOGGER_NAME, enabled, environmentInfo);
- } else {
+ String logFilePath = environmentInfo.getConfiguration(EclipseStarter.PROP_LOGFILE);
+ if (logFilePath == null) {
+ logFilePath = Long.toString(System.currentTimeMillis()) + EquinoxLogServices.LOG_EXT;
+ }
+
+ File logFile = new File(logFilePath);
+ if (!logFile.isAbsolute()) {
File configAreaDirectory = null;
if (configuration != null)
// TODO assumes the URL is a file: url
configAreaDirectory = new File(configuration.getURL().getFile());
if (configAreaDirectory != null) {
- String logFileName = Long.toString(System.currentTimeMillis()) + EquinoxLogServices.LOG_EXT;
- File logFile = new File(configAreaDirectory, logFileName);
- environmentInfo.setConfiguration(EclipseStarter.PROP_LOGFILE, logFile.getAbsolutePath());
- logWriter = new EquinoxLogWriter(logFile, EQUINOX_LOGGER_NAME, enabled, environmentInfo);
- } else
- logWriter = new EquinoxLogWriter((Writer) null, EQUINOX_LOGGER_NAME, enabled, environmentInfo);
+ logFile = new File(configAreaDirectory, logFilePath);
+ } else {
+ logFile = null;
+
+ }
}
- File logFile = logWriter.getFile();
+ boolean enabled = "true".equals(environmentInfo.getConfiguration(PROP_LOG_ENABLED, "true")); //$NON-NLS-1$ //$NON-NLS-2$
if (logFile != null) {
+ environmentInfo.setConfiguration(EclipseStarter.PROP_LOGFILE, logFile.getAbsolutePath());
+ logWriter = new EquinoxLogWriter(logFile, EQUINOX_LOGGER_NAME, enabled, environmentInfo);
+
File perfLogFile = new File(logFile.getParentFile(), "performance.log"); //$NON-NLS-1$
perfWriter = new EquinoxLogWriter(perfLogFile, PERF_LOGGER_NAME, true, environmentInfo);
} else {
+ logWriter = new EquinoxLogWriter((Writer) null, EQUINOX_LOGGER_NAME, enabled, environmentInfo);
perfWriter = new EquinoxLogWriter((Writer) null, PERF_LOGGER_NAME, true, environmentInfo);
}
+
if ("true".equals(environmentInfo.getConfiguration(EclipseStarter.PROP_CONSOLE_LOG))) //$NON-NLS-1$
logWriter.setConsoleLog(true);
logServiceManager = new LogServiceManager(logWriter, perfWriter);

Back to the top