File: 02-propertyutils-compatibility.patch

package info (click to toggle)
plexus-utils2 3.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,996 kB
  • sloc: java: 25,105; xml: 150; makefile: 8; sh: 5
file content (73 lines) | stat: -rw-r--r-- 1,681 bytes parent folder | download | duplicates (2)
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
Description: Restores the backward compatibility of PropertyUtils
 by removing the IOException on the loadProperties methods
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- a/src/main/java/org/codehaus/plexus/util/PropertyUtils.java
+++ b/src/main/java/org/codehaus/plexus/util/PropertyUtils.java
@@ -34,29 +34,44 @@
 {
 
     public static Properties loadProperties( final URL url )
-        throws IOException
     {
         if ( url == null )
         {
             throw new NullPointerException( "url" );
         }
 
-        return loadProperties( url.openStream() );
+        try
+        {
+            return loadProperties( url.openStream() );
+        }
+        catch ( IOException e )
+        {
+            // ignore
+        }
+
+        return null;
     }
 
     public static Properties loadProperties( final File file )
-        throws IOException
     {
         if ( file == null )
         {
             throw new NullPointerException( "file" );
         }
 
-        return loadProperties( new FileInputStream( file ) );
+        try
+        {
+            return loadProperties( new FileInputStream( file ) );
+        }
+        catch ( IOException e )
+        {
+            // ignore
+        }
+
+        return null;
     }
 
     public static Properties loadProperties( final InputStream is )
-        throws IOException
     {
         InputStream in = is;
         try
@@ -73,10 +88,16 @@
 
             return properties;
         }
+        catch ( IOException e )
+        {
+            // ignore
+        }
         finally
         {
             IOUtil.close( in );
         }
+
+        return null;
     }
 
 }