From 0ef4fcbff477d0c86ffcd2d493d8a3a7d3166dcf Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Tue, 11 Jan 2022 15:17:34 +0100 Subject: [PATCH] Use "protected" on all "on...()" methods (#433) Some "@override" methods used the "public" modifier, which is not necessary. Looking at the base classes of these classes a "protected" modifier was used, so "protected" seems to be intentionally. --- .../org/metafacture/javaintegration/pojo/PojoEncoder.java | 4 ++-- .../main/java/org/metafacture/mangling/RecordIdChanger.java | 6 +++--- .../java/org/metafacture/mangling/RecordPathFilter.java | 4 ++-- .../src/main/java/org/metafacture/statistics/Counter.java | 2 +- .../src/main/java/org/metafacture/strings/LineRecorder.java | 2 +- .../main/java/org/metafacture/xml/XmlElementSplitter.java | 2 +- .../src/main/java/org/metafacture/metamorph/Entity.java | 2 +- .../main/java/org/metafacture/metamorph/collectors/All.java | 2 +- .../java/org/metafacture/metamorph/collectors/Choose.java | 2 +- .../java/org/metafacture/metamorph/collectors/Combine.java | 2 +- .../org/metafacture/metamorph/collectors/EqualsFilter.java | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/PojoEncoder.java b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/PojoEncoder.java index b7396da2f..eba2cd662 100644 --- a/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/PojoEncoder.java +++ b/metafacture-javaintegration/src/main/java/org/metafacture/javaintegration/pojo/PojoEncoder.java @@ -107,12 +107,12 @@ private static Object createObjectFromString(final String value, } @Override - public void onCloseStream() { + protected void onCloseStream() { typeEncoderStack.clear(); } @Override - public void onResetStream() { + protected void onResetStream() { typeEncoderStack.clear(); } diff --git a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordIdChanger.java b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordIdChanger.java index 7c2d7e678..85e4e8ee7 100644 --- a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordIdChanger.java +++ b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordIdChanger.java @@ -217,18 +217,18 @@ public void literal(final String name, final String value) { } @Override - public void onSetReceiver() { + protected void onSetReceiver() { streamBuffer.setReceiver(getReceiver()); } @Override - public void onResetStream() { + protected void onResetStream() { streamBuffer.clear(); entityPathTracker.resetStream(); } @Override - public void onCloseStream() { + protected void onCloseStream() { streamBuffer.clear(); entityPathTracker.closeStream(); } diff --git a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java index 44b017b60..b1881def1 100644 --- a/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java +++ b/metafacture-mangling/src/main/java/org/metafacture/mangling/RecordPathFilter.java @@ -166,13 +166,13 @@ public void literal(final String name, final String value) { } @Override - public void onResetStream() { + protected void onResetStream() { entityPathTracker.resetStream(); resetRecord(); } @Override - public void onCloseStream() { + protected void onCloseStream() { entityPathTracker.closeStream(); } diff --git a/metafacture-statistics/src/main/java/org/metafacture/statistics/Counter.java b/metafacture-statistics/src/main/java/org/metafacture/statistics/Counter.java index b82387cef..8f8289c6a 100644 --- a/metafacture-statistics/src/main/java/org/metafacture/statistics/Counter.java +++ b/metafacture-statistics/src/main/java/org/metafacture/statistics/Counter.java @@ -112,7 +112,7 @@ public void endEntity() { } @Override - public void onResetStream() { + protected void onResetStream() { numRecords = 0; numEntities = 0; numLiterals = 0; diff --git a/metafacture-strings/src/main/java/org/metafacture/strings/LineRecorder.java b/metafacture-strings/src/main/java/org/metafacture/strings/LineRecorder.java index 936a831b9..c9cb1dfdb 100644 --- a/metafacture-strings/src/main/java/org/metafacture/strings/LineRecorder.java +++ b/metafacture-strings/src/main/java/org/metafacture/strings/LineRecorder.java @@ -78,7 +78,7 @@ protected void onCloseStream() { } @Override - public void onResetStream() { + protected void onResetStream() { record = new StringBuilder(SB_CAPACITY); } diff --git a/metafacture-xml/src/main/java/org/metafacture/xml/XmlElementSplitter.java b/metafacture-xml/src/main/java/org/metafacture/xml/XmlElementSplitter.java index bca233096..98c04a134 100644 --- a/metafacture-xml/src/main/java/org/metafacture/xml/XmlElementSplitter.java +++ b/metafacture-xml/src/main/java/org/metafacture/xml/XmlElementSplitter.java @@ -192,7 +192,7 @@ public String getXmlDeclaration() { } @Override - public void onResetStream() { + protected void onResetStream() { reset(); } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/Entity.java b/metamorph/src/main/java/org/metafacture/metamorph/Entity.java index e31baec40..17dfd057b 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/Entity.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/Entity.java @@ -124,7 +124,7 @@ protected void clear() { } @Override - public void onNamedValueSourceAdded(final NamedValueSource namedValueSource) { + protected void onNamedValueSourceAdded(final NamedValueSource namedValueSource) { sourceList.add(namedValueSource); sourcesLeft.add(namedValueSource); } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/collectors/All.java b/metamorph/src/main/java/org/metafacture/metamorph/collectors/All.java index 9bebe2f92..e10d8dce1 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/collectors/All.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/collectors/All.java @@ -67,7 +67,7 @@ protected void emit() { } @Override - public void onNamedValueSourceAdded(final NamedValueSource namedValueSource) { + protected void onNamedValueSourceAdded(final NamedValueSource namedValueSource) { sources.add(namedValueSource); sourcesLeft.add(namedValueSource); } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Choose.java b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Choose.java index 24a0d6f5b..9fa6ede58 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Choose.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Choose.java @@ -79,7 +79,7 @@ protected void receive(final String newName, final String newValue, final NamedV } @Override - public void onNamedValueSourceAdded(final NamedValueSource namedValueSource) { + protected void onNamedValueSourceAdded(final NamedValueSource namedValueSource) { priorities.put(namedValueSource, Integer.valueOf(nextPriority)); nextPriority += 1; } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Combine.java b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Combine.java index 8c694abc7..c733a5163 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/collectors/Combine.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/collectors/Combine.java @@ -61,7 +61,7 @@ protected void receive(final String name, final String value, final NamedValueSo } @Override - public void onNamedValueSourceAdded(final NamedValueSource namedValueSource) { + protected void onNamedValueSourceAdded(final NamedValueSource namedValueSource) { sources.add(namedValueSource); sourcesLeft.add(namedValueSource); } diff --git a/metamorph/src/main/java/org/metafacture/metamorph/collectors/EqualsFilter.java b/metamorph/src/main/java/org/metafacture/metamorph/collectors/EqualsFilter.java index 3145e8eac..91cf9d4be 100644 --- a/metamorph/src/main/java/org/metafacture/metamorph/collectors/EqualsFilter.java +++ b/metamorph/src/main/java/org/metafacture/metamorph/collectors/EqualsFilter.java @@ -68,7 +68,7 @@ protected void receive(final String name, final String value, final NamedValueSo } @Override - public void onNamedValueSourceAdded(final NamedValueSource namedValueSource) { + protected void onNamedValueSourceAdded(final NamedValueSource namedValueSource) { sources.add(namedValueSource); sourcesLeft.add(namedValueSource); }