|
42 | 42 | import org.apache.tools.ant.types.FileSet;
|
43 | 43 | import jnr.posix.FileStat;
|
44 | 44 | import jnr.posix.POSIX;
|
45 |
| -import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement; |
46 | 45 |
|
47 | 46 | import javax.crypto.SecretKey;
|
48 | 47 | import javax.crypto.spec.SecretKeySpec;
|
@@ -259,16 +258,11 @@ public static void deleteFile(File f) throws IOException {
|
259 | 258 | /**
|
260 | 259 | * Makes the given file writable by any means possible.
|
261 | 260 | */
|
262 |
| - @IgnoreJRERequirement |
263 | 261 | private static void makeWritable(File f) {
|
264 |
| - // try JDK6-way of doing it. |
265 |
| - try { |
266 |
| - if (f.setWritable(true)) { |
267 |
| - return; |
268 |
| - } |
269 |
| - } catch (NoSuchMethodError e) { |
270 |
| - // not JDK6 |
| 262 | + if (f.setWritable(true)) { |
| 263 | + return; |
271 | 264 | }
|
| 265 | + // TODO do we still need to try anything else? |
272 | 266 |
|
273 | 267 | // try chmod. this becomes no-op if this is not Unix.
|
274 | 268 | try {
|
@@ -1378,17 +1372,9 @@ private static int _indexOf(String s, char ch) {
|
1378 | 1372 | * Loads a key/value pair string as {@link Properties}
|
1379 | 1373 | * @since 1.392
|
1380 | 1374 | */
|
1381 |
| - @IgnoreJRERequirement |
1382 | 1375 | public static Properties loadProperties(String properties) throws IOException {
|
1383 | 1376 | Properties p = new Properties();
|
1384 |
| - try { |
1385 |
| - p.load(new StringReader(properties)); |
1386 |
| - } catch (NoSuchMethodError e) { |
1387 |
| - // load(Reader) method is only available on JDK6. |
1388 |
| - // this fall back version doesn't work correctly with non-ASCII characters, |
1389 |
| - // but there's no other easy ways out it seems. |
1390 |
| - p.load(new ByteArrayInputStream(properties.getBytes())); |
1391 |
| - } |
| 1377 | + p.load(new StringReader(properties)); |
1392 | 1378 | return p;
|
1393 | 1379 | }
|
1394 | 1380 |
|
|
0 commit comments