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

add new SLF4J_GET_STACK_TRACE detector (fixes #70) #72

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vorburger
Copy link
Contributor

@vorburger vorburger commented Mar 14, 2018

for #70

@vorburger
Copy link
Contributor Author

@KengoTODA this fails locally for me with this message, which makes no sense to me, can you help:

-------------------------------------------------------------------------------
Test set: jp.skypencil.findbugs.slf4j.UsingGetStackTraceTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.079 sec <<< FAILURE! - in jp.skypencil.findbugs.slf4j.UsingGetStackTraceTest
testExceptionMethods()  Time elapsed: 0.076 sec  <<< ERROR!
java.lang.ExceptionInInitializerError
	at jp.skypencil.findbugs.slf4j.UsingGetStackTraceTest.testExceptionMethods(UsingGetStackTraceTest.java:18)
Caused by: java.lang.IllegalStateException: Unable to load core plugin
	at jp.skypencil.findbugs.slf4j.UsingGetStackTraceTest.testExceptionMethods(UsingGetStackTraceTest.java:18)
Caused by: edu.umd.cs.findbugs.PluginDoesntContainMetadataException: Core pluginfindbugs-2.0.2.jar doesn't contain findbugs.xml; got jar:file:/home/vorburger/dev/github/KengoTODA/findbugs-slf4j/bug-pattern/target/bug-pattern-1.4.1-SNAPSHOT.jar!/findbugs.xml from sun.misc.Launcher$AppClassLoader[file:/home/vorburger/dev/github/KengoTODA/findbugs-slf4j/test-case/target/surefire/surefirebooter1722547952841405469.jar]
	at jp.skypencil.findbugs.slf4j.UsingGetStackTraceTest.testExceptionMethods(UsingGetStackTraceTest.java:18)

That bug-pattern-1.4.1-SNAPSHOT.jar DOES contain findbugs.xml, so not sure what it's trying to tell me... 😃

@vorburger
Copy link
Contributor Author

@KengoTODA I've written the test differently in the 3rd commit (like the existing ones), so now it passes.

Copy link
Owner

@KengoTODA KengoTODA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update CHANGELOG.md and README.md.

I will read implementation changes carefully, later. At least I don't like naming like AbstractDetectorForParameterArray2.

@vorburger
Copy link
Contributor Author

Update CHANGELOG.md and README.md.

done.

I will read implementation changes carefully, later.

thanks!

At least I don't like naming like AbstractDetectorForParameterArray2.

how would you name it?

@vorburger
Copy link
Contributor Author

@KengoTODA how is this coming along - any chance we can wrap this up soon-ish?

}

@Override
protected int getIsOfInterestKind() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please annotate this method with @Item.SpecialKind

public class ManualGetStackTraceDetector extends AbstractDetectorForParameterArray2 {

@Item.SpecialKind
private final int isGetStackTrace = Item.defineNewSpecialKind("use of throwable getStackTrace");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isXxx is common naming for boolean, better to rename...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


@Override
protected boolean isWhatWeWantToDetect(int seen) {
// return false;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete needless comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


abstract protected boolean isWhatWeWantToDetect(int seen);

abstract protected int getIsOfInterestKind();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getIsOf sounds strange, please rename...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

import javax.annotation.Nullable;
import jp.skypencil.findbugs.slf4j.parameter.ArrayDataHandler.Strategy;

public abstract class AbstractDetectorForParameterArray2 extends AbstractDetectorForParameterArray {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we still have bad naming

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how would you name it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@vorburger
Copy link
Contributor Author

@KengoTODA I've taken all your previous code review feedback (thank you) into account. OK for you now?

@vorburger
Copy link
Contributor Author

@KengoTODA would you be willing to finally merge this if I resolved the conflicts? (Those appeared after.)

@vorburger
Copy link
Contributor Author

@KengoTODA I've rebased and resolved conflicts and squased this now - how about finally merging?

@KengoTODA
Copy link
Owner

@vorburger could you rebase your branch? I've updated master to skip SonarQube analysis for external PR.

@vorburger
Copy link
Contributor Author

@vorburger could you rebase your branch?

done

@vorburger
Copy link
Contributor Author

@KengoTODA I had taken all your previous code review feedback into account. How about merging?

@vorburger
Copy link
Contributor Author

@KengoTODA ?

@vorburger
Copy link
Contributor Author

@KengoTODA are you willing to merge this if I resolve conflicts now? I am asking because I have done that twice in the past, and can't keep spending time to rebase a PR I'm unclear about whether you even consider merging it, and have thus ignored this.

@vorburger
Copy link
Contributor Author

Thought about this again when I found a catch & printStackTrace ... see https://issues.apache.org/jira/browse/FINERACT-696 ... @KengoTODA will you merge this if I resolve conflicts now? I am asking because I have done that twice in the past, and can't keep spending time to rebase a PR I'm unclear about whether you even consider merging it...

so that in the next commit the upcoming ManualGetStackTraceDetector for
a SLF4J_GET_STACK_TRACE (issue KengoTODA#70) does not have to copy/paste 3/4 of
the ManualMessageDetector
incl. adjustments for code review feedback

* delete useless inline comment
* add @Item.SpecialKind annotation
* rename getIsOfInterestKind to getKindOfInterest
* rename isGetStackTrace to getStackTraceKind
* rename AbstractDetectorForParameterArray2 to AbstractExtendedDetectorForParameterArray
@vorburger vorburger force-pushed the issue-70_getStackTrace branch 2 times, most recently from 2801d1a to 0841ad7 Compare February 5, 2019 13:06
Copy link
Owner

@KengoTODA KengoTODA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you need to change existing classes (ManualMessageDetector.java), could you separate PR into two parts: 1. changing existing classes and 2. adding new detector based on it? It will help me to focus on purpose of review.

@vorburger
Copy link
Contributor Author

Hello @KengoTODA I'm doing a year end clean up of my personal https://github.com/pulls and wanted to ask if you would still consider merging this very old Pull Request if I rebased it, or if we should forget about and close this? (This is a bulk message I'm posting to many issues to gauge what is still revelant.)

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