diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/BaseCategoryForm.java b/ccm-cms/src/com/arsdigita/cms/ui/category/BaseCategoryForm.java
index 221c37166..bb8a40bfa 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/category/BaseCategoryForm.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/category/BaseCategoryForm.java
@@ -58,7 +58,9 @@ class BaseCategoryForm extends BaseForm {
final TextField m_url;
final RadioGroup m_isAbstract;
final RadioGroup m_isEnabled;
- private Label m_script = new Label("", false);
+ private Label m_script = new Label(
+ "",
+ false);
diff --git a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryAddForm.java b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryAddForm.java
index 82f7cd59d..546ab432f 100755
--- a/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryAddForm.java
+++ b/ccm-cms/src/com/arsdigita/cms/ui/category/CategoryAddForm.java
@@ -55,8 +55,14 @@ final class CategoryAddForm extends BaseCategoryForm {
}
private final class ProcessListener implements FormProcessListener {
+
+ /**
+ *
+ * @param e
+ * @throws FormProcessException
+ */
public final void process(final FormSectionEvent e)
- throws FormProcessException {
+ throws FormProcessException {
s_log.debug("Adding a category");
final PageState state = e.getPageState();
@@ -64,8 +70,8 @@ final class CategoryAddForm extends BaseCategoryForm {
final Category parent = m_parent.getCategory(state);
final String name = (String) m_name.getValue(state);
final String description = (String) m_description.getValue(state);
- final String url = (String) m_url.getValue(state);
- final String isAbstract = (String) m_isAbstract.getValue(state);
+ final String url = (String) m_url.getValue(state);
+ final String isAbstract = (String) m_isAbstract.getValue(state);
Assert.exists(parent, "Category parent");
@@ -76,14 +82,14 @@ final class CategoryAddForm extends BaseCategoryForm {
if (parent.canEdit()) {
final Category category = new Category(name, description, url);
- // this seems anti-intuitive but the question is "can you place
- // items in this category. If the user says "yes" then the
- // category is not abstract
- if ("yes".equals(isAbstract)) {
- category.setAbstract(false);
- } else if ("no".equals(isAbstract)) {
- category.setAbstract(true);
- }
+ // this seems anti-intuitive but the question is "can you place
+ // items in this category. If the user says "yes" then the
+ // category is not abstract
+ if ("yes".equals(isAbstract)) {
+ category.setAbstract(false);
+ } else if ("no".equals(isAbstract)) {
+ category.setAbstract(true);
+ }
category.save(); // XXX this is necessary?
parent.addChild(category);
diff --git a/ccm-core/src/com/arsdigita/bebop/AbstractSingleSelectionModel.java b/ccm-core/src/com/arsdigita/bebop/AbstractSingleSelectionModel.java
index 0eff34aee..16561cd39 100755
--- a/ccm-core/src/com/arsdigita/bebop/AbstractSingleSelectionModel.java
+++ b/ccm-core/src/com/arsdigita/bebop/AbstractSingleSelectionModel.java
@@ -27,9 +27,9 @@ import com.arsdigita.util.Assert;
import com.arsdigita.util.Lockable;
/**
- * A standard implementation of SingleSelectionModel and Lockable. Those
- * wishing to define a SingleSelectionModel will ordinarily want to extend
- * this class.
+ * A standard implementation of SingleSelectionModel and
+ * Lockable. Those wishing to define a SingleSelectionModel
+ * will ordinarily want to extend this class.
*
* @version $Id: AbstractSingleSelectionModel.java 287 2005-02-22 00:29:02Z sskracic $
*/
diff --git a/ccm-core/src/com/arsdigita/bebop/Bebop.java b/ccm-core/src/com/arsdigita/bebop/Bebop.java
index d952de0f9..a7a518a17 100755
--- a/ccm-core/src/com/arsdigita/bebop/Bebop.java
+++ b/ccm-core/src/com/arsdigita/bebop/Bebop.java
@@ -29,19 +29,12 @@ public final class Bebop {
private static final Logger s_log = Logger.getLogger(Bebop.class);
- private static BebopConfig s_config;
+ private static BebopConfig s_config = BebopConfig.getInstance();
/**
* Gets the BebopConfig object.
*/
- public static final BebopConfig getConfig() {
- if (s_config == null) {
- s_config = new BebopConfig();
- // deprecated, use load() instead, load the default config db,
- // which is ccm-core /bebop.properties for BebogConfig by definition
- // s_config.load("ccm-core/bebop.properties");
- s_config.load();
- }
+ public static BebopConfig getConfig() {
return s_config;
}
}
diff --git a/ccm-core/src/com/arsdigita/bebop/BebopConfig.java b/ccm-core/src/com/arsdigita/bebop/BebopConfig.java
index b7287d54d..da308d111 100755
--- a/ccm-core/src/com/arsdigita/bebop/BebopConfig.java
+++ b/ccm-core/src/com/arsdigita/bebop/BebopConfig.java
@@ -38,7 +38,30 @@ import org.apache.log4j.Logger;
*/
public final class BebopConfig extends AbstractConfig {
+ /** A logger instance to assist debugging. */
private static final Logger s_log = Logger.getLogger(BebopConfig.class);
+
+ /** Singleton config object. */
+ private static BebopConfig s_config;
+
+ /**
+ * Gain a BebopConfig object.
+ *
+ * Singleton pattern, don't instantiate a config object using the
+ * constructor directly!
+ * @return
+ */
+ public static synchronized BebopConfig getInstance() {
+ if (s_config == null) {
+ s_config = new BebopConfig();
+ s_config.load();
+ }
+
+ return s_config;
+ }
+
+ // set of configuration parameters
+ // /////////////////////////////////////////////////////////////////
/**
*
@@ -81,6 +104,9 @@ public final class BebopConfig extends AbstractConfig {
("waf.bebop.show_class_name", Parameter.OPTIONAL, Boolean.FALSE);
/**
+ * Constructor.
+ * Singelton pattern, don't instantiate a config object using the
+ * constructor directly! Use getConfig() instead.
*
*/
public BebopConfig() {