Skip to content

Commit

Permalink
Fix errors and changes after importing add-ons in Eclipse (openhab#7270)
Browse files Browse the repository at this point in the history
* Fix errors and changes after importing add-ons in Eclipse

* Add missing Eclipse project/classpath files
* Fix null analysis errors showing in Eclipse
* Remove ignored Eclipse .settings files
* Fix Eclipse linuxinput project name

With these changes there are no unstaged changes and only one error showing in FileTailer (openhab#5442) after importing the add-ons in Eclipse.

Signed-off-by: Wouter Born <github@maindrain.net>
  • Loading branch information
wborn authored and J-N-K committed Jul 14, 2020
1 parent 74237ce commit 6c9555f
Show file tree
Hide file tree
Showing 49 changed files with 235 additions and 266 deletions.
6 changes: 6 additions & 0 deletions bundles/org.openhab.binding.adorne/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,11 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

81 changes: 32 additions & 49 deletions bundles/org.openhab.binding.goecharger/.classpath
Original file line number Diff line number Diff line change
@@ -1,49 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions bundles/org.openhab.binding.hpprinter/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.Map;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
Expand All @@ -31,7 +32,7 @@ public class HPStatus {

private static final Map<String, String> STATUS_MESSAGES = initializeStatus();

private final String printerStatus;
private final @Nullable String printerStatus;

public HPStatus(Document document) {
NodeList nodes = document.getDocumentElement().getElementsByTagName("psdyn:Status");
Expand Down Expand Up @@ -61,7 +62,7 @@ private static Map<String, String> initializeStatus() {
return statusMap;
}

public String getPrinterStatus() {
return STATUS_MESSAGES.getOrDefault(printerStatus, printerStatus);
public @Nullable String getPrinterStatus() {
return STATUS_MESSAGES.get(printerStatus);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void dispose() {
}

public void findMyDevice(String deviceId) throws IOException {
if(connection == null) {
if (connection == null) {
logger.debug("Can't send Find My Device request, because connection is null!");
return;
}
Expand All @@ -136,13 +136,13 @@ private void startHandler() {
try {
logger.debug("iCloud bridge starting handler ...");
ICloudAccountThingConfiguration config = getConfigAs(ICloudAccountThingConfiguration.class);
final String appleId = config.appleId;
final String password = config.password;
if(appleId != null || password != null) {
connection = new ICloudConnection(appleId, password);
}
else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Apple ID/Password is not set!");
final String localAppleId = config.appleId;
final String localPassword = config.password;
if (localAppleId != null && localPassword != null) {
connection = new ICloudConnection(localAppleId, localPassword);
} else {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR,
"Apple ID/Password is not set!");
return;
}
refreshJob = scheduler.scheduleWithFixedDelay(this::refreshData, 0, config.refreshTimeInMinutes, MINUTES);
Expand All @@ -167,7 +167,7 @@ public void refreshData() {

try {
ICloudAccountDataResponse iCloudData = deviceInformationParser.parse(json);
if(iCloudData == null) {
if (iCloudData == null) {
return;
}
int statusCode = Integer.parseUnsignedInt(iCloudData.getICloudAccountStatusCode());
Expand Down
6 changes: 6 additions & 0 deletions bundles/org.openhab.binding.innogysmarthome/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,11 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -191,19 +192,21 @@ public final List<InboundSpec> getReadSpec(Configuration configuration) throws K
}

public final @Nullable InboundSpec getListenSpec(Configuration configuration, GroupAddress groupAddress) {
return getAllGAKeys().stream()
Optional<ListenSpecImpl> result = getAllGAKeys().stream()
.map(key -> new ListenSpecImpl(parse((String) configuration.get(key)), getDefaultDPT(key)))
.filter(spec -> !spec.getGroupAddresses().isEmpty())
.filter(spec -> spec.getGroupAddresses().contains(groupAddress)).findFirst().orElse(null);
.filter(spec -> spec.getGroupAddresses().contains(groupAddress)).findFirst();
return result.isPresent() ? result.get() : null;
}

protected abstract String getDefaultDPT(String gaConfigKey);

public final @Nullable OutboundSpec getResponseSpec(Configuration configuration, GroupAddress groupAddress,
Type type) throws KNXFormatException {
return getAllGAKeys().stream()
Optional<ReadResponseSpecImpl> result = getAllGAKeys().stream()
.map(key -> new ReadResponseSpecImpl(parse((String) configuration.get(key)), getDefaultDPT(key), type))
.filter(spec -> groupAddress.equals(spec.getGroupAddress())).findFirst().orElse(null);
.filter(spec -> groupAddress.equals(spec.getGroupAddress())).findFirst();
return result.isPresent() ? result.get() : null;
}

@Override
Expand Down
6 changes: 6 additions & 0 deletions bundles/org.openhab.binding.lgwebos/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,11 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
2 changes: 1 addition & 1 deletion bundles/org.openhab.binding.linuxinput/.project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.openhab.binding.astro</name>
<name>org.openhab.binding.linuxinput</name>
<comment></comment>
<projects>
</projects>
Expand Down
8 changes: 2 additions & 6 deletions bundles/org.openhab.binding.logreader/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/classes" path="src/3rdparty/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/3rdparty/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
Expand All @@ -26,6 +21,7 @@
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
Expand Down
7 changes: 6 additions & 1 deletion bundles/org.openhab.binding.loxone/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
Expand Down
6 changes: 6 additions & 0 deletions bundles/org.openhab.binding.millheat/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,11 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6c9555f

Please sign in to comment.