Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Fix: avoid exceptions on node shutdown #242

Merged
merged 1 commit into from
May 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions rosjava/src/main/java/org/ros/internal/node/DefaultNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
import org.ros.internal.node.service.ServiceFactory;
import org.ros.internal.node.service.ServiceIdentifier;
import org.ros.internal.node.service.ServiceManager;
import org.ros.internal.node.topic.DefaultPublisher;
import org.ros.internal.node.topic.DefaultSubscriber;
import org.ros.internal.node.topic.PublisherFactory;
import org.ros.internal.node.topic.SubscriberFactory;
import org.ros.internal.node.topic.TopicDeclaration;
Expand Down Expand Up @@ -405,6 +403,7 @@ public void shutdown() {
// NOTE(damonkohler): We don't want to raise potentially spurious
// exceptions during shutdown that would interrupt the process. This is
// simply best effort cleanup.
slaveServer.shutdown();
topicParticipantManager.shutdown();
for (ServiceServer<?, ?> serviceServer : serviceManager.getServers()) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
public class ParameterLoaderNode extends AbstractNodeMain {

public static final String NODE_NAME = "parameter_loader";
private final List<LoadedResource> params = new ArrayList<>();
private final List<LoadedResource> params = new ArrayList<LoadedResource>();
private Log log;

/**
Expand All @@ -57,6 +57,7 @@ private void addSingleYmlInput(InputStream ymlInputStream, String namespace) {
this.params.add(new LoadedResource((new Yaml()).load(ymlInputStream), namespace));
}

@SuppressWarnings("unchecked")
private void addParams(ParameterTree parameterTree, String namespace, Map<String, Object> params) {
for (Map.Entry<String, Object> e : params.entrySet()) {
String fullKeyName = namespace + "/" + e.getKey();
Expand Down