Skip to content

Commit ec20b80

Browse files
author
jan
committed
fix warnings
1 parent be9322d commit ec20b80

File tree

15 files changed

+30
-38
lines changed

15 files changed

+30
-38
lines changed

io.sloeber.autoBuild.ui/src/io/sloeber/autoBuild/ui/tabs/ToolSettingsTab.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public void controlResized(ControlEvent e) {
216216
} else {
217217
//the line below is only here for development so I know there will only be resources
218218
//TODO remove the line below after evaluation this never ever happens
219-
System.err.println("Element should be resource " + pageElement);
219+
System.err.println("Element should be resource " + pageElement); //$NON-NLS-1$
220220
}
221221

222222
setValues();
@@ -280,17 +280,6 @@ protected void updateTipText(String name, String tip) {
280280
tipText.update();
281281
}
282282

283-
/* (non-Javadoc)
284-
* Method resetTipText
285-
* @since 7.0
286-
*/
287-
private void resetTipText() {
288-
if (tipText == null) {
289-
return;
290-
}
291-
tipText.setText(Messages.ToolSettingsTab_0);
292-
tipText.update();
293-
}
294283

295284
/* (non-Javadoc)
296285
* Method displayOptionsForCategory
@@ -411,7 +400,7 @@ public void modifyText(ModifyEvent e) {
411400
}
412401
}
413402

414-
Label label = stringField.getLabelControl(mySettingsPageContainer);
403+
//Label label = stringField.getLabelControl(mySettingsPageContainer);
415404
Text text = stringField.getTextControl(mySettingsPageContainer);
416405
text.setText(optionValue);
417406
// if(pageHasToolTipBox)

io.sloeber.autoBuild/src/io/sloeber/autoBuild/buildTools/internal/MinGW32ToolsProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ private void findTools() {
3636
try {
3737
myMinGWHome = org.eclipse.cdt.internal.core.MinGW.getMinGWHome();
3838
}
39-
catch(@SuppressWarnings("unused") Exception e) {
39+
catch( Exception e) {
4040
//ignore as this fails in maven build due to lack of gui and as such registry
4141
//is not available
4242
e.printStackTrace();

io.sloeber.autoBuild/src/io/sloeber/autoBuild/extensionPoint/providers/AutoBuildMakeRule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public String[] getRecipes(IFolder buildFolder, AutoBuildConfigurationDescriptio
296296
.getFolder(IPath.forPosix(curEntry.getValue())).getLocation();
297297
if(path==null) {
298298
//Log error to allow for investigation
299-
Activator.log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, "No location found for "+curEntry.getValue()));
299+
Activator.log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, "No location found for "+curEntry.getValue())); //$NON-NLS-1$
300300

301301
}else {
302302
includePath = includePath + WHITESPACE + DOUBLE_QUOTE + CMD_LINE_INCLUDE_FOLDER

io.sloeber.autoBuild/src/io/sloeber/autoBuild/helpers/api/KeyValueTree.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
import java.util.LinkedHashMap;
99
import java.util.Map;
1010
import java.util.Map.Entry;
11-
import java.util.TreeMap;
12-
1311
import org.apache.commons.io.FileUtils;
1412
import org.eclipse.core.resources.IFile;
1513
import org.eclipse.core.resources.IFolder;

io.sloeber.autoBuild/src/io/sloeber/autoBuild/integration/AutoBuildConfigurationDescription.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ public void deleteBuildFolder(IProgressMonitor monitor) {
11491149
curMember.delete(true, monitor);
11501150
} catch (CoreException e) {
11511151
Activator.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
1152-
"Failed to delete member "+curMember.getName(), e));
1152+
"Failed to delete member "+curMember.getName(), e)); //$NON-NLS-1$
11531153
}
11541154

11551155
}

io.sloeber.autoBuild/src/io/sloeber/autoBuild/integration/AutoBuildManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ public static Set<IProjectType> getProjectTypes(String extensionPointID, String
266266
IProjectType projectType = AutoBuildManager.getProjectType(extensionPointID, extensionID,
267267
element.getAttribute(ID), true);
268268
if (projectType == null) {
269-
System.err.println("project not found: extensionPoint ID " + extensionPointID + " and extension ID "
270-
+ extensionID + " and " + ID);
269+
System.err.println("project not found: extensionPoint ID " + extensionPointID + " and extension ID " //$NON-NLS-1$ //$NON-NLS-2$
270+
+ extensionID + " and " + ID); //$NON-NLS-1$
271271
} else {
272272
ret.add(projectType);
273273
}

io.sloeber.core/src/io/sloeber/core/Activator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ private static void testKnownIssues() {
173173
if (!errorString.isEmpty()) {
174174
errorString += "\n\nSloeber might still function but if you get strange results you know where to look.\n";
175175
errorString += "Do not create an issue if you see this!!!";
176-
log(new Status(IStatus.ERROR, PLUGIN_ID, errorString));
176+
log(new Status(IStatus.ERROR, Activator.getId(), errorString));
177177
}
178178

179179
}
@@ -301,7 +301,7 @@ public void stop(BundleContext context) throws Exception {
301301
* the io.sloeber.core.managers and io.sloeber.core.managers.ui to work.
302302
*/
303303
public static String getId() {
304-
return PLUGIN_ID;
304+
return "io.sloeber.core";
305305
}
306306

