|
From: <mba...@us...> - 2007-03-31 18:13:16
|
Revision: 2254
http://svn.sourceforge.net/rubyeclipse/?rev=2254&view=rev
Author: mbarchfe
Date: 2007-03-31 11:13:15 -0700 (Sat, 31 Mar 2007)
Log Message:
-----------
FIX Exception with negative indentation (too many ends)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/formatter/Indents.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/formatter/Indents.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/formatter/Indents.java 2007-03-31 18:01:52 UTC (rev 2253)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/core/formatter/Indents.java 2007-03-31 18:13:15 UTC (rev 2254)
@@ -79,6 +79,9 @@
* @return the indent string
*/
public static String createIndentString(int indentationUnits, Map options) {
+ if (indentationUnits < 0) {
+ return "" ;
+ }
if (options == null || indentationUnits < 0) {
throw new IllegalArgumentException();
}
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java 2007-03-31 18:01:52 UTC (rev 2253)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/formatter/TC_CodeFormatter.java 2007-03-31 18:13:15 UTC (rev 2254)
@@ -126,6 +126,10 @@
public void testLiteralsStartingWithPercentSign() {
this.doTest("LiteralsStartingWithPercentSign");
+ }
+
+ public void testNegativeIndentation() {
+ this.doTest("NegativeIndentation");
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|