Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2016-10-14 06:03:22 -0400
committerDani Megert2016-10-14 06:03:22 -0400
commit9e81f5ff60dca59cfd31ba8a1cef5df509411024 (patch)
tree94a9e314c97231c442a975d6d895582dd8889d08 /org.eclipse.text
parentda54f96015b05dab151abff845f23306c368605c (diff)
downloadeclipse.platform.text-9e81f5ff60dca59cfd31ba8a1cef5df509411024.tar.gz
eclipse.platform.text-9e81f5ff60dca59cfd31ba8a1cef5df509411024.tar.xz
eclipse.platform.text-9e81f5ff60dca59cfd31ba8a1cef5df509411024.zip
Fixed bug 505958: [implementation] org.eclipse.jface.text.TextUtilities.getDefaultLineDelimiter(IDocument) can return nullY20161020-1000Y20161018-1100I20161018-0800
Diffstat (limited to 'org.eclipse.text')
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java b/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java
index df2e9ad50..9ccd5e9ab 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* 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
@@ -481,12 +481,14 @@ public class TextUtilities {
* @since 3.0
*/
public static String getDefaultLineDelimiter(IDocument document) {
-
- if (document instanceof IDocumentExtension4)
- return ((IDocumentExtension4)document).getDefaultLineDelimiter();
-
String lineDelimiter= null;
+ if (document instanceof IDocumentExtension4) {
+ lineDelimiter= ((IDocumentExtension4) document).getDefaultLineDelimiter();
+ if (lineDelimiter != null)
+ return lineDelimiter;
+ }
+
try {
lineDelimiter= document.getLineDelimiter(0);
} catch (BadLocationException x) {

Back to the top