Skip to content

Commit

Permalink
#23982 sonarqube
Browse files Browse the repository at this point in the history
  • Loading branch information
wezell committed Feb 3, 2023
1 parent dc1dc40 commit 16a032b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
Expand Up @@ -38,8 +38,7 @@
import com.dotmarketing.util.Config;
import com.dotmarketing.util.Logger;
import com.dotmarketing.util.UtilMethods;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;

import com.liferay.util.StringPool;
import io.vavr.control.Try;

Expand All @@ -52,10 +51,7 @@
*/
public class VanityUrlAPIImpl implements VanityUrlAPI {

private final Set<Integer> allowedActions = new ImmutableSet.Builder<Integer>()
.add(HttpStatus.SC_OK)
.add(HttpStatus.SC_MOVED_PERMANENTLY)
.add(HttpStatus.SC_MOVED_TEMPORARILY).build();
private final Set<Integer> allowedActions = Set.of(HttpStatus.SC_OK,HttpStatus.SC_MOVED_PERMANENTLY,HttpStatus.SC_MOVED_TEMPORARILY);

private static final String SELECT_LIVE_VANITY_URL_INODES =
" SELECT cvi.live_inode "
Expand Down
@@ -1,13 +1,11 @@
package com.dotmarketing.startup.runonce;

import java.sql.Connection;
import java.sql.SQLException;
import com.dotmarketing.common.db.DotConnect;
import com.dotmarketing.db.DbConnectionFactory;
import com.dotmarketing.exception.DotDataException;
import com.dotmarketing.exception.DotRuntimeException;
import com.dotmarketing.startup.StartupTask;
import com.dotmarketing.util.Logger;
import java.sql.Connection;
import java.sql.SQLException;

public class Task210719CleanUpTitleField implements StartupTask {
@Override
Expand All @@ -16,7 +14,7 @@ public boolean forceRun() {
}


public void executeUpgrade() throws DotDataException, DotRuntimeException {
public void executeUpgrade() {

if(DbConnectionFactory.isPostgres()) {
executePgUpgrade();
Expand All @@ -32,7 +30,7 @@ public void executeUpgrade() throws DotDataException, DotRuntimeException {
}


public void executeSQLServerUpgrade() throws DotDataException, DotRuntimeException {
public void executeSQLServerUpgrade() {

try {
new DotConnect()
Expand All @@ -46,7 +44,7 @@ public void executeSQLServerUpgrade() throws DotDataException, DotRuntimeExcepti



public void executePgUpgrade() throws DotDataException, DotRuntimeException {
public void executePgUpgrade() {

try (Connection conn = DbConnectionFactory.getDataSource().getConnection()){

Expand Down

0 comments on commit 16a032b

Please sign in to comment.