diff options
author | Alexander Kurtakov | 2017-04-12 07:26:14 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2017-04-12 07:26:14 +0000 |
commit | 1cfccde153a4429ef15eaaeaecbde54312e6e73e (patch) | |
tree | 7f636f0de6f16a92e24a7ab7cd8406957019460e | |
parent | bb32327b6d6739ed32c408328bed8979134783e8 (diff) | |
download | org.eclipse.dltk.ruby-1cfccde153a4429ef15eaaeaecbde54312e6e73e.tar.gz org.eclipse.dltk.ruby-1cfccde153a4429ef15eaaeaecbde54312e6e73e.tar.xz org.eclipse.dltk.ruby-1cfccde153a4429ef15eaaeaecbde54312e6e73e.zip |
Use StandardCharsets.UTF-8.
Change-Id: Ie98154f037975731fe8df4e0d4e4f8722ad7d814
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rwxr-xr-x | tests/org.eclipse.dltk.ruby.core.tests/src/org/eclipse/dltk/ruby/core/tests/parser/jruby/ZippedParserSuite.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/org.eclipse.dltk.ruby.core.tests/src/org/eclipse/dltk/ruby/core/tests/parser/jruby/ZippedParserSuite.java b/tests/org.eclipse.dltk.ruby.core.tests/src/org/eclipse/dltk/ruby/core/tests/parser/jruby/ZippedParserSuite.java index ef56845d..db9429a2 100755 --- a/tests/org.eclipse.dltk.ruby.core.tests/src/org/eclipse/dltk/ruby/core/tests/parser/jruby/ZippedParserSuite.java +++ b/tests/org.eclipse.dltk.ruby.core.tests/src/org/eclipse/dltk/ruby/core/tests/parser/jruby/ZippedParserSuite.java @@ -1,16 +1,16 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * - *******************************************************************************/ package org.eclipse.dltk.ruby.core.tests.parser.jruby; import java.io.IOException; import java.io.InputStream; +import java.nio.charset.StandardCharsets; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -32,14 +32,13 @@ public class ZippedParserSuite extends TestSuite { super(testsZip); ZipFile zipFile; try { - zipFile = new ZipFile(AbstractModelTests.storeToMetadata(Activator - .getDefault().getBundle(), "parser.zip", testsZip)); + zipFile = new ZipFile( + AbstractModelTests.storeToMetadata(Activator.getDefault().getBundle(), "parser.zip", testsZip)); try { Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); - final String content = loadContent(zipFile - .getInputStream(entry)); + final String content = loadContent(zipFile.getInputStream(entry)); addTest(new TestCase(entry.getName()) { @@ -51,8 +50,7 @@ public class ZippedParserSuite extends TestSuite { @Override protected void runTest() throws Throwable { JRubySourceParser.setSilentState(false); - IModuleDeclaration module = DLTKLanguageManager - .getSourceParser(RubyNature.NATURE_ID) + IModuleDeclaration module = DLTKLanguageManager.getSourceParser(RubyNature.NATURE_ID) .parse(new ModuleSource(content), null); assertNotNull(module); } @@ -72,7 +70,7 @@ public class ZippedParserSuite extends TestSuite { int length = stream.available(); byte[] data = new byte[length]; stream.read(data); - return new String(data, "utf-8"); + return new String(data, StandardCharsets.UTF_8); } finally { stream.close(); } |