Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2009-04-01 12:26:11 +0000
committerDani Megert2009-04-01 12:26:11 +0000
commit0bfe648f0a16ba273e1e20378db8d6b84883eece (patch)
treeadd556bdbe36e41c0baf7ad329a241a23302c439
parent8fbfc58c79473716045575e507fde34fadbca458 (diff)
downloadeclipse.platform.text-20090429-1800a.tar.gz
eclipse.platform.text-20090429-1800a.tar.xz
eclipse.platform.text-20090429-1800a.zip
Clarified Javadoc regarding getNumberOfLines().v20090429-1800a
-rw-r--r--org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentTest.java9
-rw-r--r--org.eclipse.text/src/org/eclipse/jface/text/ILineTracker.java7
2 files changed, 13 insertions, 3 deletions
diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentTest.java
index c0fa842aa..b852dac69 100644
--- a/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentTest.java
+++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/DocumentTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 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
@@ -105,6 +105,13 @@ public class DocumentTest extends TestCase {
fDocument= null;
}
+
+ public void testEmptyDocument() {
+ IDocument document= new Document();
+ int lines= document.getNumberOfLines();
+ assertEquals(1, lines);
+ }
+
public void testDelete1() {
try {
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/ILineTracker.java b/org.eclipse.text/src/org/eclipse/jface/text/ILineTracker.java
index 9da272733..d2903c9d3 100644
--- a/org.eclipse.text/src/org/eclipse/jface/text/ILineTracker.java
+++ b/org.eclipse.text/src/org/eclipse/jface/text/ILineTracker.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 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
@@ -62,7 +62,10 @@ public interface ILineTracker {
/**
* Returns the number of lines.
- *
+ * <p>
+ * Note that a document always has at least one line.
+ * </p>
+ *
* @return the number of lines in this tracker's line structure
*/
int getNumberOfLines();

Back to the top