Skip to content

Commit bc867cb

Browse files
committed
HSEARCH-5300 Address various eclipse compiler + Sonar issues
1 parent 170914a commit bc867cb

File tree

56 files changed

+226
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+226
-129
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ stage('Non-default environments') {
498498
// we'd better recompile everything with the same compiler rather than get some strange errors
499499
mavenNonDefaultBuild buildEnv, """ \
500500
-DskipTests -DskipITs \
501-
-P${buildEnv.mavenProfile},!javaModuleITs \
501+
-P${buildEnv.mavenProfile},!javaModuleITs,!metamodelITs -pl '!:hibernate-search-documentation,!:hibernate-search-reports' \
502502
-Dgib.buildAll=true \
503503
"""
504504
}

backend/elasticsearch/src/main/java/org/hibernate/search/backend/elasticsearch/scope/model/impl/ElasticsearchSearchIndexScopeImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,12 @@ public <P> ElasticsearchSearchQueryBuilder<P> select(BackendSessionContext sessi
172172

173173
@Override
174174
public <SR> ElasticsearchSearchPredicateFactory<SR> predicateFactory() {
175-
return new ElasticsearchSearchPredicateFactoryImpl<SR>( SearchPredicateDslContext.root( this ) );
175+
return new ElasticsearchSearchPredicateFactoryImpl<>( SearchPredicateDslContext.root( this ) );
176176
}
177177

178178
@Override
179179
public <SR> ElasticsearchSearchSortFactory<SR> sortFactory() {
180-
return new ElasticsearchSearchSortFactoryImpl<SR>( SearchSortDslContext
180+
return new ElasticsearchSearchSortFactoryImpl<>( SearchSortDslContext
181181
.root( this, ElasticsearchSearchSortFactoryImpl::new, predicateFactory() ) );
182182
}
183183

@@ -188,7 +188,7 @@ public <SR, R, E> ElasticsearchSearchProjectionFactory<SR, R, E> projectionFacto
188188

189189
@Override
190190
public <SR> ElasticsearchSearchAggregationFactory<SR> aggregationFactory() {
191-
return new ElasticsearchSearchAggregationFactoryImpl<SR>(
191+
return new ElasticsearchSearchAggregationFactoryImpl<>(
192192
SearchAggregationDslContext.root( this, predicateFactory() ) );
193193
}
194194

backend/elasticsearch/src/main/java/org/hibernate/search/backend/elasticsearch/search/aggregation/dsl/impl/ElasticsearchSearchAggregationFactoryImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public ElasticsearchSearchAggregationFactoryImpl(
3030

3131
@Override
3232
public ElasticsearchSearchAggregationFactory<SR> withRoot(String objectFieldPath) {
33-
return new ElasticsearchSearchAggregationFactoryImpl<SR>( dslContext.rescope(
33+
return new ElasticsearchSearchAggregationFactoryImpl<>( dslContext.rescope(
3434
dslContext.scope().withRoot( objectFieldPath ),
3535
dslContext.predicateFactory().withRoot( objectFieldPath ) ) );
3636
}

backend/elasticsearch/src/main/java/org/hibernate/search/backend/elasticsearch/search/predicate/dsl/impl/ElasticsearchSearchPredicateFactoryImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public ElasticsearchSearchPredicateFactoryImpl(
2727

2828
@Override
2929
public ElasticsearchSearchPredicateFactory<SR> withRoot(String objectFieldPath) {
30-
return new ElasticsearchSearchPredicateFactoryImpl<SR>( dslContext.rescope(
30+
return new ElasticsearchSearchPredicateFactoryImpl<>( dslContext.rescope(
3131
dslContext.scope().withRoot( objectFieldPath ) ) );
3232
}
3333

backend/elasticsearch/src/main/java/org/hibernate/search/backend/elasticsearch/search/sort/dsl/impl/ElasticsearchSearchSortFactoryImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public ElasticsearchSearchSortFactoryImpl(
3232

3333
@Override
3434
public ElasticsearchSearchSortFactory<SR> withRoot(String objectFieldPath) {
35-
return new ElasticsearchSearchSortFactoryImpl<SR>( dslContext.rescope(
35+
return new ElasticsearchSearchSortFactoryImpl<>( dslContext.rescope(
3636
dslContext.scope().withRoot( objectFieldPath ),
3737
dslContext.predicateFactory().withRoot( objectFieldPath ) ) );
3838
}
@@ -48,6 +48,6 @@ public SortThenStep<SR> fromJson(String jsonString) {
4848
}
4949

5050
private SortThenStep<SR> staticThenStep(ElasticsearchSearchSort sort) {
51-
return new StaticSortThenStep<SR>( dslContext, sort );
51+
return new StaticSortThenStep<>( dslContext, sort );
5252
}
5353
}

backend/lucene/src/main/java/org/hibernate/search/backend/lucene/scope/model/impl/LuceneSearchIndexScopeImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public <SR> LuceneSearchPredicateFactory<SR> predicateFactory() {
168168

169169
@Override
170170
public <SR> LuceneSearchSortFactory<SR> sortFactory() {
171-
return new LuceneSearchSortFactoryImpl<SR>( SearchSortDslContext
171+
return new LuceneSearchSortFactoryImpl<>( SearchSortDslContext
172172
.root( this, LuceneSearchSortFactoryImpl::new, predicateFactory() ) );
173173
}
174174

@@ -179,7 +179,7 @@ public <SR, R, E> LuceneSearchProjectionFactory<SR, R, E> projectionFactory() {
179179

180180
@Override
181181
public <SR> LuceneSearchAggregationFactory<SR> aggregationFactory() {
182-
return new LuceneSearchAggregationFactoryImpl<SR>( SearchAggregationDslContext.root( this, predicateFactory() ) );
182+
return new LuceneSearchAggregationFactoryImpl<>( SearchAggregationDslContext.root( this, predicateFactory() ) );
183183
}
184184

185185
@Override

backend/lucene/src/main/java/org/hibernate/search/backend/lucene/search/aggregation/dsl/impl/LuceneSearchAggregationFactoryImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public LuceneSearchAggregationFactoryImpl(
2727

2828
@Override
2929
public LuceneSearchAggregationFactory<SR> withRoot(String objectFieldPath) {
30-
return new LuceneSearchAggregationFactoryImpl<SR>( dslContext.rescope(
30+
return new LuceneSearchAggregationFactoryImpl<>( dslContext.rescope(
3131
dslContext.scope().withRoot( objectFieldPath ),
3232
dslContext.predicateFactory().withRoot( objectFieldPath ) ) );
3333
}

backend/lucene/src/main/java/org/hibernate/search/backend/lucene/search/predicate/dsl/impl/LuceneSearchPredicateFactoryImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public LuceneSearchPredicateFactoryImpl(SearchPredicateDslContext<LuceneSearchPr
2626

2727
@Override
2828
public LuceneSearchPredicateFactory<SR> withRoot(String objectFieldPath) {
29-
return new LuceneSearchPredicateFactoryImpl<SR>( dslContext.rescope(
29+
return new LuceneSearchPredicateFactoryImpl<>( dslContext.rescope(
3030
dslContext.scope().withRoot( objectFieldPath ) ) );
3131
}
3232

backend/lucene/src/main/java/org/hibernate/search/backend/lucene/search/sort/dsl/impl/LuceneSearchSortFactoryImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public LuceneSearchSortFactoryImpl(
2929

3030
@Override
3131
public LuceneSearchSortFactory<SR> withRoot(String objectFieldPath) {
32-
return new LuceneSearchSortFactoryImpl<SR>( dslContext.rescope(
32+
return new LuceneSearchSortFactoryImpl<>( dslContext.rescope(
3333
dslContext.scope().withRoot( objectFieldPath ),
3434
dslContext.predicateFactory().withRoot( objectFieldPath ) ) );
3535
}

build/config/src/main/java/org/hibernate/search/build/report/loggers/LoggerCategoriesProcessor.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ public synchronized void init(ProcessingEnvironment processingEnv) {
5454
messager = processingEnv.getMessager();
5555

5656
moduleName = processingEnv.getOptions().get( Configuration.MODULE_NAME );
57-
if ( moduleName == null || moduleName.isBlank() ) {
58-
throw new IllegalArgumentException(
59-
"Module name cannot be null nor blank. Specify the %s annotation processor argument to define the module name"
60-
.formatted( Configuration.MODULE_NAME ) );
61-
}
6257
}
6358

6459
@Override
@@ -118,6 +113,11 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
118113
writer.write( "# This Hibernate Search module does not use any logging categories.\n" );
119114
}
120115
else {
116+
if ( moduleName == null || moduleName.isBlank() ) {
117+
throw new IllegalArgumentException(
118+
"Module name cannot be null nor blank. Specify the %s annotation processor argument to define the module name"
119+
.formatted( Configuration.MODULE_NAME ) );
120+
}
121121
Map<String, Object> data = new LinkedHashMap<>();
122122
data.put( ReportConstants.MODULE_NAME, moduleName );
123123
data.put( ReportConstants.CATEGORIES, toYamlCategories( categories, categoryLevels ) );

0 commit comments

Comments
 (0)