aboutsummaryrefslogtreecommitdiff
path: root/patches/boot/ecj-multicatch.patch
blob: ce248c90c3d447934815a6ff7512bef33c31b6e4 (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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
--- openjdk-boot/jdk/src/share/classes/java/io/PrintStream.java.orig
+++ openjdk-boot/jdk/src/share/classes/java/io/PrintStream.java
@@ -91,7 +91,10 @@
         requireNonNull(csn, "charsetName");
         try {
             return Charset.forName(csn);
-        } catch (IllegalCharsetNameException|UnsupportedCharsetException unused) {
+        } catch (IllegalCharsetNameException unused) {
+            // UnsupportedEncodingException should be thrown
+            throw new UnsupportedEncodingException(csn);
+        } catch (UnsupportedCharsetException unused) {
             // UnsupportedEncodingException should be thrown
             throw new UnsupportedEncodingException(csn);
         }
--- openjdk-boot/jdk/src/share/classes/java/io/PrintWriter.java.orig
+++ openjdk-boot/jdk/src/share/classes/java/io/PrintWriter.java
@@ -85,7 +85,10 @@
         Objects.requireNonNull(csn, "charsetName");
         try {
             return Charset.forName(csn);
-        } catch (IllegalCharsetNameException|UnsupportedCharsetException unused) {
+        } catch (IllegalCharsetNameException unused) {
+            // UnsupportedEncodingException should be thrown
+            throw new UnsupportedEncodingException(csn);
+        } catch (UnsupportedCharsetException unused) {
             // UnsupportedEncodingException should be thrown
             throw new UnsupportedEncodingException(csn);
         }
--- openjdk-boot/jdk/src/share/classes/java/lang/management/ManagementFactory.java.orig
+++ openjdk-boot/jdk/src/share/classes/java/lang/management/ManagementFactory.java
@@ -606,7 +606,9 @@
             // create an MXBean proxy
             return JMX.newMXBeanProxy(connection, objName, mxbeanInterface,
                                       emitter);
-        } catch (InstanceNotFoundException|MalformedObjectNameException e) {
+        } catch (InstanceNotFoundException e) {
+            throw new IllegalArgumentException(e);
+        } catch (MalformedObjectNameException e) {
             throw new IllegalArgumentException(e);
         }
     }
--- openjdk-boot/jdk/src/share/classes/java/util/Formatter.java.orig
+++ openjdk-boot/jdk/src/share/classes/java/util/Formatter.java
@@ -1857,7 +1857,10 @@
         Objects.requireNonNull(csn, "charsetName");
         try {
             return Charset.forName(csn);
-        } catch (IllegalCharsetNameException|UnsupportedCharsetException unused) {
+        } catch (IllegalCharsetNameException unused) {
+            // UnsupportedEncodingException should be thrown
+            throw new UnsupportedEncodingException(csn);
+        } catch (UnsupportedCharsetException unused) {
             // UnsupportedEncodingException should be thrown
             throw new UnsupportedEncodingException(csn);
         }
--- openjdk-boot/jdk/src/share/classes/java/util/Scanner.java.orig
+++ openjdk-boot/jdk/src/share/classes/java/util/Scanner.java
@@ -633,7 +633,10 @@
         Objects.requireNonNull(csn, "charsetName");
         try {
             return Charset.forName(csn);
-        } catch (IllegalCharsetNameException|UnsupportedCharsetException e) {
+        } catch (IllegalCharsetNameException e) {
+            // IllegalArgumentException should be thrown
+            throw new IllegalArgumentException(e);
+        } catch (UnsupportedCharsetException e) {
             // IllegalArgumentException should be thrown
             throw new IllegalArgumentException(e);
         }
@@ -684,7 +687,9 @@
         Objects.requireNonNull(charsetName, "charsetName");
         try {
             return Charset.forName(charsetName).newDecoder();
-        } catch (IllegalCharsetNameException|UnsupportedCharsetException unused) {
+        } catch (IllegalCharsetNameException unused) {
+            throw new IllegalArgumentException(charsetName);
+        } catch (UnsupportedCharsetException unused) {
             throw new IllegalArgumentException(charsetName);
         }
     }
