我多次遇到过这个问题。每当我使用JD-GUI反编译并保存所有源时,它会在每行前面加上一个块注释,并在方法体中插入代码的行号。这是我刚刚反编译的一个例子:
/* */ public void onEnable()
/* */ {
/* 25 */ List DropList = new ArrayList();
/* 26 */ DropList.add(Integer.valueOf(264));
/* 27 */ DropList.add(Integer.valueOf(57));
/* 28 */ DropList.add(Integer.valueOf(278));
/* */
/* 30 */ this.config = getConfig();
/* */
/* 32 */ this.config.addDefault("GiftDrops", DropList);
/* 33 */ this.config.addDefault("DropRate", Integer.valueOf(0));
/* 34 */ this.config.addDefault("GiftBoxPlayerSkin", "lol768");
/* 35 */ this.config.addDefault("CraftingRecipe.LineOne", "339,339,339");
/* 36 */ this.config.addDefault("CraftingRecipe.LineTwo", "339,264,339");
/* 37 */ this.config.addDefault("CraftingRecipe.LineThree", "339,339,339");
/* */
/* 39 */ this.config.options().copyDefaults(true);
/* 40 */ saveConfig();
/* */
/* 43 */ SkullMeta giftboxskull = (SkullMeta)this.giftbox.getItemMeta();
/* */
/* 45 */ giftboxskull.setOwner(this.config.getString("GiftBoxPlayerSkin"));
/* 46 */ giftboxskull.setDisplayName(ChatColor.GREEN + "Gift Box");
/* 47 */ this.giftbox.setItemMeta(giftboxskull);
/* */
/* 49 */ this.giftboxrecipe = new ShapedRecipe(this.giftbox);
/* 50 */ this.giftboxrecipe.shape(new String[] { "123", "456", "789" });
/* */
/* 52 */ String[] LineOne = getConfig().getString("CraftingRecipe.LineOne").split(",");
/* 53 */ String[] LineTwo = getConfig().getString("CraftingRecipe.LineTwo").split(",");
/* 54 */ String[] LineThree = getConfig().getString("CraftingRecipe.LineThree").split(",");
/* */
/* 56 */ this.giftboxrecipe.setIngredient('1', new ItemStack(Integer.parseInt(LineOne[0])).getData());
/* 57 */ this.giftboxrecipe.setIngredient('2', new ItemStack(Integer.parseInt(LineOne[1])).getData());
/* 58 */ this.giftboxrecipe.setIngredient('3', new ItemStack(Integer.parseInt(LineOne[2])).getData());
/* 59 */ this.giftboxrecipe.setIngredient('4', new ItemStack(Integer.parseInt(LineTwo[0])).getData());
/* 60 */ this.giftboxrecipe.setIngredient('5', new ItemStack(Integer.parseInt(LineTwo[1])).getData());
/* 61 */ this.giftboxrecipe.setIngredient('6', new ItemStack(Integer.parseInt(LineTwo[2])).getData());
/* 62 */ this.giftboxrecipe.setIngredient('7', new ItemStack(Integer.parseInt(LineThree[0])).getData());
/* 63 */ this.giftboxrecipe.setIngredient('8', new ItemStack(Integer.parseInt(LineThree[1])).getData());
/* 64 */ this.giftboxrecipe.setIngredient('9', new ItemStack(Integer.parseInt(LineThree[2])).getData());
/* */
/* 66 */ getServer().addRecipe(this.giftboxrecipe);
/* */
/* 68 */ getServer().getPluginManager().registerEvents(new GiftBoxEventListener(this), this);
/* */ }
这似乎是JD-GUI必须阻止人们使用他们通过编译获得的源文件的功能。我可以使用bash命令轻松删除所有这些注释,但它仍然是一个烦恼。有没有办法禁用此功能?
答案 0 :(得分:9)
在“帮助”中 - > “源节约”组下的“首选项”取消选中“显示行号”