@@ -81,7 +81,7 @@ public class ScopFactory {
8181 public static final String LATEST_VERSION = VERSION_2_0_7 ;
8282
8383 // Hold one instance for each version
84- private static Map <String ,ScopDatabase > versionedScopDBs = new HashMap <String , ScopDatabase >();
84+ private static Map <String ,ScopDatabase > versionedScopDBs = new HashMap <>();
8585 private static String defaultVersion = LATEST_VERSION ;
8686
8787 /**
@@ -92,64 +92,33 @@ public static ScopDatabase getSCOP(){
9292 return getSCOP (defaultVersion );
9393 }
9494
95- /**
96- *
97- * @param forceLocalData Whether to use a local installation or a remote installation
98- * @return
99- * @see #getSCOP(String, boolean)
100- */
101- public static ScopDatabase getSCOP (boolean forceLocalData ) {
102- return getSCOP (defaultVersion , forceLocalData );
103- }
104-
105- /**
106- * requests a particular version of SCOP.
107- *
108- * Where possible, this will be the current default instance.
109- * Otherwise a new instance will be created.
110- * @param version
111- * @return
112- */
113- public static ScopDatabase getSCOP (String version ){
114- // Default to a remote installation
115- return getSCOP (version ,false );
116- }
117-
11895 /**
11996 * Gets an instance of the specified scop version.
12097 *
12198 * <p>
122- * The particular implementation returned is influenced by the <tt>forceLocalData</tt>
123- * parameter. When false, the instance returned will generally be a
124- * remote {@link ScopDatabase}, although this may be influenced by
125- * previous calls to this class. When true, the result is guaranteed to
99+ * The particular implementation returned is guaranteed to
126100 * implement {@link LocalScopDatabase} (generally a {@link BerkeleyScopInstallation}).
127101 *
128- * <p>
129- * Note that
130102 * @param version A version number, such as {@link #VERSION_1_75A}
131- * @param forceLocalData Whether to use a local installation or a remote installation
132103 * @return an
133104 */
134- public static ScopDatabase getSCOP (String version , boolean forceLocalData ){
105+ public static ScopDatabase getSCOP (String version ){
135106 if ( version == null ) {
136107 version = defaultVersion ;
137108 }
109+
138110 ScopDatabase scop = versionedScopDBs .get (version );
139- if ( forceLocalData ) {
111+ if (scop == null ) {
140112 // Use a local installation
141- if ( scop == null || !(scop instanceof LocalScopDatabase ) ) {
142- logger .info ("Creating new {}, version {}" , BerkeleyScopInstallation .class .getSimpleName (), version );
143- BerkeleyScopInstallation berkeley = new BerkeleyScopInstallation ();
144- berkeley .setScopVersion (version );
145- versionedScopDBs .put (version ,berkeley );
146- return berkeley ;
147- }
113+ logger .info ("Creating new {}, version {}" , BerkeleyScopInstallation .class .getSimpleName (), version );
114+ BerkeleyScopInstallation berkeley = new BerkeleyScopInstallation ();
115+ berkeley .setScopVersion (version );
116+ versionedScopDBs .put (version , berkeley );
117+ return berkeley ;
148118 }
149119 return scop ;
150120 }
151121
152-
153122 /**
154123 * Set the default scop version
155124 * @param version A version number, such as {@link #VERSION_1_75A}
@@ -159,17 +128,6 @@ public static void setScopDatabase(String version) {
159128 defaultVersion = version ;
160129 }
161130
162- /**
163- * Set the default scop version
164- * @param version A version number, such as {@link #VERSION_1_75A}
165- * @param forceLocalData Whether to use a local installation or a remote installation
166- */
167- public static void setScopDatabase (String version , boolean forceLocalData ) {
168- logger .debug ("ScopFactory: Setting ScopDatabase to version: {}, forced local: {}" , version , forceLocalData );
169- getSCOP (version ,forceLocalData );
170- defaultVersion = version ;
171- }
172-
173131 /**
174132 * Set the default scop version and instance
175133 * @param scop
0 commit comments