uOttawaUniversity of Ottawa - Canadas University
list of dots

Umple User Manual    [Previous]   [Next]   

Loading

W1002-3 Unexpected Embedded Code

Umple warning reported when embedded code is found in a native language like Java, PHP or C++, yet 'strictness' has been set indicating this should not occur.

If strictness is set to 'modelOnly', this means that the developer intends to only include classes, associations, state machines and other modeling elements, but not embedded code in another programming language, not even method bodies.

If strictness is set to 'noExtraCode', it is the same as the above, except that method bodies are allowed.

This warning is issued when strictness has been set to one of the above, yet Umple has encountered sytax that interprets as either a method body or some other code in a class that it cannot parse, and is assuming it is native code to be passed to the native compiler.

This warning can often happen when the programmer/modeler wrote Umple code with a syntax error, so Umple thinks it is not Umple, but some other language. Here are some things to try in order to resolve this warning:

  • Add spaces before and after Umple syntactic elements such as the -> or -- of an association.
  • Check that you have terminated statements with semicolons where needed.
  • Ensure your parentheses and quotes match everywhere. An extra or missing { or } can often cause this warning.
  • Look at the examples of sytax in the user manual pages for such items as associations and state machines, and compare them to what you have provided.
  • Check the grammar for the elements you are trying to specify in the user manual grammar page.

Example

// The following example shows how to generate this warning.
strictness modelOnly;
class X {
  public static void main() {
    System.out.println("Hello World");
  }
}

      

Load the above code into UmpleOnline