From 25f005f93718d6652ee5df34a89b8b5b2e34cdcb Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Mar 04 2015 17:27:32 +0000 Subject: Update to latest I-build - JDT requires only hamcrest-core --- diff --git a/eclipse-help-doc-adjust-dependencies.patch b/eclipse-help-doc-adjust-dependencies.patch deleted file mode 100644 index 0ebc21e..0000000 --- a/eclipse-help-doc-adjust-dependencies.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/eclipse.platform.ua/org.eclipse.help.base/META-INF/MANIFEST.MF b/eclipse.platform.ua/org.eclipse.help.base/META-INF/MANIFEST.MF -index 0af7e6b..1985d9e 100644 ---- a/eclipse.platform.ua/org.eclipse.help.base/META-INF/MANIFEST.MF -+++ b/eclipse.platform.ua/org.eclipse.help.base/META-INF/MANIFEST.MF -@@ -43,8 +43,8 @@ Require-Bundle: org.eclipse.ant.core;bundle-version="3.2.200";resolution:=option - org.eclipse.core.runtime;bundle-version="3.6.0", - org.eclipse.help;bundle-version="[3.5.0,4.0.0)";visibility:=reexport, - org.eclipse.core.expressions;bundle-version="[3.4.200,4.0.0)", -- org.apache.lucene.analysis;bundle-version="[3.5.0,4.0.0)", -- org.apache.lucene.core;bundle-version="[3.5.0,4.0.0)", -+ org.apache.lucene.analysis;bundle-version="[3.5.0,5.0.0)", -+ org.apache.lucene.core;bundle-version="[3.5.0,5.0.0)", - org.eclipse.core.net;bundle-version="1.2.200" - Import-Package: com.ibm.icu.text, - org.eclipse.equinox.http.jetty;resolution:=optional -diff --git a/eclipse.platform.ua/org.eclipse.ua.tests/META-INF/MANIFEST.MF b/eclipse.platform.ua/org.eclipse.ua.tests/META-INF/MANIFEST.MF -index 12beb8e..e20ea19 100644 ---- a/eclipse.platform.ua/org.eclipse.ua.tests/META-INF/MANIFEST.MF -+++ b/eclipse.platform.ua/org.eclipse.ua.tests/META-INF/MANIFEST.MF -@@ -25,9 +25,9 @@ Bundle-Vendor: Eclipse.org - Bundle-ClassPath: ua-tests.jar - Import-Package: javax.servlet;version="2.4.0", - javax.servlet.http;version="2.4.0", -- org.apache.lucene.index;core=split;version="[3.5.0,4.0.0)", -- org.apache.lucene.search;core=split;version="[3.5.0,4.0.0)", -- org.apache.lucene.store;core=split;version="[3.5.0,4.0.0)" -+ org.apache.lucene.index;version="[3.5.0,5.0.0)", -+ org.apache.lucene.search;version="[3.5.0,5.0.0)", -+ org.apache.lucene.store;version="[3.5.0,5.0.0)" - Bundle-RequiredExecutionEnvironment: JavaSE-1.6 - Export-Package: org.eclipse.ua.tests, - org.eclipse.ua.tests.browser, diff --git a/eclipse-lucene-4.patch b/eclipse-lucene-4.patch index 6fe1d3f..99b269a 100644 --- a/eclipse-lucene-4.patch +++ b/eclipse-lucene-4.patch @@ -1,8 +1,41 @@ +From f93bcfb45708895f90396552677f11881f342dc9 Mon Sep 17 00:00:00 2001 +From: Mat Booth +Date: Wed, 4 Mar 2015 15:10:27 +0000 +Subject: [PATCH] Port to Lucene 4. + +--- + org.eclipse.help.base/META-INF/MANIFEST.MF | 4 +- + .../eclipse/help/internal/search/Analyzer_en.java | 27 +++++--- + .../help/internal/search/DefaultAnalyzer.java | 13 ++-- + .../search/LowerCaseAndDigitsTokenizer.java | 7 +- + .../eclipse/help/internal/search/QueryBuilder.java | 15 +++- + .../eclipse/help/internal/search/SearchIndex.java | 81 ++++++++++------------ + .../help/internal/search/SmartAnalyzer.java | 14 ++-- + .../help/internal/search/WordTokenStream.java | 2 + + org.eclipse.ua.tests/META-INF/MANIFEST.MF | 7 +- + .../help/search/PrebuiltIndexCompatibility.java | 6 +- + 10 files changed, 94 insertions(+), 82 deletions(-) + +diff --git a/eclipse.platform.ua/org.eclipse.help.base/META-INF/MANIFEST.MF b/eclipse.platform.ua/org.eclipse.help.base/META-INF/MANIFEST.MF +index ee34c8e..fdef3e6 100644 +--- a/eclipse.platform.ua/org.eclipse.help.base/META-INF/MANIFEST.MF ++++ b/eclipse.platform.ua/org.eclipse.help.base/META-INF/MANIFEST.MF +@@ -43,8 +43,8 @@ Require-Bundle: org.eclipse.ant.core;bundle-version="3.2.200";resolution:=option + org.eclipse.core.runtime;bundle-version="[3.11.0,4.0.0)", + org.eclipse.help;bundle-version="[3.5.0,4.0.0)";visibility:=reexport, + org.eclipse.core.expressions;bundle-version="[3.4.200,4.0.0)", +- org.apache.lucene.analysis;bundle-version="[3.5.0,4.0.0)", +- org.apache.lucene.core;bundle-version="[3.5.0,4.0.0)", ++ org.apache.lucene.analysis;bundle-version="[4.7.0,5.0.0)", ++ org.apache.lucene.core;bundle-version="[4.7.0,5.0.0)", + org.eclipse.core.net;bundle-version="1.2.200" + Import-Package: com.ibm.icu.text, + org.eclipse.equinox.http.jetty;resolution:=optional diff --git a/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/Analyzer_en.java b/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/Analyzer_en.java -index 4e6786c..49dc51b 100644 +index a066aa4..6c41103 100644 --- a/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/Analyzer_en.java +++ b/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/Analyzer_en.java -@@ -10,10 +10,14 @@ +@@ -11,10 +11,15 @@ *******************************************************************************/ package org.eclipse.help.internal.search; import java.io.*; @@ -11,15 +44,17 @@ index 4e6786c..49dc51b 100644 +import java.util.ArrayList; +import java.util.List; - import org.apache.lucene.analysis.*; -+import org.apache.lucene.analysis.en.*; -+import org.apache.lucene.analysis.core.*; -+import org.apache.lucene.analysis.util.*; -+import org.apache.lucene.util.Version; +-import org.apache.lucene.analysis.*; ++import org.apache.lucene.analysis.Analyzer; ++import org.apache.lucene.analysis.TokenStream; ++import org.apache.lucene.analysis.Tokenizer; ++import org.apache.lucene.analysis.core.StopFilter; ++import org.apache.lucene.analysis.en.PorterStemFilter; ++import org.apache.lucene.analysis.util.CharArraySet; + import org.apache.lucene.util.Version; /** * Lucene Analyzer for English. LowerCaseTokenizer->StopFilter->PorterStemFilter - */ -@@ -25,18 +29,22 @@ public final class Analyzer_en extends Analyzer { +@@ -27,18 +32,22 @@ public final class Analyzer_en extends Analyzer { super(); } /** @@ -28,7 +63,7 @@ index 4e6786c..49dc51b 100644 * Reader. */ - public final TokenStream tokenStream(String fieldName, Reader reader) { -- return new PorterStemFilter(new StopFilter(false, new LowerCaseAndDigitsTokenizer(reader), getStopWords(), false)); +- return new PorterStemFilter(new StopFilter(Version.LUCENE_30, new LowerCaseAndDigitsTokenizer(reader), getStopWords(), false)); + @Override + public final TokenStreamComponents createComponents(String fieldName, Reader reader) { + CharArraySet stopWordsSet = StopFilter.makeStopSet(Version.LUCENE_47, getStopWords(), true); @@ -36,10 +71,10 @@ index 4e6786c..49dc51b 100644 + TokenStream filter = new PorterStemFilter(new StopFilter(Version.LUCENE_47, source, stopWordsSet)); + return new TokenStreamComponents(source, filter); } - + - private Set stopWords; + private List stopWords; - + - private Set getStopWords() { + private List getStopWords() { if ( stopWords == null ) { @@ -49,22 +84,21 @@ index 4e6786c..49dc51b 100644 stopWords.add(STOP_WORDS[i]); } diff --git a/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/DefaultAnalyzer.java b/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/DefaultAnalyzer.java -index 50258d2..f72615f 100644 +index 4109474..2718307 100644 --- a/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/DefaultAnalyzer.java +++ b/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/DefaultAnalyzer.java -@@ -15,8 +15,10 @@ import java.util.StringTokenizer; +@@ -17,8 +17,8 @@ import java.util.StringTokenizer; import com.ibm.icu.text.BreakIterator; import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.analysis.LowerCaseFilter; -+import org.apache.lucene.analysis.core.LowerCaseFilter; +-import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.analysis.Tokenizer; - import org.apache.lucene.analysis.TokenStream; -+import org.apache.lucene.util.Version; - ++import org.apache.lucene.analysis.core.LowerCaseFilter; + import org.apache.lucene.util.Version; import org.eclipse.help.internal.base.HelpBasePlugin; -@@ -82,11 +84,14 @@ public final class DefaultAnalyzer extends Analyzer { +@@ -84,11 +84,14 @@ public final class DefaultAnalyzer extends Analyzer { } /** @@ -73,7 +107,7 @@ index 50258d2..f72615f 100644 * Reader. */ - public final TokenStream tokenStream(String fieldName, Reader reader) { -- return new LowerCaseFilter(new WordTokenStream(fieldName, reader, locale)); +- return new LowerCaseFilter(Version.LUCENE_30, new WordTokenStream(fieldName, reader, locale)); + @Override + public final TokenStreamComponents createComponents(String fieldName, Reader reader) { + Tokenizer source = new WordTokenStream(fieldName, reader, locale); @@ -83,24 +117,23 @@ index 50258d2..f72615f 100644 /** diff --git a/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/LowerCaseAndDigitsTokenizer.java b/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/LowerCaseAndDigitsTokenizer.java -index 0dd3943..d101ae9 100644 +index a475688..91e3cb4 100644 --- a/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/LowerCaseAndDigitsTokenizer.java +++ b/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/LowerCaseAndDigitsTokenizer.java -@@ -12,7 +12,8 @@ package org.eclipse.help.internal.search; +@@ -13,7 +13,7 @@ package org.eclipse.help.internal.search; import java.io.*; -import org.apache.lucene.analysis.*; -+import org.apache.lucene.analysis.util.*; -+import org.apache.lucene.util.Version; ++import org.apache.lucene.analysis.util.CharTokenizer; + import org.apache.lucene.util.Version; /** - * Tokenizer breaking words around letters or digits. -@@ -20,13 +21,14 @@ import org.apache.lucene.analysis.*; +@@ -22,13 +22,14 @@ import org.apache.lucene.util.Version; public class LowerCaseAndDigitsTokenizer extends CharTokenizer { public LowerCaseAndDigitsTokenizer(Reader input) { -- super(input); +- super(Version.LUCENE_30, input); + super(Version.LUCENE_47, input); } protected char normalize(char c) { @@ -114,21 +147,22 @@ index 0dd3943..d101ae9 100644 } diff --git a/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryBuilder.java b/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryBuilder.java -index 00c2799..9f9962d 100644 +index 9cc690e..6449adb 100644 --- a/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryBuilder.java +++ b/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryBuilder.java -@@ -243,16 +243,24 @@ public class QueryBuilder { +@@ -243,16 +243,25 @@ public class QueryBuilder { private List analyzeText(Analyzer analyzer, String fieldName, String text) { List words = new ArrayList(1); Reader reader = new StringReader(text); - TokenStream tStream = analyzer.tokenStream(fieldName, reader); - + - CharTermAttribute termAttribute = (CharTermAttribute) tStream.getAttribute(CharTermAttribute.class); + TokenStream tStream = null; try { + tStream = analyzer.tokenStream(fieldName, reader); + tStream.reset(); -+ CharTermAttribute termAttribute = (CharTermAttribute) tStream.getAttribute(CharTermAttribute.class); ++ CharTermAttribute termAttribute = (CharTermAttribute) tStream ++ .getAttribute(CharTermAttribute.class); while (tStream.incrementToken()) { String term = termAttribute.toString(); words.add(term); @@ -143,17 +177,17 @@ index 00c2799..9f9962d 100644 + } + } } - + return words; diff --git a/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java b/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java -index e860c8d..0d5a8b6 100644 +index 33c9476..5a46fe5 100644 --- a/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java +++ b/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/SearchIndex.java -@@ -31,13 +31,20 @@ import java.util.Set; +@@ -33,17 +33,20 @@ import java.util.Set; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; -+import org.apache.lucene.analysis.Analyzer; +-import org.apache.lucene.analysis.LimitTokenCountAnalyzer; +import org.apache.lucene.analysis.miscellaneous.LimitTokenCountAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -162,47 +196,27 @@ index e860c8d..0d5a8b6 100644 +import org.apache.lucene.index.DocsEnum; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; -+import org.apache.lucene.index.IndexWriterConfig; -+import org.apache.lucene.index.IndexWriterConfig.OpenMode; -+import org.apache.lucene.index.LogDocMergePolicy; -+import org.apache.lucene.index.SlowCompositeReaderWrapper; - import org.apache.lucene.index.Term; +-import org.apache.lucene.index.Term; -import org.apache.lucene.index.TermDocs; --import org.apache.lucene.index.IndexWriter.MaxFieldLength; + import org.apache.lucene.index.IndexWriterConfig.OpenMode; + import org.apache.lucene.index.IndexWriterConfig; + import org.apache.lucene.index.LogByteSizeMergePolicy; + import org.apache.lucene.index.LogMergePolicy; ++import org.apache.lucene.index.SlowCompositeReaderWrapper; ++import org.apache.lucene.index.Term; import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; -@@ -265,10 +272,10 @@ public class SearchIndex implements IHelpSearchIndex { - if (iw != null) { - iw.close(); - } -- boolean create = false; -+ OpenMode create = OpenMode.APPEND; - if (!indexDir.exists() || !isLuceneCompatible() || !isAnalyzerCompatible() - || inconsistencyFile.exists() && firstOperation) { -- create = true; -+ create = OpenMode.CREATE; - indexDir.mkdirs(); - if (!indexDir.exists()) - return false; // unable to setup index directory -@@ -276,9 +283,13 @@ public class SearchIndex implements IHelpSearchIndex { - indexedDocs = new HelpProperties(INDEXED_DOCS_FILE, indexDir); +@@ -283,7 +286,7 @@ public class SearchIndex implements IHelpSearchIndex { indexedDocs.restore(); setInconsistent(true); -- MaxFieldLength max = new MaxFieldLength(1000000); -- iw = new IndexWriter(luceneDirectory, analyzerDescriptor.getAnalyzer(), create, max); -- iw.setMergeFactor(20); -+ Analyzer wrapper = new LimitTokenCountAnalyzer(analyzerDescriptor.getAnalyzer(), 1000000); -+ IndexWriterConfig iconfig = new IndexWriterConfig(org.apache.lucene.util.Version.LUCENE_47, wrapper); -+ iconfig.setOpenMode(create); -+ LogDocMergePolicy policy = new LogDocMergePolicy(); -+ policy.setMergeFactor(20); -+ iconfig.setMergePolicy(policy); -+ iw = new IndexWriter(luceneDirectory, iconfig); - return true; - } catch (IOException e) { - HelpBasePlugin.logError("Exception occurred in search indexing at beginAddBatch.", e); //$NON-NLS-1$ -@@ -297,7 +308,7 @@ public class SearchIndex implements IHelpSearchIndex { + LimitTokenCountAnalyzer analyzer = new LimitTokenCountAnalyzer(analyzerDescriptor.getAnalyzer(), 1000000); +- IndexWriterConfig writerConfig = new IndexWriterConfig(org.apache.lucene.util.Version.LUCENE_31, analyzer); ++ IndexWriterConfig writerConfig = new IndexWriterConfig(org.apache.lucene.util.Version.LUCENE_47, analyzer); + writerConfig.setOpenMode(create ? OpenMode.CREATE : OpenMode.APPEND); + LogMergePolicy mergePolicy = new LogByteSizeMergePolicy(); + mergePolicy.setMergeFactor(20); +@@ -307,7 +310,7 @@ public class SearchIndex implements IHelpSearchIndex { indexedDocs = new HelpProperties(INDEXED_DOCS_FILE, indexDir); indexedDocs.restore(); setInconsistent(true); @@ -211,7 +225,7 @@ index e860c8d..0d5a8b6 100644 return true; } catch (IOException e) { HelpBasePlugin.logError("Exception occurred in search indexing at beginDeleteBatch.", e); //$NON-NLS-1$ -@@ -313,7 +324,7 @@ public class SearchIndex implements IHelpSearchIndex { +@@ -323,7 +326,7 @@ public class SearchIndex implements IHelpSearchIndex { if (ir != null) { ir.close(); } @@ -220,7 +234,7 @@ index e860c8d..0d5a8b6 100644 return true; } catch (IOException e) { HelpBasePlugin.logError("Exception occurred in search indexing at beginDeleteBatch.", e); //$NON-NLS-1$ -@@ -331,7 +342,7 @@ public class SearchIndex implements IHelpSearchIndex { +@@ -341,7 +344,7 @@ public class SearchIndex implements IHelpSearchIndex { public IStatus removeDocument(String name) { Term term = new Term(FIELD_NAME, name); try { @@ -229,16 +243,7 @@ index e860c8d..0d5a8b6 100644 indexedDocs.remove(name); } catch (IOException e) { return new Status(IStatus.ERROR, HelpBasePlugin.PLUGIN_ID, IStatus.ERROR, -@@ -350,7 +361,7 @@ public class SearchIndex implements IHelpSearchIndex { - if (iw == null) - return false; - if (optimize) -- iw.optimize(); -+ iw.forceMerge(1); - iw.close(); - iw = null; - // save the update info: -@@ -369,7 +380,7 @@ public class SearchIndex implements IHelpSearchIndex { +@@ -379,7 +382,7 @@ public class SearchIndex implements IHelpSearchIndex { * know about this change. Close it so that it gets reloaded next search. */ if (searcher != null) { @@ -247,7 +252,7 @@ index e860c8d..0d5a8b6 100644 searcher = null; } return true; -@@ -401,7 +412,7 @@ public class SearchIndex implements IHelpSearchIndex { +@@ -411,7 +414,7 @@ public class SearchIndex implements IHelpSearchIndex { * know about this change. Close it so that it gets reloaded next search. */ if (searcher != null) { @@ -256,18 +261,7 @@ index e860c8d..0d5a8b6 100644 searcher = null; } return true; -@@ -505,8 +516,8 @@ public class SearchIndex implements IHelpSearchIndex { - } - Directory[] luceneDirs = dirList.toArray(new Directory[dirList.size()]); - try { -- iw.addIndexesNoOptimize(luceneDirs); -- iw.optimize(); -+ iw.addIndexes(luceneDirs); -+ iw.forceMerge(1); - } catch (IOException ioe) { - HelpBasePlugin.logError("Merging search indexes failed.", ioe); //$NON-NLS-1$ - return new HashMap(); -@@ -515,18 +526,19 @@ public class SearchIndex implements IHelpSearchIndex { +@@ -525,18 +528,19 @@ public class SearchIndex implements IHelpSearchIndex { } public IStatus removeDuplicates(String name, String[] index_paths) { @@ -294,7 +288,7 @@ index e860c8d..0d5a8b6 100644 } removeDocuments(hrefDocs, indexDocs); } -@@ -535,19 +547,6 @@ public class SearchIndex implements IHelpSearchIndex { +@@ -545,19 +549,6 @@ public class SearchIndex implements IHelpSearchIndex { "IO exception occurred while removing duplicates of document " + name //$NON-NLS-1$ + " from index " + indexDir.getAbsolutePath() + ".", //$NON-NLS-1$ //$NON-NLS-2$ ioe); @@ -314,7 +308,7 @@ index e860c8d..0d5a8b6 100644 } return Status.OK_STATUS; } -@@ -559,33 +558,33 @@ public class SearchIndex implements IHelpSearchIndex { +@@ -569,33 +560,33 @@ public class SearchIndex implements IHelpSearchIndex { * @param docs2 * @throws IOException */ @@ -361,16 +355,16 @@ index e860c8d..0d5a8b6 100644 return; } } -@@ -792,7 +791,7 @@ public class SearchIndex implements IHelpSearchIndex { +@@ -802,7 +793,7 @@ public class SearchIndex implements IHelpSearchIndex { public void openSearcher() throws IOException { synchronized (searcherCreateLock) { if (searcher == null) { -- searcher = new IndexSearcher(luceneDirectory, false); +- searcher = new IndexSearcher(IndexReader.open(luceneDirectory, false)); + searcher = new IndexSearcher(DirectoryReader.open(luceneDirectory)); } } } -@@ -814,7 +813,7 @@ public class SearchIndex implements IHelpSearchIndex { +@@ -820,7 +811,7 @@ public class SearchIndex implements IHelpSearchIndex { if (searches.isEmpty()) { if (searcher != null) { try { @@ -379,25 +373,28 @@ index e860c8d..0d5a8b6 100644 } catch (IOException ioe) { } } -@@ -888,9 +887,11 @@ public class SearchIndex implements IHelpSearchIndex { - */ - private void cleanOldIndex() { +@@ -903,7 +894,7 @@ public class SearchIndex implements IHelpSearchIndex { IndexWriter cleaner = null; -- MaxFieldLength max = new MaxFieldLength(10000); + LimitTokenCountAnalyzer analyzer = new LimitTokenCountAnalyzer(analyzerDescriptor.getAnalyzer(), 10000); try { -- cleaner = new IndexWriter(luceneDirectory, analyzerDescriptor.getAnalyzer(), true, max); -+ Analyzer wrapper = new LimitTokenCountAnalyzer(analyzerDescriptor.getAnalyzer(), 10000); -+ IndexWriterConfig iconfig = new IndexWriterConfig(org.apache.lucene.util.Version.LUCENE_47, wrapper); -+ iconfig.setOpenMode(OpenMode.CREATE); -+ cleaner = new IndexWriter(luceneDirectory, iconfig); +- cleaner = new IndexWriter(luceneDirectory, new IndexWriterConfig(org.apache.lucene.util.Version.LUCENE_31, analyzer).setOpenMode( ++ cleaner = new IndexWriter(luceneDirectory, new IndexWriterConfig(org.apache.lucene.util.Version.LUCENE_47, analyzer).setOpenMode( + OpenMode.CREATE)); } catch (IOException ioe) { } finally { - try { diff --git a/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/SmartAnalyzer.java b/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/SmartAnalyzer.java -index d0a7bb7..df31d89 100644 +index d0a7bb7..1b20d3b 100644 --- a/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/SmartAnalyzer.java +++ b/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/SmartAnalyzer.java -@@ -18,7 +18,7 @@ import org.apache.lucene.analysis.*; +@@ -10,15 +10,13 @@ + *******************************************************************************/ + package org.eclipse.help.internal.search; + +-import java.io.*; +- + import org.apache.lucene.analysis.*; + + /** * Smart Analyzer. Chooses underlying implementation based on the field which * text is analyzed. */ @@ -406,7 +403,7 @@ index d0a7bb7..df31d89 100644 Analyzer pluggedInAnalyzer; Analyzer exactAnalyzer; -@@ -31,14 +31,14 @@ public final class SmartAnalyzer extends Analyzer { +@@ -31,14 +29,14 @@ public final class SmartAnalyzer extends Analyzer { this.exactAnalyzer = new DefaultAnalyzer(locale); } /** @@ -427,7 +424,7 @@ index d0a7bb7..df31d89 100644 } } diff --git a/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/WordTokenStream.java b/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/WordTokenStream.java -index 1360599..f622417 100644 +index 0b70cf7..106775a 100644 --- a/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/WordTokenStream.java +++ b/eclipse.platform.ua/org.eclipse.help.base/src/org/eclipse/help/internal/search/WordTokenStream.java @@ -35,6 +35,7 @@ public final class WordTokenStream extends Tokenizer { @@ -440,32 +437,59 @@ index 1360599..f622417 100644 @@ -105,6 +106,7 @@ public final class WordTokenStream extends Tokenizer { } - + public void close() throws IOException { + super.close(); /// Unlikely to be called as this is a reused if (this.reader != null) { this.reader.close(); ---- a/eclipse.platform.ua/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java 2014-11-29 17:08:45.937034662 +0000 -+++ b/eclipse.platform.ua/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java 2014-11-29 17:12:29.324984554 +0000 -@@ -23,6 +23,7 @@ +diff --git a/eclipse.platform.ua/org.eclipse.ua.tests/META-INF/MANIFEST.MF b/eclipse.platform.ua/org.eclipse.ua.tests/META-INF/MANIFEST.MF +index a8177c3..cd99e8a 100644 +--- a/eclipse.platform.ua/org.eclipse.ua.tests/META-INF/MANIFEST.MF ++++ b/eclipse.platform.ua/org.eclipse.ua.tests/META-INF/MANIFEST.MF +@@ -18,16 +18,15 @@ Require-Bundle: org.junit, + org.eclipse.ui.intro.universal, + org.eclipse.ui.forms, + org.eclipse.ui.browser;bundle-version="3.2.300", ++ org.apache.lucene.analysis;bundle-version="[4.7.0,5.0.0)", ++ org.apache.lucene.core;bundle-version="[4.7.0,5.0.0)", + org.eclipse.equinox.jsp.jasper;bundle-version="1.0.200", + org.eclipse.equinox.jsp.jasper.registry;bundle-version="1.0.100" + Bundle-ActivationPolicy: lazy + Bundle-Vendor: Eclipse.org + Bundle-ClassPath: ua-tests.jar + Import-Package: javax.servlet;version="2.4.0", +- javax.servlet.http;version="2.4.0", +- org.apache.lucene.index;core=split;version="[3.5.0,4.0.0)", +- org.apache.lucene.search;core=split;version="[3.5.0,4.0.0)", +- org.apache.lucene.store;core=split;version="[3.5.0,4.0.0)" ++ javax.servlet.http;version="2.4.0" + Bundle-RequiredExecutionEnvironment: JavaSE-1.6 + Export-Package: org.eclipse.ua.tests, + org.eclipse.ua.tests.browser, +diff --git a/eclipse.platform.ua/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java b/eclipse.platform.ua/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java +index 640d4c9..8924fa7 100644 +--- a/eclipse.platform.ua/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java ++++ b/eclipse.platform.ua/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/search/PrebuiltIndexCompatibility.java +@@ -24,7 +24,7 @@ import junit.framework.TestSuite; import org.osgi.framework.Bundle; import org.apache.lucene.index.CorruptIndexException; +-import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.TopDocs; -@@ -155,7 +156,7 @@ +@@ -157,7 +157,7 @@ public class PrebuiltIndexCompatibility extends TestCase { IndexSearcher searcher = null; try { luceneDirectory = new NIOFSDirectory(new File(filePath)); -- searcher = new IndexSearcher(luceneDirectory, true); +- searcher = new IndexSearcher(IndexReader.open(luceneDirectory, true)); + searcher = new IndexSearcher(DirectoryReader.open(luceneDirectory)); TopDocs hits = searcher.search(luceneQuery, 500); assertEquals(hits.totalHits, 1); } finally { -@@ -165,7 +166,7 @@ +@@ -167,7 +167,7 @@ public class PrebuiltIndexCompatibility extends TestCase { } catch (IOException x) { } if (searcher != null) @@ -474,3 +498,6 @@ index 1360599..f622417 100644 } } else { fail("Cannot resolve to file protocol"); +-- +2.1.0 + diff --git a/eclipse-webkit2-support.patch b/eclipse-webkit2-support.patch index 1d9fa67..0380f10 100644 --- a/eclipse-webkit2-support.patch +++ b/eclipse-webkit2-support.patch @@ -115,7 +115,7 @@ index 6bce587..fea2a5b 100644 GLX_LIB = lib$(GLX_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so CAIROCFLAGS = `pkg-config --cflags cairo` -@@ -298,7 +299,7 @@ xpcominit_stats.o: xpcominit_stats.cpp +@@ -292,7 +293,7 @@ xpcominit_stats.o: xpcominit_stats.cpp # # WebKit lib # @@ -124,7 +124,7 @@ index 6bce587..fea2a5b 100644 $(WEBKIT_LIB): $(WEBKIT_OBJECTS) $(CC) $(LFLAGS) -o $(WEBKIT_LIB) $(WEBKIT_OBJECTS) -@@ -312,6 +313,13 @@ webkit_structs.o: webkitgtk_structs.c +@@ -306,6 +307,13 @@ webkit_structs.o: webkitgtk_structs.c webkit_stats.o: webkitgtk_stats.c webkitgtk_stats.h $(CC) $(CFLAGS) $(WEBKITCFLAGS) -c webkitgtk_stats.c -o webkit_stats.o @@ -776,8 +776,8 @@ index 7ef6236..0e00c09 100644 import org.eclipse.swt.internal.LONG; import org.eclipse.swt.internal.Library; import org.eclipse.swt.internal.gtk.GdkEventKey; -@@ -49,6 +53,8 @@ import org.eclipse.swt.widgets.Shell; - @SuppressWarnings({"rawtypes", "unchecked"}) +@@ -48,6 +52,8 @@ import org.eclipse.swt.widgets.Shell; + class WebKit extends WebBrowser { long /*int*/ webView, webViewData, scrolledWindow; + long pageId; @@ -785,7 +785,7 @@ index 7ef6236..0e00c09 100644 int failureCount, lastKeyCode, lastCharCode; String postData; String[] headers; -@@ -56,10 +62,61 @@ class WebKit extends WebBrowser { +@@ -55,10 +61,61 @@ class WebKit extends WebBrowser { byte[] htmlBytes; BrowserFunction eventFunction; @@ -808,7 +808,7 @@ index 7ef6236..0e00c09 100644 static int DisabledJSCount; static long /*int*/ ExternalClass, PostString, WebViewType; static boolean IsWebKit14orNewer, LibraryLoaded; - static Hashtable WindowMappings = new Hashtable (); + static Hashtable WindowMappings = new Hashtable (); + static HashMap browserIdMappings = new HashMap(); + + private static final String WEBKIT_MAIN_PROCESS_DBUS_NAME_PREFIX = "org.eclipse.webkit_main."; @@ -1434,7 +1434,7 @@ index 7ef6236..0e00c09 100644 type = WebKitGTK.JSValueGetType (ctx, result[0]); if (type == WebKitGTK.kJSTypeString) { @@ -2349,6 +2754,7 @@ long /*int*/ callJava (long /*int*/ ctx, long /*int*/ func, long /*int*/ thisObj - BrowserFunction function = (BrowserFunction)functions.get (key); + BrowserFunction function = functions.get (key); if (function != null && token.equals (function.token)) { try { + // The third argument is an array of arguments to the Java function. diff --git a/eclipse.spec b/eclipse.spec index bb54a5e..aa526ab 100644 --- a/eclipse.spec +++ b/eclipse.spec @@ -13,7 +13,7 @@ Epoch: 1 %global eclipse_minor 5 %global eclipse_micro 0 %global eb_commit 2775b93d3d9f147f5711c91bb3aa623f2582019d -%global eclipse_tag I20150224-0800 +%global eclipse_tag I20150303-0800 %global eclipse_version %{eclipse_major}.%{eclipse_minor}.%{eclipse_micro} %global _jetty_version 9.2.9 @@ -38,7 +38,7 @@ Epoch: 1 Summary: An open, extensible IDE Name: %{?scl_prefix}eclipse Version: %{eclipse_version} -Release: 0.3.git201502240800%{?dist} +Release: 0.4.git201503030800%{?dist} License: EPL URL: http://www.eclipse.org/ @@ -46,15 +46,6 @@ URL: http://www.eclipse.org/ Source0: R4_platform-aggregator-%{eclipse_tag}.tar.xz Source1: http://git.eclipse.org/c/linuxtools/org.eclipse.linuxtools.eclipse-build.git/snapshot/org.eclipse.linuxtools.eclipse-build-%{eb_commit}.tar.bz2 -# -com.sun.el -# +javax.el -# -org.apache.jasper.glassfish -# +org.glassfish.web.javax.servlet.jsp -Patch0: %{pkg_name}-help-doc-adjust-dependencies.patch - -# -org.w3c.dom.smil -# -javax.annotation -# +org.apache.geronimo.specs.geronimo-annotation_1.1_spec Patch1: %{pkg_name}-remove-w3c-smil-and-use-geronimo.patch # Eclipse should not include source for dependencies that are not supplied by this package @@ -80,7 +71,6 @@ Patch7: %{pkg_name}-pdebuild-add-target.patch # Strict Fedora purpose, too. We can't build entire product, just base # and JDT and SDK as update sites, then we can assemble our own packages. # https://bugs.eclipse.org/bugs/show_bug.cgi?id=386670 -# additional poms are a part of e-b Patch8: %{pkg_name}-change-build-packagings.patch Patch9: %{pkg_name}-test-support.patch @@ -97,6 +87,8 @@ Patch15: %{pkg_name}-fix-startup-class-refresh.patch Patch16: %{pkg_name}-fix-dropins.patch Patch17: %{pkg_name}-bug-386377.patch + +# Port eclipse user assistance to latest version of lucene Patch19: %{pkg_name}-lucene-4.patch # Resolving the target platform requires too many changes, so don't use it @@ -115,6 +107,14 @@ Patch25: %{pkg_name}-support-symlink-bundles.patch # If plugin is external, updating it breaks the feature. (version changes) # Workaround : Change definition to a 'requirement' and list # the plugin in the top-level category so it still gets bundled. +# Also makes the following BSN changes at the same time: +# -com.sun.el +# +javax.el +# -org.apache.jasper.glassfish +# +org.glassfish.web.javax.servlet.jsp +# -javax.annotation +# +org.apache.geronimo.specs.geronimo-annotation_1.1_spec +# -org.w3c.dom.smil Patch26: %{pkg_name}-feature-plugins-to-category-ius.patch # Require hamcrest when using directly (cannot rely on junit reexporting it) @@ -157,7 +157,7 @@ BuildRequires: osgi(org.eclipse.jetty.servlet) >= %{_jetty_version} BuildRequires: %{?scl_prefix}lucene-core >= 4.10.2 BuildRequires: %{?scl_prefix}lucene-analysis >= 4.10.2 BuildRequires: junit >= 4.10-5 -BuildRequires: hamcrest >= 0:1.1-11 +BuildRequires: hamcrest >= 0:1.3-11 BuildRequires: sat4j >= 2.3.5-1 BuildRequires: objectweb-asm >= 5.0.3-1 BuildRequires: zip @@ -256,7 +256,7 @@ Java Development Tools or the Plugin Development Environment. Summary: Eclipse Java Development Tools Requires: %{name}-platform = %{epoch}:%{eclipse_version}-%{release} Requires: junit >= 4.10-5 -Requires: hamcrest >= 0:1.1-11 +Requires: hamcrest-core >= 0:1.3-11 %description jdt Eclipse Java Development Tools. This package is required to use Eclipse for @@ -302,7 +302,6 @@ Eclipse Tests. tar --strip-components=1 -xf %{SOURCE1} -%patch0 -p1 %patch1 %patch2 %patch3 @@ -1017,6 +1016,10 @@ fi %{_libdir}/%{pkg_name}/plugins/org.eclipse.osgi.compatibility.state_* %changelog +* Wed Mar 04 2015 Mat Booth - 1:4.5.0-0.4.git201503030800 +- Update to latest I-build +- JDT requires only hamcrest-core + * Wed Feb 25 2015 Mat Booth - 1:4.5.0-0.3.git201502240800 - Update to latest I-build - Require jetty 9.2.9 diff --git a/get-eclipse.sh b/get-eclipse.sh index 500adfc..41fae20 100755 --- a/get-eclipse.sh +++ b/get-eclipse.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e AGGREGATOR_PATH=git://git.eclipse.org/gitroot/platform/eclipse.platform.releng.aggregator.git -TAG=I20150224-0800 +TAG=I20150303-0800 rm -rf R4_platform-aggregator-$TAG rm -rf R4_platform-aggregator-$TAG.tar.xz