aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/net/SocketPermission.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/net/SocketPermission.java')
-rw-r--r--libjava/java/net/SocketPermission.java112
1 files changed, 56 insertions, 56 deletions
diff --git a/libjava/java/net/SocketPermission.java b/libjava/java/net/SocketPermission.java
index 18fb7ef2f1f..6fa65f8793a 100644
--- a/libjava/java/net/SocketPermission.java
+++ b/libjava/java/net/SocketPermission.java
@@ -276,62 +276,62 @@ public final class SocketPermission extends Permission
// Get ours
if (hostport.indexOf(":") == -1)
{
- ourfirstport = 0;
- ourlastport = 65535;
+ ourfirstport = 0;
+ ourlastport = 65535;
}
else
{
- // FIXME: Needs bulletproofing.
- // This will dump if hostport if all sorts of bad data was passed to
- // the constructor
- String range = hostport.substring(hostport.indexOf(":") + 1);
- if (range.startsWith("-"))
- ourfirstport = 0;
- else if (range.indexOf("-") == -1)
- ourfirstport = Integer.parseInt(range);
- else
- ourfirstport =
- Integer.parseInt(range.substring(0, range.indexOf("-")));
-
- if (range.endsWith("-"))
- ourlastport = 65535;
- else if (range.indexOf("-") == -1)
- ourlastport = Integer.parseInt(range);
- else
- ourlastport =
- Integer.parseInt(range.
- substring(range.indexOf("-") + 1,
- range.length()));
+ // FIXME: Needs bulletproofing.
+ // This will dump if hostport if all sorts of bad data was passed to
+ // the constructor
+ String range = hostport.substring(hostport.indexOf(":") + 1);
+ if (range.startsWith("-"))
+ ourfirstport = 0;
+ else if (range.indexOf("-") == -1)
+ ourfirstport = Integer.parseInt(range);
+ else
+ ourfirstport =
+ Integer.parseInt(range.substring(0, range.indexOf("-")));
+
+ if (range.endsWith("-"))
+ ourlastport = 65535;
+ else if (range.indexOf("-") == -1)
+ ourlastport = Integer.parseInt(range);
+ else
+ ourlastport =
+ Integer.parseInt(range.
+ substring(range.indexOf("-") + 1,
+ range.length()));
}
// Get theirs
if (p.hostport.indexOf(":") == -1)
{
- theirfirstport = 0;
- ourlastport = 65535;
+ theirfirstport = 0;
+ ourlastport = 65535;
}
else
{
- // This will dump if hostport if all sorts of bad data was passed to
- // the constructor
- String range = p.hostport.substring(hostport.indexOf(":") + 1);
- if (range.startsWith("-"))
- theirfirstport = 0;
- else if (range.indexOf("-") == -1)
- theirfirstport = Integer.parseInt(range);
- else
- theirfirstport =
- Integer.parseInt(range.substring(0, range.indexOf("-")));
-
- if (range.endsWith("-"))
- theirlastport = 65535;
- else if (range.indexOf("-") == -1)
- theirlastport = Integer.parseInt(range);
- else
- theirlastport =
- Integer.parseInt(range.
- substring(range.indexOf("-") + 1,
- range.length()));
+ // This will dump if hostport if all sorts of bad data was passed to
+ // the constructor
+ String range = p.hostport.substring(hostport.indexOf(":") + 1);
+ if (range.startsWith("-"))
+ theirfirstport = 0;
+ else if (range.indexOf("-") == -1)
+ theirfirstport = Integer.parseInt(range);
+ else
+ theirfirstport =
+ Integer.parseInt(range.substring(0, range.indexOf("-")));
+
+ if (range.endsWith("-"))
+ theirlastport = 65535;
+ else if (range.indexOf("-") == -1)
+ theirlastport = Integer.parseInt(range);
+ else
+ theirlastport =
+ Integer.parseInt(range.
+ substring(range.indexOf("-") + 1,
+ range.length()));
}
// Now check them
@@ -361,17 +361,17 @@ public final class SocketPermission extends Permission
String ourcanonical = null, theircanonical = null;
try
{
- ourcanonical = InetAddress.getByName(ourhost).getHostName();
- theircanonical = InetAddress.getByName(theirhost).getHostName();
+ ourcanonical = InetAddress.getByName(ourhost).getHostName();
+ theircanonical = InetAddress.getByName(theirhost).getHostName();
}
catch (UnknownHostException e)
{
- // Who didn't resolve? Just assume current address is canonical enough
- // Is this ok to do?
- if (ourcanonical == null)
- ourcanonical = ourhost;
- if (theircanonical == null)
- theircanonical = theirhost;
+ // Who didn't resolve? Just assume current address is canonical enough
+ // Is this ok to do?
+ if (ourcanonical == null)
+ ourcanonical = ourhost;
+ if (theircanonical == null)
+ theircanonical = theirhost;
}
if (ourcanonical.equals(theircanonical))
@@ -380,9 +380,9 @@ public final class SocketPermission extends Permission
// Well, last chance. Try for a wildcard
if (ourhost.indexOf("*.") != -1)
{
- String wild_domain = ourhost.substring(ourhost.indexOf("*" + 1));
- if (theircanonical.endsWith(wild_domain))
- return (true);
+ String wild_domain = ourhost.substring(ourhost.indexOf("*" + 1));
+ if (theircanonical.endsWith(wild_domain))
+ return (true);
}
// Didn't make it