1.1 --- a/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/PlsqlValidateFilesSummary.java Wed Apr 17 18:54:39 2013 +0200
1.2 +++ b/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/PlsqlValidateFilesSummary.java Fri Apr 19 11:03:52 2013 +0200
1.3 @@ -59,6 +59,7 @@
1.4
1.5 /**
1.6 * Action that valitates files in the component folder and provide a summary
1.7 + *
1.8 * @author YADHLK
1.9 */
1.10 public class PlsqlValidateFilesSummary extends CookieAction {
1.11 @@ -76,7 +77,6 @@
1.12 @Override
1.13 protected void performAction(final Node[] activatedNodes) {
1.14 RequestProcessor.getDefault().post(new Runnable() {
1.15 -
1.16 @Override
1.17 public void run() {
1.18 ProgressHandle handle = ProgressHandleFactory.createHandle("Validating files of the component...");
1.19 @@ -131,13 +131,14 @@
1.20 int warnings = 0;
1.21 for (Integer offset : annotations.keySet()) {
1.22 List<PlsqlAnnotation> lstAnnotation = annotations.get(offset);
1.23 - for (PlsqlAnnotation annotation: lstAnnotation) {
1.24 + for (PlsqlAnnotation annotation : lstAnnotation) {
1.25 int severity = annotation.getSeverity();
1.26 - if (severity == PlsqlAnnotation.ERROR)
1.27 + if (severity == PlsqlAnnotation.CRITICAL || severity == PlsqlAnnotation.BLOCKER || severity == PlsqlAnnotation.MAJOR) {
1.28 errors++;
1.29 - else
1.30 + } else {
1.31 warnings++;
1.32 - }
1.33 + }
1.34 + }
1.35 }
1.36 io.getOut().print(" " + errors + " errors and " + warnings + " warnings found.\n");
1.37 }
2.1 --- a/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/annotations/PlsqlAnnotation.java Wed Apr 17 18:54:39 2013 +0200
2.2 +++ b/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/annotations/PlsqlAnnotation.java Fri Apr 19 11:03:52 2013 +0200
2.3 @@ -69,11 +69,14 @@
2.4
2.5 public static final String GENERAL = "General PL/SQL Rules";
2.6 public static final String IFS_SPECIFIC = "IFS specific PL/SQL Rules";
2.7 - public static final int ERROR = 1;
2.8 - public static final int WARNING = 2;
2.9 + public static final int BLOCKER = 1;
2.10 + public static final int CRITICAL = 2;
2.11 + public static final int MAJOR = 3;
2.12 + public static final int MINOR = 4;
2.13 + public static final int INFO = 5;
2.14 public int offset = 0;
2.15 public int ignoreOffset = -1;
2.16 - public int severity = WARNING;
2.17 + public int severity = MINOR;
2.18 String category = IFS_SPECIFIC;
2.19
2.20 public abstract String getErrorToolTip();
2.21 @@ -168,7 +171,7 @@
2.22 Date date = new Date();
2.23 return dateFormat.format(date);
2.24 }
2.25 -
2.26 +
2.27 private String getDate() {
2.28 DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
2.29 Date date = new Date();
3.1 --- a/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/annotations/PlsqlCursorWhereAnnotation.java Wed Apr 17 18:54:39 2013 +0200
3.2 +++ b/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/annotations/PlsqlCursorWhereAnnotation.java Fri Apr 19 11:03:52 2013 +0200
3.3 @@ -64,7 +64,7 @@
3.4 public PlsqlCursorWhereAnnotation(int offset, int ignoreOffset) {
3.5 this.offset = offset;
3.6 this.ignoreOffset = ignoreOffset;
3.7 - this.severity = ERROR;
3.8 + this.severity = CRITICAL;
3.9 this.category = GENERAL;
3.10 }
3.11
4.1 --- a/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/annotations/PlsqlFunctionReturnAnnotation.java Wed Apr 17 18:54:39 2013 +0200
4.2 +++ b/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/annotations/PlsqlFunctionReturnAnnotation.java Fri Apr 19 11:03:52 2013 +0200
4.3 @@ -52,6 +52,7 @@
4.4
4.5 /**
4.6 * Check for missing return statements in functions
4.7 + *
4.8 * @author YADHLK
4.9 */
4.10 public class PlsqlFunctionReturnAnnotation extends PlsqlBlockAnnotation {
4.11 @@ -63,10 +64,10 @@
4.12 return new PlsqlFunctionReturnAnnotation();
4.13 }
4.14
4.15 - public PlsqlFunctionReturnAnnotation(int offset, int ignoreOffset, int severity) {
4.16 + public PlsqlFunctionReturnAnnotation(int offset, int ignoreOffset, int isReturn) {
4.17 this.offset = offset;
4.18 this.ignoreOffset = ignoreOffset;
4.19 - this.severity = severity;
4.20 + this.severity = isReturn == 1 ? MINOR : CRITICAL;
4.21 this.category = GENERAL;
4.22 }
4.23
4.24 @@ -82,37 +83,38 @@
4.25
4.26 @Override
4.27 public String getShortDescription() {
4.28 - if (this.severity == WARNING) {
4.29 - return NbBundle.getMessage(this.getClass(), "function_return_annotation_warning");
4.30 - } else {
4.31 - return NbBundle.getMessage(this.getClass(), "function_return_annotation");
4.32 - }
4.33 + if (this.severity == MINOR) {
4.34 + return NbBundle.getMessage(this.getClass(), "function_return_annotation_warning");
4.35 + } else {
4.36 + return NbBundle.getMessage(this.getClass(), "function_return_annotation");
4.37 + }
4.38 }
4.39
4.40 - @Override
4.41 - public void evaluateAnnotation(Map<Integer, List<PlsqlAnnotation>> annotationsToAdd, Document doc, PlsqlBlock block, Document specDoc, PlsqlBlockFactory specBlockFac) {
4.42 - int isReturn = PlsqlMethodAnnotationUtil.isReturnExist(doc, block);
4.43 - int ignoreMarkerOffset = isIgnoreSpecified(doc, block.getStartOffset(), getIgnoreKey(), true);
4.44 - boolean exists = false;
4.45 + @Override
4.46 + public void evaluateAnnotation(Map<Integer, List<PlsqlAnnotation>> annotationsToAdd, Document doc, PlsqlBlock block, Document specDoc, PlsqlBlockFactory specBlockFac) {
4.47 + int isReturn = PlsqlMethodAnnotationUtil.isReturnExist(doc, block);
4.48 + int ignoreMarkerOffset = isIgnoreSpecified(doc, block.getStartOffset(), getIgnoreKey(), true);
4.49 + boolean exists = false;
4.50
4.51 - if (isReturn > 0) {
4.52 - exists = true;
4.53 - PlsqlFunctionReturnAnnotation annotation = new PlsqlFunctionReturnAnnotation(block.getStartOffset(), block.getStartOffset(), isReturn);
4.54 - if (annotation != null) {
4.55 - if (!isIgnoreAlowed() || -1 == ignoreMarkerOffset) {
4.56 - PlsqlAnnotationUtil.addAnnotation(annotation, annotationsToAdd);
4.57 - }
4.58 - checkIgnoreAnnotation(annotationsToAdd, getIgnoreKey(), ignoreMarkerOffset, exists);
4.59 + if (isReturn > 0) {
4.60 + exists = true;
4.61 + PlsqlFunctionReturnAnnotation annotation = new PlsqlFunctionReturnAnnotation(block.getStartOffset(), block.getStartOffset(), isReturn);
4.62 + if (annotation != null) {
4.63 + if (!isIgnoreAlowed() || -1 == ignoreMarkerOffset) {
4.64 + PlsqlAnnotationUtil.addAnnotation(annotation, annotationsToAdd);
4.65 }
4.66 - }
4.67 - }
4.68 + checkIgnoreAnnotation(annotationsToAdd, getIgnoreKey(), ignoreMarkerOffset, exists);
4.69 + }
4.70 + }
4.71 + }
4.72
4.73 @Override
4.74 public Action[] getActions() {
4.75 - if (isIgnoreAlowed())
4.76 + if (isIgnoreAlowed()) {
4.77 return new Action[]{new AddIgnoreMarkerAction()};
4.78 - else
4.79 + } else {
4.80 return new Action[0];
4.81 + }
4.82 }
4.83
4.84 @Override
5.1 --- a/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/annotations/PlsqlIfNullAnnotation.java Wed Apr 17 18:54:39 2013 +0200
5.2 +++ b/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/annotations/PlsqlIfNullAnnotation.java Fri Apr 19 11:03:52 2013 +0200
5.3 @@ -64,7 +64,7 @@
5.4 public PlsqlIfNullAnnotation(int offset, int ignoreOffset) {
5.5 this.offset = offset;
5.6 this.ignoreOffset = ignoreOffset;
5.7 - this.severity = ERROR;
5.8 + this.severity = CRITICAL;
5.9 this.category = GENERAL;
5.10 }
5.11
6.1 --- a/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/annotations/PlsqlUnreachableAnnotation.java Wed Apr 17 18:54:39 2013 +0200
6.2 +++ b/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/annotations/PlsqlUnreachableAnnotation.java Fri Apr 19 11:03:52 2013 +0200
6.3 @@ -69,7 +69,7 @@
6.4 public PlsqlUnreachableAnnotation(int offset, int ignoreOffset) {
6.5 this.offset = offset;
6.6 this.ignoreOffset = ignoreOffset;
6.7 - this.severity = ERROR;
6.8 + this.severity = MAJOR;
6.9 this.category = GENERAL;
6.10 }
6.11
7.1 --- a/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/annotations/PlsqlWrongEndNameAnnotation.java Wed Apr 17 18:54:39 2013 +0200
7.2 +++ b/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/annotations/PlsqlWrongEndNameAnnotation.java Fri Apr 19 11:03:52 2013 +0200
7.3 @@ -73,7 +73,7 @@
7.4 this.existingName = existingName;
7.5 this.offset = offset;
7.6 this.ignoreOffset = ignoreOffset;
7.7 - this.severity = ERROR;
7.8 + this.severity = CRITICAL;
7.9 this.category = GENERAL;
7.10 }
7.11
8.1 --- a/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/annotations/PlsqlWrongParamOrderAnnotation.java Wed Apr 17 18:54:39 2013 +0200
8.2 +++ b/PLSQL/Annotation/src/org/netbeans/modules/plsql/annotation/annotations/PlsqlWrongParamOrderAnnotation.java Fri Apr 19 11:03:52 2013 +0200
8.3 @@ -57,7 +57,7 @@
8.4 import org.openide.util.NbBundle;
8.5
8.6 /**
8.7 - * Check for correct method param oder (OUT, IN OUT or IN, DEFAULT) and warn
8.8 + * Check for correct method param oder (OUT, IN OUT or IN, DEFAULT) and warn
8.9 */
8.10 public class PlsqlWrongParamOrderAnnotation extends PlsqlBlockAnnotation {
8.11
8.12 @@ -72,6 +72,7 @@
8.13 super();
8.14 this.offset = offset;
8.15 this.ignoreOffset = ignoreOffset;
8.16 + this.severity = INFO;
8.17 this.category = GENERAL;
8.18 }
8.19
8.20 @@ -142,7 +143,7 @@
8.21 }
8.22 pre = type;
8.23 }
8.24 - }
8.25 + }
8.26 }
8.27
8.28 private int getParamOrderNo(final String param) {