You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`FieldType`/`MethodType`/`ConstructorType` are reflection-path only; source-path descriptors lack raw reflection handles
357
357
-`java.lang.Object` superclass is **not** modelled as `ExtendsTypeDescriptor` unless explicitly extended
358
358
-`ResolvedMethod` only resolves methods in types already present in the `CodeModel`; JDK stdlib methods (e.g. `String.valueOf`) are never resolved
359
-
- Unbounded wildcard `?` in reflection: `WildcardType.getUpperBounds()` returns `[Object.class]`— the code explicitly suppresses this
359
+
- Unbounded wildcard `?` in reflection: `WildcardType.getUpperBounds()` returns `[Object.class]`for an unbounded `?` — `JDKCodeModel.getTypeUsage()`suppresses this and correctly produces a `WildcardTypeUsage` with no upper bound; fully contained inside that method
**Depended on by:**`dependency-injection`, `codemodel-framework-builder`, `jdk-annotation-processor`
@@ -593,22 +593,28 @@ sequenceDiagram
593
593
594
594
**Plugin extensibility:** Implement `Enricher<T, E>`, `TypeChecker<T>`, `Compiler<T>`, or `Completer<T>` and register via `ServiceLoader` (`META-INF/services`). Use `@AutoService` to auto-generate the registration.
595
595
596
-
**TypeUsage equality:** String-based on `toString()`. A `TypeName` constructed with a `ModuleName` is **not** equal to the same logical type without one.
596
+
**TypeUsage equality:** String-based on `toString()`. The reflection path includes a module prefix in `TypeName` (e.g. `java.base/java.lang.String`); the source path does not. Don't mix both paths for the same types in one`CodeModel`.
597
597
598
598
---
599
599
600
600
## Gotchas
601
601
602
-
-**`JdkInitializer` is single-use.** Throws on second `initialize()` call.
603
-
-**Javac diagnostics are silenced.** Unresolvable types become `UnknownTypeUsage` without any error.
604
-
-**`Object` superclass is never modelled.** Types that implicitly extend `Object` have no `ExtendsTypeDescriptor` trait.
605
-
-**`ResolvedMethod` only resolves within the current `CodeModel`.** JDK stdlib methods (e.g. `String.valueOf`) are never resolved to `MethodDescriptor`.
606
-
-**`ProviderResolver` is opt-in.**`Provider<T>` injection fails silently without `context.addResolver(ProviderResolver::new)`.
607
-
-**`@Singular` registration is JVM-global and cached forever.** Classification cannot be changed between tests; create new `CodeModel` instances but expect shared trait metadata.
608
-
-**`@Provides` methods with parameters are silently ignored** by `ProvidesResolver`.
609
-
-**Override suppression is unconditional.** Overriding a method in a subclass removes the parent's `@Inject`, even if the override has no `@Inject` itself.
610
-
-**`IntersectionTypeUsage.dependencies()` does not include its own `types()`.** Asymmetric vs `UnionTypeUsage`. Potentially a bug.
611
-
-**`base-parsing` migration (PR #24):** The internal Pratt-parser classes (`ExpressionParser`, `Tokenizer`, `NodeResolver`, `TokenParser`, and all related token-parser types) were deleted from `expression-codemodel`. If you see references to these classes in branches or external forks, they no longer exist.
602
+
Non-obvious behaviours that are working as designed but will surprise you if you don't know them.
603
+
604
+
**`jdk-codemodel`**
605
+
-`JdkInitializer` is single-use — call `initialize()` a second time and it throws.
606
+
- Javac diagnostics are suppressed — unresolvable types silently become `UnknownTypeUsage`. This is intentional; the source path is designed to be permissive.
607
+
- Types that implicitly extend `Object` have no `ExtendsTypeDescriptor` trait. `Object` is the implicit root and is not modelled as an explicit parent.
608
+
-`ResolvedMethod` is only attached when the declaring type is already in the `CodeModel`. Calls into JDK stdlib (e.g. `String.valueOf`) produce no trait — expected, since stdlib types aren't reverse-engineered unless explicitly loaded.
609
+
-`FieldType`/`MethodType`/`ConstructorType` traits only exist on reflection-path descriptors. `MethodBodyDescriptor`/`FieldInitializerDescriptor` only exist on source-path descriptors.
610
+
611
+
**`dependency-injection`**
612
+
-`ProviderResolver` must be added explicitly: `context.addResolver(ProviderResolver::new)`. `Provider<T>` injection does nothing without it.
613
+
- Overriding a method removes the parent's `@Inject` even if the override has no `@Inject` — this is JSR-330 spec behaviour.
614
+
-`@Provides` methods with parameters are silently skipped by `ProvidesResolver` (factory pattern requires no-arg methods).
615
+
616
+
**`base-parsing` migration**
617
+
- The internal Pratt-parser classes (`ExpressionParser`, `Tokenizer`, `NodeResolver`, `TokenParser`, etc.) were deleted from `expression-codemodel` in PR #24. Parsing is now in `build.base:base-parsing`. References to those classes in old branches are dead.
0 commit comments