Skip to content
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

fix: Do not throw an exception when the solution or entity classes are interfaces #934

Merged

Conversation

Christopher-Chianelli
Copy link
Contributor

The superclass of an interface is null. This caused this line of code to throw an exception for solution classes that are interface:

var superclass = bottomClass.getSuperclass();
lineageClassList.addAll(getAllAnnotatedLineageClasses(superclass, annotation));

Since getAllAnnotatedLineageClasses expected superclass to not be null. getAllAnnotatedLineageClasses now returns an empty list for null arguments.

…e interfaces

The superclass of an interface is `null`. This caused this line of code
to throw an exception for solution classes that are interface:

```java
var superclass = bottomClass.getSuperclass();
lineageClassList.addAll(getAllAnnotatedLineageClasses(superclass, annotation));
```

Since `getAllAnnotatedLineageClasses` expected superclass to not be `null`.
`getAllAnnotatedLineageClasses` now returns an empty list for `null`
arguments.
Copy link

sonarqubecloud bot commented Jul 4, 2024

@triceo
Copy link
Contributor

triceo commented Jul 5, 2024

I'm wondering if solutions as interfaces should be supported. What would be the use case? What would be the downsides?

Considering that in all the years we have not seen anyone ask us for this, maybe we don't need this.

@Christopher-Chianelli
Copy link
Contributor Author

I'm wondering if solutions as interfaces should be supported. What would be the use case? What would be the downsides?

Considering that in all the years we have not seen anyone ask us for this, maybe we don't need this.

It mostly for proxies, which are used in FFI (for instance, when using Python objects in Java via GraalVM).
Proxies almost certainly need a custom solution cloner, but otherwise work without issue.

@triceo triceo added this to the v1.12.0 milestone Jul 8, 2024
@triceo triceo merged commit d5ed7e1 into TimefoldAI:main Jul 8, 2024
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants