Skip to content

Commit 5a2f2c7

Browse files
author
jantje
committed
refactor messages name with _TAG suffix
1 parent 2a452b5 commit 5a2f2c7

File tree

13 files changed

+44
-44
lines changed

13 files changed

+44
-44
lines changed

io.sloeber.core/src/cc/arduino/packages/ssh/SSHPwdSetup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public Session setup(BoardPort port, JSch jSch) throws JSchException {
5959
// The user should set the password in the project
6060
// properties->arduino
6161
Common.log(
62-
new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID, Messages.Upload_login_credentials_missing.replace(Messages.HOST, host)));
62+
new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID, Messages.Upload_login_credentials_missing.replace(Messages.HOST_TAG, host)));
6363

6464
return null;
6565
}

io.sloeber.core/src/io/sloeber/core/Messages.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@
44

55
public class Messages extends NLS {
66
private static final String BUNDLE_NAME = "io.sloeber.core.messages"; //$NON-NLS-1$
7-
public static final String PORT = "{PORT}"; //$NON-NLS-1$
8-
public static final String MENUITEMID = "{MENUITEMID}"; //$NON-NLS-1$
9-
public static final String MENUID = "{MENUID}"; //$NON-NLS-1$
10-
public static final String BOARDID = "{BOARDID}"; //$NON-NLS-1$
11-
public static final String MENUITEMNAME = "{MENUITEMNAME}"; //$NON-NLS-1$
12-
public static final String LIB = "{LIB}"; //$NON-NLS-1$
13-
public static final String PROJECT = "{PROJECT}"; //$NON-NLS-1$
14-
public static final String UPLOADER = "{UPLOADER}"; //$NON-NLS-1$
15-
public static final String MS = "{MS}"; //$NON-NLS-1$
16-
public static final String NAMEFIELD = "{NAME}"; //$NON-NLS-1$
17-
public static final String ID = "{ID}"; //$NON-NLS-1$
18-
public static final String COMMAND = "{COMMAND}"; //$NON-NLS-1$
19-
public static final String TOOL = "{TOOL}"; //$NON-NLS-1$
20-
public static final String FILE = "{FILE}"; //$NON-NLS-1$
21-
public static final String BOARD = "{BOARD}"; //$NON-NLS-1$
22-
public static final String CONFIG = "{CONFIG}"; //$NON-NLS-1$
23-
public static final String KEY = "{KEY}"; //$NON-NLS-1$
24-
public static final String FOLDER = "{FOLDER}"; //$NON-NLS-1$
25-
public static final String VERSION = "{VERSION}"; //$NON-NLS-1$
26-
public static final String HOST = "{HOST}"; //$NON-NLS-1$
7+
public static final String PORT_TAG = "{PORT}"; //$NON-NLS-1$
8+
public static final String MENUITEMID_TAG = "{MENUITEMID}"; //$NON-NLS-1$
9+
public static final String MENUID_TAG = "{MENUID}"; //$NON-NLS-1$
10+
public static final String BOARDID_TAG = "{BOARDID}"; //$NON-NLS-1$
11+
public static final String MENUITEMNAME_TAG = "{MENUITEMNAME}"; //$NON-NLS-1$
12+
public static final String LIB_TAG = "{LIB}"; //$NON-NLS-1$
13+
public static final String PROJECT_TAG = "{PROJECT}"; //$NON-NLS-1$
14+
public static final String UPLOADER_TAG = "{UPLOADER}"; //$NON-NLS-1$
15+
public static final String MS_TAG = "{MS}"; //$NON-NLS-1$
16+
public static final String NAME_TAG = "{NAME}"; //$NON-NLS-1$
17+
public static final String ID_TAG = "{ID}"; //$NON-NLS-1$
18+
public static final String COMMAND_TAG = "{COMMAND}"; //$NON-NLS-1$
19+
public static final String TOOL_TAG = "{TOOL}"; //$NON-NLS-1$
20+
public static final String FILE_TAG = "{FILE}"; //$NON-NLS-1$
21+
public static final String BOARD_TAG = "{BOARD}"; //$NON-NLS-1$
22+
public static final String CONFIG_TAG = "{CONFIG}"; //$NON-NLS-1$
23+
public static final String KEY_TAG = "{KEY}"; //$NON-NLS-1$
24+
public static final String FOLDER_TAG = "{FOLDER}"; //$NON-NLS-1$
25+
public static final String VERSION_TAG = "{VERSION}"; //$NON-NLS-1$
26+
public static final String HOST_TAG = "{HOST}"; //$NON-NLS-1$
2727

2828

2929
public static String ArduinoSerial_Comport_Appeared_and_disappeared;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static public void loadJson(File jsonFile) {
295295
libraryIndices.add(index);
296296
} catch (Exception e) {
297297
Common.log(new Status(IStatus.ERROR, Activator.getId(),
298-
Manager_Failed_to_parse.replace(FILE, jsonFile.getAbsolutePath()), e));
298+
Manager_Failed_to_parse.replace(FILE_TAG, jsonFile.getAbsolutePath()), e));
299299
jsonFile.delete();// Delete the file so it stops damaging
300300
}
301301
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public static File[] getAllBoardsFiles() {
243243
}
244244
if (boardFiles.size() == 0) {
245245
Common.log(new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID,
246-
Helpers_No_boards_txt_found.replace(FILE, String.join("\n", hardwareFolders)), null)); //$NON-NLS-1$
246+
Helpers_No_boards_txt_found.replace(FILE_TAG, String.join("\n", hardwareFolders)), null)); //$NON-NLS-1$
247247
return null;
248248
}
249249
return boardFiles.toArray(new File[boardFiles.size()]);
@@ -255,7 +255,7 @@ private static void searchFiles(File folder, TreeSet<File> Hardwarelists, String
255255
if (a == null) {
256256
if (!myHasbeenLogged) {
257257
Common.log(new Status(IStatus.INFO, Const.CORE_PLUGIN_ID,
258-
Helpers_Error_The_folder_is_empty.replace(FOLDER, folder.toString()), null));
258+
Helpers_Error_The_folder_is_empty.replace(FOLDER_TAG, folder.toString()), null));
259259
myHasbeenLogged = true;
260260
}
261261
return;
@@ -691,7 +691,7 @@ static private void loadPackage(File jsonFile) {
691691
packageIndices.add(index);
692692
} catch (Exception e) {
693693
Common.log(new Status(IStatus.ERROR, Activator.getId(),
694-
Manager_Failed_to_parse.replace(FILE, jsonFile.getAbsolutePath()), e));
694+
Manager_Failed_to_parse.replace(FILE_TAG, jsonFile.getAbsolutePath()), e));
695695
jsonFile.delete();// Delete the file so it stops damaging
696696
}
697697
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454

