MCPcopy Index your code
hub / github.com/processing/processing / getLibrary

Method getLibrary

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

Source from the content-addressed store, hash-verified

403
404
405 public Library getLibrary(String pkgName) throws SketchException {
406 List<Library> libraries = importToLibraryTable.get(pkgName);
407 if (libraries == null) {
408 return null;
409
410 } else if (libraries.size() > 1) {
411 String primary = "More than one library is competing for this sketch.";
412 String secondary = "The import " + pkgName + " points to multiple libraries:<br>";
413 for (Library library : libraries) {
414 String location = library.getPath();
415 if (location.startsWith(getLibrariesFolder().getAbsolutePath())) {
416 location = "part of Processing";
417 }
418 secondary += "<b>" + library.getName() + "</b> (" + location + ")<br>";
419 }
420 secondary += "Extra libraries need to be removed before this sketch can be used.";
421 Messages.showWarningTiered("Duplicate Library Problem", primary, secondary, null);
422 throw new SketchException("Duplicate libraries found for " + pkgName + ".");
423
424 } else {
425 return libraries.get(0);
426 }
427 }
428
429
430 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Callers 3

preprocessMethod · 0.80

Calls 7

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

Tested by

no test coverage detected