Skip to content

Commit 3bce7a7

Browse files
author
jantje
committed
handle some TODO and TOFIX tasks
1 parent 5472243 commit 3bce7a7

File tree

11 files changed

+9
-76
lines changed

11 files changed

+9
-76
lines changed

io.sloeber.core/src/cc/arduino/packages/PreferencesMap.java

Lines changed: 3 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
package cc.arduino.packages;
2323

2424
import java.io.File;
25-
import java.io.FileInputStream;
26-
import java.io.FileNotFoundException;
27-
import java.io.IOException;
28-
import java.io.InputStream;
2925
import java.util.LinkedHashMap;
3026
import java.util.Map;
3127
import java.util.SortedSet;
@@ -38,41 +34,13 @@ public PreferencesMap(Map<String, String> table) {
3834
super(table);
3935
}
4036

41-
/**
42-
* Create a PreferencesMap and load the content of the file passed as
43-
* argument.
44-
*
45-
* Is equivalent to:
46-
*
47-
* <pre>
48-
* PreferencesMap map = new PreferencesMap();
49-
* map.load(file);
50-
* </pre>
51-
*
52-
* @param file
53-
* @throws IOException
54-
*/
55-
public PreferencesMap(File file) throws IOException {
56-
super();
57-
load(file);
58-
}
37+
5938

6039
public PreferencesMap() {
6140
super();
6241
}
6342

64-
/**
65-
* Parse a property list file and put kev/value pairs into the Map
66-
*
67-
* @param file
68-
* @throws FileNotFoundException
69-
* @throws IOException
70-
*/
71-
public void load(File file) throws IOException {
72-
try(FileInputStream fileInputStream = new FileInputStream(file);) {
73-
load(fileInputStream);
74-
}
75-
}
43+
7644

7745
@SuppressWarnings("static-method")
7846
protected String processPlatformSuffix(String key, String suffix, boolean isCurrentPlatform) {
@@ -88,33 +56,7 @@ protected String processPlatformSuffix(String key, String suffix, boolean isCurr
8856
return key.substring(0, key.length() - suffix.length());
8957
}
9058

91-
/**
92-
* Parse a property list stream and put key/value pairs into the Map
93-
*
94-
* @param input
95-
* @throws IOException
96-
*/
97-
public void load(InputStream input) throws IOException {
98-
//TOFIX see wether this code is used and if so what to do with it
99-
// String[] lines = PApplet.loadStrings(input);
100-
// for (String line : lines) {
101-
// if (line.length() == 0 || line.charAt(0) == '#')
102-
// continue;
103-
//
104-
// int equals = line.indexOf('=');
105-
// if (equals != -1) {
106-
// String key = line.substring(0, equals).trim();
107-
// String value = line.substring(equals + 1).trim();
108-
//
109-
// key = processPlatformSuffix(key, ".linux", OSUtils.isLinux());
110-
// key = processPlatformSuffix(key, ".windows", OSUtils.isWindows());
111-
// key = processPlatformSuffix(key, ".macosx", OSUtils.isMacOS());
112-
//
113-
// if (key != null)
114-
// put(key, value);
115-
// }
116-
// }
117-
}
59+
11860

11961
/**
12062
* Create a new PreferenceMap that contains all the top level pairs of the

io.sloeber.core/src/cc/arduino/packages/discoverers/NetworkDiscovery.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ public void stop() {
165165
try {
166166
this.jmdns.close();
167167
} catch (IOException e) {
168-
// TODO Auto-generated catch block
169168
e.printStackTrace();
170169
}
171170
}

io.sloeber.core/src/io/sloeber/core/api/SloeberProject.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,6 @@ public static synchronized SloeberProject getSloeberProject(IProject project, bo
812812
return ret;
813813
}
814814
} catch (CoreException e) {
815-
// TODO Auto-generated catch block
816815
e.printStackTrace();
817816
}
818817
if (!allowNull) {

io.sloeber.core/src/io/sloeber/core/common/ConfigurationPreferences.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public static File getPostProcessingBoardsFile() {
162162
}
163163

164164
public static String getJsonURLs() {
165-
// TODO I added some code here to get easier from V3 to V4
165+
// I added some code here to get easier from V3 to V4
166166
// the library json url is now managed as the boards url's so it also
167167
// needs to be added to the json url's
168168
// this is doen in the default but people who have installed other

io.sloeber.core/src/io/sloeber/core/managers/InternalPackageManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ static public synchronized IStatus downloadAndInstall(ArduinoPlatform platform,
145145
try {
146146
Files.copy(packageFile.toPath(), copyToFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
147147
} catch (IOException e) {
148-
// TODO Auto-generated catch block
149148
e.printStackTrace();
150149
}
151150

io.sloeber.core/src/io/sloeber/core/tools/Helpers.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ public static void removeCodeFolder(IProject project, String LinkName) {
257257
try {
258258
link.delete(true, null);
259259
} catch (CoreException e) {
260-
// TODO Auto-generated catch block
261260
e.printStackTrace();
262261
}
263262
}

io.sloeber.core/src/io/sloeber/core/tools/PdePreprocessor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ public static void writeDummySloeberInoCPPFile(IProject iProject) {
154154
}
155155
}
156156
} catch (CoreException e) {
157-
// TODO Auto-generated catch block
158157
e.printStackTrace();
159158
}
160159
}

io.sloeber.core/src/io/sloeber/core/tools/uploaders/arduinoUploader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public boolean uploadUsingPreferences(IFile hexFile, BoardDescription boardDescr
7171
return false;
7272
}
7373

74-
// TODO see whether this is still needed
74+
// due needs a restart after upload
7575
if (boardDescr.getBoardName().startsWith("Arduino Due ")) { //$NON-NLS-1$
7676
ArduinoSerial.reset_Arduino_by_baud_rate(boardDescr.getUploadPort(), 115200, 100);
7777
}

io.sloeber.tests/src/io/sloeber/core/Shared.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ public static String getProjectName(CodeDescription codeDescriptor, Examples exa
269269
}
270270

271271
public static String getLastFailMessage() {
272-
// TODO Auto-generated method stub
273272
return myLastFailMessage;
274273
}
275274

io.sloeber.ui/src/io/sloeber/ui/Import_Libraries_Page.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.eclipse.ui.dialogs.WizardResourceImportPage;
2828

2929
import io.sloeber.core.api.Sketch;
30+
import io.sloeber.core.common.Const;
3031

3132
public class Import_Libraries_Page extends WizardResourceImportPage {
3233

@@ -112,12 +113,12 @@ protected ITreeContentProvider getFolderProvider() {
112113
return null;
113114
}
114115

116+
@SuppressWarnings("restriction")
115117
public boolean PerformFinish() {
116118
// check if there is a incompatibility in the library folder name
117119
// windows only
118120
if (Platform.getOS().equals(Platform.OS_WIN32)) {
119-
// TODO libraries should not be hardcoded here
120-
IFolder folder = this.myProject.getFolder("libraries"); //$NON-NLS-1$
121+
IFolder folder = this.myProject.getFolder(Const.LIBRARY_PATH_SUFFIX);
121122
if (!folder.exists()) {
122123
try {
123124
folder.create(false, true, null);

0 commit comments

Comments
 (0)