307307
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public class Const extends AutoBuildConstants {
7373
public static final String REMOTE_SUFFIX = "_remote";
7474

7575
// General stuff
76-
public static final String PLUGIN_ID = "io.sloeber.core";
76+
//public static final String PLUGIN_ID = "io.sloeber.core";
7777
public static final String CORE_PLUGIN_ID = "io.sloeber.arduino.core";
7878
public static final String SLOEBER_NATURE_ID = "io.sloeber.arduinonature";
7979
public static final String KEY_LAST_USED_EXAMPLES = "Last used Examples";

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
77
import org.eclipse.equinox.security.storage.StorageException;
88

9+
import io.sloeber.autoBuild.helpers.api.AutoBuildConstants;
910
import io.sloeber.core.Activator;
1011
import io.sloeber.core.Messages;
1112

@@ -113,7 +114,7 @@ public static void ErasePassword(String host) {
113114

114115
private static String ConvertHostToNodeName(String host) {
115116

116-
return "ssh/" + host.replace(Const.DOT, Const.SLACH); //$NON-NLS-1$
117+
return "ssh/" + host.replace(AutoBuildConstants.DOT, AutoBuildConstants.SLACH); //$NON-NLS-1$
117118
}
118119

119120
}

io.sloeber.core/src/io/sloeber/core/eclipseIntegrations/CDT_EnvironmentVariableResolver.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package io.sloeber.core.eclipseIntegrations;
22

3-
import static io.sloeber.core.api.Const.*;
4-
53
import org.eclipse.cdt.core.CCorePlugin;
64
import org.eclipse.cdt.core.envvar.IEnvironmentVariableManager;
75
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
@@ -18,6 +16,7 @@
1816
import org.eclipse.core.variables.IStringVariableManager;
1917
import org.eclipse.core.variables.VariablesPlugin;
2018

19+
import io.sloeber.core.Activator;
2120
import io.sloeber.core.Messages;
2221

2322
public class CDT_EnvironmentVariableResolver implements IDynamicVariableResolver {
@@ -29,7 +28,7 @@ public String resolveValue(IDynamicVariable variable, String varName) throws Cor
2928
return getBuildEnvironmentVariable(confDesc, varName);
3029

3130
} catch ( Exception e) {
32-
Status iStatus = new Status(IStatus.ERROR, PLUGIN_ID, Messages.projectNotFoundInGUI,e);
31+
Status iStatus = new Status(IStatus.ERROR, Activator.getId(), Messages.projectNotFoundInGUI,e);
3332
throw new CoreException(iStatus);
3433
}
3534
}

io.sloeber.ui/src/io/sloeber/ui/actions/BuildHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected IStatus run(IProgressMonitor monitor) {
4343
} catch (CoreException e) {
4444
return new Status(IStatus.ERROR, NODE_ARDUINO,
4545
Messages.buildHandler_build_code_of_project.replace(Messages.PROJECT, myBuildProject.getName())
46-
+ " failed",
46+
+ " failed", //$NON-NLS-1$
4747
e);
4848
}
4949
return Status.OK_STATUS;

io.sloeber.ui/src/io/sloeber/ui/monitor/views/PlotterView.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package io.sloeber.ui.monitor.views;
22

3+
4+
import static io.sloeber.core.api.Const.*;
5+
6+
import java.net.URI;
37
import java.net.URL;
48

