| author | kwilk | 2011-05-23 16:38:55 (EDT) |
|---|---|---|
| committer | Ryan D. Brooks | 2011-05-23 16:38:55 (EDT) |
| commit | f5273080a11f5ed5c82a48844e243468cd04ecd1 (patch) (side-by-side diff) | |
| tree | febb928fd5107182854ffebc43eaaa6c48a35a15 | |
| parent | ae5bec1e0a8a61ff449c5d01f0ac97ef7b1a2d3e (diff) | |
| download | org.eclipse.osee-f5273080a11f5ed5c82a48844e243468cd04ecd1.zip org.eclipse.osee-f5273080a11f5ed5c82a48844e243468cd04ecd1.tar.gz org.eclipse.osee-f5273080a11f5ed5c82a48844e243468cd04ecd1.tar.bz2 | |
refinement: Minor code quality changes
8 files changed, 9 insertions, 26 deletions
diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/creation/CreateBranchOperation.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/creation/CreateBranchOperation.java index 40794b7..fcd8a07 100644 --- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/creation/CreateBranchOperation.java +++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/creation/CreateBranchOperation.java @@ -53,22 +53,22 @@ public class CreateBranchOperation extends AbstractDbTxOperation { // descending order is used so that the most recent entry will be used if there are multiple rows with the same gamma (an error case) private static final String SELECT_ADDRESSING = - "SELECT gamma_id, mod_type FROM osee_txs txs WHERE txs.tx_current <> ? AND txs.branch_id = ? order by txs.transaction_id desc"; + "SELECT gamma_id, mod_type FROM osee_txs txs WHERE txs.tx_current <> ? AND txs.branch_id = ? ORDER BY txs.transaction_id DESC"; private static final String INSERT_ADDRESSING = "INSERT INTO osee_txs (transaction_id, gamma_id, mod_type, tx_current, branch_id) VALUES (?,?,?,?,?)"; private static final String USER_ID_QUERY = - "select oa.art_id from osee_attribute_type oat, osee_attribute oa, osee_txs txs where oat.name = 'User Id' and oat.attr_type_id = oa.attr_type_id and oa.gamma_id = txs.gamma_id and txs.tx_current = 1 and oa.value = ?"; + "SELECT oa.art_id FROM osee_attribute_type oat, osee_attribute oa, osee_txs txs WHERE oat.name = 'User Id' AND oat.attr_type_id = oa.attr_type_id AND oa.gamma_id = txs.gamma_id AND txs.tx_current = 1 AND oa.value = ?"; private static final String MERGE_BRANCH_INSERT = - "INSERT INTO osee_merge (source_branch_id, dest_branch_id, merge_branch_id, commit_transaction_id) VALUES(?,?,?,?)"; + "INSERT INTO osee_merge (source_branch_id, dest_branch_id, merge_branch_id, commit_transaction_id) VALUES (?,?,?,?)"; private final static String SELECT_ATTRIBUTE_ADDRESSING_FROM_JOIN = - "SELECT item.gamma_id, txs.mod_type FROM osee_attribute item, osee_txs txs, osee_join_artifact artjoin WHERE txs.branch_id = ? AND txs.tx_current <> ? AND txs.gamma_id = item.gamma_id AND item.art_id = artjoin.art_id and artjoin.query_id = ? order by txs.transaction_id desc"; + "SELECT item.gamma_id, txs.mod_type FROM osee_attribute item, osee_txs txs, osee_join_artifact artjoin WHERE txs.branch_id = ? AND txs.tx_current <> ? AND txs.gamma_id = item.gamma_id AND item.art_id = artjoin.art_id and artjoin.query_id = ? ORDER BY txs.transaction_id DESC"; private final static String SELECT_ARTIFACT_ADDRESSING_FROM_JOIN = - "SELECT item.gamma_id, txs.mod_type FROM osee_artifact item, osee_txs txs, osee_join_artifact artjoin WHERE txs.branch_id = ? AND txs.tx_current <> ? AND txs.gamma_id = item.gamma_id AND item.art_id = artjoin.art_id and artjoin.query_id = ? order by txs.transaction_id desc"; + "SELECT item.gamma_id, txs.mod_type FROM osee_artifact item, osee_txs txs, osee_join_artifact artjoin WHERE txs.branch_id = ? AND txs.tx_current <> ? AND txs.gamma_id = item.gamma_id AND item.art_id = artjoin.art_id and artjoin.query_id = ? ORDER BY txs.transaction_id DESC"; private static final String TEST_MERGE_BRANCH_EXISTENCE = - "SELECT count(1) FROM osee_merge WHERE source_branch_id = ? AND dest_branch_id = ?"; + "SELECT COUNT(1) FROM osee_merge WHERE source_branch_id = ? AND dest_branch_id = ?"; private boolean passedPreConditions; private boolean wasSuccessful; @@ -142,6 +142,7 @@ public class CreateBranchOperation extends AbstractDbTxOperation { if (!GUID.isValid(guid)) { guid = GUID.create(); } + branch = factoryService.getOseeFactoryService().getBranchFactory().create(guid, request.getBranchName(), request.getBranchType(), BranchState.CREATION_IN_PROGRESS, false); diff --git a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/ImportDataFromDbServiceOperation.java b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/ImportDataFromDbServiceOperation.java index 62c7156..ce3c0f6 100644 --- a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/ImportDataFromDbServiceOperation.java +++ b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/schema/operations/ImportDataFromDbServiceOperation.java @@ -131,10 +131,6 @@ public class ImportDataFromDbServiceOperation extends AbstractOperation { return connectionsNeeded; } - public boolean canRun() { - return true; - } - private Map<String, SchemaData> getAvailableSchemasFromImportDb(IProgressMonitor monitor, Set<String> schemas) throws Exception { Map<String, SchemaData> schemaMap = new HashMap<String, SchemaData>(); ExtractDatabaseSchemaOperation schemaExtractor = diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/BranchFactory.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/BranchFactory.java index 0d87f6f..26541c6 100644 --- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/BranchFactory.java +++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/BranchFactory.java @@ -24,9 +24,6 @@ import org.eclipse.osee.framework.core.util.Conditions; */ public class BranchFactory implements IOseeTypeFactory { - public BranchFactory() { - } - public Branch create(String guid, String name, BranchType branchType, BranchState branchState, boolean isArchived) throws OseeCoreException { Conditions.checkNotNullOrEmpty(name, "branch name"); Conditions.checkNotNull(branchType, "branch type"); diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/BranchField.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/BranchField.java index d2192b0..98b4ece 100644 --- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/BranchField.java +++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/BranchField.java @@ -28,5 +28,6 @@ public final class BranchField { public static final String MERGE_BRANCH_DESTINATION = "osee.merge.branch.destination"; private BranchField() { + // } } diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/type/AttributeTypeFactory.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/type/AttributeTypeFactory.java index 18e1501..fc1982b 100644 --- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/type/AttributeTypeFactory.java +++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/type/AttributeTypeFactory.java @@ -23,9 +23,6 @@ import org.eclipse.osee.framework.jdk.core.util.Strings; */ public class AttributeTypeFactory implements IOseeTypeFactory { - public AttributeTypeFactory() { - } - public AttributeType create(String guid, String name, String baseAttributeTypeId, String attributeProviderNameId, String fileTypeExtension, String defaultValue, int minOccurrences, int maxOccurrences, String tipText, String taggerId) throws OseeCoreException { Conditions.checkNotNullOrEmpty(name, "attribute type name"); // checkNameUnique(cache, name); diff --git a/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/AddCommonBranch.java b/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/AddCommonBranch.java index 263b787..4b3b62b 100644 --- a/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/AddCommonBranch.java +++ b/plugins/org.eclipse.osee.framework.database.init/src/org/eclipse/osee/framework/database/init/AddCommonBranch.java @@ -76,8 +76,4 @@ public abstract class AddCommonBranch implements IDbInitializationTask { transaction.execute(); } } - - public boolean canRun() { - return true; - } } diff --git a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/TxData.java b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/TxData.java index fc02e9b..0e411e2 100644 --- a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/TxData.java +++ b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/TxData.java @@ -32,7 +32,6 @@ public class TxData { private final Long txId; public TxData(Branch branch, int authorId, Date timeStamp, String comment, int txType, int commitArtId, long txId) { - super(); this.authorId = authorId; this.timeStamp = timeStamp; this.comment = comment; diff --git a/plugins/org.eclipse.osee.support.test.util/src/org/eclipse/osee/support/test/util/TestUtil.java b/plugins/org.eclipse.osee.support.test.util/src/org/eclipse/osee/support/test/util/TestUtil.java index 89cb130..9944ed1 100644 --- a/plugins/org.eclipse.osee.support.test.util/src/org/eclipse/osee/support/test/util/TestUtil.java +++ b/plugins/org.eclipse.osee.support.test.util/src/org/eclipse/osee/support/test/util/TestUtil.java @@ -57,11 +57,7 @@ public class TestUtil { } public static void setDemoDb(boolean set) throws OseeCoreException { - if (set) { - OseeInfo.putValue(OseeInfo.DB_TYPE_KEY, DEMO_DB_TYPE); - } else { - OseeInfo.putValue(OseeInfo.DB_TYPE_KEY, ""); - } + OseeInfo.putValue(OseeInfo.DB_TYPE_KEY, set ? DEMO_DB_TYPE : ""); } public static void sleep(long milliseconds) throws Exception { |

