Skip to content
Permalink
Browse files
[ANY23-464] Performance improvement for inner classes
  • Loading branch information
kamaci committed Apr 20, 2021
1 parent 5857bd3 commit 38e21fad98a9ef815bf4f8e4a5d1d924b1dc5d6a
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
@@ -176,7 +176,7 @@ public ExtractorDescription getDescription() {
return EmbeddedJSONLDExtractorFactory.getDescriptionInstance();
}

private class JSONLDScript {
private static class JSONLDScript {

private String xpath;

@@ -220,7 +220,7 @@ private String fixWhiteSpace(String s) {
/**
* Represents a possible field value.
*/
private class FieldValue {
private static class FieldValue {

private TextField value;
private List<TextField> multiValue = new ArrayList<TextField>();
@@ -193,7 +193,7 @@ public ExtractorDescription getDescription() {
return HTMLMetaExtractorFactory.getDescriptionInstance();
}

private class Meta {
private static class Meta {

private String xpath;

@@ -307,7 +307,7 @@ private void configureParser(final RDFParser parser, final boolean verifyDataTyp
/**
* Internal listener used to trace <i>RDF</i> parse errors.
*/
private class InternalParseErrorListener implements ParseErrorListener {
private static class InternalParseErrorListener implements ParseErrorListener {

private final IssueReport extractionResult;

@@ -352,7 +352,7 @@ private void notifyExceptionInNotification(Exception e) {
/**
* This extended Turtle parser sets the default namespace to the base IRI before the parsing.
*/
private class ExtendedTurtleParser extends TurtleParser {
private static class ExtendedTurtleParser extends TurtleParser {
@Override
public void parse(Reader reader, String baseIRI) throws IOException, RDFParseException, RDFHandlerException {
setNamespace("", baseIRI);
@@ -999,7 +999,7 @@ private class EvaluationContext {
/**
* Defines a prefix mapping.
*/
private class PrefixMap {
private static class PrefixMap {
final String prefix;
final IRI IRI;

@@ -1012,7 +1012,7 @@ public PrefixMap(String prefix, IRI IRI) {
/**
* Defines a IRI mapping.
*/
private class IRIMapping {
private static class IRIMapping {
final Node sourceNode;
final Map<String, IRI> map;

@@ -1032,7 +1032,7 @@ private enum IncompleteTripleDirection {
/**
* Defines an incomplete triple.
*/
private class IncompleteTriple {
private static class IncompleteTriple {
final Node originatingNode;
final Resource subject;
final IRI predicate;
@@ -1072,7 +1072,7 @@ public boolean produceTriple(Node resourceNode, Resource r, ExtractionResult ext
/**
* Defines a vocabulary object.
*/
private class Vocabulary {
private static class Vocabulary {
final Node originatingNode;
final IRI prefix;

@@ -65,7 +65,7 @@ private ElementsProcessor() {
* A model holder describes the two required parameters which makes a model useful in further processing: a root
* node and model itself.
*/
public class ModelHolder {
public static class ModelHolder {
private final Value root;
private final Model model;

@@ -143,7 +143,7 @@ private void closeDocument() {
contextQueues.clear();
}

private class ValvedTriplePipeException extends Exception {
private static class ValvedTriplePipeException extends Exception {

private ValvedTriplePipeException(String s) {
super(s);
@@ -144,7 +144,7 @@ public void setContentLength(long contentLength) {
/**
* A single statistics.
*/
private class StatObject {
private static class StatObject {

AtomicInteger methodCalls = new AtomicInteger(0);
AtomicInteger triples = new AtomicInteger(0);
@@ -130,7 +130,7 @@ public static DOMDocument loadDocument(String document) throws IOException, URIS
return new DefaultDOMDocument(new URI(documentIRI), tsp.getDOM());
}

class FakeRule implements Rule {
static class FakeRule implements Rule {
public String getHRName() {
return "fake-rule";
}
@@ -141,7 +141,7 @@ public boolean applyOn(DOMDocument document, @SuppressWarnings("rawtypes") RuleC
}
}

class FakeFix implements Fix {
static class FakeFix implements Fix {
public String getHRName() {
return "fake-fix";
}
@@ -81,7 +81,7 @@ public void testGetComments() {
/**
* Target test class.
*/
class TargetVocabulary extends Vocabulary {
static class TargetVocabulary extends Vocabulary {

@Comment("Comment prop 1.")
public final IRI property1 = createProperty(namespace, "prop1");

0 comments on commit 38e21fa

Please sign in to comment.