Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2008 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2009 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 25-30
Link Here
|
25 |
import org.eclipse.jdt.core.search.IJavaSearchScope; |
25 |
import org.eclipse.jdt.core.search.IJavaSearchScope; |
26 |
import org.eclipse.jdt.core.search.SearchEngine; |
26 |
import org.eclipse.jdt.core.search.SearchEngine; |
27 |
import org.eclipse.jdt.core.search.SearchParticipant; |
27 |
import org.eclipse.jdt.core.search.SearchParticipant; |
|
|
28 |
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; |
28 |
import org.eclipse.jdt.internal.compiler.util.SimpleLookupTable; |
29 |
import org.eclipse.jdt.internal.compiler.util.SimpleLookupTable; |
29 |
import org.eclipse.jdt.internal.compiler.util.Util; |
30 |
import org.eclipse.jdt.internal.compiler.util.Util; |
30 |
import org.eclipse.jdt.internal.core.JavaModelManager; |
31 |
import org.eclipse.jdt.internal.core.JavaModelManager; |
Lines 153-159
Link Here
|
153 |
// iterate each entry to index it |
154 |
// iterate each entry to index it |
154 |
ZipEntry ze = (ZipEntry) e.nextElement(); |
155 |
ZipEntry ze = (ZipEntry) e.nextElement(); |
155 |
String zipEntryName = ze.getName(); |
156 |
String zipEntryName = ze.getName(); |
156 |
if (Util.isClassFileName(zipEntryName)) |
157 |
if (Util.isClassFileName(zipEntryName) && (indexedFileNames.get(zipEntryName) != null) |
|
|
158 |
|| org.eclipse.jdt.internal.core.util.Util.isPackageNameForClassValid(zipEntryName, CompilerOptions.VERSION_1_5, CompilerOptions.VERSION_1_5)) |
159 |
// the class file may not be there if the package name is not valid |
157 |
indexedFileNames.put(zipEntryName, EXISTS); |
160 |
indexedFileNames.put(zipEntryName, EXISTS); |
158 |
} |
161 |
} |
159 |
boolean needToReindex = indexedFileNames.elementSize != max; // a new file was added |
162 |
boolean needToReindex = indexedFileNames.elementSize != max; // a new file was added |
Lines 195-201
Link Here
|
195 |
|
198 |
|
196 |
// iterate each entry to index it |
199 |
// iterate each entry to index it |
197 |
ZipEntry ze = (ZipEntry) e.nextElement(); |
200 |
ZipEntry ze = (ZipEntry) e.nextElement(); |
198 |
if (Util.isClassFileName(ze.getName())) { |
201 |
String zipEntryName = ze.getName(); |
|
|
202 |
if (Util.isClassFileName(zipEntryName) && |
203 |
org.eclipse.jdt.internal.core.util.Util.isPackageNameForClassValid(zipEntryName, CompilerOptions.VERSION_1_5, CompilerOptions.VERSION_1_5)) { |
204 |
// index only classes coming from valid packages - https://bugs.eclipse.org/bugs/show_bug.cgi?id=293861 |
199 |
final byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(ze, zip); |
205 |
final byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(ze, zip); |
200 |
JavaSearchDocument entryDocument = new JavaSearchDocument(ze, zipFilePath, classFileBytes, participant); |
206 |
JavaSearchDocument entryDocument = new JavaSearchDocument(ze, zipFilePath, classFileBytes, participant); |
201 |
this.manager.indexDocument(entryDocument, participant, index, this.containerPath); |
207 |
this.manager.indexDocument(entryDocument, participant, index, this.containerPath); |