You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2017/10/26 14:05:32 UTC
[karaf] branch master updated (fdc0397 -> 2574524)
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git.
from fdc0397 [KARAF-5443] Add a completer for bundle symbolic names
new 1c6a337 [KARAF-5445] Completers should be followed by a space when complete
new b23ca41 [KARAF-5432] Upgrade to Felix Utils 1.10.4 and FileInstall 3.6.4
new e913df7 [KARAF-5023] Improve the error message a bit.
new 05beb17 [KARAF-5023] Fix regression that cause newly created configurations to not be persisted in the etc directory
new 2574524 [KARAF-5023] Fix regression when using "config:property-delete --pid"
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../completers/BundleSymbolicNameCompleter.java | 17 ++++-----------
.../apache/karaf/config/command/UpdateCommand.java | 2 +-
.../command/completers/ConfigurationCompleter.java | 6 +++---
.../config/core/impl/ConfigRepositoryImpl.java | 16 ++++++++++++--
.../java/org/apache/karaf/itests/BundleTest.java | 8 +++----
.../itests/ssh/ConfigSshCommandSecurityTest.java | 19 ++++++++--------
.../ConnectionFactoriesNameCompleter.java | 2 +-
pom.xml | 4 ++--
.../impl/action/command/ArgumentCompleter.java | 25 ++++++++++------------
.../shell/impl/console/CommandsCompleter.java | 2 +-
.../shell/support/completers/StringsCompleter.java | 4 ++--
11 files changed, 52 insertions(+), 53 deletions(-)
--
To stop receiving notification emails like this one, please contact
['"commits@karaf.apache.org" <co...@karaf.apache.org>'].
[karaf] 02/05: [KARAF-5432] Upgrade to Felix Utils 1.10.4 and
FileInstall 3.6.4
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git
commit b23ca4169ce1d5fb8c0494ecb6d7ffa56a818aae
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Wed Oct 25 20:21:52 2017 +0200
[KARAF-5432] Upgrade to Felix Utils 1.10.4 and FileInstall 3.6.4
[KARAF-5313] Exception when deleting a .cfg file from hot deploy directory
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index aa8a234..eeaf438 100644
--- a/pom.xml
+++ b/pom.xml
@@ -189,7 +189,7 @@
<felix.configadmin.version>1.8.16</felix.configadmin.version>
<felix.connect.version>0.1.0</felix.connect.version>
<felix.coordinator.version>1.0.2</felix.coordinator.version>
- <felix.fileinstall.version>3.6.2</felix.fileinstall.version>
+ <felix.fileinstall.version>3.6.4</felix.fileinstall.version>
<felix.framework.version>5.6.8</felix.framework.version>
<felix.framework.security.version>2.6.0</felix.framework.security.version>
<felix.gogo.runtime.version>1.0.10</felix.gogo.runtime.version>
@@ -197,7 +197,7 @@
<felix.httplite.version>0.1.6</felix.httplite.version>
<felix.inventory.version>1.0.4</felix.inventory.version>
<felix.plugin.version>3.3.0</felix.plugin.version>
- <felix.utils.version>1.10.2</felix.utils.version>
+ <felix.utils.version>1.10.4</felix.utils.version>
<felix.webconsole.version>4.3.4</felix.webconsole.version>
<felix.webconsole.api.version>3.1.2</felix.webconsole.api.version>
<felix.metatype.version>1.1.4</felix.metatype.version>
--
To stop receiving notification emails like this one, please contact
"commits@karaf.apache.org" <co...@karaf.apache.org>.
[karaf] 04/05: [KARAF-5023] Fix regression that cause newly created
configurations to not be persisted in the etc directory
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git
commit 05beb1769cdf0fa1d44e769e6455a6f5edebb982
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Thu Oct 26 09:17:46 2017 +0200
[KARAF-5023] Fix regression that cause newly created configurations to not be persisted in the etc directory
---
.../apache/karaf/config/core/impl/ConfigRepositoryImpl.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/config/src/main/java/org/apache/karaf/config/core/impl/ConfigRepositoryImpl.java b/config/src/main/java/org/apache/karaf/config/core/impl/ConfigRepositoryImpl.java
index b2d05c8..04b38f0 100644
--- a/config/src/main/java/org/apache/karaf/config/core/impl/ConfigRepositoryImpl.java
+++ b/config/src/main/java/org/apache/karaf/config/core/impl/ConfigRepositoryImpl.java
@@ -55,7 +55,7 @@ public class ConfigRepositoryImpl implements ConfigRepository {
public void update(String pid, Map<String, Object> properties) throws IOException {
try {
LOGGER.trace("Updating configuration {}", pid);
- Configuration cfg = configAdmin.getConfiguration(pid, null);
+ Configuration cfg = configAdmin.getConfiguration(pid, "?");
Dictionary<String, Object> dict = cfg.getProperties();
TypedProperties props = new TypedProperties();
File file = getCfgFileFromProperties(dict);
@@ -67,7 +67,10 @@ public class ConfigRepositoryImpl implements ConfigRepository {
props.load(file);
props.put(FILEINSTALL_FILE_NAME, file.toURI().toString());
} else {
+ file = new File(System.getProperty("karaf.etc"), pid + ".cfg");
props.putAll(properties);
+ props.save(file);
+ props.put(FILEINSTALL_FILE_NAME, file.toURI().toString());
}
cfg.update(new Hashtable<>(props));
} catch (URISyntaxException e) {
@@ -146,7 +149,12 @@ public class ConfigRepositoryImpl implements ConfigRepository {
@Override
public String createFactoryConfiguration(String factoryPid, String alias, Map<String, Object> properties) throws IOException {
Configuration config = configAdmin.createFactoryConfiguration(factoryPid, "?");
- config.update(new Hashtable<>(properties));
+ TypedProperties props = new TypedProperties();
+ File file = File.createTempFile(factoryPid + "-", ".cfg", new File(System.getProperty("karaf.etc")));
+ props.putAll(properties);
+ props.save(file);
+ props.put(FILEINSTALL_FILE_NAME, file.toURI().toString());
+ config.update(new Hashtable<>(props));
return config.getPid();
}
--
To stop receiving notification emails like this one, please contact
"commits@karaf.apache.org" <co...@karaf.apache.org>.
[karaf] 03/05: [KARAF-5023] Improve the error message a bit.
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git
commit e913df7cdfac222dfc8215fe78281d5a3f04dd18
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Thu Oct 26 09:19:52 2017 +0200
[KARAF-5023] Improve the error message a bit.
---
config/src/main/java/org/apache/karaf/config/command/UpdateCommand.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/src/main/java/org/apache/karaf/config/command/UpdateCommand.java b/config/src/main/java/org/apache/karaf/config/command/UpdateCommand.java
index a908c8c..ff572a7 100644
--- a/config/src/main/java/org/apache/karaf/config/command/UpdateCommand.java
+++ b/config/src/main/java/org/apache/karaf/config/command/UpdateCommand.java
@@ -29,7 +29,7 @@ public class UpdateCommand extends ConfigCommandSupport {
protected Object doExecute() throws Exception {
TypedProperties props = getEditedProps();
if (props == null) {
- System.err.println("No configuration is being edited--run the edit command first");
+ System.err.println("No configuration is being edited. Run the edit command first.");
return null;
}
--
To stop receiving notification emails like this one, please contact
"commits@karaf.apache.org" <co...@karaf.apache.org>.
[karaf] 05/05: [KARAF-5023] Fix regression when using
"config:property-delete --pid"
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git
commit 25745245c5655a3f86ac7fd75a289f00a9d0b08e
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Thu Oct 26 15:26:11 2017 +0200
[KARAF-5023] Fix regression when using "config:property-delete --pid"
---
.../karaf/config/core/impl/ConfigRepositoryImpl.java | 4 ++++
.../test/java/org/apache/karaf/itests/BundleTest.java | 8 ++++----
.../itests/ssh/ConfigSshCommandSecurityTest.java | 19 +++++++++----------
3 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/config/src/main/java/org/apache/karaf/config/core/impl/ConfigRepositoryImpl.java b/config/src/main/java/org/apache/karaf/config/core/impl/ConfigRepositoryImpl.java
index 04b38f0..898c88c 100644
--- a/config/src/main/java/org/apache/karaf/config/core/impl/ConfigRepositoryImpl.java
+++ b/config/src/main/java/org/apache/karaf/config/core/impl/ConfigRepositoryImpl.java
@@ -24,8 +24,10 @@ import java.net.URISyntaxException;
import java.net.URL;
import java.util.Dictionary;
import java.util.Enumeration;
+import java.util.HashSet;
import java.util.Hashtable;
import java.util.Map;
+import java.util.Set;
import org.apache.felix.utils.properties.TypedProperties;
import org.apache.karaf.config.core.ConfigRepository;
@@ -62,6 +64,7 @@ public class ConfigRepositoryImpl implements ConfigRepository {
if (file != null) {
props.load(file);
props.putAll(properties);
+ props.keySet().retainAll(properties.keySet());
props.save(file);
props.clear();
props.load(file);
@@ -69,6 +72,7 @@ public class ConfigRepositoryImpl implements ConfigRepository {
} else {
file = new File(System.getProperty("karaf.etc"), pid + ".cfg");
props.putAll(properties);
+ props.keySet().retainAll(properties.keySet());
props.save(file);
props.put(FILEINSTALL_FILE_NAME, file.toURI().toString());
}
diff --git a/itests/src/test/java/org/apache/karaf/itests/BundleTest.java b/itests/src/test/java/org/apache/karaf/itests/BundleTest.java
index 38b270f..2fd336d 100644
--- a/itests/src/test/java/org/apache/karaf/itests/BundleTest.java
+++ b/itests/src/test/java/org/apache/karaf/itests/BundleTest.java
@@ -62,7 +62,7 @@ public class BundleTest extends KarafTestSupport {
assertFalse(allCapabilitiesOutput.isEmpty());
String jmxWhiteboardBundleCapabilitiesOutput = executeCommand("bundle:capabilities org.apache.aries.jmx.whiteboard", ADMIN_ROLES);
System.out.println(jmxWhiteboardBundleCapabilitiesOutput);
- assertTrue(jmxWhiteboardBundleCapabilitiesOutput.contains("osgi.wiring.bundle; org.apache.aries.jmx.whiteboard 1.1.5 [UNUSED]"));
+ assertContains("osgi.wiring.bundle; org.apache.aries.jmx.whiteboard 1.1.5 [UNUSED]", jmxWhiteboardBundleCapabilitiesOutput);
}
@Test
@@ -71,7 +71,7 @@ public class BundleTest extends KarafTestSupport {
assertFalse(allClassesOutput.isEmpty());
String jmxWhiteboardBundleClassesOutput = executeCommand("bundle:classes org.apache.aries.jmx.whiteboard", ADMIN_ROLES);
System.out.println(jmxWhiteboardBundleClassesOutput);
- assertTrue(jmxWhiteboardBundleClassesOutput.contains("org/apache/aries/jmx/whiteboard/Activator$MBeanTracker.class"));
+ assertContains("org/apache/aries/jmx/whiteboard/Activator$MBeanTracker.class", jmxWhiteboardBundleClassesOutput);
}
/**
@@ -94,14 +94,14 @@ public class BundleTest extends KarafTestSupport {
public void headersCommand() throws Exception {
String headersOutput = executeCommand("bundle:headers org.apache.aries.jmx.whiteboard", ADMIN_ROLES);
System.out.println(headersOutput);
- assertTrue(headersOutput.contains("Bundle-Activator = org.apache.aries.jmx.whiteboard.Activator"));
+ assertContains("Bundle-Activator = org.apache.aries.jmx.whiteboard.Activator", headersOutput);
}
@Test
public void infoCommand() throws Exception {
String infoOutput = executeCommand("bundle:info org.apache.karaf.management.server", ADMIN_ROLES);
System.out.println(infoOutput);
- assertTrue(infoOutput.contains("This bundle starts the Karaf embedded MBean server"));
+ assertContains("This bundle starts the Karaf embedded MBean server", infoOutput);
}
@Test
diff --git a/itests/src/test/java/org/apache/karaf/itests/ssh/ConfigSshCommandSecurityTest.java b/itests/src/test/java/org/apache/karaf/itests/ssh/ConfigSshCommandSecurityTest.java
index 2e012c9..7d627be 100644
--- a/itests/src/test/java/org/apache/karaf/itests/ssh/ConfigSshCommandSecurityTest.java
+++ b/itests/src/test/java/org/apache/karaf/itests/ssh/ConfigSshCommandSecurityTest.java
@@ -66,27 +66,26 @@ public class ConfigSshCommandSecurityTest extends SshCommandTestBase {
String result = assertCommand(user, "config:edit " + pid + "\n" +
"config:property-list\n" +
"config:cancel", Result.OK);
- Assert.assertTrue("Result should contain 'x = yz': " + result, result.contains("x = yz"));
- Assert.assertTrue("Result should contain 'a = b': " + result, result.contains("a = b"));
+ assertContains("a = b", result);
String result2 = assertCommand(user, "config:edit " + pid + "\n" +
"config:property-delete a\n" +
"config:property-list\n" +
"config:update", Result.OK);
- Assert.assertTrue("Result should contain 'x = yz': " + result2, result2.contains("x = yz"));
- Assert.assertFalse("Result should contain 'a = b': " + result2, result2.contains("a = b"));
+ assertContains("x = yz", result2);
+ assertContainsNot("a = b", result2);
if (isAdmin) {
assertCommand(user, "config:delete " + pid, Result.OK);
String result3 = assertCommand(user, "config:edit " + pid + "\n" +
"config:property-list", Result.OK);
- Assert.assertFalse(result3.contains("x = yz"));
- Assert.assertFalse(result3.contains("a = b"));
+ assertContainsNot("x = yz", result3);
+ assertContainsNot("a = b", result3);
} else {
assertCommand(user, "config:delete " + pid, Result.NOT_FOUND);
String result3 = assertCommand(user, "config:edit " + pid + "\n" +
"config:property-list", Result.OK);
- Assert.assertTrue("The delete command should have had no effect", result3.contains("x = yz"));
- Assert.assertFalse(result3.contains("a = b"));
+ assertContains("x = yz", result3);
+ assertContainsNot("a = b", result3);
}
}
@@ -123,11 +122,11 @@ public class ConfigSshCommandSecurityTest extends SshCommandTestBase {
assertCommand(user, "config:property-append -p " + pid + " a.b.c .g.h", expectedResult);
if (expectedResult == Result.OK) {
- Assert.assertTrue(assertCommand(user, "config:property-list -p " + pid, Result.OK).contains("a.b.c = d.e.f.g.h"));
+ assertContains("a.b.c = d.e.f.g.h", assertCommand(user, "config:property-list -p " + pid, Result.OK));
}
assertCommand(user, "config:property-delete -p " + pid + " a.b.c", expectedResult);
if (expectedResult == Result.OK) {
- Assert.assertFalse(assertCommand(user, "config:property-list -p " + pid, Result.OK).contains("a.b.c"));
+ assertContainsNot("a.b.c", assertCommand(user, "config:property-list -p " + pid, Result.OK));
}
}
}
--
To stop receiving notification emails like this one, please contact
"commits@karaf.apache.org" <co...@karaf.apache.org>.
[karaf] 01/05: [KARAF-5445] Completers should be followed by a
space when complete
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git
commit 1c6a3371116c3f48a7f6405be1cc17fd7c06ef8c
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Thu Oct 26 12:42:56 2017 +0200
[KARAF-5445] Completers should be followed by a space when complete
---
.../completers/BundleSymbolicNameCompleter.java | 17 ++++-----------
.../command/completers/ConfigurationCompleter.java | 6 +++---
.../ConnectionFactoriesNameCompleter.java | 2 +-
.../impl/action/command/ArgumentCompleter.java | 25 ++++++++++------------
.../shell/impl/console/CommandsCompleter.java | 2 +-
.../shell/support/completers/StringsCompleter.java | 4 ++--
6 files changed, 22 insertions(+), 34 deletions(-)
diff --git a/bundle/core/src/main/java/org/apache/karaf/bundle/command/completers/BundleSymbolicNameCompleter.java b/bundle/core/src/main/java/org/apache/karaf/bundle/command/completers/BundleSymbolicNameCompleter.java
index c0b56f7..0b2ec36 100644
--- a/bundle/core/src/main/java/org/apache/karaf/bundle/command/completers/BundleSymbolicNameCompleter.java
+++ b/bundle/core/src/main/java/org/apache/karaf/bundle/command/completers/BundleSymbolicNameCompleter.java
@@ -18,14 +18,13 @@ package org.apache.karaf.bundle.command.completers;
import org.apache.karaf.shell.api.action.lifecycle.Reference;
import org.apache.karaf.shell.api.action.lifecycle.Service;
-import org.apache.karaf.shell.api.console.Candidate;
import org.apache.karaf.shell.api.console.CommandLine;
import org.apache.karaf.shell.api.console.Completer;
import org.apache.karaf.shell.api.console.Session;
+import org.apache.karaf.shell.support.completers.StringsCompleter;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-import java.util.ArrayList;
import java.util.List;
@Service
@@ -36,19 +35,11 @@ public class BundleSymbolicNameCompleter implements Completer {
@Override
public int complete(Session session, CommandLine commandLine, List<String> candidates) {
- List<Candidate> cands = new ArrayList<>();
- completeCandidates(session, commandLine, cands);
- for (Candidate cand : cands) {
- candidates.add(cand.value());
- }
- return candidates.isEmpty() ? -1 : 0;
- }
-
- @Override
- public void completeCandidates(Session session, CommandLine commandLine, List<Candidate> candidates) {
+ StringsCompleter delegate = new StringsCompleter();
for (Bundle bundle : bundleContext.getBundles()) {
- candidates.add(new Candidate(bundle.getSymbolicName(), true));
+ delegate.getStrings().add(bundle.getSymbolicName());
}
+ return delegate.complete(session, commandLine, candidates);
}
}
diff --git a/config/src/main/java/org/apache/karaf/config/command/completers/ConfigurationCompleter.java b/config/src/main/java/org/apache/karaf/config/command/completers/ConfigurationCompleter.java
index 19cc0df..b0cef13 100644
--- a/config/src/main/java/org/apache/karaf/config/command/completers/ConfigurationCompleter.java
+++ b/config/src/main/java/org/apache/karaf/config/command/completers/ConfigurationCompleter.java
@@ -77,7 +77,7 @@ public class ConfigurationCompleter implements Completer, ConfigurationListener
Collection<String> pids = new ArrayList<>();
for (Configuration config : configs) {
- pids.add(config.getPid() + " ");
+ pids.add(config.getPid());
}
delegate.getStrings().addAll(pids);
@@ -95,9 +95,9 @@ public class ConfigurationCompleter implements Completer, ConfigurationListener
public void configurationEvent(ConfigurationEvent configurationEvent) {
String pid = configurationEvent.getPid();
if (configurationEvent.getType() == ConfigurationEvent.CM_DELETED) {
- delegate.getStrings().remove(pid + " ");
+ delegate.getStrings().remove(pid);
} else if (configurationEvent.getType() == ConfigurationEvent.CM_UPDATED) {
- delegate.getStrings().add(pid + " ");
+ delegate.getStrings().add(pid);
}
}
}
diff --git a/jms/src/main/java/org/apache/karaf/jms/command/completers/ConnectionFactoriesNameCompleter.java b/jms/src/main/java/org/apache/karaf/jms/command/completers/ConnectionFactoriesNameCompleter.java
index 2fd8d2a..98f97b3 100644
--- a/jms/src/main/java/org/apache/karaf/jms/command/completers/ConnectionFactoriesNameCompleter.java
+++ b/jms/src/main/java/org/apache/karaf/jms/command/completers/ConnectionFactoriesNameCompleter.java
@@ -40,7 +40,7 @@ public class ConnectionFactoriesNameCompleter implements Completer {
StringsCompleter delegate = new StringsCompleter();
try {
for (String connectionFactory : jmsService.connectionFactories()) {
- delegate.getStrings().add(connectionFactory + " ");
+ delegate.getStrings().add(connectionFactory);
}
} catch (Exception e) {
// nothing to do
diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/action/command/ArgumentCompleter.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/action/command/ArgumentCompleter.java
index 25e259e..0a4a5e1 100644
--- a/shell/core/src/main/java/org/apache/karaf/shell/impl/action/command/ArgumentCompleter.java
+++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/action/command/ArgumentCompleter.java
@@ -22,6 +22,7 @@ import java.io.File;
import java.lang.reflect.Field;
import java.net.URI;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.EnumSet;
import java.util.HashMap;
@@ -119,12 +120,10 @@ public class ArgumentCompleter implements Completer {
if (ann != null) {
Class<?> clazz = ann.value();
String[] value = ann.values();
- if (clazz != null) {
- if (value.length > 0 && clazz == StringsCompleter.class) {
- completer = new StringsCompleter(value, ann.caseSensitive());
- } else {
- completer = command.getCompleter(clazz);
- }
+ if (value.length > 0) {
+ completer = new StringsCompleter(Arrays.asList(value), ann.caseSensitive());
+ } else {
+ completer = command.getCompleter(clazz);
}
} else {
completer = getDefaultCompleter(field, multi);
@@ -148,12 +147,10 @@ public class ArgumentCompleter implements Completer {
try {
Class clazz = ann.value();
String[] value = ann.values();
- if (clazz != null) {
- if (clazz == StringsCompleter.class) {
- completer = new StringsCompleter(value, ann.caseSensitive());
- } else {
- completer = command.getCompleter(clazz);
- }
+ if (value.length > 0) {
+ completer = new StringsCompleter(Arrays.asList(value), ann.caseSensitive());
+ } else {
+ completer = command.getCompleter(clazz);
}
} catch (Throwable t) {
// Ignore in case the completer class is not even available
@@ -189,13 +186,13 @@ public class ArgumentCompleter implements Completer {
} else if (type.isAssignableFrom(File.class)) {
completer = new FileCompleter();
} else if (type.isAssignableFrom(Boolean.class) || type.isAssignableFrom(boolean.class)) {
- completer = new StringsCompleter(new String[] {"false", "true"}, false);
+ completer = new StringsCompleter(Arrays.asList("false", "true"));
} else if (Enum.class.isAssignableFrom(type)) {
Set<String> values = new HashSet<>();
for (Object o : EnumSet.allOf((Class<Enum>) type)) {
values.add(o.toString());
}
- completer = new StringsCompleter(values, false);
+ completer = new StringsCompleter(values);
}
return completer;
}
diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/CommandsCompleter.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/CommandsCompleter.java
index 84f87c6..b75489b 100644
--- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/CommandsCompleter.java
+++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/CommandsCompleter.java
@@ -97,7 +97,7 @@ public class CommandsCompleter extends org.apache.karaf.shell.support.completers
}
}
if (!subShell.equals(Session.SCOPE_GLOBAL)) {
- completers.add(new StringsCompleter(new String[] { "exit" }));
+ completers.add(new StringsCompleter(Collections.singletonList("exit")));
}
completers.forEach(c -> c.completeCandidates(session, commandLine, candidates));
return;
diff --git a/shell/core/src/main/java/org/apache/karaf/shell/support/completers/StringsCompleter.java b/shell/core/src/main/java/org/apache/karaf/shell/support/completers/StringsCompleter.java
index 7eff78d..4a57aef 100644
--- a/shell/core/src/main/java/org/apache/karaf/shell/support/completers/StringsCompleter.java
+++ b/shell/core/src/main/java/org/apache/karaf/shell/support/completers/StringsCompleter.java
@@ -39,7 +39,7 @@ public class StringsCompleter
private final boolean caseSensitive;
public StringsCompleter() {
- this(true);
+ this(false);
}
public StringsCompleter(final boolean caseSensitive) {
@@ -95,7 +95,7 @@ public class StringsCompleter
}
// noinspection unchecked
- candidates.add(match);
+ candidates.add(match + " ");
}
return candidates.isEmpty() ? -1 : commandLine.getBufferPosition() - commandLine.getArgumentPosition();
--
To stop receiving notification emails like this one, please contact
"commits@karaf.apache.org" <co...@karaf.apache.org>.