From 7f11de275fc33f7e2c61b7d42e585e7d8ea59332 Mon Sep 17 00:00:00 2001 From: Areek Zillur Date: Mon, 27 Oct 2014 13:18:36 -0400 Subject: [PATCH] minor fix: LicenseSpecs Original commit: elastic/x-pack-elasticsearch@5c9e0b3ad04cebe12e9841447b4fa82310e9d4b9 --- .../org/elasticsearch/license/licensor/LicenseSpecs.java | 5 ----- .../license/licensor/tools/LicenseGeneratorTool.java | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/elasticsearch/license/licensor/LicenseSpecs.java b/src/main/java/org/elasticsearch/license/licensor/LicenseSpecs.java index 5ec2cb845f0..512dd3415df 100644 --- a/src/main/java/org/elasticsearch/license/licensor/LicenseSpecs.java +++ b/src/main/java/org/elasticsearch/license/licensor/LicenseSpecs.java @@ -9,7 +9,6 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.license.core.DateUtils; import org.elasticsearch.license.core.ESLicense; -import org.elasticsearch.license.core.LicensesCharset; import java.io.IOException; import java.text.ParseException; @@ -43,10 +42,6 @@ public class LicenseSpecs { return builder.build(); } - public static Set fromSource(String content) throws IOException, ParseException { - return fromSource(content.getBytes(LicensesCharset.UTF_8)); - } - public static Set fromSource(byte[] bytes) throws IOException, ParseException { return fromXContents(XContentFactory.xContent(bytes).createParser(bytes)); } diff --git a/src/main/java/org/elasticsearch/license/licensor/tools/LicenseGeneratorTool.java b/src/main/java/org/elasticsearch/license/licensor/tools/LicenseGeneratorTool.java index 9ec3694d394..07e9b572d8a 100644 --- a/src/main/java/org/elasticsearch/license/licensor/tools/LicenseGeneratorTool.java +++ b/src/main/java/org/elasticsearch/license/licensor/tools/LicenseGeneratorTool.java @@ -11,6 +11,7 @@ import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.license.core.ESLicense; import org.elasticsearch.license.core.ESLicenses; +import org.elasticsearch.license.core.LicensesCharset; import org.elasticsearch.license.licensor.ESLicenseSigner; import org.elasticsearch.license.licensor.LicenseSpecs; @@ -47,7 +48,7 @@ public class LicenseGeneratorTool { switch (command) { case "--license": String licenseInput = args[++i]; - licenseSpecs.addAll(LicenseSpecs.fromSource(licenseInput)); + licenseSpecs.addAll(LicenseSpecs.fromSource(licenseInput.getBytes(LicensesCharset.UTF_8))); break; case "--licenseFile": File licenseFile = new File(args[++i]);