59
import org.eclipse.core.runtime.IProgressMonitor;
@@ -41,7 +45,7 @@ public class PlotterView extends ViewPart implements ServiceListener {
4145
Serial mySerial = null;
4246

4347
private static final String FLAG_MONITOR = "FmStatus"; //$NON-NLS-1$
44-
String uri = "h tt p://bae yens.i t/ec li pse/do wnl oad/Sc opeS tart.h t ml?m="; //$NON-NLS-1$
48+
private static String uri = "h tt p://bae yens.i t/ec li pse/do wnl oad/Sc opeS tart.h t ml?m="; //$NON-NLS-1$
4549
public Object mstatus; // status of the plotter
4650

4751
public PlotterView() {
@@ -53,8 +57,8 @@ protected IStatus run(IProgressMonitor monitor) {
5357
IEclipsePreferences mySCope = InstanceScope.INSTANCE.getNode(MyPreferences.NODE_ARDUINO);
5458
int curFsiStatus = mySCope.getInt(FLAG_MONITOR, 0) + 1;
5559
mySCope.putInt(FLAG_MONITOR, curFsiStatus);
56-
URL pluginStartInitiator = new URL(
57-
PlotterView.this.uri.replace(" ", "") + Integer.toString(curFsiStatus)); //$NON-NLS-1$ //$NON-NLS-2$
60+
URI tt= new URI(uri.replace(SPACE, EMPTY) + Integer.toString(curFsiStatus));
61+
URL pluginStartInitiator = tt.toURL();
5862
PlotterView.this.mstatus = pluginStartInitiator.getContent();
5963
} catch (Exception e) {// JABA is not going to add code
6064
}

io.sloeber.ui/src/io/sloeber/ui/monitor/views/SerialMonitor.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package io.sloeber.ui.monitor.views;
22

3+
import static io.sloeber.core.api.Const.*;
34
import static io.sloeber.ui.Activator.*;
45

56
import java.io.File;
7+
import java.net.URI;
68
import java.net.URL;
79
import java.nio.charset.Charset;
810
import java.nio.file.Files;
@@ -200,9 +202,8 @@ protected IStatus run(IProgressMonitor monitor) {
200202
IEclipsePreferences myScope = InstanceScope.INSTANCE.getNode(MyPreferences.NODE_ARDUINO);
201203
int curFsiStatus = myScope.getInt(MY_FLAG_MONITOR, 0) + 1;
202204
myScope.putInt(MY_FLAG_MONITOR, curFsiStatus);
203-
URL mypluginStartInitiator = new URL(uri.replace(" ", new String()) //$NON-NLS-1$
204-
+ Integer.toString(curFsiStatus));
205-
mypluginStartInitiator.getContent();
205+
URI tt= new URI(uri.replace(SPACE, EMPTY) + Integer.toString(curFsiStatus));
206+
tt.toURL().getContent();
206207
} catch (Exception e) {// JABA is not going to add code
207208
}
208209
return Status.OK_STATUS;

io.sloeber.ui/src/io/sloeber/ui/preferences/LibrarySelectionPage.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ public boolean canUpdate() {
147147
public String getTooltip() {
148148
if (myTooltip == null) {
149149
IArduinoLibraryVersion libVers = getLatest();
150-
myTooltip = "Architectures:" + libVers.getArchitectures().toString() + blankLine
151-
+ libVers.getSentence() + blankLine + libVers.getParagraph() + blankLine + "Author: "
152-
+ libVers.getAuthor() + blankLine + "Maintainer: " + libVers.getMaintainer() ;
150+
myTooltip = "Architectures:" + libVers.getArchitectures().toString() + blankLine //$NON-NLS-1$
151+
+ libVers.getSentence() + blankLine + libVers.getParagraph() + blankLine + "Author: " //$NON-NLS-1$
152+
+ libVers.getAuthor() + blankLine + "Maintainer: " + libVers.getMaintainer() ; //$NON-NLS-1$
153153
}
154154
return myTooltip;
155155
}

io.sloeber.ui/src/io/sloeber/ui/wizard/newsketch/NewSketchWizard.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class NewSketchWizard extends Wizard implements INewWizard, IExecutableEx
4040
Messages.ui_new_sketch_arduino_information);
4141
protected NewSketchWizardCodeSelectionPage mNewArduinoSketchWizardCodeSelectionPage = new NewSketchWizardCodeSelectionPage(
4242
Messages.ui_new_sketch_sketch_template_location);
43-
private NewProjectSourceLocationPage mySourceLocationPage= new NewProjectSourceLocationPage("code location page");
43+
private NewProjectSourceLocationPage mySourceLocationPage= new NewProjectSourceLocationPage("code location page"); //$NON-NLS-1$
4444
private IConfigurationElement mConfig;
4545
private IProject mProject;
4646

0 commit comments

Comments
 (0)