Skip to content

Commit

Permalink
feat(#768): fix all the code offences
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Oct 19, 2024
1 parent 252c3b7 commit 6e0a0ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/eolang/jeo/BytecodeDirectory.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
/**
* This class knows how to verify generated bytecode.
* It requires all the classes to be loaded into the current classloader.
* @see {@link PluginStartup#init()} how to load all the generated classes.
* See {@link PluginStartup#init()} how to load all the generated classes.
* @since 0.6
*/
final class BytecodeDirectory {
Expand All @@ -70,7 +70,7 @@ void verify() {
.filter(Files::isRegularFile)
.filter(path -> path.toString().endsWith(".class"))
) {
classess.map(this::read).forEach(this::verify);
classess.map(BytecodeDirectory::read).forEach(BytecodeDirectory::verify);
} catch (final IOException exception) {
throw new IllegalStateException(
String.format("Can't read '%s' directory with classes", this.input),
Expand All @@ -84,7 +84,7 @@ void verify() {
* @param clazz Class file to read.
* @return Bytes of the class file.
*/
private byte[] read(final Path clazz) {
private static byte[] read(final Path clazz) {
try {
return Files.readAllBytes(clazz);
} catch (final IOException exception) {
Expand All @@ -99,7 +99,7 @@ private byte[] read(final Path clazz) {
* Verify the generated bytecode.
* @param bytes Bytecode to verify.
*/
private void verify(final byte[] bytes) {
private static void verify(final byte[] bytes) {
final ClassNode clazz = new ClassNode();
new ClassReader(bytes)
.accept(new CheckClassAdapter(clazz, false), ClassReader.SKIP_DEBUG);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,17 @@
package org.eolang.jeo.representation.bytecode;

import com.jcabi.xml.XML;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.eolang.jeo.PluginStartup;
import org.eolang.jeo.representation.BytecodeRepresentation;
import org.eolang.jeo.representation.ClassName;
import org.eolang.jeo.representation.PrefixedName;
import org.eolang.jeo.representation.directives.DirectivesMetas;
import org.eolang.jeo.representation.directives.DirectivesProgram;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.util.CheckClassAdapter;

/**
* Bytecode program.
Expand Down

0 comments on commit 6e0a0ec

Please sign in to comment.