Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGianMaria Romanato2018-07-17 05:49:43 -0400
committerGianMaria Romanato2018-07-17 05:49:43 -0400
commit4d798a9f7af2333e750f9631854b8f4cc25968d2 (patch)
treefc04891dd9db633f12eb2939f278656c4920b798
parent9d5b47ab86e64f3d5975c5ae73c92b7edf0541a5 (diff)
downloadorg.eclipse.virgo.ide-4d798a9f7af2333e750f9631854b8f4cc25968d2.tar.gz
org.eclipse.virgo.ide-4d798a9f7af2333e750f9631854b8f4cc25968d2.tar.xz
org.eclipse.virgo.ide-4d798a9f7af2333e750f9631854b8f4cc25968d2.zip
537017: Virgo Tools do not work on Photon
Use a bit of reflection to support both Oxygen and Photon. This is needed due to a signature change in a PDE internal class that the Virgo Tools use.
-rw-r--r--org.eclipse.virgo.ide.manifest.core/src/org/eclipse/virgo/ide/manifest/core/editor/model/SpringBundleModel.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/org.eclipse.virgo.ide.manifest.core/src/org/eclipse/virgo/ide/manifest/core/editor/model/SpringBundleModel.java b/org.eclipse.virgo.ide.manifest.core/src/org/eclipse/virgo/ide/manifest/core/editor/model/SpringBundleModel.java
index 8b77def..0ee16bb 100644
--- a/org.eclipse.virgo.ide.manifest.core/src/org/eclipse/virgo/ide/manifest/core/editor/model/SpringBundleModel.java
+++ b/org.eclipse.virgo.ide.manifest.core/src/org/eclipse/virgo/ide/manifest/core/editor/model/SpringBundleModel.java
@@ -10,6 +10,9 @@
package org.eclipse.virgo.ide.manifest.core.editor.model;
+import java.lang.reflect.Method;
+import java.nio.charset.Charset;
+
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
import org.eclipse.pde.internal.core.ibundle.IBundleModelFactory;
@@ -38,4 +41,26 @@ public class SpringBundleModel extends BundleModel {
return this.fFactory;
}
+ public void setCharset(String charset) {
+ Method m;
+ try {
+ m = getClass().getSuperclass().getMethod("setCharset", Charset.class);
+ try {
+ m.invoke(this, Charset.forName(charset));
+ return;
+ } catch (Exception e) {
+ }
+ } catch (NoSuchMethodException e) {
+ try {
+ m = getClass().getSuperclass().getMethod("setCharset", String.class);
+ m.invoke(this, charset);
+ return;
+ } catch (Exception e1) {
+ }
+ } catch (Exception e) {
+ }
+
+ throw new RuntimeException("Cannot set file charset");
+ }
+
}

Back to the top