-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Guard against NullPointerException in AnnotationParser #12453
Comments
What version of Jetty? |
Jetty 12.0.14 using EE8 |
What |
Any fix for this wont make it into this months release. (too late for that) |
To be honest: I don't know yet. We're trying to do a forklift upgrade from 10.0.18 to 12.0.14 and everything is broken :). I've only just now started investigating why. This caught my eye and I'd thought to fire off a quick issue lest I'd forget. I was not counting on a response within three minutes! /me waves angry first :) |
+ Better utilize Resource object, don't rely on Path existing for things that don't require Path.
@guusdk a WIP PR for this is already opened at #12454 It's missing a testcase, something to prevent regression. |
Looks like OpenFire is setting the scheme |
Huh, OpenFire seems to only support Jetty 10.0.x |
Ya, looks like you are developer with OpenFire. Don't set / use the URLResourceFactory for the default schemes ( Only use it for oddball schemes like |
Yeah, like I wrote earlier, we ran into this while working to get Jetty upgraded in our project. Thanks for the pointers! |
@joakime The upgrade is being worked on here: https://github.com/surevine/Openfire/tree/feature/jetty-12.0.14-ee8-upgrade What we're upgrading is old code that itself might not have been in the best state. We've been using Jetty for ages. Most of the upgrades were a 'hit it until it runs' kind of effort. |
I tossed a few quick comments in your commits that might help you. |
That's super helpful, thanks! |
We've got a broken setup, that is unlikely to be caused by the problem described herein. Via the stacktrace, however, we did find a possible improvement for Jetty 12.0.14 using EE8. No wars are going to be won by this, but still, it might be a useful improvement.
Given this stacktrace:
It appears that there's room for improvement in
AnnotationParser
:If the Resource argument is
null
, the method immediately short-circuits tofalse
. If the Resource is notnull
, but has anull
path, then a NPE is thrown in only the last check (inFileID.isClassFile()
).FileID.isJavaArchive()
isn't bothered by having a null argument, butisClassFile
is.I'd suggest to make this behavior consistent, either by short-circuiting in the first check, or by adjusting the implementation of
FileID.isClassFile()
The text was updated successfully, but these errors were encountered: