diff --git a/app/test/cc/arduino/contributions/UpdatableLibraryTest.java b/app/test/cc/arduino/contributions/UpdatableLibraryTest.java index e06c12710..0dab3531c 100644 --- a/app/test/cc/arduino/contributions/UpdatableLibraryTest.java +++ b/app/test/cc/arduino/contributions/UpdatableLibraryTest.java @@ -36,8 +36,7 @@ public class UpdatableLibraryTest { LibrariesIndexer indexer = new LibrariesIndexer(index_SD_only); BaseNoGui.librariesIndexer = indexer; indexer.parseIndex(); - indexer.setLibrariesFolders(folders); - indexer.rescanLibraries(); + indexer.setLibrariesFoldersAndRescan(folders); ContributedLibrary sdLib = indexer.getIndex().getInstalled("SD").get(); assertTrue("SD lib is installed", sdLib.isLibraryInstalled()); @@ -46,7 +45,7 @@ public class UpdatableLibraryTest { assertTrue(ContributionsSelfCheck.checkForUpdatableLibraries()); folders.add(new UserLibraryFolder(SD121, Location.SKETCHBOOK)); - indexer.setLibrariesFolders(folders); + indexer.setLibrariesFoldersAndRescan(folders); sdLib = indexer.getIndex().getInstalled("SD").get(); assertTrue("SD lib is installed", sdLib.isLibraryInstalled()); @@ -63,8 +62,7 @@ public class UpdatableLibraryTest { LibrariesIndexer indexer = new LibrariesIndexer(index_Bridge_only); BaseNoGui.librariesIndexer = indexer; indexer.parseIndex(); - indexer.setLibrariesFolders(folders); - indexer.rescanLibraries(); + indexer.setLibrariesFoldersAndRescan(folders); ContributedLibrary l = indexer.getIndex().getInstalled("Bridge").get(); assertTrue("Bridge lib is installed", l.isLibraryInstalled()); @@ -73,7 +71,7 @@ public class UpdatableLibraryTest { assertTrue(ContributionsSelfCheck.checkForUpdatableLibraries()); folders.add(new UserLibraryFolder(Bridge170, Location.SKETCHBOOK)); - indexer.setLibrariesFolders(folders); + indexer.setLibrariesFoldersAndRescan(folders); l = indexer.getIndex().getInstalled("Bridge").get(); assertTrue("Bridge lib is installed", l.isLibraryInstalled()); diff --git a/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java b/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java index fb0b0c76a..57460fc19 100644 --- a/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java +++ b/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java @@ -114,7 +114,11 @@ public class LibrariesIndexer { } public void setLibrariesFolders(List folders) { - librariesFolders = folders; + this.librariesFolders = folders; + } + + public void setLibrariesFoldersAndRescan(List folders) { + setLibrariesFolders(folders); rescanLibraries(); }