File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
src/main/scala/com/fasterxml/jackson/module/scala/introspect Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -230,9 +230,18 @@ object ScalaAnnotationIntrospector extends NopAnnotationIntrospector with ValueI
230
230
private def isScalaPackage (pkg : Option [Package ]): Boolean =
231
231
pkg.exists(_.getName.startsWith(" scala." ))
232
232
233
- private [introspect] def isMaybeScalaBeanType (cls : Class [_]): Boolean =
234
- (cls.extendsScalaClass(ScalaAnnotationIntrospectorModule .shouldSupportScala3Classes()) || cls.hasSignature) &&
235
- ! isScalaPackage(Option (cls.getPackage))
233
+ private [introspect] def isMaybeScalaBeanType (cls : Class [_]): Boolean = {
234
+ val key = cls.getName
235
+ val flag = Option (ScalaAnnotationIntrospectorModule ._scalaTypeCache.get(key)) match {
236
+ case Some (flag) => flag
237
+ case _ => {
238
+ val flag = cls.extendsScalaClass(ScalaAnnotationIntrospectorModule .shouldSupportScala3Classes()) || cls.hasSignature
239
+ ScalaAnnotationIntrospectorModule ._scalaTypeCache.put(key, flag)
240
+ flag
241
+ }
242
+ }
243
+ flag && ! isScalaPackage(Option (cls.getPackage))
244
+ }
236
245
237
246
private def isScala (a : Annotated ): Boolean = {
238
247
a match {
You can’t perform that action at this time.
0 commit comments