Errors/Warnings

Indicate your preferences for the Errors/Warnings settings on the Opens the Errors/Warnings preference page VJET > Validators > Errors/Warnings preference page.

VJET Specific

Option Description Default Example
Vjo syntax isn't correct When enabled, the compiler will issue an error or a warning whenever it encounters a Vjo syntax error. Error  
Missing endType When enabled, the compiler will issue an error or a warning whenever a endType is missing. Error  
Class name cannot have numeric token When enabled, the compiler will issue an error or a warning whenever it encounters a numeric token in the class name. Error  
OType should not have inner type When enabled, the compiler will issue an error or a warning whenever it encounters an inner type in the OType. Error  
OType should not have none object literal typed property When enabled, the compiler will issue an error or a warning whenever it encounters none object literal typed property in OType(such as int type). Error  
Main class should be public When enabled, the compiler will issue an error or a warning whenever a main class is not declared as public. Warnings  
Multiple protos When enabled, the compiler will issue an error or a warning whenever it encounters more than one protos in the field. Error  
Redundant import When enabled, the compiler will issue an error or a warning whenever it encounters redundant import. Warning  
Multiple props When enabled, the compiler will issue an error or a warning whenever it encounters more than one props in the field. Error  
IType cannot have none-public modifier When enabled, the compiler will issue an error or a warning whenever it encounters none-public modifier in IType. Error  
Multiple inherits When enabled, the compiler will issue an error or a warning whenever it encounters more than one inherits. Error  
OType should not be as inner type When enabled, the compiler will issue an error or a warning whenever it encounters OType being an inner type. Error  
IType shouldn't define method body When enabled, the compiler will issue an error or a warning whenever it encounters IType defines a method body. Error  
IType shouldn't define instance property When enabled, the compiler will issue an error or a warning whenever it encounters IType defines an instance property. Error  
Public class should reside in corresponding file path When enabled, the compiler will issue an error or a warning whenever it encounters the public class does not reside in corresponding file path.
( The public class path does not match the corresponding file path )
Warning  
Unknown type, missing import When enabled, the compiler will issue an error or a warning whenever it encounters an unknown type and does not find its import. Warning The type exists in other .js file, but not imported into current file
Unknown type, not found in type space When enabled, the compiler will issue an error or a warning whenever it encounters an unknown type and does not find its definition in context. Error The type does not exist. So when you're calling this type, an error/warning message will show in the problems view.
namespace collision When enabled, the compiler will issue an error or a warning whenever it encounters duplicate namespace. Error  
invalid indentifier found When enabled, the compiler will issue an error or a warning whenever it encounters an invalid indentifier. Error  

Accessibility violation

Option Description Default Example
package is not found in the scope When enabled, the compiler will issue an error or a warning whenever the package is not found in the scope. Error  
Can't access none-static method from static context When enabled, the compiler will issue an error or a warning whenever it encounters any none-static method access from props(static). Error  
Property isn't visible in the context When enabled, the compiler will issue an error or a warning whenever it encounters an invisible property but displays in the context. Warning A property(as : 1) is declared as private in other .js file.
So when you're calling this property in other .js file( new this.vj$.Sample.as ), an error/warning will show in the problems view.
Can't access static method from none-static context When enabled, the compiler will issue an error or a warning whenever it encounters any static method access from protos(none-static). Error  
Method isn't visible in the context When enabled, the compiler will issue an error or a warning whenever it encounters an invisible method but displays in the context. Warning A method( foo:function(){} //< private void foo() ) is declared as private in other .js file.
So when you're calling this property in other .js file( new this.vj$.Sample.foo() ), an error/warning will show in the problems view.
Can't access none-static field from static context When enabled, the compiler will issue an error or a warning whenever it encounters any none-static type access from props(static). Error  
Can't access static field from none-static context When enabled, the compiler will issue an error or a warning whenever it encounters any static type access from protos(none-static). Error  

Type incompatibilities

Option Description Default Example
dimension should be integer if using vjo.createArray(val,dimension) When enabled, the compiler will issue an error or a warning whenever it encounters the dimension is not an integer type. Error  
Require number|string expression here When enabled, the compiler will issue an error or a warning whenever it encounters type unmatched problem. Warning The operator plus(+), the type on the two sides of this operator should be the same.(a and b are both integer type or string, etc.)
Require boolean expression here When enabled, the compiler will issue an error or a warning whenever it encounters type unmatched problem. Warning In the if statement, you can choose a boolean type as the expression(see Sample1 below), but in JS it is also available if you use other type of expressions like number or string(see Sample2 below)
Sample1:
var i = 1;
if(i == 1) 
statement;
		  
Sample2:
var i = 1;
if(i) 
statement
		  
The index of the array should with integer or string type When enabled, the compiler will issue an error or a warning whenever it encounters the index of the array is not an integer or string type. Error  
The arguments type of the method don't match When enabled, the compiler will issue an error or a warning whenever it encounters the arguments type of the method don't match. Warning
//> public void main(String[] args)
  main:function(args){    
    this.foo("hello", "world");
  },

//> public void foo(int i, int j)
  foo:function(i, j){
    var a = i;
    var b = j;
    vjo.sysout.println(a + b);
  }
        
