Commit 5ae14e55 authored by Lionel Seinturier's avatar Lionel Seinturier
Browse files

Typing and final.

parent e6fa04a8
......@@ -91,7 +91,7 @@ public class SCAUltraMerge extends AbstractUltraMerge {
String refName = refNames.get(umfield);
if( refName == null ) {
// Defensive programming. Shouldn't occur.
String msg =
final String msg =
"Unexpected case. No reference name for field: "+
SpoonHelper.toEclipseClickableString(ctfield);
throw new TinfiRuntimeException(msg);
......@@ -210,7 +210,7 @@ public class SCAUltraMerge extends AbstractUltraMerge {
List<CtTypeReference<?>> genericTypes =
fieldType.getActualTypeArguments();
if( genericTypes==null || genericTypes.size()!=1 ) {
String msg =
final String msg =
SpoonHelper.toEclipseClickableString(ctfield)+
" expected to be of type List<K>";
throw new JuliacRuntimeException(msg);
......@@ -264,7 +264,7 @@ public class SCAUltraMerge extends AbstractUltraMerge {
*/
String value = scope.value();
if( !value.equals("STATELESS") && !value.equals("COMPOSITE") ) {
String msg =
final String msg =
"Unsupported scope "+value+" for component class: "+
umclassname;
throw new IllegalComponentCodeException(msg);
......@@ -307,7 +307,7 @@ public class SCAUltraMerge extends AbstractUltraMerge {
*/
String methName = method.getSimpleName();
if( methName.length()<4 || !methName.startsWith("set") ) {
String msg =
final String msg =
"Illegal name ("+methName+
") for @Reference annotated setter method: "+
SpoonHelper.toEclipseClickableString(ctmethod);
......@@ -328,10 +328,10 @@ public class SCAUltraMerge extends AbstractUltraMerge {
* Check that the body of the method is of the form
* this.field = value;
*/
CtBlock body = ctmethod.getBody(); // CtBlock instead of CtBlock<?> for compiling with javac
CtBlock<?> body = ctmethod.getBody(); // CtBlock instead of CtBlock<?> for compiling with javac
List<CtStatement> stats = body.getStatements();
if( stats.size() != 1 ) {
String msg =
final String msg =
"Setter method body does not contain one and only one "+
"statement: "+
SpoonHelper.toEclipseClickableString(ctmethod);
......@@ -340,7 +340,7 @@ public class SCAUltraMerge extends AbstractUltraMerge {
CtStatement stat = stats.get(0);
if( ! (stat instanceof CtAssignment<?,?>) ) {
String msg =
final String msg =
"Illegal setter method body. Not an assignment. "+stat;
throw new IllegalComponentCodeException(msg);
}
......@@ -349,7 +349,7 @@ public class SCAUltraMerge extends AbstractUltraMerge {
if( ! (assigned instanceof CtFieldAccess<?>) ) {
if( ! (stat instanceof CtAssignment<?,?>) ) {
String msg =
final String msg =
"Illegal setter method body. Not a field access. "+stat;
throw new IllegalComponentCodeException(msg);
}
......@@ -360,7 +360,7 @@ public class SCAUltraMerge extends AbstractUltraMerge {
String qname = tref.getQualifiedName();
if( ! qname.equals(umclassname) ) {
String msg =
final String msg =
"Illegal setter method body. Field from class "+qname+
" referenced instead of a field from the current class "+
umclassname+". "+stat;
......@@ -484,7 +484,7 @@ public class SCAUltraMerge extends AbstractUltraMerge {
Map<UMField<?>,String> refNameByUMClass =
refNamesByUMClass.get(umclassname);
if( refNameByUMClass == null ) {
String msg =
final String msg =
"Unexpected exception. No reference names for class: "+umclass;
throw new TinfiRuntimeException(msg);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment