]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.issues.common/src/org/simantics/issues/common/CountModelIssuesBySeverity.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.issues.common / src / org / simantics / issues / common / CountModelIssuesBySeverity.java
index 79cf7377ae1d25a6454aa1dd69b892543bbbe3ad..923c29ce4bd9456b9eca72979b97af701e1b59de 100644 (file)
@@ -1,52 +1,52 @@
-/*******************************************************************************\r
- * Copyright (c) 2013 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- *     VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.issues.common;\r
-\r
-import gnu.trove.map.TObjectIntMap;\r
-import gnu.trove.map.hash.TObjectIntHashMap;\r
-\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.common.request.ObjectsWithType;\r
-import org.simantics.db.common.request.TernaryRead;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.issues.Severity;\r
-import org.simantics.issues.ontology.IssueResource;\r
-import org.simantics.layer0.Layer0;\r
-\r
-/**\r
- * @author Tuukka Lehtonen\r
- * @see CountModelIssuesWithSeverity\r
- */\r
-public class CountModelIssuesBySeverity extends TernaryRead<Resource, Boolean, Severity, TObjectIntMap<Severity>> {\r
-\r
-    public CountModelIssuesBySeverity(Resource model, boolean onlyUnresolved, Severity minSeverity) {\r
-        super(model, onlyUnresolved, minSeverity);\r
-    }\r
-\r
-    @Override\r
-    public TObjectIntMap<Severity> perform(ReadGraph graph) throws DatabaseException {\r
-        Layer0 L0 = Layer0.getInstance(graph);\r
-        IssueResource ISSUE = IssueResource.getInstance(graph);\r
-\r
-        TObjectIntMap<Severity> result = new TObjectIntHashMap<Severity>();\r
-        for (Resource issue : graph.syncRequest(new ObjectsWithType(parameter, L0.ConsistsOf, ISSUE.Issue))) {\r
-            if (parameter2 && graph.hasStatement(issue, ISSUE.Resolved))\r
-                continue;\r
-            Severity s = IssueUtils.toSeverity(ISSUE, graph.getPossibleObject(issue, ISSUE.Issue_HasSeverity));\r
-            if (null != s && s.compareTo(parameter3) <= 0)\r
-                result.adjustOrPutValue(s, 1, 1);\r
-        }\r
-        return result;\r
-    }\r
-\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2013 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.issues.common;
+
+import gnu.trove.map.TObjectIntMap;
+import gnu.trove.map.hash.TObjectIntHashMap;
+
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.common.request.ObjectsWithType;
+import org.simantics.db.common.request.TernaryRead;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.issues.Severity;
+import org.simantics.issues.ontology.IssueResource;
+import org.simantics.layer0.Layer0;
+
+/**
+ * @author Tuukka Lehtonen
+ * @see CountModelIssuesWithSeverity
+ */
+public class CountModelIssuesBySeverity extends TernaryRead<Resource, Boolean, Severity, TObjectIntMap<Severity>> {
+
+    public CountModelIssuesBySeverity(Resource model, boolean onlyUnresolved, Severity minSeverity) {
+        super(model, onlyUnresolved, minSeverity);
+    }
+
+    @Override
+    public TObjectIntMap<Severity> perform(ReadGraph graph) throws DatabaseException {
+        Layer0 L0 = Layer0.getInstance(graph);
+        IssueResource ISSUE = IssueResource.getInstance(graph);
+
+        TObjectIntMap<Severity> result = new TObjectIntHashMap<Severity>();
+        for (Resource issue : graph.syncRequest(new ObjectsWithType(parameter, L0.ConsistsOf, ISSUE.Issue))) {
+            if (parameter2 && graph.hasStatement(issue, ISSUE.Resolved))
+                continue;
+            Severity s = IssueUtils.toSeverity(ISSUE, graph.getPossibleObject(issue, ISSUE.Issue_HasSeverity));
+            if (null != s && s.compareTo(parameter3) <= 0)
+                result.adjustOrPutValue(s, 1, 1);
+        }
+        return result;
+    }
+
+}