Browse Source

Use fewer fully qualified class names

master
Gintas Grigelionis 7 years ago
parent
commit
5c6e9ace1e
3 changed files with 30 additions and 26 deletions
  1. +3
    -2
      src/main/org/apache/tools/ant/helper/ProjectHelper2.java
  2. +3
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java
  3. +24
    -22
      src/main/org/apache/tools/ant/types/Permissions.java

+ 3
- 2
src/main/org/apache/tools/ant/helper/ProjectHelper2.java View File

@@ -22,6 +22,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.nio.file.Files;
@@ -227,7 +228,7 @@ public class ProjectHelper2 extends ProjectHelper {
try {
context.setBuildFile((File) null);
context.setBuildFile(url);
} catch (java.net.MalformedURLException ex) {
} catch (MalformedURLException ex) {
throw new BuildException(ex);
}
buildFileName = url.toString();
@@ -783,7 +784,7 @@ public class ProjectHelper2 extends ProjectHelper {
if (MagicNames.ANT_FILE_TYPE_URL.equals(dupType)) {
try {
dupFile = new URL(dup);
} catch (java.net.MalformedURLException mue) {
} catch (MalformedURLException mue) {
throw new BuildException("failed to parse "
+ dup + " as URL while looking"
+ " at a duplicate project"


+ 3
- 2
src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java View File

@@ -21,6 +21,7 @@ package org.apache.tools.ant.taskdefs.optional.ejb;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Files;
import java.util.Collections;
@@ -97,7 +98,7 @@ public class DescriptorHandler extends HandlerBase {
* put into the jar file, mapped to File objects Accessed by the SAX
* parser call-back method characters().
*/
protected Hashtable<String, File> ejbFiles = null;
protected Map<String, File> ejbFiles = null;

/**
* Instance variable that stores the value found in the &lt;ejb-name&gt; element
@@ -169,7 +170,7 @@ public class DescriptorHandler extends HandlerBase {
URL urldtd = new URL(location);
urlDTDs.put(publicId, urldtd);
}
} catch (java.net.MalformedURLException e) {
} catch (MalformedURLException e) {
//ignored
}



+ 24
- 22
src/main/org/apache/tools/ant/types/Permissions.java View File

@@ -19,10 +19,12 @@
package org.apache.tools.ant.types;

import java.lang.reflect.Constructor;
import java.net.SocketPermission;
import java.security.UnresolvedPermission;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.PropertyPermission;
import java.util.Set;
import java.util.StringTokenizer;

@@ -122,27 +124,27 @@ public class Permissions {
}
}
// Add base set of permissions
granted.add(new java.net.SocketPermission("localhost:1024-", "listen"));
granted.add(new java.util.PropertyPermission("java.version", "read"));
granted.add(new java.util.PropertyPermission("java.vendor", "read"));
granted.add(new java.util.PropertyPermission("java.vendor.url", "read"));
granted.add(new java.util.PropertyPermission("java.class.version", "read"));
granted.add(new java.util.PropertyPermission("os.name", "read"));
granted.add(new java.util.PropertyPermission("os.version", "read"));
granted.add(new java.util.PropertyPermission("os.arch", "read"));
granted.add(new java.util.PropertyPermission("file.encoding", "read"));
granted.add(new java.util.PropertyPermission("file.separator", "read"));
granted.add(new java.util.PropertyPermission("path.separator", "read"));
granted.add(new java.util.PropertyPermission("line.separator", "read"));
granted.add(new java.util.PropertyPermission("java.specification.version", "read"));
granted.add(new java.util.PropertyPermission("java.specification.vendor", "read"));
granted.add(new java.util.PropertyPermission("java.specification.name", "read"));
granted.add(new java.util.PropertyPermission("java.vm.specification.version", "read"));
granted.add(new java.util.PropertyPermission("java.vm.specification.vendor", "read"));
granted.add(new java.util.PropertyPermission("java.vm.specification.name", "read"));
granted.add(new java.util.PropertyPermission("java.vm.version", "read"));
granted.add(new java.util.PropertyPermission("java.vm.vendor", "read"));
granted.add(new java.util.PropertyPermission("java.vm.name", "read"));
granted.add(new SocketPermission("localhost:1024-", "listen"));
granted.add(new PropertyPermission("java.version", "read"));
granted.add(new PropertyPermission("java.vendor", "read"));
granted.add(new PropertyPermission("java.vendor.url", "read"));
granted.add(new PropertyPermission("java.class.version", "read"));
granted.add(new PropertyPermission("os.name", "read"));
granted.add(new PropertyPermission("os.version", "read"));
granted.add(new PropertyPermission("os.arch", "read"));
granted.add(new PropertyPermission("file.encoding", "read"));
granted.add(new PropertyPermission("file.separator", "read"));
granted.add(new PropertyPermission("path.separator", "read"));
granted.add(new PropertyPermission("line.separator", "read"));
granted.add(new PropertyPermission("java.specification.version", "read"));
granted.add(new PropertyPermission("java.specification.vendor", "read"));
granted.add(new PropertyPermission("java.specification.name", "read"));
granted.add(new PropertyPermission("java.vm.specification.version", "read"));
granted.add(new PropertyPermission("java.vm.specification.vendor", "read"));
granted.add(new PropertyPermission("java.vm.specification.name", "read"));
granted.add(new PropertyPermission("java.vm.version", "read"));
granted.add(new PropertyPermission("java.vm.vendor", "read"));
granted.add(new PropertyPermission("java.vm.name", "read"));
}

private java.security.Permission createPermission(
@@ -187,7 +189,7 @@ public class Permissions {
*/
@Override
public void checkExit(final int status) {
final java.security.Permission perm = new java.lang.RuntimePermission("exitVM", null);
final java.security.Permission perm = new RuntimePermission("exitVM", null);
try {
checkPermission(perm);
} catch (final SecurityException e) {


Loading…
Cancel
Save