How can Eclipse create a class with unresolved compilation problems?

后端 未结 3 890
耶瑟儿~
耶瑟儿~ 2020-11-30 02:38

When I try to compile this class with javac, I get a compilation error and Test.class is not created.

public class Test {
    public static void main(String[         


        
3条回答
  •  [愿得一人]
    2020-11-30 03:36

    Eclipse uses the IBM compiler which has an option of creating classes which do not compile, replacing errors with

    throw new Error();
    

    IMHO, this is very bad practice and I have seen some very poor quality projects use this. The project didn't compile completely for weeks at a time.

    Unlike fail fast strategies, which try to minimise the cost of bugs, discovering bugs as late as possible also maximises the cost of fixing them.

    This strategy only works if you are writing prototype code quickly, i.e. code you know will never get into production. (It is hard to be sure this will be the case)

提交回复
热议问题