ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From james-mas...@apache.org
Subject svn commit: r1789840 - /ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetector.java
Date Sat, 01 Apr 2017 20:25:13 GMT
Author: james-masanz
Date: Sat Apr  1 20:25:13 2017
New Revision: 1789840

URL: http://svn.apache.org/viewvc?rev=1789840&view=rev
Log:
CTAKES-275 method declares throws IOException, so throw that if get NPE for can't find parent
dir because file not found

Modified:
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetector.java

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetector.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetector.java?rev=1789840&r1=1789839&r2=1789840&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetector.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SentenceDetector.java
Sat Apr  1 20:25:13 2017
@@ -349,7 +349,12 @@ public class SentenceDetector extends JC
 
 	public static File getFileInExistingDir(String fn) throws IOException {
 		File f = new File(fn);
-		if (!f.getParentFile().isDirectory()) {
+		File parent = f.getParentFile();
+		if (parent == null) {
+			throw new IOException("Parent of directory not found: "
+					+ f.getAbsolutePath());
+		}
+		if (!parent.isDirectory()) {
 			throw new IOException("Directory not found: "
 					+ f.getParentFile().getAbsolutePath());
 		}



Mime
View raw message