Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
This repository was archived by the owner on Aug 17, 2018. It is now read-only.

Commit ef76258

Browse files
author
Kin Man Chung
committed
Fix Bug 21819986: Remove "synchronized" from JspFactory#setDefaultFactor and JspFactory#getDefaultFactory
svn path=/trunk/; revision=1482
1 parent f4147d1 commit ef76258

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

api/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
</executions>
132132
</plugin>
133133
<plugin>
134+
<groupId>org.apache.maven.plugins</groupId>
134135
<artifactId>maven-jar-plugin</artifactId>
135136
<configuration>
136137
<!-- Use default to include version in jar file name -->
@@ -182,6 +183,7 @@
182183
<plugin>
183184
<groupId>org.apache.maven.plugins</groupId>
184185
<artifactId>maven-javadoc-plugin</artifactId>
186+
<version>2.10.1</version>
185187
<executions>
186188
<execution>
187189
<id>attach-javadocs</id>

api/src/main/java/javax/servlet/jsp/JspFactory.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989

9090
public abstract class JspFactory {
9191

92-
private static JspFactory deflt = null;
92+
private static volatile JspFactory deflt = null;
9393

9494
/**
9595
* Sole constructor. (For invocation by subclass constructors,
@@ -107,7 +107,7 @@ public JspFactory() {
107107
* @param deflt The default factory implementation
108108
*/
109109

110-
public static synchronized void setDefaultFactory(JspFactory deflt) {
110+
public static void setDefaultFactory(JspFactory deflt) {
111111
JspFactory.deflt = deflt;
112112
}
113113

@@ -117,16 +117,7 @@ public static synchronized void setDefaultFactory(JspFactory deflt) {
117117
* @return the default factory for this implementation
118118
*/
119119

120-
public static synchronized JspFactory getDefaultFactory() {
121-
if (deflt == null) {
122-
try {
123-
Class factory = Class.forName("org.apache.jasper.runtime.JspFactoryImpl");
124-
if (factory != null) {
125-
deflt = (JspFactory) factory.newInstance();
126-
}
127-
} catch (Exception ex) {
128-
}
129-
}
120+
public static JspFactory getDefaultFactory() {
130121
return deflt;
131122
}
132123

0 commit comments

Comments
 (0)