5555
public class InternalPackageManager extends PackageManager {
5656

57-
private static final String FILE = Messages.FILE;
58-
private static final String FOLDER = Messages.FOLDER;
57+
private static final String FILE = Messages.FILE_TAG;
58+
private static final String FOLDER = Messages.FOLDER_TAG;
5959
private static boolean myIsReady = false;
6060

6161
public static boolean isReady() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
public class Tool {
2222

2323
private static final String TOOLS = "tools"; //$NON-NLS-1$
24-
private static final String KEY = Messages.KEY;
24+
private static final String KEY = Messages.KEY_TAG;
2525
private String name;
2626
private String version;
2727
private List<ToolSystem> systems;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public IStatus install(IProgressMonitor monitor) {
5454
Tool tool = getTool();
5555
if (tool == null) {
5656
return new Status(IStatus.ERROR, Activator.getId(),
57-
ToolDependency_Tool_not_found.replace(NAMEFIELD, this.name).replace(VERSION, this.version));
57+
ToolDependency_Tool_not_found.replace(NAME_TAG, this.name).replace(VERSION_TAG, this.version));
5858
}
5959
return tool.install(monitor);
6060
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
*/
5858
@SuppressWarnings("unused")
5959
public class ExternalCommandLauncher {
60-
private static final String COMMAND = Messages.COMMAND;
60+
private static final String COMMAND = Messages.COMMAND_TAG;
6161

6262
/** Lock for internal synchronization */
6363
protected final Object myRunLock;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
*/
5454
public class Helpers {
5555

56-
private static final String FILE = Messages.FILE;
57-
private static final String FOLDER = Messages.FOLDER;
56+
private static final String FILE = Messages.FILE_TAG;
57+
private static final String FOLDER = Messages.FOLDER_TAG;
5858

5959
private static boolean myHasBeenLogged = false;
6060

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public static Map<String, IPath> findAllArduinoManagerLibraries() {
157157
switch (versions.length) {
158158
case 0:// A empty lib folder is hanging around
159159
Common.log(
160-
new Status(IStatus.WARNING, CORE_PLUGIN_ID, EmptyLibFolder.replace(LIB, curLib)));
160+
new Status(IStatus.WARNING, CORE_PLUGIN_ID, EmptyLibFolder.replace(LIB_TAG, curLib)));
161161
Lib_root.toFile().delete();
162162
break;
163163
case 1:// There should only be 1
@@ -170,7 +170,7 @@ public static Map<String, IPath> findAllArduinoManagerLibraries() {
170170
int highestVersion = Version.getHighestVersion(versions);
171171
ret.put(curLib, Lib_root.append(versions[highestVersion]));
172172
Common.log(new Status(IStatus.WARNING, CORE_PLUGIN_ID,
173-
MultipleVersionsOfLib.replace(LIB, curLib)));
173+
MultipleVersionsOfLib.replace(LIB_TAG, curLib)));
174174

175175
}
176176
}
@@ -198,7 +198,7 @@ public static boolean removeLibrariesFromProject(IProject project, ICConfigurati
198198
final IFolder folderHandle = project.getFolder(WORKSPACE_LIB_FOLDER + CurItem);
199199
folderHandle.delete(true, null);
200200
} catch (CoreException e) {
201-
Common.log(new Status(IStatus.ERROR, CORE_PLUGIN_ID, failed_to_remove_lib.replace(LIB, CurItem), e));
201+
Common.log(new Status(IStatus.ERROR, CORE_PLUGIN_ID, failed_to_remove_lib.replace(LIB_TAG, CurItem), e));
202202
}
203203
}
204204
return Helpers.removeInvalidIncludeFolders(confdesc);

0 commit comments

Comments
 (0)