-
-
Notifications
You must be signed in to change notification settings - Fork 353
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: inner types without file should not crash Environment#report #4998
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some preliminary thoughts
// TODO: will explode if type == null | ||
buffer.append(" at " + type.getQualifiedName() + "."); | ||
if (type != null) { | ||
buffer.append(" at " + type.getQualifiedName() + "."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buffer.append(" at " + type.getQualifiedName() + "."); | |
buffer.append(" at ").append(type.getQualifiedName()).append("."); |
If you already have a buffer I'd use its append
method instead of string concatenation inside the argument.
CtExecutable<?> exe = (element instanceof CtExecutable) ? (CtExecutable<?>) element : element.getParent(CtExecutable.class); | ||
if (exe != null) { | ||
buffer.append(exe.getSimpleName()); | ||
} | ||
buffer.append("(" + sp.getFile().getName() + ":" + sp.getLine() + ")"); | ||
if (sp.getFile() != null) { | ||
buffer.append("(" + sp.getFile().getName() + ":" + sp.getLine() + ")"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buffer.append("(" + sp.getFile().getName() + ":" + sp.getLine() + ")"); | |
buffer.append("(").append(sp.getFile().getName()=.append(":").append(sp.getLine()).append(")"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a small formatting issue
fixes #4997