PLSQL formatting issue when CASE and IF statements are together release701
authorSubhashini Sooriarachchi <subslk@netbeans.org>
Mon, 06 Feb 2012 09:51:52 +0530
branchrelease701
changeset 1581751a7043208
parent 157 79db7e913ba4
child 159 4939baf51da4
PLSQL formatting issue when CASE and IF statements are together
PLSQL/Formatter/src/org/netbeans/modules/plsql/format/PlsqlFormatter.java
     1.1 --- a/PLSQL/Formatter/src/org/netbeans/modules/plsql/format/PlsqlFormatter.java	Sat Feb 04 10:44:20 2012 +0530
     1.2 +++ b/PLSQL/Formatter/src/org/netbeans/modules/plsql/format/PlsqlFormatter.java	Mon Feb 06 09:51:52 2012 +0530
     1.3 @@ -726,8 +726,9 @@
     1.4                          && (!imageTmpPre.equalsIgnoreCase(";")))
     1.5                          || (imageTmp.equalsIgnoreCase("LOOP")
     1.6                          && (!imageTmpPre.equalsIgnoreCase(";")))
     1.7 -                        || (imageTmp.equalsIgnoreCase("BEGIN"))                       
     1.8 -                        || (imageTmp.equalsIgnoreCase("CASE"))
     1.9 +	    || (imageTmp.equalsIgnoreCase("CASE")
    1.10 +                        && (!imageTmpPre.equalsIgnoreCase(";")))
    1.11 +	    || (imageTmp.equalsIgnoreCase("BEGIN"))
    1.12                          || (imageTmp.equalsIgnoreCase("PACKAGE"))) {
    1.13                      isParent = true;
    1.14                  }
    1.15 @@ -1493,16 +1494,10 @@
    1.16                  String imageTmp = tokenTemp.getImage().trim();
    1.17  
    1.18                  //If we have reached the beginning of a block stop
    1.19 -                if ((imageTmp.equalsIgnoreCase("IF"))
    1.20 -                        || (imageTmp.equalsIgnoreCase("ELSE"))
    1.21 -	    || (imageTmp.equalsIgnoreCase("$IF"))
    1.22 -	    || (imageTmp.equalsIgnoreCase("$ELSE"))
    1.23 -	    || (imageTmp.equalsIgnoreCase("$ELSIF"))
    1.24 -	    || (imageTmp.equalsIgnoreCase("$ERROR"))
    1.25 +                if ( (imageTmp.equalsIgnoreCase("$ERROR"))
    1.26                          || (imageTmp.equalsIgnoreCase("BEGIN"))
    1.27                          || (imageTmp.equalsIgnoreCase("EXCEPTION"))
    1.28 -                        || (imageTmp.equalsIgnoreCase("LOOP"))
    1.29 -                        || (imageTmp.equalsIgnoreCase("ELSIF"))) {
    1.30 +                        || (imageTmp.equalsIgnoreCase("LOOP"))) {
    1.31                      break;
    1.32                  } else if ((imageTmp.equalsIgnoreCase(";"))
    1.33                          && (tokenThen != null)) {