Skip to content

Commit bf1b523

Browse files
committed
Removed installedLibrariesWithDuplicates since it's no more used
1 parent 627d4fb commit bf1b523

File tree

2 files changed

+0
-40
lines changed

2 files changed

+0
-40
lines changed

arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java

-21
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public class LibrariesIndexer {
5959

6060
private LibrariesIndex index;
6161
private final LibraryList installedLibraries = new LibraryList();
62-
private final LibraryList installedLibrariesWithDuplicates = new LibraryList();
6362
private List<File> librariesFolders;
6463
private final File indexFile;
6564
private final File stagingFolder;
@@ -113,7 +112,6 @@ public List<File> getLibrariesFolders() {
113112
public void rescanLibraries() {
114113
// Clear all installed flags
115114
installedLibraries.clear();
116-
installedLibrariesWithDuplicates.clear();
117115

118116
if (index.getLibraries() == null) {
119117
return;
@@ -180,11 +178,6 @@ private void scanLibrary(File folder, boolean isSketchbook) throws IOException {
180178
throw new IOException(lib.getSrcFolder().getAbsolutePath());
181179
}
182180
installedLibraries.addOrReplace(lib);
183-
if (isSketchbook) {
184-
installedLibrariesWithDuplicates.add(lib);
185-
} else {
186-
installedLibrariesWithDuplicates.addOrReplace(lib);
187-
}
188181
return;
189182
}
190183

@@ -196,11 +189,6 @@ private void scanLibrary(File folder, boolean isSketchbook) throws IOException {
196189
throw new IOException(lib.getSrcFolder().getAbsolutePath());
197190
}
198191
installedLibraries.addOrReplaceArchAware(lib);
199-
if (isSketchbook) {
200-
installedLibrariesWithDuplicates.add(lib);
201-
} else {
202-
installedLibrariesWithDuplicates.addOrReplaceArchAware(lib);
203-
}
204192

205193
// Check if we can find the same library in the index
206194
// and mark it as installed
@@ -229,15 +217,6 @@ public LibraryList getInstalledLibraries() {
229217
return new LibraryList(installedLibraries);
230218
}
231219

232-
// Same as getInstalledLibraries(), but allow duplicates between
233-
// builtin+package libraries and sketchbook installed libraries.
234-
// However, do not report duplicates among builtin and packages, to
235-
// allow any package to override builtin libraries without being
236-
// reported as duplicates.
237-
public LibraryList getInstalledLibrariesWithDuplicates() {
238-
return installedLibrariesWithDuplicates;
239-
}
240-
241220
public File getStagingFolder() {
242221
return stagingFolder;
243222
}

arduino-core/src/processing/app/BaseNoGui.java

-19
Original file line numberDiff line numberDiff line change
@@ -816,25 +816,6 @@ static public void populateImportToLibraryTable() {
816816
.format("Unable to list header files in {0}", lib.getSrcFolder()), e);
817817
}
818818
}
819-
// repeat for ALL libraries, to pick up duplicates not visible normally.
820-
// any new libraries found here are NEVER used, but they are added to the
821-
// end of already-found headers, to allow Compiler to report them if
822-
// the sketch tries to use them.
823-
for (UserLibrary lib : librariesIndexer.getInstalledLibrariesWithDuplicates()) {
824-
try {
825-
String headers[] = headerListFromIncludePath(lib.getSrcFolder());
826-
for (String header : headers) {
827-
LibraryList list = importToLibraryTable.get(header);
828-
if (list != null) {
829-
if (!(list.hasLibrary(lib))) {
830-
list.addLast(lib);
831-
//System.out.println(" duplicate lib: " + lib.getInstalledFolder().getPath());
832-
}
833-
}
834-
}
835-
} catch (IOException e) {
836-
}
837-
}
838819
}
839820

840821
static public void initParameters(String args[]) throws Exception {

0 commit comments

Comments
 (0)