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
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ public static Ejb3Column[] buildColumnFromAnnotation(
}

final String columnName;
if ( "".equals( col.name() ) ) {
if ( col.name() != null && col.name().isEmpty() ) {
columnName = null;
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public static Ejb3JoinColumn buildJoinColumn(
}

final String name;
if ( "".equals( colName ) ) {
if ( colName != null && colName.isEmpty() ) {
name = normalizer.normalizeIdentifierQuotingAsString( defaultName );
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ private static SimpleValue buildCollectionKey(
ConstraintMode foreignKeyValue = joinTableAnn.foreignKey().value();
if ( joinTableAnn.joinColumns().length != 0 ) {
final JoinColumn joinColumnAnn = joinTableAnn.joinColumns()[0];
if ( "".equals( foreignKeyName ) ) {
if ( foreignKeyName != null && foreignKeyName.isEmpty() ) {
foreignKeyName = joinColumnAnn.foreignKey().name();
foreignKeyDefinition = joinColumnAnn.foreignKey().foreignKeyDefinition();
}
Expand Down Expand Up @@ -1458,7 +1458,7 @@ else if ( anyAnn != null ) {
ConstraintMode foreignKeyValue = joinTableAnn.inverseForeignKey().value();
if ( joinTableAnn.inverseJoinColumns().length != 0 ) {
final JoinColumn joinColumnAnn = joinTableAnn.inverseJoinColumns()[0];
if ( "".equals( foreignKeyName ) ) {
if ( foreignKeyName != null && foreignKeyName.isEmpty() ) {
foreignKeyName = joinColumnAnn.foreignKey().name();
foreignKeyDefinition = joinColumnAnn.foreignKey().foreignKeyDefinition();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public String getForUpdateString(String aliases, LockOptions lockOptions) {
/*
* Parent's implementation for (aliases, lockOptions) ignores aliases.
*/
if ( "".equals( aliases ) ) {
if ( aliases != null && aliases.isEmpty() ) {
LockMode lockMode = lockOptions.getLockMode();
final Iterator<Map.Entry<String, LockMode>> itr = lockOptions.getAliasLockIterator();
while ( itr.hasNext() ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public String getForUpdateString(String aliases, LockOptions lockOptions) {
/*
* Parent's implementation for (aliases, lockOptions) ignores aliases.
*/
if ( "".equals( aliases ) ) {
if ( aliases != null && aliases.isEmpty() ) {
LockMode lockMode = lockOptions.getLockMode();
final Iterator<Map.Entry<String, LockMode>> itr = lockOptions.getAliasLockIterator();
while ( itr.hasNext() ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,9 @@ && isManyToManyRoot( last )
join.getAlias(),
enabledFilters
);
condition = "".equals( manyToManyFilter )
condition = (manyToManyFilter != null && manyToManyFilter.isEmpty())
? on
: "".equals( on ) ? manyToManyFilter : on + " and " + manyToManyFilter;
: (on != null && on.isEmpty()) ? manyToManyFilter : on + " and " + manyToManyFilter;
}
else {
condition = on;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private void prepareAnyImplicitJoins(DotNode dotNode) throws SemanticException {
if ( dotNode.getLhs() instanceof DotNode ) {
DotNode lhs = (DotNode) dotNode.getLhs();
FromElement lhsOrigin = lhs.getFromElement();
if ( lhsOrigin != null && "".equals( lhsOrigin.getText() ) ) {
if ( lhsOrigin != null && lhsOrigin.getText() != null && lhsOrigin.getText().isEmpty() ) {
String lhsOriginText = lhsOrigin.getQueryable().getTableName() +
" " + lhsOrigin.getTableAlias();
lhsOrigin.setText( lhsOriginText );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void addDiscriminatorWhereFragment(
Map enabledFilters,
String alias) {
String whereFragment = persister.filterFragment( alias, enabledFilters ).trim();
if ( "".equals( whereFragment ) ) {
if ( whereFragment != null && whereFragment.isEmpty() ) {
return;
}
if ( whereFragment.startsWith( "and" ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ public boolean isManyToManyWith(OuterJoinableAssociation other) {

public void addManyToManyJoin(JoinFragment outerjoin, QueryableCollection collection) throws MappingException {
String manyToManyFilter = collection.getManyToManyFilterFragment( rhsAlias, enabledFilters );
String condition = "".equals( manyToManyFilter )
String condition = (manyToManyFilter != null && manyToManyFilter.isEmpty())
? on
: "".equals( on )
: (on != null && on.isEmpty())
? manyToManyFilter
: on + " and " + manyToManyFilter;
outerjoin.addJoin(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ private void applyImportSources(

for ( String currentFile : importFiles.split( "," ) ) {
final String resourceName = currentFile.trim();
if ( "".equals( resourceName ) ) {
if ( resourceName != null && resourceName.isEmpty() ) {
//skip empty resource names
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ else if ( mapKeyEnumType != null ) {
final IdMappingData referencedIdMapping = mainGenerator.getEntitiesConfigurations()
.get( referencedEntityName ).getIdMappingData();
final int currentIndex = queryGeneratorBuilder == null ? 0 : queryGeneratorBuilder.getCurrentIndex();
if ( "".equals( mapKey ) ) {
if ( mapKey != null && mapKey.isEmpty() ) {
// The key of the map is the id of the entity.
return new MiddleComponentData(
new MiddleMapKeyIdComponentMapper(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
public abstract class StringTools {
public static boolean isEmpty(String s) {
return s == null || "".equals( s );
return s == null || s.isEmpty();
}

public static boolean isEmpty(Object o) {
Expand Down