Skip to content

Commit 06b8609

Browse files
committed
Various FindBugs / Eclipse warnings Silence the false positives git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1056244 13f79535-47bb-0310-9956-ffa450edef68
1 parent f0d9854 commit 06b8609

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

java/org/apache/naming/java/javaURLContextFactory.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ public class javaURLContextFactory
8080
/**
8181
* Crete a new Context's instance.
8282
*/
83+
@SuppressWarnings("unchecked")
84+
@Override
8385
public Object getObjectInstance(Object obj, Name name, Context nameCtx,
8486
Hashtable<?,?> environment)
8587
throws NamingException {
@@ -94,6 +96,8 @@ public Object getObjectInstance(Object obj, Name name, Context nameCtx,
9496
/**
9597
* Get a new (writable) initial context.
9698
*/
99+
@SuppressWarnings("unchecked")
100+
@Override
97101
public Context getInitialContext(Hashtable<?,?> environment)
98102
throws NamingException {
99103
if (ContextBindings.isThreadBound() ||
@@ -105,7 +109,7 @@ public Context getInitialContext(Hashtable<?,?> environment)
105109

106110
// If the thread is not bound, return a shared writable context
107111
if (initialContext == null) {
108-
synchronized(getClass()) {
112+
synchronized(javaURLContextFactory.class) {
109113
if (initialContext == null) {
110114
initialContext = new NamingContext(
111115
(Hashtable<String,Object>)environment, MAIN);

res/findbugs/filter-false-positives.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
<Method name="checkResources" />
66
<Bug code="SWL" />
77
</Match>
8+
<Match>
9+
<Class name="org.apache.naming.java.javaURLContextFactory" />
10+
<Bug code="Nm" />
11+
</Match>
812
<!-- Generated code -->
913
<Match>
1014
<Class name="org.apache.el.parser.ELParserTokenManager" />

webapps/docs/changelog.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@
193193
ensure that a subsequent request for that directory does not result in a
194194
404 response. (markt)
195195
</fix>
196+
<fix>
197+
<bug>50554</bug>: Code clean up. (markt)
198+
</fix>
196199
</changelog>
197200
</subsection>
198201
<subsection name="Coyote">

0 commit comments

Comments
 (0)