Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SONAR] cleanup #4115

Merged
merged 1 commit into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ public boolean isCanceled() {
}

@Override
public void worked(int nrWorks) {}
public void worked(int nrWorks) {
// Do nothing
}

@Override
public void done() {}
public void done() {
// Do nothing
}

@Override
public void setTaskName(String taskName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@

public class ConfigNoFileSerializer implements IHopConfigSerializer {
@Override
public void writeToFile(String filename, Map<String, Object> configMap) throws HopException {}
public void writeToFile(String filename, Map<String, Object> configMap) throws HopException {
// Do nothing
}

@Override
public Map<String, Object> readFromFile(String filename) throws HopException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ protected boolean extractSeparateClassLoader(ConfigPlugin annotation) {

@Override
protected void addExtraClasses(
Map<Class<?>, String> classMap, Class<?> clazz, ConfigPlugin annotation) {}
Map<Class<?>, String> classMap, Class<?> clazz, ConfigPlugin annotation) {
// Do nothing
}

@Override
protected String extractDocumentationUrl(ConfigPlugin annotation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public class DatabaseFactory implements IDatabaseFactory {
public static final ILoggingObject loggingObject =
new SimpleLoggingObject("Database factory", LoggingObjectType.GENERAL, null);

public DatabaseFactory() {}
public DatabaseFactory() {
// Do nothing
}

@Override
public String getConnectionTestReport(IVariables variables, DatabaseMeta databaseMeta)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ protected boolean extractSeparateClassLoader(DatabaseMetaPlugin annotation) {

@Override
protected void addExtraClasses(
Map<Class<?>, String> classMap, Class<?> clazz, DatabaseMetaPlugin annotation) {}
Map<Class<?>, String> classMap, Class<?> clazz, DatabaseMetaPlugin annotation) {
// Do nothing
}

@Override
protected String extractDocumentationUrl(DatabaseMetaPlugin annotation) {
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/java/org/apache/hop/core/encryption/Encr.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ public class Encr {

private static ITwoWayPasswordEncoder encoder;

public Encr() {}
public Encr() {
// Do nothing
}

public static void init(String encoderPluginId) throws HopException {
if (Utils.isEmpty(encoderPluginId)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ protected boolean extractSeparateClassLoader(TwoWayPasswordEncoderPlugin annotat

@Override
protected void addExtraClasses(
Map<Class<?>, String> classMap, Class<?> clazz, TwoWayPasswordEncoderPlugin annotation) {}
Map<Class<?>, String> classMap, Class<?> clazz, TwoWayPasswordEncoderPlugin annotation) {
// Do nothing
}

@Override
protected String extractDocumentationUrl(TwoWayPasswordEncoderPlugin annotation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ protected boolean extractSeparateClassLoader(ExtensionPoint annotation) {

@Override
protected void addExtraClasses(
Map<Class<?>, String> classMap, Class<?> clazz, ExtensionPoint annotation) {}
Map<Class<?>, String> classMap, Class<?> clazz, ExtensionPoint annotation) {
// Do nothing
}

@Override
protected String extractDocumentationUrl(ExtensionPoint annotation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public boolean canRenameTo(FileObject arg0) {
}

@Override
public void close() throws FileSystemException {}
public void close() throws FileSystemException {
// Do nothing
}

@Override
public void copyFrom(FileObject arg0, FileSelector arg1) throws FileSystemException {
Expand Down Expand Up @@ -192,7 +194,9 @@ public void moveTo(FileObject arg0) throws FileSystemException {
}

@Override
public void refresh() throws FileSystemException {}
public void refresh() throws FileSystemException {
// Do nothing
}

@Override
public FileObject resolveFile(String arg0) throws FileSystemException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ protected boolean extractSeparateClassLoader(GuiPlugin annotation) {

@Override
protected void addExtraClasses(
Map<Class<?>, String> classMap, Class<?> clazz, GuiPlugin annotation) {}
Map<Class<?>, String> classMap, Class<?> clazz, GuiPlugin annotation) {
// Do nothing
}

@Override
protected String extractDocumentationUrl(GuiPlugin annotation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@

public class GuiActionLambdaBuilder<T> {

public GuiActionLambdaBuilder() {}
public GuiActionLambdaBuilder() {
// Do nothing
}

/**
* Create a copy of the given action and create an action lambda for it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

public class EmptyTypeFilename implements ITypeFilename {

public EmptyTypeFilename() {}
public EmptyTypeFilename() {
// Do nothing
}

@Override
public String getDefaultFileExtension() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@

public class EmptyTypeMetadata implements ITypeMetadata {

public EmptyTypeMetadata() {}
public EmptyTypeMetadata() {
// Do nothing
}

@Override
public Class<? extends IHopMetadata> getMetadataClass() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ public boolean ignoresThrowable() {
return false;
}

public void activateOptions() {}
public void activateOptions() {
// Do nothing
}

public boolean isTimeAdded() {
return timeAdded;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ public StringBuffer getBuffer() {
return getBuffer(null, true);
}

public void close() {}
public void close() {
// Do nothing
}

public void doAppend(HopLoggingEvent event) {
if (event.getMessage() instanceof LogMessage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ protected boolean extractSeparateClassLoader(LoggingPlugin annotation) {

@Override
protected void addExtraClasses(
Map<Class<?>, String> classMap, Class<?> clazz, LoggingPlugin annotation) {}
Map<Class<?>, String> classMap, Class<?> clazz, LoggingPlugin annotation) {
// Do nothing
}

@Override
protected String extractDocumentationUrl(LoggingPlugin annotation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.apache.hop.core.metrics.MetricsSnapshotType;

@SuppressWarnings("java:S1104")
public class Metrics implements IMetrics {

// Database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public class Slf4jLoggingEventListener implements IHopLoggingEventListener {

private static final String SEPARATOR = "/";

public Slf4jLoggingEventListener() {}
public Slf4jLoggingEventListener() {
// Do nothing
}

@Override
public void eventAdded(HopLoggingEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ public class NamedParameters implements INamedParameters {
protected Map<String, NamedParameter> params = new HashMap<>();

/** Default constructor. */
public NamedParameters() {}
public NamedParameters() {
// Do nothing
}

@Override
public void addParameterDefinition(String key, String defValue, String description)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public class NamedParametersDefnitions implements INamedParameterDefinitions {
protected Map<String, NamedParameterDefinition> params = new HashMap<>();

/** Default constructor. */
public NamedParametersDefnitions() {}
public NamedParametersDefnitions() {
// Do nothing
}

@Override
public void addParameterDefinition(String key, String defValue, String description)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ protected boolean extractSeparateClassLoader(T annotation) {
}

@Override
protected void addExtraClasses(Map<Class<?>, String> classMap, Class<?> clazz, T annotation) {}
protected void addExtraClasses(Map<Class<?>, String> classMap, Class<?> clazz, T annotation) {
// Do nothing
}

protected abstract class FragmentTypeListener implements IPluginTypeListener {
private final PluginRegistry registry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,9 @@ protected boolean extractincludeJdbcDrivers(T annotation) {
return false;
}

protected void addExtraClasses(Map<Class<?>, String> classMap, Class<?> clazz, T annotation) {}
protected void addExtraClasses(Map<Class<?>, String> classMap, Class<?> clazz, T annotation) {
// Do nothing
}

protected String extractDocumentationUrl(T annotation) {
return null;
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/java/org/apache/hop/core/row/IValueMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,9 @@ String getDatabaseColumnTypeDefinition(
void loadMetaFromJson(JSONObject jValue);

class ValueMetaHopMetadataObjectFactory implements IHopMetadataObjectFactory {
public ValueMetaHopMetadataObjectFactory() {}
public ValueMetaHopMetadataObjectFactory() {
// Do nothing
}

@Override
public Object createObject(String id, Object parentObject) throws HopException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ protected boolean extractSeparateClassLoader(ValueMetaPlugin annotation) {

@Override
protected void addExtraClasses(
Map<Class<?>, String> classMap, Class<?> clazz, ValueMetaPlugin annotation) {}
Map<Class<?>, String> classMap, Class<?> clazz, ValueMetaPlugin annotation) {
// Do nothing
}

@Override
protected String extractDocumentationUrl(ValueMetaPlugin annotation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ protected boolean extractSeparateClassLoader(SearchableAnalyserPlugin annotation

@Override
protected void addExtraClasses(
Map<Class<?>, String> classMap, Class<?> clazz, SearchableAnalyserPlugin annotation) {}
Map<Class<?>, String> classMap, Class<?> clazz, SearchableAnalyserPlugin annotation) {
// Do nothing
}

@Override
protected String extractDocumentationUrl(SearchableAnalyserPlugin annotation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,13 @@ public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}

public void checkClientTrusted(X509Certificate[] certs, String authType) {}
public void checkClientTrusted(X509Certificate[] certs, String authType) {
// Do nothing
}

public void checkServerTrusted(X509Certificate[] certs, String authType) {}
public void checkServerTrusted(X509Certificate[] certs, String authType) {
// Do nothing
}
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ public void write(int b) throws IOException {

/** Catch <code>flush</code> method, don't do nothing */
@Override
public void flush() throws IOException {}
public void flush() throws IOException {
// Do nothing
}

/**
* If internally stored content is available, sorting keys of content, then sending content to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ protected boolean extractSeparateClassLoader(VfsPlugin annotation) {

@Override
protected void addExtraClasses(
Map<Class<?>, String> classMap, Class<?> clazz, VfsPlugin annotation) {}
Map<Class<?>, String> classMap, Class<?> clazz, VfsPlugin annotation) {
// Do nothing
}

@Override
protected String extractDocumentationUrl(VfsPlugin annotation) {
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/java/org/apache/hop/i18n/GlobalMessages.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ public class GlobalMessages extends AbstractMessageHandler {
* TODO: extend from abstract class to ensure singleton status and migrate instantiation to class
* controlled private
*/
public GlobalMessages() {}
public GlobalMessages() {
// Do nothing
}

public static synchronized IMessageHandler getInstance() {
if (GMinstance == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ protected boolean extractSeparateClassLoader(HopMetadata annotation) {

@Override
protected void addExtraClasses(
Map<Class<?>, String> classMap, Class<?> clazz, HopMetadata annotation) {}
Map<Class<?>, String> classMap, Class<?> clazz, HopMetadata annotation) {
// Do Nothing
}

@Override
protected String extractDocumentationUrl(HopMetadata annotation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ private static X509TrustManager getDefaultTrustManager() {
return new X509TrustManager() {
@Override
public void checkClientTrusted(X509Certificate[] certs, String param)
throws CertificateException {}
throws CertificateException {
// Do nothing
}

@Override
public void checkServerTrusted(X509Certificate[] certs, String param)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import org.apache.hop.core.variables.IVariables;
import org.apache.hop.core.variables.Variables;
import org.apache.hop.junit.rules.RestoreHopEnvironment;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
Expand Down Expand Up @@ -106,9 +105,6 @@ public void setUp() throws Exception {
variables = new Variables();
}

@After
public void tearDown() {}

@Test
public void testGetQueryFieldsFromDatabaseMetaData() throws Exception {
DatabaseMeta meta = mock(DatabaseMeta.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public class DuplicateParamExceptionTest {
DuplicateParamException exception;

@Before
public void setUp() throws Exception {}
public void setUp() throws Exception {
// Do nothing
}

@Test
public void testConstructors() {
Expand Down
Loading
Loading