You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sdap.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/06/05 18:29:00 UTC

[jira] [Commented] (SDAP-75) Fix bugs in AggregateTriples.java

    [ https://issues.apache.org/jira/browse/SDAP-75?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16502251#comment-16502251 ] 

ASF GitHub Bot commented on SDAP-75:
------------------------------------

lewismc closed pull request #22: SDAP-75
URL: https://github.com/apache/incubator-sdap-mudrod/pull/22
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core/src/main/java/org/apache/sdap/mudrod/ontology/pre/AggregateTriples.java b/core/src/main/java/org/apache/sdap/mudrod/ontology/pre/AggregateTriples.java
index f1a9c04..e32c0f7 100644
--- a/core/src/main/java/org/apache/sdap/mudrod/ontology/pre/AggregateTriples.java
+++ b/core/src/main/java/org/apache/sdap/mudrod/ontology/pre/AggregateTriples.java
@@ -62,30 +62,27 @@ public Object execute() {
       e2.printStackTrace();
     }
 
-    FileWriter fw;
-    try {
-      fw = new FileWriter(file.getAbsoluteFile());
+    try(FileWriter fw = new FileWriter(file.getAbsoluteFile())){
       bw = new BufferedWriter(fw);
-    } catch (IOException e) {
-      e.printStackTrace();
-    }
-
-    File[] files = new File(this.props.getProperty(MudrodConstants.ONTOLOGY_INPUT_PATH)).listFiles();
-    for (File file_in : files) {
-      String ext = FilenameUtils.getExtension(file_in.getAbsolutePath());
-      if ("owl".equals(ext)) {
-        try {
-          loadxml(file_in.getAbsolutePath());
-          getAllClass();
-        } catch (JDOMException e1) {
-          e1.printStackTrace();
-        } catch (IOException e1) {
-          e1.printStackTrace();
+      File[] files = new File(this.props.getProperty(MudrodConstants.ONTOLOGY_INPUT_PATH)).listFiles();
+      for (File fileIn : files) {
+        String ext = FilenameUtils.getExtension(fileIn.getAbsolutePath());
+        if ("owl".equals(ext)) {
+          try {
+            loadXml(fileIn.getAbsolutePath());
+            getAllClass();
+          } catch (JDOMException e1) {
+            e1.printStackTrace();
+          } catch (IOException e1) {
+            e1.printStackTrace();
+          }
+  
         }
-
       }
+    } catch (IOException e) {
+      e.printStackTrace();
     }
-
+    
     try {
       bw.close();
     } catch (IOException e) {
@@ -109,7 +106,7 @@ public Object execute() {
    * @throws JDOMException JDOMException
    * @throws IOException   IOException
    */
-  public void loadxml(String filePathName) throws JDOMException, IOException {
+  public void loadXml(String filePathName) throws JDOMException, IOException {
     SAXBuilder saxBuilder = new SAXBuilder();
     File file = new File(filePathName);
 
diff --git a/core/src/main/java/org/apache/sdap/mudrod/ontology/process/OntologyLinkCal.java b/core/src/main/java/org/apache/sdap/mudrod/ontology/process/OntologyLinkCal.java
index 0c5301d..23fa348 100644
--- a/core/src/main/java/org/apache/sdap/mudrod/ontology/process/OntologyLinkCal.java
+++ b/core/src/main/java/org/apache/sdap/mudrod/ontology/process/OntologyLinkCal.java
@@ -91,6 +91,7 @@ public Object execute() {
       e.printStackTrace();
     } catch (InterruptedException e) {
       e.printStackTrace();
+      Thread.currentThread().interrupt();
     } catch (ExecutionException e) {
       e.printStackTrace();
     } finally {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Fix bugs in AggregateTriples.java
> ---------------------------------
>
>                 Key: SDAP-75
>                 URL: https://issues.apache.org/jira/browse/SDAP-75
>             Project: Apache Science Data Analytics Platform
>          Issue Type: Bug
>          Components: mudrod
>            Reporter: Yun Li
>            Priority: Major
>             Fix For: 0.1
>
>
> Fix bugs found in AggregateTriple by sonar coverage @[~lewismc] 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)