Skip to content

Commit

Permalink
Removed unused methods from JavaEEScanner
Browse files Browse the repository at this point in the history
- btw Parser is a Closeable and it wasn't closed.

Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
  • Loading branch information
dmatej committed Sep 18, 2022
1 parent 7ed97d9 commit 159c72a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import java.util.Set;

import org.glassfish.hk2.classmodel.reflect.Types;
import org.jvnet.hk2.annotations.Contract;

/**
Expand Down Expand Up @@ -58,11 +57,4 @@ public interface Scanner {
*/
ComponentInfo getComponentInfo(Class<?> componentImpl);

/**
* Return the types information for this module
*
* @return types the archive resulting types
*/
Types getTypes();

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@

import org.glassfish.apf.ComponentInfo;
import org.glassfish.apf.Scanner;
import org.glassfish.hk2.classmodel.reflect.Parser;
import org.glassfish.hk2.classmodel.reflect.ParsingContext;
import org.glassfish.hk2.classmodel.reflect.Types;

/**
* Super class for all JavaEE scanners
Expand All @@ -33,8 +30,6 @@
*/
public abstract class JavaEEScanner<T> implements Scanner {

private Types types;

/**
* Scan the archive file and gather a list of classes
* that should be processed for anntoations
Expand All @@ -46,28 +41,8 @@ public abstract class JavaEEScanner<T> implements Scanner {
protected abstract void process(File archiveFile, T descriptor, ClassLoader classLoader) throws IOException;


@Override
public Types getTypes() {
return types;
}


@Override
public ComponentInfo getComponentInfo(Class<?> componentImpl) {
return new ComponentDefinition(componentImpl);
}


protected void initTypes(File file) throws IOException {
ParsingContext context = new ParsingContext.Builder().build();
Parser cp = new Parser(context);
cp.parse(file, null);
try {
cp.awaitTermination();
} catch (InterruptedException e) {
throw new IOException(e);
}
types = cp.getContext().getTypes();
}

}

0 comments on commit 159c72a

Please sign in to comment.