--- openjdk-boot/jdk/src/share/classes/sun/invoke/util/ValueConversions.java.orig
+++ openjdk-boot/jdk/src/share/classes/sun/invoke/util/ValueConversions.java
@@ -676,7 +676,11 @@
             IGNORE = IMPL_LOOKUP.findStatic(THIS_CLASS, "ignore", ignoreType);
             EMPTY = IMPL_LOOKUP.findStatic(THIS_CLASS, "empty", ignoreType.dropParameterTypes(0, 1));
             NEW_ARRAY = IMPL_LOOKUP.findStatic(THIS_CLASS, "newArray", MethodType.methodType(Object[].class, int.class));
-        } catch (NoSuchMethodException | IllegalAccessException ex) {
+        } catch (NoSuchMethodException ex) {
+            Error err = new InternalError("uncaught exception");
+            err.initCause(ex);
+            throw err;
+        } catch (IllegalAccessException ex) {
             Error err = new InternalError("uncaught exception");
             err.initCause(ex);
             throw err;
--- openjdk-boot/jdk/src/share/classes/sun/security/krb5/internal/PAData.java.orig
+++ openjdk-boot/jdk/src/share/classes/sun/security/krb5/internal/PAData.java
@@ -280,7 +280,9 @@
                                     .append(info.getSalt())
                                     .append('\n');
                         }
-                    } catch (IOException|Asn1Exception e) {
+                    } catch (Asn1Exception e) {
+                        sb.append("\t <Unparseable PA-ETYPE-INFO>\n");
+                    } catch (IOException e) {
                         sb.append("\t <Unparseable PA-ETYPE-INFO>\n");
                     }
                 }
@@ -307,7 +309,9 @@
                                         .encodeBuffer(s2kparams));
                             }
                         }
-                    } catch (IOException|Asn1Exception e) {
+                    } catch (IOException e) {
+                        sb.append("\t <Unparseable PA-ETYPE-INFO>\n");
+                    } catch (Asn1Exception e) {
                         sb.append("\t <Unparseable PA-ETYPE-INFO>\n");
                     }
                 }
--- openjdk-boot/jdk/src/share/classes/sun/text/bidi/BidiBase.java.orig
+++ openjdk-boot/jdk/src/share/classes/sun/text/bidi/BidiBase.java
@@ -3477,7 +3477,9 @@
             try {
                 Field f = clazz.getField(name);
                 return f.get(null);
-            } catch (NoSuchFieldException | IllegalAccessException x) {
+            } catch (NoSuchFieldException x) {
+                throw new AssertionError(x);
+            } catch (IllegalAccessException x) {
                 throw new AssertionError(x);
             }
         }
diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/tools/jcmd/JCmd.java openjdk-boot/jdk/src/share/classes/sun/tools/jcmd/JCmd.java
--- openjdk-boot.orig/jdk/src/share/classes/sun/tools/jcmd/JCmd.java	2012-03-22 10:00:56.029260268 +0000
+++ openjdk-boot/jdk/src/share/classes/sun/tools/jcmd/JCmd.java	2012-03-22 10:02:41.275789667 +0000
@@ -94,7 +94,7 @@
                         && mainClass.indexOf(arg.getProcessSubstring()) != -1) {
                             pids.add(vmd.id());
                     }
-                } catch (MonitorException|URISyntaxException e) {
+                } catch (MonitorException e) {
                     if (e.getMessage() != null) {
                         System.err.println(e.getMessage());
                     } else {
@@ -105,7 +105,18 @@
                             e.printStackTrace();
                         }
                     }
-                }
+                } catch (URISyntaxException e) {
+                    if (e.getMessage() != null) {
+                        System.err.println(e.getMessage());
+                    } else {
+                        Throwable cause = e.getCause();
+                        if ((cause != null) && (cause.getMessage() != null)) {
+                            System.err.println(cause.getMessage());
+                        } else {
+                            e.printStackTrace();
+                        }
+                    }
+		}
             }
             if (pids.isEmpty()) {
                 System.err.println("Could not find any processes matching : '"
@@ -185,9 +196,11 @@
         try {
             String mainClass = getMainClass(vmd);
             return mainClass != null && mainClass.equals(JCmd.class.getName());
-        } catch (URISyntaxException|MonitorException ex) {
+        } catch (URISyntaxException ex) {
             return false;
-        }
+        } catch (MonitorException ex) {
+	    return false;
+	}
     }
 
     private static String getMainClass(VirtualMachineDescriptor vmd)
