Skip to content

Commit 4b6fd86

Browse files
committed
Suppress some of the warning reported by the eclipse compiler
1 parent e53d945 commit 4b6fd86

File tree

10 files changed

+15
-2
lines changed

10 files changed

+15
-2
lines changed

integrationtest/backend/tck/src/main/java/org/hibernate/search/integrationtest/backend/tck/testsupport/util/extension/SearchSetupHelper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ public PartialSetup setupFirstPhaseOnly() {
257257
return setupFirstPhaseOnly( Optional.empty() );
258258
}
259259

260+
@SuppressWarnings("resource") // For the eclipse-compiler: complains on StubMappingImpl not bing closed
260261
public PartialSetup setupFirstPhaseOnly(Optional<StubMapping> previousMapping) {
261262
Context context = currentContext();
262263
SearchIntegrationEnvironment environment =

integrationtest/performance/backend/base/src/main/java/org/hibernate/search/integrationtest/performance/backend/base/testsupport/index/AbstractBackendHolder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public abstract class AbstractBackendHolder {
4444
private List<MappedIndex> indexes;
4545

4646
@Setup(Level.Trial)
47+
@SuppressWarnings("resource") // For the eclipse-compiler: complains on StubMappingImpl not bing closed
4748
public void startHibernateSearch(TemporaryFileHolder temporaryFileHolder) throws IOException {
4849
Map<String, Object> baseProperties = new LinkedHashMap<>();
4950

mapper/pojo-base/src/main/java/org/hibernate/search/mapper/pojo/bridge/binding/impl/DefaultIdentifierBindingContext.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ public <I2> void bridge(Class<I2> expectedValueType, IdentifierBridge<I2> bridge
5757
}
5858

5959
@Override
60+
@SuppressWarnings("resource") // For the eclipse-compiler: complains on bridge not bing closed
6061
public <I2> void bridge(Class<I2> expectedValueType, BeanHolder<? extends IdentifierBridge<I2>> bridgeHolder) {
62+
PojoRawTypeModel<I2> expectedValueTypeModel = introspector.typeModel( expectedValueType );
6163
try {
62-
PojoRawTypeModel<I2> expectedValueTypeModel = introspector.typeModel( expectedValueType );
6364
if ( !identifierTypeModel.rawType().equals( expectedValueTypeModel ) ) {
6465
throw log.invalidInputTypeForBridge( bridgeHolder.get(), identifierTypeModel, expectedValueTypeModel );
6566
}

mapper/pojo-base/src/main/java/org/hibernate/search/mapper/pojo/bridge/binding/impl/PropertyBindingContextImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ public Optional<BoundPropertyBridge<P>> applyBinder(PropertyBinder binder) {
126126
}
127127
}
128128

129+
@SuppressWarnings("resource") // For the eclipse-compiler: complains on bridge not bing closed
129130
private <P2> void checkAndBind(BeanHolder<? extends PropertyBridge<P2>> bridgeHolder,
130131
PojoRawTypeModel<?> expectedPropertyTypeModel) {
131132
if ( !propertyTypeModel.rawType().isSubTypeOf( expectedPropertyTypeModel ) ) {

mapper/pojo-base/src/main/java/org/hibernate/search/mapper/pojo/bridge/binding/impl/RoutingBindingContextImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ public <E2> void bridge(Class<E2> expectedType, RoutingBridge<E2> bridge) {
5353
}
5454

5555
@Override
56-
@SuppressWarnings("unchecked") // Checked using reflection
56+
@SuppressWarnings({
57+
"unchecked" /*Checked using reflection*/,
58+
"resource" /* For the eclipse-compiler: complains on bridge not bing closed */ })
5759
public <E2> void bridge(Class<E2> expectedType, BeanHolder<? extends RoutingBridge<E2>> bridgeHolder) {
5860
PojoRawTypeModel<E2> expectedTypeModel = introspector.typeModel( expectedType );
5961
if ( !indexedEntityType.isSubTypeOf( expectedTypeModel ) ) {

mapper/pojo-base/src/main/java/org/hibernate/search/mapper/pojo/bridge/binding/impl/TypeBindingContextImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ public Optional<BoundTypeBridge<T>> applyBinder(TypeBinder binder) {
126126
}
127127
}
128128

129+
@SuppressWarnings("resource") // For the eclipse-compiler: complains on bridge not bing closed
129130
private <T2> void checkAndBind(BeanHolder<? extends TypeBridge<T2>> bridgeHolder,
130131
PojoRawTypeModel<?> expectedPropertyTypeModel) {
131132
if ( !typeModel.rawType().isSubTypeOf( expectedPropertyTypeModel ) ) {

mapper/pojo-base/src/main/java/org/hibernate/search/mapper/pojo/bridge/binding/impl/ValueBindingContextImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public <V2, F> void bridge(Class<V2> expectedValueType, ValueBridge<V2, F> bridg
8989
}
9090

9191
@Override
92+
@SuppressWarnings("resource") // For the eclipse-compiler: complains on bridge not bing closed
9293
public <V2, F> void bridge(Class<V2> expectedValueType, BeanHolder<? extends ValueBridge<V2, F>> bridgeHolder,
9394
IndexFieldTypeOptionsStep<?, F> fieldTypeOptionsStep) {
9495
try {

mapper/pojo-base/src/main/java/org/hibernate/search/mapper/pojo/bridge/runtime/impl/RoutingBridgeDocumentRouter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ private final class CurrentDocumentRoutes implements DocumentRoutes {
7070
private boolean skip = false;
7171

7272
@Override
73+
@SuppressWarnings("resource") // For the eclipse-compiler: complains on bridge not bing closed
7374
public DocumentRoute addRoute() {
7475
if ( currentRoute != null ) {
7576
// TODO HSEARCH-3971 allow routing to multiple indexes *simultaneously*?
@@ -84,6 +85,7 @@ public void notIndexed() {
8485
skip = true;
8586
}
8687

88+
@SuppressWarnings("resource") // For the eclipse-compiler: complains on bridge not bing closed
8789
DocumentRouteDescriptor currentRoute(Object entityIdentifier, E entity, BridgeSessionContext context) {
8890
routingBridgeHolder.get()
8991
.route( this, entityIdentifier, entity, context.routingBridgeRouteContext() );
@@ -117,6 +119,7 @@ public void notIndexed() {
117119
skip = true;
118120
}
119121

122+
@SuppressWarnings("resource") // For the eclipse-compiler: complains on bridge not bing closed
120123
Collection<DocumentRouteDescriptor> previousDifferentRoutes(DocumentRouteDescriptor currentRoute,
121124
Object entityIdentifier, E entity, DocumentRoutesDescriptor providedRoutes, BridgeSessionContext context) {
122125
routingBridgeHolder.get()

mapper/pojo-standalone/src/main/java/org/hibernate/search/mapper/pojo/standalone/bootstrap/impl/StandalonePojoIntegrationPartialBuildState.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ StandalonePojoMapping doBootSecondPhase(ConfigurationPropertySource propertySour
6666
ConfigurationPropertyChecker propertyChecker) {
6767
SearchIntegrationFinalizer finalizer = integrationBuildState.finalizer( propertySource, propertyChecker );
6868

69+
@SuppressWarnings("resource") // For the eclipse-compiler: complains on mapping not bing closed
6970
StandalonePojoMapping mapping = finalizer.finalizeMapping(
7071
mappingKey,
7172
(context, partialMapping) -> partialMapping.finalizeMapping( context )

util/internal/integrationtest/common/src/main/java/org/hibernate/search/util/impl/integrationtest/common/extension/VerifyingStubBackendBehavior.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ public long executeCountWork(Set<String> indexNames) {
401401
}
402402

403403
@Override
404+
@SuppressWarnings("resource") // For the eclipse-compiler: complains on StubSearchScroll not bing closed
404405
public <T> SearchScroll<T> executeScrollWork(Set<String> indexNames, StubSearchWork work, int chunkSize,
405406
StubSearchProjectionContext projectionContext, SearchLoadingContext<?> loadingContext,
406407
StubSearchProjection<T> rootProjection, TimingSource timingSource) {

0 commit comments

Comments
 (0)