|
Lines 265-297
Link Here
|
| 265 |
int length = entries.length; |
265 |
int length = entries.length; |
| 266 |
for (int i = 0; i < length; i++) { |
266 |
for (int i = 0; i < length; i++) { |
| 267 |
IBuildEntry buildEntry = entries[i]; |
267 |
IBuildEntry buildEntry = entries[i]; |
| 268 |
if (buildEntry.getName().startsWith(IBuildEntry.JAR_PREFIX)) { |
268 |
String name = buildEntry.getName(); |
| 269 |
String jar = buildEntry.getName().substring(IBuildEntry.JAR_PREFIX.length()); |
269 |
if (name.startsWith(IBuildEntry.JAR_PREFIX)) { |
| 270 |
String[] tokens = buildEntry.getTokens(); |
270 |
retrieveContainers(name, IBuildEntry.JAR_PREFIX, buildEntry); |
| 271 |
if (tokens.length == 1) { |
271 |
} else if (name.startsWith("extra.")) { //$NON-NLS-1$ |
| 272 |
IApiTypeContainer container = getApiTypeContainer(tokens[0], this); |
272 |
retrieveContainers(name, "extra.", buildEntry); //$NON-NLS-1$ |
| 273 |
if (container != null) { |
|
|
| 274 |
fPathToOutputContainers.put(jar, container); |
| 275 |
} |
| 276 |
} else { |
| 277 |
List containers = new ArrayList(); |
| 278 |
for (int j = 0; j < tokens.length; j++) { |
| 279 |
String currentToken = tokens[j]; |
| 280 |
IApiTypeContainer container = getApiTypeContainer(currentToken, this); |
| 281 |
if (container != null && !containers.contains(container)) { |
| 282 |
containers.add(container); |
| 283 |
} |
| 284 |
} |
| 285 |
if (!containers.isEmpty()) { |
| 286 |
IApiTypeContainer cfc = null; |
| 287 |
if (containers.size() == 1) { |
| 288 |
cfc = (IApiTypeContainer) containers.get(0); |
| 289 |
} else { |
| 290 |
cfc = new CompositeApiTypeContainer(this, containers); |
| 291 |
} |
| 292 |
fPathToOutputContainers.put(jar, cfc); |
| 293 |
} |
| 294 |
} |
| 295 |
} |
273 |
} |
| 296 |
} |
274 |
} |
| 297 |
} |
275 |
} |
|
Lines 301-307
Link Here
|
| 301 |
} |
279 |
} |
| 302 |
return Collections.EMPTY_LIST; |
280 |
return Collections.EMPTY_LIST; |
| 303 |
} |
281 |
} |
| 304 |
|
282 |
private void retrieveContainers(String name, String prefix, IBuildEntry buildEntry) throws CoreException { |
|
|
283 |
String jar = name.substring(prefix.length()); |
| 284 |
String[] tokens = buildEntry.getTokens(); |
| 285 |
if (tokens.length == 1) { |
| 286 |
IApiTypeContainer container = getApiTypeContainer(tokens[0], this); |
| 287 |
if (container != null) { |
| 288 |
IApiTypeContainer existingContainer = (IApiTypeContainer) this.fPathToOutputContainers.get(jar); |
| 289 |
if (existingContainer != null) { |
| 290 |
// concat both containers |
| 291 |
List allContainers = new ArrayList(); |
| 292 |
allContainers.add(existingContainer); |
| 293 |
allContainers.add(container); |
| 294 |
IApiTypeContainer apiTypeContainer = new CompositeApiTypeContainer(this, allContainers); |
| 295 |
fPathToOutputContainers.put(jar, apiTypeContainer); |
| 296 |
} else { |
| 297 |
fPathToOutputContainers.put(jar, container); |
| 298 |
} |
| 299 |
} |
| 300 |
} else { |
| 301 |
List containers = new ArrayList(); |
| 302 |
for (int j = 0; j < tokens.length; j++) { |
| 303 |
String currentToken = tokens[j]; |
| 304 |
IApiTypeContainer container = getApiTypeContainer(currentToken, this); |
| 305 |
if (container != null && !containers.contains(container)) { |
| 306 |
containers.add(container); |
| 307 |
} |
| 308 |
} |
| 309 |
if (!containers.isEmpty()) { |
| 310 |
IApiTypeContainer existingContainer = (IApiTypeContainer) this.fPathToOutputContainers.get(jar); |
| 311 |
if (existingContainer != null) { |
| 312 |
// concat both containers |
| 313 |
containers.add(existingContainer); |
| 314 |
} |
| 315 |
IApiTypeContainer cfc = null; |
| 316 |
if (containers.size() == 1) { |
| 317 |
cfc = (IApiTypeContainer) containers.get(0); |
| 318 |
} else { |
| 319 |
cfc = new CompositeApiTypeContainer(this, containers); |
| 320 |
} |
| 321 |
fPathToOutputContainers.put(jar, cfc); |
| 322 |
} |
| 323 |
} |
| 324 |
} |
| 305 |
/* (non-Javadoc) |
325 |
/* (non-Javadoc) |
| 306 |
* @see org.eclipse.pde.api.tools.internal.BundleApiComponent#createClassFileContainer(java.lang.String) |
326 |
* @see org.eclipse.pde.api.tools.internal.BundleApiComponent#createClassFileContainer(java.lang.String) |
| 307 |
*/ |
327 |
*/ |