diff -Nru openjdk-boot.orig/jdk/src/share/classes/sun/security/util/UntrustedCertificates.java openjdk-boot/jdk/src/share/classes/sun/security/util/UntrustedCertificates.java
--- openjdk-boot.orig/jdk/src/share/classes/sun/security/util/UntrustedCertificates.java	2012-05-02 20:50:17.549643066 +0100
+++ openjdk-boot/jdk/src/share/classes/sun/security/util/UntrustedCertificates.java	2012-05-02 20:52:03.435320716 +0100
@@ -65,7 +65,10 @@
                 throw new RuntimeException("Duplicate untrusted certificate: " +
                     cert.getSubjectX500Principal());
             }
-        } catch (CertificateException | IOException e) {
+	} catch (CertificateException e) {
+            throw new RuntimeException(
+                        "Incorrect untrusted certificate: " + alias, e);
+	} catch (IOException e) {
             throw new RuntimeException(
                         "Incorrect untrusted certificate: " + alias, e);
         }
diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/util/HashMap.java openjdk-boot/jdk/src/share/classes/java/util/HashMap.java
--- openjdk-boot.orig/jdk/src/share/classes/java/util/HashMap.java	2012-06-08 17:12:17.000000000 +0100
+++ openjdk-boot/jdk/src/share/classes/java/util/HashMap.java	2012-06-11 14:54:16.123125601 +0100
@@ -237,7 +237,9 @@
                 UNSAFE = sun.misc.Unsafe.getUnsafe();
                 HASHSEED_OFFSET = UNSAFE.objectFieldOffset(
                     HashMap.class.getDeclaredField("hashSeed"));
-            } catch (NoSuchFieldException | SecurityException e) {
+            } catch (NoSuchFieldException e ) {
+                throw new Error("Failed to record hashSeed offset", e);
+            } catch (SecurityException e) {
                 throw new Error("Failed to record hashSeed offset", e);
             }
         }
diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/util/Hashtable.java openjdk-boot/jdk/src/share/classes/java/util/Hashtable.java
--- openjdk-boot.orig/jdk/src/share/classes/java/util/Hashtable.java	2012-06-08 17:12:17.000000000 +0100
+++ openjdk-boot/jdk/src/share/classes/java/util/Hashtable.java	2012-06-11 14:54:40.275511896 +0100
@@ -227,7 +227,9 @@
             UNSAFE = sun.misc.Unsafe.getUnsafe();
             HASHSEED_OFFSET = UNSAFE.objectFieldOffset(
                 Hashtable.class.getDeclaredField("hashSeed"));
-        } catch (NoSuchFieldException | SecurityException e) {
+        } catch (NoSuchFieldException e) {
+            throw new Error("Failed to record hashSeed offset", e);
+        } catch (SecurityException e) {
             throw new Error("Failed to record hashSeed offset", e);
         }
      }
diff -Nru openjdk-boot.orig/jdk/src/share/classes/java/lang/reflect/Proxy.java openjdk-boot/jdk/src/share/classes/java/lang/reflect/Proxy.java
--- openjdk-boot.orig/jdk/src/share/classes/java/lang/reflect/Proxy.java	2013-02-02 16:14:27.971429681 +0000
+++ openjdk-boot/jdk/src/share/classes/java/lang/reflect/Proxy.java	2013-02-02 16:14:58.283922372 +0000
@@ -738,7 +738,9 @@
     private static Object newInstance(Constructor<?> cons, InvocationHandler h) {
         try {
             return cons.newInstance(new Object[] {h} );
-        } catch (IllegalAccessException | InstantiationException e) {
+        } catch (IllegalAccessException e) {
+            throw new InternalError(e.toString());
+        } catch (InstantiationException e) {
             throw new InternalError(e.toString());
         } catch (InvocationTargetException e) {
             Throwable t = e.getCause();