Skip to content
Snippets Groups Projects
Commit b58c7816 authored by Dominique Marcadet's avatar Dominique Marcadet
Browse files

use console.warning() if diagnostic severity is WARNING

parent b5d3e34e
No related branches found
No related tags found
1 merge request!11Resolve "complete validation by NSD"
...@@ -58,7 +58,7 @@ public class RiseClipseValidatorSCL { ...@@ -58,7 +58,7 @@ public class RiseClipseValidatorSCL {
private static boolean oclValidation = false; private static boolean oclValidation = false;
private static boolean nsdValidation = false; private static boolean nsdValidation = false;
@NonNull private static IRiseClipseConsole console; private static IRiseClipseConsole console;
private static void usage() { private static void usage() {
console.setLevel( IRiseClipseConsole.INFO_LEVEL ); console.setLevel( IRiseClipseConsole.INFO_LEVEL );
...@@ -247,17 +247,34 @@ public class RiseClipseValidatorSCL { ...@@ -247,17 +247,34 @@ public class RiseClipseValidatorSCL {
List< ? > data = childDiagnostic.getData(); List< ? > data = childDiagnostic.getData();
EObject object = ( EObject ) data.get( 0 ); EObject object = ( EObject ) data.get( 0 );
if( data.size() == 1 ) { if( data.size() == 1 ) {
console.error( childDiagnostic.getMessage() ); if( childDiagnostic.getSeverity() == Diagnostic.ERROR ) {
console.error( childDiagnostic.getMessage() );
}
else {
console.warning( childDiagnostic.getMessage() );
}
} }
else if( data.get( 1 ) instanceof EAttribute ) { else if( data.get( 1 ) instanceof EAttribute ) {
EAttribute attribute = ( EAttribute ) data.get( 1 ); EAttribute attribute = ( EAttribute ) data.get( 1 );
if( attribute == null ) continue; if( attribute == null ) continue;
console.error( "\tAttribute " + attribute.getName() + " of " if( childDiagnostic.getSeverity() == Diagnostic.ERROR ) {
+ substitutionLabelProvider.getObjectLabel( object ) + " : " console.error( "\tAttribute " + attribute.getName() + " of "
+ childDiagnostic.getChildren().get( 0 ).getMessage() ); + substitutionLabelProvider.getObjectLabel( object ) + " : "
+ childDiagnostic.getChildren().get( 0 ).getMessage() );
}
else {
console.warning( "\tAttribute " + attribute.getName() + " of "
+ substitutionLabelProvider.getObjectLabel( object ) + " : "
+ childDiagnostic.getChildren().get( 0 ).getMessage() );
}
} }
else { else {
console.error( childDiagnostic.getMessage() ); if( childDiagnostic.getSeverity() == Diagnostic.ERROR ) {
console.error( childDiagnostic.getMessage() );
}
else {
console.warning( childDiagnostic.getMessage() );
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment