KOPI | ||
---|---|---|
Prev | Chapter 2. The KOPI Kopi Java Compiler | Next |
KJC accepts all valid Java source files but unlike other compilers it generates warnings in order to ensure a high quality source code within the development process. These warnings may be individually turned ON and OFF depending on your needs.
Here is a list of currently available warnings:
Semicolon as type declaration or class member
class Foo { ; // old Java style, produce a warning ``stray semicolon'' } ; // old Java style, produce a warning ``stray semicolon''
Stray comma
class Foo { int[] i = {1, 2, 3,}; // old Java style, produce a warning ``stray comma'' }
Old style array bounds
class Foo { int i[]; //old Java style, produce a warning ``old-style array bound declaration'' int foo() [] { //old Java style, produce a warning ``old-style array bound declaration'' } }
Unused local variable
It happens a lot of time, if you misstype the name of a formal parameter is mistyped, it helps you find your mistake in:
class Foo { void foo(int ix) { this.i = i; } // produce a warning ``variable ix is not used in this method'' int i; }
Self assignation
If you forget the this prefix in constructor, it helps you to find your mistakes:
class Foo { void foo(int i) { i = i; // produce a warning ``variable i is assignated to itself'' } int i; }
Prev | Home | Next |
Usage | Up | Road map |