MCPcopy Index your code
hub / github.com/benfry/processing4 / getLibrary

Method getLibrary

app/src/processing/app/Mode.java:357–379  ·  view source on GitHub ↗
(String pkgName)

Source from the content-addressed store, hash-verified

355
356
357 public Library getLibrary(String pkgName) throws SketchException {
358 List<Library> libraries = importToLibraryTable.get(pkgName);
359 if (libraries == null) {
360 return null;
361
362 } else if (libraries.size() > 1) {
363 String primary = "More than one library is competing for this sketch.";
364 String secondary = "The import " + pkgName + " points to multiple libraries:<br>";
365 for (Library library : libraries) {
366 String location = library.getPath();
367 if (location.startsWith(getLibrariesFolder().getAbsolutePath())) {
368 location = "part of Processing";
369 }
370 secondary += "<b>" + library.getName() + "</b> (" + location + ")<br>";
371 }
372 secondary += "Extra libraries need to be removed before this sketch can be used.";
373 Messages.showWarningTiered("Duplicate Library Problem", primary, secondary, null);
374 throw new SketchException("Duplicate libraries found for " + pkgName + ".");
375
376 } else {
377 return libraries.get(0);
378 }
379 }
380
381
382 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Callers 4

createTestJavaModeMethod · 0.80
preprocessMethod · 0.80

Calls 6

getLibrariesFolderMethod · 0.95
showWarningTieredMethod · 0.95
getMethod · 0.65
sizeMethod · 0.45
getPathMethod · 0.45
getNameMethod · 0.45

Tested by 1

createTestJavaModeMethod · 0.64