Skip to content
Commits on Source (3)
eclipse-platform-ua (4.8-1) unstable; urgency=medium
* New upstream release
-- Emmanuel Bourg <ebourg@apache.org> Tue, 27 Nov 2018 13:21:28 +0100
eclipse-platform-ua (4.7.3-1) unstable; urgency=medium
* Initial release (Closes: #910187)
......
......@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %help_base_plugin_name
Bundle-SymbolicName: org.eclipse.help.base; singleton:=true
Bundle-Version: 4.2.103.qualifier
Bundle-Version: 4.2.200.qualifier
Bundle-Activator: org.eclipse.help.internal.base.HelpBasePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
......@@ -44,11 +44,11 @@ Require-Bundle: org.eclipse.ant.core;bundle-version="[3.2.200,4.0.0)";resolution
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.eclipse.core.net;bundle-version="[1.2.200,2.0.0]",
org.apache.lucene.analyzers-common;bundle-version="[6.1.0,7.0.0)",
org.apache.lucene.core;bundle-version="[6.1.0,7.0.0)",
org.apache.lucene.misc;bundle-version="[6.1.0,7.0.0)",
org.apache.lucene.analyzers-smartcn;bundle-version="[6.1.0,7.0.0)"
org.apache.lucene.analyzers-common;bundle-version="[7.0.0,8.0.0)",
org.apache.lucene.core;bundle-version="[7.0.0,8.0.0)",
org.apache.lucene.analyzers-smartcn;bundle-version="[7.0.0,8.0.0)"
Import-Package: com.ibm.icu.text,
org.eclipse.equinox.http.jetty;resolution:=optional
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: org.eclipse.help.base
###############################################################################
# Copyright (c) 2000, 2017 IBM Corporation and others.
# Copyright (c) 2000, 2018 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
......
......@@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.ua</artifactId>
<groupId>eclipse.platform.ua</groupId>
<version>4.7.3-SNAPSHOT</version>
<version>4.8.0-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.help</groupId>
<artifactId>org.eclipse.help.base</artifactId>
<version>4.2.103-SNAPSHOT</version>
<version>4.2.200-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<properties>
<defaultSigning-excludeInnerJars>true</defaultSigning-excludeInnerJars>
......
/*******************************************************************************
* Copyright (c) 2000, 2015 IBM Corporation and others.
* Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
......@@ -321,7 +321,7 @@ public final class BaseHelpSystem {
try {
Class<?> c = bundle.loadClass(className);
Object o = c.newInstance();
Object o = c.getDeclaredConstructor().newInstance();
//Runnable runnable = null;
if (o != null && o instanceof ILiveHelpAction) {
ILiveHelpAction helpExt = (ILiveHelpAction) o;
......
......@@ -100,6 +100,9 @@ public class IndexToolApplication implements IApplication {
private static void delete(File file) throws IOException {
if (file.isDirectory()) {
File files[] = file.listFiles();
if(files == null) {
throw new IOException("Content from directory '" + file.getAbsolutePath() + "' can not be listed."); //$NON-NLS-1$ //$NON-NLS-2$
}
for (int i = 0; i < files.length; i++) {
delete(files[i]);
}
......
......@@ -56,7 +56,7 @@ public class HttpsUtility {
public static InputStream getHttpsInputStream(String thisProtocol,String thisHost, String thisPort, String thisPath, String locale)
{
try {
URL url = new URL(thisProtocol, thisHost, new Integer(thisPort) .intValue(),
URL url = new URL(thisProtocol, thisHost, Integer.valueOf(thisPort) .intValue(),
thisPath + PATH_TOC + '?' + PARAM_LANG + '=' + locale);
return getHttpsStream(url);
} catch (Exception e) {
......@@ -68,7 +68,7 @@ public class HttpsUtility {
public static URL getHttpsURL(String thisProtocol,String thisHost, int thisPort, String thisPath)
{
try {
return new URL(thisProtocol, thisHost, new Integer(thisPort) .intValue(),
return new URL(thisProtocol, thisHost, Integer.valueOf(thisPort) .intValue(),
thisPath + PATH_TOC);
} catch (Exception e) {
e.printStackTrace();
......
......@@ -60,7 +60,7 @@ public class RemoteContextProvider extends AbstractContextProvider {
HttpURLConnection connection;
if(protocols[i].equals(PROTOCOL))
{
url = new URL(PROTOCOL, host[i], new Integer(port[i]).intValue(), path[i]+ PATH_CONTEXT + '?' + PARAM_ID + '=' + id + '&' + PARAM_LANG + '=' + locale);
url = new URL(PROTOCOL, host[i], Integer.valueOf(port[i]).intValue(), path[i]+ PATH_CONTEXT + '?' + PARAM_ID + '=' + id + '&' + PARAM_LANG + '=' + locale);
connection = (HttpURLConnection)ProxyUtil.getConnection(url);
if (connection.getResponseCode() == 200) {
in = connection.getInputStream();
......
......@@ -61,7 +61,7 @@ public class RemoteSearchManager {
if(protocols[i].equals(PROTOCOL_HTTP))
{
url = new URL("http", host[i], new Integer(port[i]).intValue(), path[i] + PATH_SEARCH + '?' + PARAM_PHRASE + '=' + URLCoder.encode(searchQuery.getSearchWord()) + '&' + PARAM_LANG + '=' + searchQuery.getLocale()); //$NON-NLS-1$
url = new URL("http", host[i], Integer.valueOf(port[i]).intValue(), path[i] + PATH_SEARCH + '?' + PARAM_PHRASE + '=' + URLCoder.encode(searchQuery.getSearchWord()) + '&' + PARAM_LANG + '=' + searchQuery.getLocale()); //$NON-NLS-1$
in = ProxyUtil.getStream(url);
}
else
......
......@@ -37,7 +37,7 @@ public class RemoteSearchParser extends DefaultHandler {
private SAXParser parser;
private Stack<SearchHit> stack;
private List<SearchHit> hits;
private StringBuffer summary;
private StringBuilder summary;
/*
* Parses the given serialized search hits and returns generated model
......@@ -131,8 +131,8 @@ public class RemoteSearchParser extends DefaultHandler {
}
private void handleSummary(Attributes attr) {
// prepare the buffer to receive text summary
summary = new StringBuffer();
// prepare the builder to receive text summary
summary = new StringBuilder();
}
/*
......
......@@ -81,7 +81,7 @@ public class RemoteTocProvider extends AbstractTocProvider {
if(protocol[i].equalsIgnoreCase(PROTOCOL))
{
url = new URL(protocol[i], host[i], new Integer(port[i]) .intValue(),
url = new URL(protocol[i], host[i], Integer.valueOf(port[i]) .intValue(),
path[i] + PATH_TOC + '?' + PARAM_LANG + '=' + locale);
in = ProxyUtil.getStream(url);
......
......@@ -25,7 +25,7 @@ public class TString {
return in;
int lastIndex = 0;
int newIndex = 0;
StringBuffer newString = new StringBuffer();
StringBuilder newString = new StringBuilder();
for (;;) {
newIndex = in.indexOf(oldPat, lastIndex);
if (newIndex != -1) {
......
......@@ -172,7 +172,7 @@ public class CustomBrowser implements IBrowser {
*/
private String doSubstitutions(String token, String url) {
boolean substituted = false;
StringBuffer newToken = new StringBuffer(token);
StringBuilder newToken = new StringBuilder(token);
String substitutionMarker = "%1"; //$NON-NLS-1$
int index = newToken.indexOf(substitutionMarker);
while (index != -1) {
......
......@@ -16,11 +16,11 @@ import java.util.HashSet;
import java.util.Set;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.CharArraySet;
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;
/**
* Lucene Analyzer for English.
......
......@@ -195,11 +195,13 @@ class IndexingOperation {
*/
private void removeNewDocuments(IProgressMonitor pm, Map<String, String[]> docsToDelete)
throws IndexingException {
if (docsToDelete.size() == 0) {
return;
}
pm = new LazyProgressMonitor(pm);
pm.beginTask("", docsToDelete.size()); //$NON-NLS-1$
checkCancelled(pm);
Set<String> keysToDelete = docsToDelete.keySet();
if (keysToDelete.size() > 0) {
if (!index.beginRemoveDuplicatesBatch()) {
throw new IndexingException();
}
......@@ -232,7 +234,6 @@ class IndexingOperation {
if (!index.endRemoveDuplicatesBatch()) {
throw new IndexingException();
}
}
pm.done();
}
......
......@@ -253,7 +253,7 @@ public final class InfoCenter implements ISearchEngine {
if (scope.url == null) {
return null;
}
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
buf.append(scope.url);
if (!scope.url.endsWith("/")) //$NON-NLS-1$
buf.append("/search?phrase="); //$NON-NLS-1$
......
......@@ -152,7 +152,7 @@ public class PluginIndex {
.getProperty(SearchIndex.DEPENDENCIES_KEY_ANALYZER);
if (!targetIndex.isLuceneCompatible(lucene) || !targetIndex.isAnalyzerCompatible(analyzer)) {
String message = "Unable to consume Lucene index from bundle '" + bundle.toString() //$NON-NLS-1$
+ "'. The index should be rebuilt with Lucene 6.1."; //$NON-NLS-1$
+ "'. The index should be rebuilt with Lucene 7.0.0"; //$NON-NLS-1$
Status warningStatus = new Status(IStatus.WARNING, HelpBasePlugin.PLUGIN_ID, IStatus.OK, message, null);
HelpBasePlugin.logStatus(warningStatus);
return false;
......@@ -202,7 +202,7 @@ public class PluginIndex {
@Override
public String toString() {
StringBuffer ret = new StringBuffer(pluginId);
StringBuilder ret = new StringBuilder(pluginId);
ret.append(":"); //$NON-NLS-1$
ret.append(path);
ret.append("="); //$NON-NLS-1$
......
......@@ -447,7 +447,7 @@ public class QueryBuilder {
* word roots.
*/
public String gethighlightTerms() {
StringBuffer buf = new StringBuffer();
StringBuilder buf = new StringBuilder();
for (Iterator<String> it = highlightWords.iterator(); it.hasNext();) {
buf.append('"');
buf.append(it.next());
......
/*******************************************************************************
* Copyright (c) 2000, 2016 IBM Corporation and others.
* Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
......@@ -46,11 +46,10 @@ 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.LeafReader;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.LogByteSizeMergePolicy;
import org.apache.lucene.index.LogMergePolicy;
import org.apache.lucene.index.PostingsEnum;
import org.apache.lucene.index.SlowCompositeReaderWrapper;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.IndexSearcher;
......@@ -200,7 +199,7 @@ public class SearchIndex implements IHelpSearchIndex {
try {
DirectoryReader.open(luceneDirectory);
} catch (IndexFormatTooOldException | IndexNotFoundException e) {
} catch (IndexFormatTooOldException | IndexNotFoundException | IllegalArgumentException e) {
deleteDir(indexDir);
indexDir.delete();
} catch (IOException e) {
......@@ -211,6 +210,9 @@ public class SearchIndex implements IHelpSearchIndex {
private void deleteDir(File indexDir) {
File[] files = indexDir.listFiles();
if(files == null) {
files = new File[0];
}
for (File file : files) {
if (file.isDirectory())
deleteDir(file);
......@@ -352,6 +354,9 @@ public class SearchIndex implements IHelpSearchIndex {
ir.close();
}
ir = DirectoryReader.open(luceneDirectory);
if (iw == null) {
return beginDeleteBatch();
}
return true;
} catch (IOException e) {
HelpBasePlugin.logError("Exception occurred in search indexing at beginDeleteBatch.", e); //$NON-NLS-1$
......@@ -458,6 +463,8 @@ public class SearchIndex implements IHelpSearchIndex {
return false;
ir.close();
ir = null;
iw.close();
iw = null;
// save the update info:
// - all the docs
// - plugins (and their version) that were indexed
......@@ -557,16 +564,19 @@ public class SearchIndex implements IHelpSearchIndex {
public IStatus removeDuplicates(String name, String[] index_paths) {
try (LeafReader ar = SlowCompositeReaderWrapper.wrap(ir)) {
try (DirectoryReader ar = DirectoryReader.open(luceneDirectory)) {
PostingsEnum hrefDocs = null;
PostingsEnum indexDocs = null;
Term hrefTerm = new Term(FIELD_NAME, name);
for (int i = 0; i < index_paths.length; i++) {
Term indexTerm = new Term(FIELD_INDEX_ID, index_paths[i]);
hrefDocs = ar.postings(hrefTerm);
indexDocs = ar.postings(indexTerm);
List<LeafReaderContext> leaves = ar.leaves();
for (LeafReaderContext c : leaves) {
indexDocs = c.reader().postings(indexTerm);
hrefDocs = c.reader().postings(hrefTerm);
removeDocuments(hrefDocs, indexDocs);
}
}
} catch (IOException ioe) {
return new Status(IStatus.ERROR, HelpBasePlugin.PLUGIN_ID, IStatus.ERROR,
"IO exception occurred while removing duplicates of document " + name //$NON-NLS-1$
......@@ -679,7 +689,7 @@ public class SearchIndex implements IHelpSearchIndex {
IExtension[] extensions = extensionPoint.getExtensions();
for (int i=0;i<extensions.length;++i) {
try {
totalIds.add(extensions[i].getNamespaceIdentifier());
totalIds.add(extensions[i].getContributor().getName());
}
catch (InvalidRegistryObjectException e) {
// ignore this extension and move on
......@@ -745,9 +755,9 @@ public class SearchIndex implements IHelpSearchIndex {
}
Version luceneVersion = new Version(luceneVersionString);
Version indexVersion = new Version(indexVersionString);
Version v610 = new Version(6, 1, 0);
if (indexVersion.compareTo(v610) < 0) {
// index is older than Lucene 6.1.0
Version v700 = new Version(7, 0, 0);
if (indexVersion.compareTo(v700) < 0) {
// index is older than Lucene 7.0.0
return false;
}
if ( luceneVersion.compareTo(indexVersion) >= 0 ) {
......@@ -1088,7 +1098,7 @@ public class SearchIndex implements IHelpSearchIndex {
return null;
try {
StringBuffer query = new StringBuffer();
StringBuilder query = new StringBuilder();
query.append("?"); //$NON-NLS-1$
query.append("lang=" + locale); //$NON-NLS-1$
if (id != null)
......
......@@ -133,7 +133,7 @@ public final class WebSearch implements ISearchEngine {
}
private static String composeURL(String query, String urlTemplate) {
StringBuffer result = new StringBuffer();
StringBuilder result = new StringBuilder();
boolean inSubstitution = false;
int varStart = -1;
for (int i = 0; i < urlTemplate.length(); i++) {
......