diff options
author | Evgeny Mandrikov <138671+Godin@users.noreply.github.com> | 2019-10-07 19:43:42 +0200 |
---|---|---|
committer | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2019-10-07 19:43:42 +0200 |
commit | a74369534687d3c040717de327e711886f0086d5 (patch) | |
tree | 5cd704db660aa60d329e90c264a32bb3874dc345 /org.jacoco.core/src | |
parent | 674055ec1659d3f9dbbc5c7286dd057a5777b42f (diff) | |
download | jacoco-a74369534687d3c040717de327e711886f0086d5.tar.gz |
Normalize line endings in Java source files (#955)
Diffstat (limited to 'org.jacoco.core/src')
-rw-r--r-- | org.jacoco.core/src/org/jacoco/core/internal/Pack200Streams.java | 158 | ||||
-rw-r--r-- | org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/IFilterContext.java | 108 |
2 files changed, 133 insertions, 133 deletions
diff --git a/org.jacoco.core/src/org/jacoco/core/internal/Pack200Streams.java b/org.jacoco.core/src/org/jacoco/core/internal/Pack200Streams.java index 5b4c0dcc..d9dda737 100644 --- a/org.jacoco.core/src/org/jacoco/core/internal/Pack200Streams.java +++ b/org.jacoco.core/src/org/jacoco/core/internal/Pack200Streams.java @@ -1,79 +1,79 @@ -/*******************************************************************************
- * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors
- * This program and the accompanying materials are made available under
- * the terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Marc R. Hoffmann - initial API and implementation
- *
- *******************************************************************************/
-package org.jacoco.core.internal;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.jar.JarInputStream;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Pack200;
-
-/**
- * Internal wrapper for the weird Pack200 Java API to allow usage with streams.
- */
-public final class Pack200Streams {
-
- /**
- * Unpack a stream in Pack200 format into a stream in JAR/ZIP format.
- *
- * @param input
- * stream in Pack200 format
- * @return stream in JAR/ZIP format
- * @throws IOException
- * in case of errors with the streams
- */
- public static InputStream unpack(final InputStream input)
- throws IOException {
- final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
- final JarOutputStream jar = new JarOutputStream(buffer);
- Pack200.newUnpacker().unpack(new NoCloseInput(input), jar);
- jar.finish();
- return new ByteArrayInputStream(buffer.toByteArray());
- }
-
- /**
- * Packs a buffer in JAR/ZIP format into a stream in Pack200 format.
- *
- * @param source
- * source in JAR/ZIP format
- * @param output
- * stream in Pack200 format
- * @throws IOException
- * in case of errors with the streams
- */
- public static void pack(final byte[] source, final OutputStream output)
- throws IOException {
- final JarInputStream jar = new JarInputStream(
- new ByteArrayInputStream(source));
- Pack200.newPacker().pack(jar, output);
- }
-
- private static class NoCloseInput extends FilterInputStream {
- protected NoCloseInput(final InputStream in) {
- super(in);
- }
-
- @Override
- public void close() throws IOException {
- // do not close the underlying stream
- }
- }
-
- private Pack200Streams() {
- }
-
-}
+/******************************************************************************* + * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Marc R. Hoffmann - initial API and implementation + * + *******************************************************************************/ +package org.jacoco.core.internal; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.FilterInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.jar.JarInputStream; +import java.util.jar.JarOutputStream; +import java.util.jar.Pack200; + +/** + * Internal wrapper for the weird Pack200 Java API to allow usage with streams. + */ +public final class Pack200Streams { + + /** + * Unpack a stream in Pack200 format into a stream in JAR/ZIP format. + * + * @param input + * stream in Pack200 format + * @return stream in JAR/ZIP format + * @throws IOException + * in case of errors with the streams + */ + public static InputStream unpack(final InputStream input) + throws IOException { + final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + final JarOutputStream jar = new JarOutputStream(buffer); + Pack200.newUnpacker().unpack(new NoCloseInput(input), jar); + jar.finish(); + return new ByteArrayInputStream(buffer.toByteArray()); + } + + /** + * Packs a buffer in JAR/ZIP format into a stream in Pack200 format. + * + * @param source + * source in JAR/ZIP format + * @param output + * stream in Pack200 format + * @throws IOException + * in case of errors with the streams + */ + public static void pack(final byte[] source, final OutputStream output) + throws IOException { + final JarInputStream jar = new JarInputStream( + new ByteArrayInputStream(source)); + Pack200.newPacker().pack(jar, output); + } + + private static class NoCloseInput extends FilterInputStream { + protected NoCloseInput(final InputStream in) { + super(in); + } + + @Override + public void close() throws IOException { + // do not close the underlying stream + } + } + + private Pack200Streams() { + } + +} diff --git a/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/IFilterContext.java b/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/IFilterContext.java index b4141e16..93ecf889 100644 --- a/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/IFilterContext.java +++ b/org.jacoco.core/src/org/jacoco/core/internal/analysis/filter/IFilterContext.java @@ -1,54 +1,54 @@ -/*******************************************************************************
- * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors
- * This program and the accompanying materials are made available under
- * the terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Marc R. Hoffmann - initial API and implementation
- *
- *******************************************************************************/
-package org.jacoco.core.internal.analysis.filter;
-
-import java.util.Set;
-
-/**
- * Context information provided to filters.
- */
-public interface IFilterContext {
-
- /**
- * @return vm name of the enclosing class
- */
- String getClassName();
-
- /**
- * @return vm name of the super class of the enclosing class
- */
- String getSuperClassName();
-
- /**
- * @return vm names of the class annotations of the enclosing class
- */
- Set<String> getClassAnnotations();
-
- /**
- * @return names of the class attributes
- */
- Set<String> getClassAttributes();
-
- /**
- * @return file name of the corresponding source file or <code>null</code>
- * if not available
- */
- String getSourceFileName();
-
- /**
- * @return value of SourceDebugExtension attribute or <code>null</code> if
- * not available
- */
- String getSourceDebugExtension();
-
-}
+/******************************************************************************* + * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors + * This program and the accompanying materials are made available under + * the terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Marc R. Hoffmann - initial API and implementation + * + *******************************************************************************/ +package org.jacoco.core.internal.analysis.filter; + +import java.util.Set; + +/** + * Context information provided to filters. + */ +public interface IFilterContext { + + /** + * @return vm name of the enclosing class + */ + String getClassName(); + + /** + * @return vm name of the super class of the enclosing class + */ + String getSuperClassName(); + + /** + * @return vm names of the class annotations of the enclosing class + */ + Set<String> getClassAnnotations(); + + /** + * @return names of the class attributes + */ + Set<String> getClassAttributes(); + + /** + * @return file name of the corresponding source file or <code>null</code> + * if not available + */ + String getSourceFileName(); + + /** + * @return value of SourceDebugExtension attribute or <code>null</code> if + * not available + */ + String getSourceDebugExtension(); + +} |