使用lombok不可能很好地进行编译



因为我是日本人,所以英文很差。请承认。使用lombok不可能很好地进行编译。(来源网站:http://projectlombok.org/download.html)Lombok安装了Eclipse,用jad进行了编译和反编译。

import java.sql.*;
import lombok.Cleanup;
public class TEST {
    public static void main(String[] args) throws Exception {
        Connection conn = null;
        // Statement
        @Cleanup Statement cstmt = null;
        cstmt = conn.prepareCall("{call 11111.22222(?,?,?,?,?,?,?,?,?)}");
        // Execute
        cstmt.executeBatch();
        //write file code goes here 
    }
}

,

import java.sql.Connection;
import java.sql.Statement;
import java.util.Collections;
import java.util.List;
public class TEST
{
  public static void main(String[] args)
    throws Exception
  {
    Connection conn = null;
    Statement cstmt = null;
    try { cstmt = conn.prepareCall("{call 11111.22222(?,?,?,?,?,?,?,?,?)}");
      cstmt.executeBatch();
    }
    finally
    {
      if (Collections.singletonList(cstmt).get(0) != null) cstmt.close();
    }
  }
} 

在eclipse的编译结果中,我是想要它的结果。但是这个在命令行下编译的结果与eclipse的结果不匹配javac -cp lib lombook .jar srcTEST.java

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.Statement;
public class TEST
{
  public static void main(String[] paramArrayOfString)
    throws Exception
  {
    Object localObject = null;
    CallableStatement localCallableStatement = null;
    localCallableStatement = localObject.prepareCall("{call 11111.22222(?,?,?,?,?,?,?,?,?)}");
    localCallableStatement.executeBatch();
  }
}

我想获得与在命令行中执行的编译结果相同的eclipse结果。我该怎么办?

OS setting
jdk=1.5
eclipse
jdk=1.5

Lombok要求在javac上使用JDK 1.6。但是,在Eclipse中使用Lombok没有这个限制。

相关内容

最新更新