Require number expression here When enabled, the compiler will issue an error or a warning whenever it encounters type unmatched problem. Warning The operator minus(-), the type on the two sides of this operator should be the Number.
Method should return value compatible with its definition When enabled, the compiler will issue an error or a warning whenever it encounters the returned value does not compatible with its definition. Warning  
Require boolean|number expression here When enabled, the compiler will issue an error or a warning whenever it encounters type unmatched problem. Warning Please refer to Require boolean expression here.
Require expressions to be consistent here When enabled, the compiler will issue an error or a warning whenever it encounters type inconsistent problem. Warning The ternary operator.
Suppose an expression: a>b?a:b. In order to avoid side effects, a and b are recommended to have the same type. Like they are both int type or string type.
class should be able to instantiate When enabled, the compiler will issue an error or a warning whenever it encounters an abstract class was instantiated. Error  
Cast should have compatible type When enabled, the compiler will issue an error or a warning whenever it encounters a cast without a compatible type. Warning  
Assignment should have compatible type When enabled, the compiler will issue an error or a warning whenever it encounters type unmatched problem. Warning The operator equal(=), the type on the two side of this operator should be the same. Or you can use Type Cast.
var i = 1; //< int
var j; //< int j = i;
		  
Object should have class type When enabled, the compiler will issue an error or a warning whenever it encounters object but do not have a class type. Error  
The parameters type of the method should not be void When enabled, the compiler will issue an error or a warning whenever it encounters a void parameters type of the method. Warning In a function:
foo:funciton(){}//< public void foo(void)
		
item type should compatible with array type When enabled, the compiler will issue an error or a warning whenever it encounters unmatched item type of an array. Warning  

Misc Problems

Option Description Default Example
Qualifier is not found in the context When enabled, the compiler will issue an error or a warning whenever it does not find any qualifier. Error  
Should not assign to enum type When enabled, the compiler will issue an error or a warning whenever it encounters an assignment to an enum type.
(Since for any constant defined in enum type is default declared as a final type)
Error  
Void method can't return value When enabled, the compiler will issue an error or a warning whenever it encounters a method with a returned value. Warning  
Private method isn't invoked anywhere When enabled, the compiler will issue an error or a warning whenever it encounters a private method method was invoked. Warning  
Statement is unreachable When enabled, the compiler will issue an error or a warning whenever it encounters an unreachable statement. Warning
//> public void foo() 
  foo:funciton() {
    var i=1; //< int 
    return;
    vjo.sysout.println(i);
    (This statement is unreachable)
  }     
class obj should be defined When enabled, the compiler will issue an error or a warning whenever it encounters class obj is not defined. Error  
The number of the method's arguments don't match When enabled, the compiler will issue an error or a warning whenever it encounters an unreachable number of the method's arguments. Warning  
Overloading method having ambiguous invocation When enabled, the compiler will issue an error or a warning whenever it encounters an ambiguous overloading method. Warning
//> public void bar(String...)
//> public void bar(String)
bar: function(i){
}	    
val should be defined if using vjo.createArray(val,dimension) When enabled, the compiler will issue an error or a warning whenever it encounters the val is not defined. Error  
Qualifier shouldn't be null When enabled, the compiler will issue an error or a warning whenever it encounters qualifier is null. Error  
cannot find define When enabled, the compiler will issue an error or a warning whenever it encounters undefined variables. Error  
Method is not found in the context When enabled, the compiler will issue an error or a warning whenever it encounters method is not found in the context. Warning  
Overload methods having variable modifier When enabled, the compiler will issue an error or a warning whenever it encounters overload methods having variable modifier. Error  
Should not assign to final field When enabled, the compiler will issue an error or a warning whenever it encounters any assignment to final field. Error  
final property in the constructs method should be initialized When enabled, the compiler will issue an error or a warning whenever it encounters final property in the constructs method is not initialized. Warning
.protos({ 
  //>public constructs()
  constructs : function(){
    var s = 1;//< final
  }
})      
Property is not found in the scope When enabled, the compiler will issue an error or a warning whenever it encounters undefined properties. Warning  
Cannot use uninitialized type When enabled, the compiler will issue an error or a warning whenever it encounters an uninitialized type . Warning
//>public constructs()
  constructs : function(){
    var s = 1;//< final
  }     
None void method requires return type When enabled, the compiler will issue an error or a warning whenever it encounters a none void method missing a returned value. Warning  

Uniqueness violation

Option Description Default Example
Object literal cannot have multiple keys with the same name When enabled, the compiler will issue an error or a warning whenever it encounters duplicate name in the object literal. Error
vjo.otype("sample.OTypeSample1")
.defs({
  prop1: {
    name: 121,
	name: 123
  },
})
.endType();
Duplicate methods with the same name When enabled, the compiler will issue an error or a warning whenever it encounters duplicate methods with the same name. Error  
Overlap static and none-static method When enabled, the compiler will issue an error or a warning whenever it encounters methods with same name in props(static) and protos(none-static) field. Error  
With scope may conflicts with local scope, check with scope's properties and methods When enabled, the compiler will issue an error or a warning whenever it encounters with scope conflicts. Warning
vjo.ctype('sample.VJOSample') {
  i: 1, //< int
  //> public void foo()
  foo:function(){ 
    var i = 0; //< int 
    var j = 1;
    with (j) {
      this.i;
    }
  }    
}	    
Overlap static and none-static property When enabled, the compiler will issue an error or a warning whenever it encounters properties with same name in props(static) and protos(none-static) field. Error  
Duplicate properties with the same name When enabled, the compiler will issue an error or a warning whenever it encounters duplicate properties with the same name. Error  
Can't redefine variable When enabled, the compiler will issue an error or a warning whenever it encounters redefined variable in the same scope. Error
//> public void foo()
foo:funcion(){
  var i=1;
  var i=1;
}		

Related reference