insertBefore.add("<ejb-local-ref>");
}
- protected static int die;
protected String classPath = null;
protected URLClassLoader loader = null;
protected boolean trimSpaces = false;
if (arg.length == 0) {
System.out.println(Localizer.getMessage("jspc.usage"));
} else {
+ JspC jspc = null;
try {
- JspC jspc = new JspC();
+ jspc = new JspC();
jspc.setArgs(arg);
if (jspc.helpNeeded) {
System.out.println(Localizer.getMessage("jspc.usage"));
}
} catch (JasperException je) {
System.err.println(je);
- if (die != NO_DIE_LEVEL) {
- System.exit(die);
+ if (jspc != null && jspc.dieLevel != NO_DIE_LEVEL) {
+ System.exit(jspc.dieLevel);
}
}
}
String tok;
dieLevel = NO_DIE_LEVEL;
- die = dieLevel;
while ((tok = nextArg()) != null) {
if (tok.equals(SWITCH_VERBOSE)) {
} catch (NumberFormatException nfe) {
dieLevel = DEFAULT_DIE_LEVEL;
}
- die = dieLevel;
} else if (tok.equals(SWITCH_HELP)) {
helpNeeded = true;
} else if (tok.equals(SWITCH_POOLING)) {
* includes.
*/
public void setUriroot( String s ) {
- if( s==null ) {
- uriRoot = s;
+ if (s == null) {
+ uriRoot = null;
return;
}
try {
fis.close();
fos.close();
- webXml2.delete();
- (new File(webxmlFile)).delete();
+ if(!webXml2.delete() && log.isDebugEnabled())
+ log.debug(Localizer.getMessage("jspc.delete.fail",
+ webXml2.toString()));
+
+ if (!(new File(webxmlFile)).delete() && log.isDebugEnabled())
+ log.debug(Localizer.getMessage("jspc.delete.fail", webxmlFile));
}
jspc.error.generalException=ERROR-the file ''{0}'' generated the following general exception:
jspc.error.fileDoesNotExist=The file argument ''{0}'' does not exist
jspc.error.emptyWebApp=-webapp requires a trailing file argument
+jspc.delete.fail=Failed to delete file [{0}]
jsp.error.library.invalid=JSP page is invalid according to library {0}: {1}
jsp.error.tlvclass.instantiation=Failed to load or instantiate TagLibraryValidator class: {0}
jsp.error.tlv.invalid.page=Validation error messages from TagLibraryValidator for {0} in {1}
}
/**
- * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
+ * @see InvocationHandler#invoke(Object, Method, Object[])
*/
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ @Override
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable {
if (portQNameClass.equals(method)) {
return getProxyPortQNameClass(args);
* @return Returns the correct Port
* @throws ServiceException if port's QName is an unknown Port (not defined in WSDL).
*/
+ @SuppressWarnings("unchecked")
private Object getProxyPortQNameClass(Object[] args)
throws ServiceException {
QName name = (QName) args[0];
for (Entry<ByteEntry,int[]> item : bcStats.entrySet()) {
ByteEntry entry = item.getKey();
int[] countA = item.getValue();
- Integer count = new Integer(countA[0]);
+ Integer count = Integer.valueOf(countA[0]);
// Add to the list for that count
ArrayList<ByteEntry> list = tempMap.get(count);
if (list == null) {
for (Entry<CharEntry,int[]> item : ccStats.entrySet()) {
CharEntry entry = item.getKey();
int[] countA = item.getValue();
- Integer count = new Integer(countA[0]);
+ Integer count = Integer.valueOf(countA[0]);
// Add to the list for that count
ArrayList<CharEntry> list = tempMap.get(count);
if (list == null) {
int i = 0;
while (true) {
- i = (b + a) / 2;
+ i = (b + a) >>> 1;
int result = compare(name, array[i].name);
if (result == 1) {
a = i;
int i = 0;
while (true) {
- i = (b + a) / 2;
+ i = (b + a) >>> 1;
int result = compare(name, array[i].name);
if (result == 1) {
a = i;
<FindBugsFilter>
<!-- Considered to be false positives -->
<Match>
+ <!-- JNI library can only be loaded once so statics are appropriate -->
+ <Class name="org.apache.catalina.core.AprLifecycleListener" />
+ <Bug code="ST" />
+ </Match>
+ <Match>
<!-- Have to trigger GC for leak detection to work. Clearly documented -->
<Class name="org.apache.catalina.core.StandardHost" />
<Method name="findReloadedContextMemoryLeaks" />
<Bug code="MSF" />
</Match>
<Match>
- <!-- Catalina isn'y used when embedding -->
+ <!-- Catalina isn't used when embedding -->
<Class name="org.apache.catalina.startup.Catalina" />
<Method name="stopServer" />
<Bug code="Dm" />
<Bug code="NS"/>
</Match>
<Match>
+ <!-- JspC will not be used under a security manager -->
+ <Class name="org.apache.jasper.JspC"/>
+ <Method name="initClassLoader"/>
+ <Bug code="DP" />
+ </Match>
+ <Match>
+ <!-- Parser config is static so statics are appropriate -->
+ <Class name="org.apache.jasper.JspC"/>
+ <Method name="setValidateXml"/>
+ <Bug code="ST" />
+ </Match>
+ <Match>
<!-- Simpler to catch Exception than to create dummy implementations of the
necessary exception hierarchy -->
<Class name="org.apache.naming.factory.SendMailFactory$1" />
<Bug code="DE" />
</Match>
<Match>
+ <!-- Simpler to catch Exception than to create dummy implementations of the
+ necessary exception hierarchy -->
+ <Class name="org.apache.naming.factory.webservices.ServiceProxy" />
+ <Method name="<init>"/>
+ <Bug code="ST" />
+ </Match>
+ <Match>
<!-- Class name needs to start with a lower case letter in this case -->
<Class name="org.apache.naming.java.javaURLContextFactory" />
<Bug code="Nm" />
<Bug code="NP" />
</Match>
<Match>
+ <!-- Whilst cache is global there may be multiple instances (one per -->
+ <!-- server so statics are appropriate -->
+ <Class name="org.apache.tomcat.util.buf.StringCache"/>
+ <Bug code="ST" />
+ </Match>
+ <Match>
<!-- Test really is for the same object rather than equality -->
<Class name="org.apache.tomcat.util.digester.Digester"/>
<Method name="updateBodyText"/>