gpt4 book ai didi

eclipse - 如何将补丁应用于 Java 项目?

转载 作者:行者123 更新时间:2023-12-04 02:51:27 24 4
gpt4 key购买 nike

该补丁适用于 nutch 0.9:
http://cvs.tty.org/~butch/blog/nutch_0.9_OR.patch

我应该如何正确应用补丁?

操作系统是 Windows XP

更具体地说,我正在使用 eclipse 来调试一个 nutch 项目。

这是我的试验:

D:\nutch-0.9.bak>patch -p0 < nutch_0.9_OR.patch
Hmm... Looks like an ed script to me...
(Patch is indented 5 spaces.)
The text leading up to this was:
--------------------------
|diff -rBNu src.orig/java/org/apache/nutch/analysis/NutchAnalysisConstants.java src/java/org/apache/nutch/analysis/NutchAnalysisConstants.java
|--- src.orig/java/org/apache/nutch/analysis/NutchAnalysisConstants.java 2009-03-10 11:34:01.000000000 -0700
|+++ src/java/org/apache/nutch/analysis/NutchAnalysisConstants.java 2009-03-10 14:11:55.000000000 -0700
|@@ -4,30 +4,34 @@
| public interface NutchAnalysisConstants {
|
| int EOF = 0;
|- int WORD = 1;
|- int ACRONYM = 2;
|- int SIGRAM = 3;
|- int IRREGULAR_WORD = 4;
|- int C_PLUS_PLUS = 5;
|- int C_SHARP = 6;
|- int PLUS = 7;
|- int MINUS = 8;
|- int QUOTE = 9;
|- int COLON = 10;
|- int SLASH = 11;
|- int DOT = 12;
|- int ATSIGN = 13;
|- int APOSTROPHE = 14;
|- int WHITE = 15;
|- int WORD_PUNCT = 16;
|- int LETTER = 17;
|- int CJK = 18;
|- int DIGIT = 19;
|+ int QOR = 1;
|+ int WORD = 2;
|+ int ACRONYM = 3;
|+ int SIGRAM = 4;
|+ int IRREGULAR_WORD = 5;
|+ int C_PLUS_PLUS = 6;
|+ int C_SHARP = 7;
|+ int PLUS = 8;
|+ int MINUS = 9;
|+ int QUOTE = 10;
|+ int COLON = 11;
|+ int SLASH = 12;
|+ int LPAREN = 13;
|+ int RPAREN = 14;
|+ int DOT = 15;
|+ int ATSIGN = 16;
|+ int APOSTROPHE = 17;
|+ int WHITE = 18;
|+ int WORD_PUNCT = 19;
|+ int LETTER = 20;
|+ int CJK = 21;
|+ int DIGIT = 22;
|
| int DEFAULT = 0;
|
| String[] tokenImage = {
| "<EOF>",
|+ "\"OR\"",
| "<WORD>",
| "<ACRONYM>",
| "<SIGRAM>",
|@@ -39,6 +43,8 @@
| "\"\\\"\"",
| "\":\"",
| "\"/\"",
|+ "\"(\"",
|+ "\")\"",
| "\".\"",
| "\"@\"",
| "\"\\\'\"",
|diff -rBNu src.orig/java/org/apache/nutch/analysis/NutchAnalysis.java src/java/org/apache/nutch/analysis/NutchAnalysis.java
|--- src.orig/java/org/apache/nutch/analysis/NutchAnalysis.java 2009-03-10 11:34:01.000000000 -0700
|+++ src/java/org/apache/nutch/analysis/NutchAnalysis.java 2009-03-10 14:11:55.000000000 -0700
|@@ -56,7 +56,11 @@
| queryString, (analyzer != null) ? analyzer : new NutchDocumentAnalyzer(conf));
| parser.queryString = queryString;
| parser.queryFilters = new QueryFilters(conf);
|- return parser.parse(conf);
|+ try {
|+ return parser.parse(conf);
|+ } catch (ParseException pe) {
|+ throw new IOException("Parse exception: " + pe);
|+ }
| }
|
| /** For debugging. */
|@@ -77,44 +81,60 @@
| String field;
| boolean stop;
| boolean prohibited;
|+ boolean required;
| nonOpOrTerm();
| label_1:
--------------------------
File to patch:

最佳答案

既然你提到了 Eclipse - 右键单击​​项目,转到 Team -> Apply patch。

关于eclipse - 如何将补丁应用于 Java 项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/986222/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com