You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by rm...@apache.org on 2020/05/02 13:11:49 UTC
[openwebbeans-meecrowave] branch master updated: MEECROWAVE-243
long support in meecrowave configuration
This is an automated email from the ASF dual-hosted git repository.
rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwebbeans-meecrowave.git
The following commit(s) were added to refs/heads/master by this push:
new 9f6fb85 MEECROWAVE-243 long support in meecrowave configuration
9f6fb85 is described below
commit 9f6fb854090eb658b91b2393c7df774bad781efb
Author: Romain Manni-Bucau <rm...@gmail.com>
AuthorDate: Sat May 2 15:11:44 2020 +0200
MEECROWAVE-243 long support in meecrowave configuration
---
.../main/java/org/apache/meecrowave/configuration/Configuration.java | 4 ++++
meecrowave-core/src/main/java/org/apache/meecrowave/runner/Cli.java | 3 +++
2 files changed, 7 insertions(+)
diff --git a/meecrowave-core/src/main/java/org/apache/meecrowave/configuration/Configuration.java b/meecrowave-core/src/main/java/org/apache/meecrowave/configuration/Configuration.java
index 669c9f0..f5bf2ef 100644
--- a/meecrowave-core/src/main/java/org/apache/meecrowave/configuration/Configuration.java
+++ b/meecrowave-core/src/main/java/org/apache/meecrowave/configuration/Configuration.java
@@ -1093,6 +1093,8 @@ public class Configuration {
toSet = Boolean.parseBoolean(val);
} else if (field.getType() == File.class) {
toSet = new File(val);
+ } else if (field.getType() == long.class) {
+ toSet = Long.parseLong(val);
} else {
toSet = null;
}
@@ -1195,6 +1197,8 @@ public class Configuration {
f.set(instance, value);
} else if (t == int.class) {
f.set(instance, Integer.parseInt(value));
+ } else if (t == long.class) {
+ f.set(instance, Long.parseLong(value));
} else if (t == boolean.class) {
f.set(instance, Boolean.parseBoolean(value));
} else {
diff --git a/meecrowave-core/src/main/java/org/apache/meecrowave/runner/Cli.java b/meecrowave-core/src/main/java/org/apache/meecrowave/runner/Cli.java
index 526fe5f..e5545a7 100644
--- a/meecrowave-core/src/main/java/org/apache/meecrowave/runner/Cli.java
+++ b/meecrowave-core/src/main/java/org/apache/meecrowave/runner/Cli.java
@@ -171,6 +171,9 @@ public class Cli implements Runnable, AutoCloseable {
if (int.class == type) {
return Integer.parseInt(optionValues[0]);
}
+ if (long.class == type) {
+ return Long.parseLong(optionValues[0]);
+ }
if (File.class == type) {
return new File(optionValues[0]);
}