summaryrefslogtreecommitdiff
path: root/languagetool/JLanguageTool-1.0.0.patch
blob: 2b025c90439494f1d9c9103bd99479ab7a288579 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
--- misc/JLanguageTool-1.0.0/build.properties	2009-11-01 17:02:22.000000000 +0100
+++ misc/build/JLanguageTool-1.0.0/build.properties	2010-03-10 15:33:21.000000000 +0100
@@ -54,10 +54,10 @@
 ext.log4j.lib = ${ext.dir}/build/cobertura/log4j-1.2.9.jar
 ext.jakarta-oro.lib = ${ext.dir}/build/cobertura/jakarta-oro-2.0.8.jar
 
-ext.ooo.juh.lib = ${ext.ooo.dir}/juh.jar
-ext.ooo.unoil.lib = ${ext.ooo.dir}/unoil.jar
-ext.ooo.ridl.lib = ${ext.ooo.dir}/ridl.jar
-ext.ooo.jurt.lib = ${ext.ooo.dir}/jurt.jar
+ext.ooo.juh.lib = ${solver.ooo.dir}/juh.jar
+ext.ooo.unoil.lib = ${solver.ooo.dir}/unoil.jar
+ext.ooo.ridl.lib = ${solver.ooo.dir}/ridl.jar
+ext.ooo.jurt.lib = ${solver.ooo.dir}/jurt.jar
 
 build.meta-inf = ${build.dir}/META-INF
 final.name = LanguageTool
--- misc/JLanguageTool-1.0.0/build.xml	2009-10-26 14:28:30.000000000 +0100
+++ misc/build/JLanguageTool-1.0.0/build.xml	2010-03-10 15:33:21.000000000 +0100
@@ -20,6 +20,8 @@
 		<pathelement location="${ext.logging.lib}" />		
 		<pathelement location="${ext.segment.lib}" />
 		<!-- -->
+		<pathelement location="${ext.junit.lib}"/>
+		<!-- -->
 		<pathelement location="${ext.ooo.juh.lib}" />
 		<pathelement location="${ext.ooo.unoil.lib}" />
 		<pathelement location="${ext.ooo.ridl.lib}" />
@@ -367,11 +369,11 @@
 <!-- ================================================================== -->
 
 <target name="dist" depends="ooo-internal" description="Builds one ZIP for both OpenOffice.org and stand-alone use">
-<zip compress="yes" destfile="${dist.dir}/LanguageTool-${version}.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,jdic.jar,printlocales.jar,linux/**,windows/**,sunos/**,mac/**" />
+<zip compress="yes" destfile="${dist.dir}/LanguageTool.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,jdic.jar,printlocales.jar,linux/**,windows/**,sunos/**,mac/**" />
 </target>
 
 <target name="fast" depends="ooo-internal" description="like dist, but without ZIP compression (for development only)">
-<zip compress="no" destfile="${dist.dir}/LanguageTool-${version}.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,jdic.jar,printlocales.jar,linux/**,windows/**,sunos/**,mac/**" />
+<zip compress="no" destfile="${dist.dir}/LanguageTool.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,jdic.jar,printlocales.jar,linux/**,windows/**,sunos/**,mac/**" />
 </target>
 
 <target name="ooo-internal" depends="clean,init,build,ooo-build">
@@ -402,11 +404,6 @@
 <copy file="${ext.segment.lib}" todir="${dist.dir}" />
 <copy file="${ext.logging.lib}" todir="${dist.dir}" />
 <copy file="${ext.junit.lib}" todir="${dist.dir}" />
-<!-- JAXB jars for Java 1.5 -->	
-<copy file="${ext.jaxb-api.lib}" todir="${dist.dir}" />
-<copy file="${ext.jaxb-impl.lib}" todir="${dist.dir}" />
-<copy file="${ext.jsr.lib}" todir="${dist.dir}" />
-<copy file="${ext.activation.lib}" todir="${dist.dir}" />
 
 
 <copy todir="${dist.dir}/linux">
