Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions api/src/org/labkey/api/query/QueryKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ else if (contains(ILLEGAL, String.valueOf(c)))

static protected boolean contains(String[] strs, String s)
{
for (int i = 0; i < strs.length; i++)
if (strs[i].equals(s))
for (String str : strs)
if (str.equals(s))
return true;

return false;
Expand All @@ -221,7 +221,7 @@ protected QueryKey(QueryKey<T> parent, @NotNull String name)
_hash = _name.toLowerCase().hashCode() ^ Objects.hashCode(_parent);
}

protected QueryKey(QueryKey<T> parent, Enum name)
protected QueryKey(QueryKey<T> parent, Enum<?> name)
{
this(parent, name.toString());
}
Expand Down Expand Up @@ -251,7 +251,7 @@ public boolean equals(Object other)
{
if (other == null || !(getClass().equals(other.getClass())))
return false;
QueryKey that = (QueryKey) other;
QueryKey<?> that = (QueryKey<?>) other;
return strEqualsIgnoreCase(_name, that._name) &&
Objects.equals(_parent, that._parent);
}
Expand Down Expand Up @@ -349,7 +349,7 @@ protected boolean needsQuotes(String part)
return true;
}

public boolean startsWith(@NotNull QueryKey<? extends QueryKey> prefix)
public boolean startsWith(@NotNull QueryKey<? extends QueryKey<?>> prefix)
{
if (size() < prefix.size())
return false;
Expand Down
13 changes: 7 additions & 6 deletions query/src/org/labkey/query/LinkedSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.labkey.query;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Strings;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -106,7 +107,7 @@ public static LinkedSchema get(User user, Container container, LinkedSchemaDef d
Container sourceContainer = def.lookupSourceContainer();
if (sourceContainer == null)
{
LOG.warn("Source container '" + def.getSourceContainerId() + "' not found for linked schema " + def.getUserSchemaName());
LOG.warn("Source container '{}' not found for linked schema {}", def.getSourceContainerId(), def.getUserSchemaName());
return null;
}

Expand All @@ -117,7 +118,7 @@ public static LinkedSchema get(User user, Container container, LinkedSchemaDef d
UserSchema sourceSchema = getSourceSchema(def, sourceSchemaName, sourceContainer, user);
if (sourceSchema == null)
{
LOG.warn("Source schema '" + sourceSchemaName + "' not found in container '" + sourceContainer.getPath() + "' for linked schema " + def.getUserSchemaName());
LOG.warn("Source schema '{}' not found in container '{}' for linked schema {}", sourceSchemaName, sourceContainer.getPath(), def.getUserSchemaName());
return null;
}

Expand Down Expand Up @@ -166,7 +167,7 @@ private static UserSchema getSourceSchema(LinkedSchemaDef def, String sourceSche
// Disallow recursive linked schema
if (def.lookupContainer() == sourceContainer && def.getUserSchemaName().equals(sourceSchemaName))
{
LOG.warn("Disallowed recursive linked schema definition '" + sourceSchemaName + "' in container '" + sourceContainer.getPath() + "'");
LOG.warn("Disallowed recursive linked schema definition '{}' in container '{}'", sourceSchemaName, sourceContainer.getPath());
return null;
}

Expand Down Expand Up @@ -343,7 +344,7 @@ protected LinkedTableInfo createWrappedTable(String name, @NotNull TableInfo sou
if (null != metaData && null != metaData.getIncludeColumnsList())
{
String cols = StringUtils.trim(metaData.getIncludeColumnsList());
if (!StringUtils.equals("*",cols))
if (!Strings.CS.equals("*",cols))
{
includedFields = Arrays.stream(StringUtils.split(cols,";"))
.map((col)->new FieldKey(null,col))
Expand Down Expand Up @@ -483,7 +484,7 @@ public static String generateLabKeySQL(TableInfo sourceTable, SQLWhereClauseSour
for (QueryService.ParameterDecl decl : parameterDecls)
{
sql.append(paramSep);
sql.append(" \"").append(decl.getName()).append("\" ").append(decl.getJdbcType().name());
sql.append(" ").append(FieldKey.fromParts(decl.getName()).toSQLString()).append(" ").append(decl.getJdbcType().name());
if (decl.getDefault() != null)
sql.append(" DEFAULT ").append(decl.getDefault());
paramSep = ",\n";
Expand All @@ -499,7 +500,7 @@ public static String generateLabKeySQL(TableInfo sourceTable, SQLWhereClauseSour
if (col.isAdditionalQueryColumn())
continue;
sql.append(columnSep);
sql.append("\"").append(col.getName()).append("\"");
sql.append(col.getFieldKey().toSQLString());
if (col.isHidden())
sql.append(" @hidden");

Expand Down