W035 Uninitialized Constant
[Previous]  [Next] 
|
User Manual [Previous]  [Next] W035 Uninitialized ConstantUmple semantic warning generated when a Umple builtin data type constant is not initializedIt makes little sense to have a constant unless it is given a value. If a constant is of one of the built-in Umple data types we will set it to a default value: Integer, Double and Float will be set to zero, String will be set to an empty String, Boolean will be set to false, Date will be set to the date where the code was generated and Time will be set to midnight (00:00:00). However, the warning is issued since forgetting to initialize a constant is a common source of errors. Example// The following will generate this warning class X { const String A; //same as const String a = ""; } Load the above code into UmpleOnline Solution to The Above So the Message No Longer Appears// The following will resolve the issue class X { const String A = "Something Interesting"; } Load the above code into UmpleOnline |