Skip to content

Commit

Permalink
Bugfix: NullPointerException at CacheIndexMetadata.getField() (#2110)
Browse files Browse the repository at this point in the history
PROBLEM
=======
NullPointerException raising at CacheIndexMetadata.getField() while EntityManager initialising.

CAUSE
=======
Entity metadata XML file contains tag <cache-index><column-name>SOMENAME</column-name></cache-index>.
XML Deserializer call CacheIndexMetadata default constructor. ORMetadata.m_project field stay none initialised.
Call of CacheIndexMetadata.getField() throw to exception.

SOLVING
=======
Set ORMetadata.m_project value after XML deserialization.

Signed-off-by: Radek Felcman <radek.felcman@oracle.com>
  • Loading branch information
rfelcman authored Apr 16, 2024
1 parent 3fe3f12 commit 8a993b4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2021 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -1016,6 +1016,7 @@ protected void processCacheIndexes() {
}

for (CacheIndexMetadata indexMetadata : m_cacheIndexes) {
indexMetadata.setProject(getProject());
indexMetadata.process(getDescriptor(), null);
}
}
Expand Down

0 comments on commit 8a993b4

Please sign in to comment.