@@ -472,7 +472,6 @@
 <copy file="${resource.dir}/sv/swedish.info" todir="${dist.dir}/resource/sv" />
 <copy file="${resource.dir}/sv/swedish.dict" todir="${dist.dir}/resource/sv" />
 <copy file="${resource.dir}/sv/compounds.txt" todir="${dist.dir}/resource/sv" />
-<copy file="${resource.dir}/uk/ukrainian.dict" todir="${dist.dir}/resource/uk" />
 <copy file="${resource.dir}/ru/russian.dict" todir="${dist.dir}/resource/ru" />
 <copy file="${resource.dir}/ru/russian.info" todir="${dist.dir}/resource/ru" />
 <copy file="${resource.dir}/ru/russian_tags.txt" todir="${dist.dir}/resource/ru" />
@@ -494,7 +493,6 @@
 <copy file="${resource.dir}/sk/slovak_synth.dict" todir="${dist.dir}/resource/sk" />
 <copy file="${resource.dir}/sk/slovak_synth.info" todir="${dist.dir}/resource/sk" />
 <copy file="${resource.dir}/sk/slovak_tags.txt" todir="${dist.dir}/resource/sk" />
-<copy file="${resource.dir}/xx/dummy.dict" tofile="${dist.dir}/resource/cs/czech.dict" />
 
 <!-- prepare properties file automatically -->
 <javac encoding="${encoding}" srcdir="${src.dir}/dev" includes="de/danielnaber/languagetool/dev/PrintLocales.java" destdir="${build.classes}" target="${target}" debug="${debug}">
--- misc/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/gui/Configuration.java	2009-01-01 23:39:30.000000000 +0100
+++ misc/build/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/gui/Configuration.java	2010-03-10 15:33:21.000000000 +0100
@@ -23,6 +23,7 @@
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.lang.ClassLoader;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Properties;
@@ -154,8 +155,19 @@
       final String motherTongueStr = (String) props
           .get(MOTHER_TONGUE_CONFIG_KEY);
       if (motherTongueStr != null) {
+        // FIXME: hack to disable the functionality for JRE 1.5
+        // javax.xml.bind.JAXBException is part of JRE 1.6
+        boolean isJRE15 = false;
+        try {
+          ClassLoader cl = ClassLoader.getSystemClassLoader();
+          cl.loadClass("javax.xml.bind.JAXBException");
+        } catch (ClassNotFoundException e) {
+          isJRE15 = true;
+        }
+        if (!isJRE15) {
         motherTongue = Language.getLanguageForShortName(motherTongueStr);
       }
+      }
       final String runServerString = (String) props.get(SERVER_RUN_CONFIG_KEY);
       if (runServerString != null) {
         runServer = runServerString.equals("true");
--- misc/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/openoffice/Main.java	2009-10-24 16:52:03.000000000 +0200
+++ misc/build/JLanguageTool-1.0.0/src/java/de/danielnaber/languagetool/openoffice/Main.java	2010-03-10 15:33:21.000000000 +0100
@@ -24,6 +24,7 @@
  * @author Marcin Miłkowski
  */
 import java.io.File;
+import java.lang.ClassLoader;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Comparator;
@@ -455,6 +456,14 @@
    * @return An array of Locales supported by LT.
    */
   public final Locale[] getLocales() {
+    // FIXME: hack to disable the functionality for JRE 1.5
+    // javax.xml.bind.JAXBException is part of JRE 1.6
+    try {
+	ClassLoader cl = ClassLoader.getSystemClassLoader(); 
+	cl.loadClass("javax.xml.bind.JAXBException");
+    } catch (ClassNotFoundException e) {
+	return new Locale[0];
+    }
     try {
       int dims = 0;
       for (final Language element : Language.LANGUAGES) {
@@ -609,9 +618,9 @@
     if (version != null
         && (version.startsWith("1.0") || version.startsWith("1.1")
             || version.startsWith("1.2") || version.startsWith("1.3") || version
-            .startsWith("1.4"))) {
+            .startsWith("1.4") || version.startsWith("1.5"))) {
       final DialogThread dt = new DialogThread(
-          "Error: LanguageTool requires Java 1.5 or later. Current version: "
+          "Error: LanguageTool requires Java 1.6 or later. Current version: "
               + version);
       dt.start();
       return false;