-
Notifications
You must be signed in to change notification settings - Fork 3k
Added class name check to remove warning #50722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
3c203fb
b833f13
fd68642
2fe0271
f2f0fb5
e83711e
f61a352
d0925a7
06ab0bb
3023296
0040b6f
91756cd
25201f3
c7b878e
573a771
795141c
3569463
a504778
0d3395e
9eb8296
3e8012c
cf20244
55b3d5b
4acd473
b0fdb6a
788b4ba
cd13282
6670cfd
74f3ad8
2656170
7be850c
202b4c3
194edb6
7de7920
c3b4d8d
d87beba
2906258
0d2843b
2e7f396
999771b
672df7f
058b7fe
65f407f
17564d8
b1f2272
a8a4190
ce05361
234c81f
e3e0b8d
131d7bc
e9d1e56
41e309e
b2acb6c
2f9f1e5
ccb8867
bf78cb7
fd62eaf
5ac20db
44c590d
bb1cfa0
b931128
85f36b9
cf9b1bf
ba27383
86ea3f3
3955d11
06261a5
29b5b02
ea75990
d7197db
ebd7bbf
a57e9c8
f041f7c
9bd29fb
1a7f60a
8fce8ae
720f194
edd7a8f
b8454af
59bc814
fd70b63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -471,6 +471,7 @@ public BytecodeRecorderConstantDefinitionBuildItem pregenProxies( | |
| LiveReloadBuildItem liveReloadBuildItem, | ||
| ExecutorService buildExecutor) throws ExecutionException, InterruptedException { | ||
| Set<String> managedClassAndPackageNames = new HashSet<>(jpaModel.getEntityClassNames()); | ||
| Set<String> managedClassesName = new HashSet<>(jpaModel.getEntityClassNames()); | ||
| for (PersistenceUnitDescriptorBuildItem pud : persistenceUnitDescriptorBuildItems) { | ||
| // Note: getManagedClassNames() can also return *package* names | ||
| // See the source code of Hibernate ORM for proof: | ||
|
|
@@ -483,7 +484,7 @@ public BytecodeRecorderConstantDefinitionBuildItem pregenProxies( | |
| managedClassAndPackageNames.add(additionalJpaModelBuildItem.getClassName()); | ||
| } | ||
|
|
||
| PreGeneratedProxies proxyDefinitions = generateProxies(managedClassAndPackageNames, | ||
| PreGeneratedProxies proxyDefinitions = generateProxies(managedClassAndPackageNames, managedClassesName, | ||
|
||
| indexBuildItem.getIndex(), transformedClassesBuildItem, | ||
| generatedClassBuildItemBuildProducer, liveReloadBuildItem, buildExecutor); | ||
|
|
||
|
|
@@ -1229,6 +1230,12 @@ public static Map<String, JpaPersistenceUnitModel> getModelPerPersistenceUnit(Hi | |
| Set<String> modelClassesWithPersistenceUnitAnnotations = new TreeSet<>(); | ||
|
|
||
| for (String modelClassName : jpaModel.getAllModelClassNames()) { | ||
|
|
||
| if(!jpaModel.getEntityClassNames().contains(modelClassName)) { | ||
| // We only care about class name here | ||
| continue; | ||
| } | ||
|
|
||
|
Comment on lines
1245
to
1248
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is correct, as you can see within this for loop we add the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, unfortunately this patch is too simple and would cause trouble down the way. Really, you can't use existing information in See the explanation I gave in this comment: #50572 (comment)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry but this is still not enough. I added a comment further up in this file, hopefully this will clear things up... If you think my comment does not make sense, please say so, so we can discuss that. don't just ignore it :) |
||
| ClassInfo modelClassInfo = index.getClassByName(DotName.createSimple(modelClassName)); | ||
| Set<String> relatedModelClassNames = getRelatedModelClassNames(index, jpaModel.getAllModelClassNames(), | ||
| modelClassInfo); | ||
|
|
@@ -1433,7 +1440,7 @@ private static MultiTenancyStrategy getMultiTenancyStrategy(Optional<String> mul | |
| return multiTenancyStrategy; | ||
| } | ||
|
|
||
| private PreGeneratedProxies generateProxies(Set<String> managedClassAndPackageNames, IndexView combinedIndex, | ||
| private PreGeneratedProxies generateProxies(Set<String> managedClassAndPackageNames, Set<String> managedClassesName, IndexView combinedIndex, | ||
| TransformedClassesBuildItem transformedClassesBuildItem, | ||
| BuildProducer<GeneratedClassBuildItem> generatedClassBuildItemBuildProducer, | ||
| LiveReloadBuildItem liveReloadBuildItem, | ||
|
|
@@ -1466,6 +1473,12 @@ private PreGeneratedProxies generateProxies(Set<String> managedClassAndPackageNa | |
| CachedProxy proxy = proxyCache.cache.get(managedClassOrPackageName); | ||
| generatedProxyQueue.add(CompletableFuture.completedFuture(proxy)); | ||
| } else { | ||
|
|
||
| if(!managedClassesName.contains(managedClassOrPackageName)) { | ||
| // we don't generate proxies for packages | ||
| continue; | ||
| } | ||
|
|
||
| if (!proxyHelper.isProxiable(combinedIndex.getClassByName(managedClassOrPackageName))) { | ||
| // we need to make sure we have a class and not a package and that it is proxiable | ||
| continue; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.