From 5449bec72778bd774c917843783c024243f079ec Mon Sep 17 00:00:00 2001
From: Violette Roche-Montane <violette.roche-montane@forgerock.com>
Date: Wed, 28 Aug 2013 08:47:02 +0000
Subject: [PATCH] Trivial style fix
---
opends/src/guitools/org/opends/guitools/controlpanel/util/SchemaLoader.java | 86 +++++++++++++++++++++++-------------------
1 files changed, 47 insertions(+), 39 deletions(-)
diff --git a/opends/src/guitools/org/opends/guitools/controlpanel/util/SchemaLoader.java b/opends/src/guitools/org/opends/guitools/controlpanel/util/SchemaLoader.java
index 6b33ccb..841a827 100644
--- a/opends/src/guitools/org/opends/guitools/controlpanel/util/SchemaLoader.java
+++ b/opends/src/guitools/org/opends/guitools/controlpanel/util/SchemaLoader.java
@@ -51,32 +51,30 @@
/**
* Class used to retrieve the schema from the schema files.
- *
*/
public class SchemaLoader
{
private Schema schema;
private final String[] attrsToKeep = {
- ConfigConstants.ATTR_ATTRIBUTE_TYPES_LC,
- ConfigConstants.ATTR_OBJECTCLASSES_LC,
- ConfigConstants.ATTR_NAME_FORMS_LC,
- ConfigConstants.ATTR_DIT_CONTENT_RULES_LC,
- ConfigConstants.ATTR_DIT_STRUCTURE_RULES_LC,
- ConfigConstants.ATTR_MATCHING_RULE_USE_LC};
- private final String[] ocsToKeep = {"top"};
+ ConfigConstants.ATTR_ATTRIBUTE_TYPES_LC,
+ ConfigConstants.ATTR_OBJECTCLASSES_LC,
+ ConfigConstants.ATTR_NAME_FORMS_LC,
+ ConfigConstants.ATTR_DIT_CONTENT_RULES_LC,
+ ConfigConstants.ATTR_DIT_STRUCTURE_RULES_LC,
+ ConfigConstants.ATTR_MATCHING_RULE_USE_LC };
+ private final String[] ocsToKeep = { "top" };
private final ArrayList<ObjectClass> objectclassesToKeep =
- new ArrayList<ObjectClass>();
+ new ArrayList<ObjectClass>();
private final ArrayList<AttributeType> attributesToKeep =
- new ArrayList<AttributeType>();
+ new ArrayList<AttributeType>();
private final ArrayList<MatchingRule> matchingRulesToKeep =
- new ArrayList<MatchingRule>();
+ new ArrayList<MatchingRule>();
private final ArrayList<AttributeSyntax<?>> syntaxesToKeep =
- new ArrayList<AttributeSyntax<?>>();
+ new ArrayList<AttributeSyntax<?>>();
/**
* Constructor.
- *
*/
public SchemaLoader()
{
@@ -110,42 +108,47 @@
private static String getSchemaDirectoryPath()
{
File schemaDir =
- DirectoryServer.getEnvironmentConfig().getSchemaDirectory();
- if (schemaDir != null) {
+ DirectoryServer.getEnvironmentConfig().getSchemaDirectory();
+ if (schemaDir != null)
+ {
return schemaDir.getAbsolutePath();
- } else {
+ }
+ else
+ {
return null;
}
}
/**
* Reads the schema.
- * @throws ConfigException if an error occurs reading the schema.
- * @throws InitializationException if an error occurs trying to find out
- * the schema files.
- * @throws DirectoryException if there is an error registering the minimal
- * objectclasses.
+ *
+ * @throws ConfigException
+ * if an error occurs reading the schema.
+ * @throws InitializationException
+ * if an error occurs trying to find out the schema files.
+ * @throws DirectoryException
+ * if there is an error registering the minimal objectclasses.
*/
- public void readSchema() throws DirectoryException,
- ConfigException, InitializationException
+ public void readSchema() throws DirectoryException, ConfigException,
+ InitializationException
{
schema = getBaseSchema();
String[] fileNames;
- String schemaDirPath= getSchemaDirectoryPath();
+ String schemaDirPath = getSchemaDirectoryPath();
try
{
// Load install directory schema
File schemaDir = new File(schemaDirPath);
- if (schemaDirPath == null || ! schemaDir.exists())
+ if (schemaDirPath == null || !schemaDir.exists())
{
Message message = ERR_CONFIG_SCHEMA_NO_SCHEMA_DIR.get(schemaDirPath);
throw new InitializationException(message);
}
- else if (! schemaDir.isDirectory())
+ else if (!schemaDir.isDirectory())
{
Message message =
- ERR_CONFIG_SCHEMA_DIR_NOT_DIRECTORY.get(schemaDirPath);
+ ERR_CONFIG_SCHEMA_DIR_NOT_DIRECTORY.get(schemaDirPath);
throw new InitializationException(message);
}
FileFilter ldifFiles = new FileFilter()
@@ -161,11 +164,12 @@
if (f.isDirectory())
{
accept = true;
- } else if (Utils.isWindows())
+ }
+ else if (Utils.isWindows())
{
- accept =
- f.getName().toLowerCase().endsWith(".ldif");
- } else
+ accept = f.getName().toLowerCase().endsWith(".ldif");
+ }
+ else
{
accept = f.getName().endsWith(".ldif");
}
@@ -195,14 +199,16 @@
}
catch (Exception e)
{
- Message message = ERR_CONFIG_SCHEMA_CANNOT_LIST_FILES.get(
- schemaDirPath, e.getMessage());
+ Message message =
+ ERR_CONFIG_SCHEMA_CANNOT_LIST_FILES
+ .get(schemaDirPath, e.getMessage());
throw new InitializationException(message, e);
}
-// Iterate through the schema files and read them as an LDIF file containing
-// a single entry. Then get the attributeTypes and objectClasses attributes
-// from that entry and parse them to initialize the server schema.
+ // Iterate through the schema files and read them as an LDIF file
+ // containing a single entry. Then get the attributeTypes and
+ // objectClasses attributes from that entry and parse them to
+ // initialize the server schema.
for (String schemaFile : fileNames)
{
SchemaConfigManager.loadSchemaFile(schema, schemaFile);
@@ -210,11 +216,12 @@
}
/**
- * Returns a basic version of the schema. The schema is created and contains
+ * Returns a basic version of the schema. The schema is created and contains
* enough definitions for the schema to be loaded.
+ *
* @return a basic version of the schema.
- * @throws DirectoryException if there is an error registering the minimal
- * objectclasses.
+ * @throws DirectoryException
+ * if there is an error registering the minimal objectclasses.
*/
protected Schema getBaseSchema() throws DirectoryException
{
@@ -240,6 +247,7 @@
/**
* Returns the schema that was read.
+ *
* @return the schema that was read.
*/
public Schema getSchema()
--
Gitblit v1.10.0