File tree 1 file changed +6
-6
lines changed
arduino-core/src/processing/app/packages
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -50,29 +50,29 @@ public LibraryList(List<UserLibrary> ideLibs) {
50
50
super (ideLibs );
51
51
}
52
52
53
- public UserLibrary getByName (String name ) {
53
+ public synchronized UserLibrary getByName (String name ) {
54
54
for (UserLibrary l : this )
55
55
if (l .getName ().equals (name ))
56
56
return l ;
57
57
return null ;
58
58
}
59
59
60
- public void addOrReplace (UserLibrary lib ) {
60
+ public synchronized void addOrReplace (UserLibrary lib ) {
61
61
remove (lib );
62
62
add (lib );
63
63
}
64
64
65
- public void remove (UserLibrary lib ) {
65
+ public synchronized void remove (UserLibrary lib ) {
66
66
UserLibrary l = getByName (lib .getName ());
67
67
if (l != null )
68
68
super .remove (l );
69
69
}
70
70
71
- public void sort () {
71
+ public synchronized void sort () {
72
72
Collections .sort (this , UserLibrary .CASE_INSENSITIVE_ORDER );
73
73
}
74
74
75
- public LibraryList filterLibrariesInSubfolder (File subFolder ) {
75
+ public synchronized LibraryList filterLibrariesInSubfolder (File subFolder ) {
76
76
LibraryList res = new LibraryList ();
77
77
for (UserLibrary lib : this ) {
78
78
if (FileUtils .isSubDirectory (subFolder , lib .getInstalledFolder ())) {
@@ -82,7 +82,7 @@ public LibraryList filterLibrariesInSubfolder(File subFolder) {
82
82
return res ;
83
83
}
84
84
85
- public boolean hasLibrary (UserLibrary lib ) {
85
+ public synchronized boolean hasLibrary (UserLibrary lib ) {
86
86
for (UserLibrary l : this )
87
87
if (l == lib ) return true ;
88
88
return false ;
You can’t perform that action at this time.
0 commit comments