diff options
author | Ryan D. Brooks | 2011-08-02 20:05:44 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2011-08-02 20:05:44 +0000 |
commit | 5618fe9dd7eb79ae3118d1e874aace2ce208bec8 (patch) | |
tree | bc6fce7bf67baca7c3ecb0279133657eb90eb66b /plugins/org.eclipse.osee.framework.skynet.core | |
parent | 38f5425454f60d085a2ad10b340b63a5c1562378 (diff) | |
download | org.eclipse.osee-5618fe9dd7eb79ae3118d1e874aace2ce208bec8.tar.gz org.eclipse.osee-5618fe9dd7eb79ae3118d1e874aace2ce208bec8.tar.xz org.eclipse.osee-5618fe9dd7eb79ae3118d1e874aace2ce208bec8.zip |
refactor: Replace OseeLog.log() calls that use String.format with OseeLog.logf
Diffstat (limited to 'plugins/org.eclipse.osee.framework.skynet.core')
14 files changed, 43 insertions, 47 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java index 0650e39d40e..982a3c5819c 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java @@ -112,8 +112,8 @@ public final class ArtifactLoader { previousBranchId = branchId; } } catch (OseeDataStoreException ex) { - OseeLog.log(Activator.class, Level.SEVERE, - String.format("%s - %s", sqlKey, sql == null ? "SQL unknown" : sql), ex); + OseeLog.logf(Activator.class, Level.SEVERE, + ex, "%s - %s", sqlKey, sql == null ? "SQL unknown" : sql); throw ex; } finally { chStmt.close(); @@ -213,11 +213,8 @@ public final class ArtifactLoader { if (data != loadedItems) { loadedItems.addAll(data); } - OseeLog.log( - Activator.class, - Level.FINE, - String.format("Artifact Load Time [%s] for [%d] artifacts. ", Lib.getElapseString(time), - loadedItems.size()), new Exception("Artifact Load Time")); + OseeLog.logf(Activator.class, Level.FINE, new Exception("Artifact Load Time"), + "Artifact Load Time [%s] for [%d] artifacts. ", Lib.getElapseString(time), loadedItems.size()); clearQuery(queryId); } } @@ -295,8 +292,8 @@ public final class ArtifactLoader { } finally { chStmt.close(); } - OseeLog.log(Activator.class, Level.FINE, String.format("Artifact Selection Time [%s], [%d] artifacts selected", - Lib.getElapseString(time), insertParameters.size()), new Exception("Artifact Selection Time")); + OseeLog.logf(Activator.class, Level.FINE, new Exception("Artifact Selection Time"), + "Artifact Selection Time [%s], [%d] artifacts selected", Lib.getElapseString(time), insertParameters.size()); } private static Artifact retrieveShallowArtifact(IOseeStatement chStmt, LoadType reload, boolean historical) throws OseeCoreException { diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java index def762c26a7..2ecbfc7a28b 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java @@ -313,9 +313,9 @@ public abstract class Attribute<T> implements Comparable<Attribute<T>> { try { return modificationType.isDeleted(); } catch (NullPointerException ex) { - OseeLog.log(Activator.class, Level.SEVERE, String.format( + OseeLog.logf(Activator.class, Level.SEVERE, ex, "Unexpected null modification type for artifact attribute [%d] gamma [%d] on artifact [%s]", getId(), - getGammaId(), getArtifact().getSafeName()), ex); + getGammaId(), getArtifact().getSafeName()); } return false; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/AttributeLoader.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/AttributeLoader.java index b76a34fc900..3e19404cdef 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/AttributeLoader.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/AttributeLoader.java @@ -117,8 +117,8 @@ public class AttributeLoader { artifact = ArtifactCache.getActive(current.artifactId, current.branchId); } if (artifact == null) { - OseeLog.log(ArtifactLoader.class, Level.WARNING, - String.format("Orphaned attribute for artifact id[%d] branch[%d]", current.artifactId, current.branchId)); + OseeLog.logf(ArtifactLoader.class, Level.WARNING, + "Orphaned attribute for artifact id[%d] branch[%d]", current.artifactId, current.branchId); } return artifact; } @@ -150,13 +150,13 @@ public class AttributeLoader { // Do not warn about skipping on historical loading, because the most recent // transaction is used first due to sorting on the query if (!historical) { - OseeLog.log( + OseeLog.logf( ArtifactLoader.class, Level.WARNING, - String.format( + "multiple attribute version for attribute id [%d] artifact id[%d] branch[%d] previousGammaId[%s] currentGammaId[%s] previousModType[%s] currentModType[%s]", current.attrId, current.artifactId, current.branchId, previous.gammaId, current.gammaId, - previous.modType, current.modType)); + previous.modType, current.modType); } } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeArtifacts.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeArtifacts.java index 853ac1e166e..ee9f705fd29 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeArtifacts.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/PurgeArtifacts.java @@ -152,13 +152,13 @@ public class PurgeArtifacts extends AbstractDbTxOperation { int artifactVersions = ConnectionHandler.runPreparedUpdate(connection, DELETE_FROM_ARTIFACT_VERSIONS, transactionJoinId); - OseeLog.log( + OseeLog.logf( Activator.class, Level.FINE, - String.format( + "Purge Row Deletes: txs rows [%d], rel ver rows [%d], attr ver rows [%d] art ver rows [%d]. txs vs. total versions [%d vs %d]", txsDeletes, relationVersions, attributeVersions, artifactVersions, txDetails, - (relationVersions + attributeVersions + artifactVersions))); + (relationVersions + attributeVersions + artifactVersions)); ConnectionHandler.runPreparedUpdate(connection, "DELETE FROM osee_join_transaction where query_id = ?", transactionJoinId); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/factory/ArtifactFactoryManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/factory/ArtifactFactoryManager.java index 55bf4d47ab1..0858ad6f76d 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/factory/ArtifactFactoryManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/factory/ArtifactFactoryManager.java @@ -43,12 +43,12 @@ public final class ArtifactFactoryManager { if (responsibleFactory == null) { responsibleFactory = factory; } else { - OseeLog.log( + OseeLog.logf( Activator.class, Level.SEVERE, - String.format( + "Multiple ArtifactFactories [%s] [%s]responsible for same artifact type [%s]. Defaulting to DefaultArtifactFactory.", - responsibleFactory, factory, artifactType)); + responsibleFactory, factory, artifactType); return getDefaultArtifactFactory(); } } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/HttpAttributeTaggingListener.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/HttpAttributeTaggingListener.java index ec6c3ff9ed2..dc2af4db41e 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/HttpAttributeTaggingListener.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/HttpAttributeTaggingListener.java @@ -142,8 +142,8 @@ public class HttpAttributeTaggingListener implements IArtifactEventListener, IBr HttpUrlBuilderClient.getInstance().getOsgiServletServiceUrl(OseeServerContext.SEARCH_TAGGING_CONTEXT, parameters); response.append(HttpProcessor.put(new URL(url), inputStream, "application/xml", "UTF-8")); - OseeLog.log(Activator.class, Level.FINEST, - String.format("Transmitted to Tagger in [%d ms]", System.currentTimeMillis() - start)); + OseeLog.logf(Activator.class, Level.FINEST, + "Transmitted to Tagger in [%d ms]", System.currentTimeMillis() - start); } catch (Exception ex) { if (response.length() > 0) { response.append("\n"); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/email/EmailGroup.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/email/EmailGroup.java index fa274866e77..c78852638cf 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/email/EmailGroup.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/email/EmailGroup.java @@ -62,7 +62,7 @@ public class EmailGroup { if (EmailUtil.isEmailValid(str)) { this.emails.add(str); } else { - OseeLog.log(Activator.class, Level.SEVERE, String.format("Invalid Email [%s]", str)); + OseeLog.logf(Activator.class, Level.SEVERE, "Invalid Email [%s]", str); } } } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/FrameworkEventUtil.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/FrameworkEventUtil.java index 5c64fa01535..9c5846c882a 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/FrameworkEventUtil.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/FrameworkEventUtil.java @@ -223,7 +223,7 @@ public class FrameworkEventUtil { EventModType modType = EventModType.getType(remGuidArt.getModTypeGuid()); // This can happen if new events are added that old releases don't handle if (modType == null) { - OseeLog.log(Activator.class, Level.WARNING, String.format("Unhandled remote artifact [%s]", remGuidArt)); + OseeLog.logf(Activator.class, Level.WARNING, "Unhandled remote artifact [%s]", remGuidArt); } else { if (modType == EventModType.Modified) { event.getArtifacts().add(getEventModifiedBasicGuidArtifact(modType, remGuidArt)); @@ -238,7 +238,7 @@ public class FrameworkEventUtil { EventBasicGuidRelation relEvent = getEventBasicGuidRelation(guidRel); // This can happen if new events are added that old releases don't handle if (relEvent == null) { - OseeLog.log(Activator.class, Level.WARNING, String.format("Unhandled remote relation [%s]", guidRel)); + OseeLog.logf(Activator.class, Level.WARNING, "Unhandled remote relation [%s]", guidRel); } else { event.getRelations().add(relEvent); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/ClientDashboardRequestHandler.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/ClientDashboardRequestHandler.java index f252086c46e..536e2f66dec 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/ClientDashboardRequestHandler.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/httpRequests/ClientDashboardRequestHandler.java @@ -154,8 +154,8 @@ public class ClientDashboardRequestHandler implements IHttpServerRequest { } } } catch (Exception ex) { - OseeLog.log(Activator.class, Level.SEVERE, - String.format("Error processing request for [%s]", httpRequest.toString()), ex); + OseeLog.logf(Activator.class, Level.SEVERE, + ex, "Error processing request for [%s]", httpRequest.toString()); httpResponse.getPrintStream().println(Lib.exceptionToString(ex)); } finally { httpResponse.getOutputStream().flush(); @@ -171,8 +171,8 @@ public class ClientDashboardRequestHandler implements IHttpServerRequest { httpResponse.sendResponseHeaders(HttpURLConnection.HTTP_OK, results.length()); httpResponse.getPrintStream().println(results); } catch (Exception ex) { - OseeLog.log(Activator.class, Level.SEVERE, - String.format("Error processing request for [%s]", httpRequest.toString()), ex); + OseeLog.logf(Activator.class, Level.SEVERE, + ex, "Error processing request for [%s]", httpRequest.toString()); httpResponse.getPrintStream().println(Lib.exceptionToString(ex)); } finally { httpResponse.getOutputStream().flush(); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/AccessPolicyImpl.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/AccessPolicyImpl.java index b0287bc93b3..177b695d810 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/AccessPolicyImpl.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/AccessPolicyImpl.java @@ -13,7 +13,6 @@ package org.eclipse.osee.framework.skynet.core.internal; import java.util.ArrayList; import java.util.Collection; import java.util.logging.Level; - import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; import org.eclipse.osee.framework.core.data.IOseeBranch; @@ -56,10 +55,10 @@ public class AccessPolicyImpl implements AccessPolicy { boolean notMatched = !permissionStatus.matched(); if (notMatched) { - OseeLog.log(Activator.class, level, String.format( + OseeLog.logf(Activator.class, level, "Access Denied - [%s] does not have valid permission to edit item(s) : [%s]%s", user, org.eclipse.osee.framework.jdk.core.util.Collections.toString("; ", objects), - (Strings.isValid(permissionStatus.getReason()) ? "\n reason:[%s]" : ""))); + (Strings.isValid(permissionStatus.getReason()) ? "\n reason:[%s]" : "")); } return notMatched; } @@ -73,7 +72,7 @@ public class AccessPolicyImpl implements AccessPolicy { public boolean isReadOnly(Artifact artifact) { try { return artifact.isDeleted() || artifact.isHistorical() || !artifact.getBranch().isEditable() || !getAccessService().hasPermission( - artifact, PermissionEnum.WRITE); + artifact, PermissionEnum.WRITE); } catch (OseeCoreException ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); return true; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationCache.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationCache.java index 9f71a49301e..8b2fe1d3b83 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationCache.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationCache.java @@ -92,9 +92,9 @@ public class RelationCache { relationsByType.put(new ArtifactKey(artifact), relationType, selectedRelations); } if (selectedRelations.contains(newRelation)) { - OseeLog.log(Activator.class, Level.SEVERE, String.format( + OseeLog.logf(Activator.class, Level.SEVERE, "Duplicate relationByType objects for same relation for Relation [%s] Artifact (%s)[%s]", newRelation, - artifact.getArtId(), artifact.getName())); + artifact.getArtId(), artifact.getName()); } selectedRelations.add(newRelation); } @@ -177,11 +177,11 @@ public class RelationCache { } int size = relations.size(); if (size > 1) { - OseeLog.log( + OseeLog.logf( Activator.class, Level.SEVERE, - String.format("Artifact A [%s] has [%d] relations of same type [%s] to Artifact B [%s]", - artifact.getArtId(), relations.size(), relationType, bArtifactId)); + "Artifact A [%s] has [%d] relations of same type [%s] to Artifact B [%s]", + artifact.getArtId(), relations.size(), relationType, bArtifactId); } return size != 0 ? relations.iterator().next() : null; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java index 42e46c9aa5c..f305f2c8183 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java @@ -81,9 +81,9 @@ public class RelationManager { relation.getBArtifactId() == newRelation.getBArtifactId() && // relation.getRelationType() == newRelation.getRelationType() && // relation != newRelation) { - OseeLog.log(Activator.class, Level.WARNING, String.format( + OseeLog.logf(Activator.class, Level.WARNING, "Duplicate relation objects for same relation for RELATION 1 [%s] RELATION 2 [%s]", relation, - newRelation)); + newRelation); } } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionMonitor.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionMonitor.java index fa619e7b933..dd4db07cc3f 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionMonitor.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/transaction/TransactionMonitor.java @@ -44,9 +44,9 @@ public class TransactionMonitor { // use the same transaction. // This case may happens legitimately if an exception occurs outside this API before transaction.execute() is called, // so it is only notification that this is occurring. - OseeLog.log(Activator.class, Level.SEVERE, - String.format("New transaction [%s] created over Last transaction [%s]", comment, lastComment), - currentTx.getError()); + OseeLog.logf(Activator.class, Level.SEVERE, currentTx.getError(), + "New transaction [%s] created over Last transaction [%s]", comment, lastComment); + } lastComment = comment; txMap.put(key, new TxOperation(transaction)); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/validation/OseeValidator.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/validation/OseeValidator.java index a020f64c317..022db790e4f 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/validation/OseeValidator.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/validation/OseeValidator.java @@ -127,8 +127,8 @@ public class OseeValidator { // loadedObjects.put(attributeType, object); // } // } catch (Exception ex) { - // OseeLog.log(OseeActivator.class, Level.SEVERE, String.format("Unable to Load: [%s - %s]", bundleName, - // className), ex); + // OseeLog.log(OseeActivator.class, Level.SEVERE, ex, "Unable to Load: [%s - %s]", bundleName, + // className); // } // } // } |