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 future deprecation #298

Closed
OpherV opened this issue May 3, 2020 · 21 comments · May be fixed by #307 or #308
Closed

Fix future deprecation #298

OpherV opened this issue May 3, 2020 · 21 comments · May be fixed by #307 or #308

Comments

@OpherV
Copy link
Owner

OpherV commented May 3, 2020

image

@fabmars
Copy link

fabmars commented May 3, 2020

Yeah that was expected: public **abstract** class TaskDialogPanelProvider declares

@SuppressWarnings("DeprecatedIsStillUsed")
 @Deprecated
 @Nullable
 public abstract TaskDialogPanel getOpenTaskPanel(@NotNull Project project, @NotNull Task task);

Since GitflowTaskDialogPanelProvider extends TaskDialogPanelProvider, there is no other choice but to implement the method

Funny to see that idea's own VcsTaskDialogPanelProvider was also compelled to provide with a dummy override for that method. They have the same warning on their builds.

One way to solve is is to GitflowTaskDialogPanelProvider extends VcsTaskDialogPanelProvider LOL!

@enderteszla
Copy link

@fabmars @OpherV , this method in their implementation always returns null.
And, yes, I guess the most proper solution is to GitflowTaskDialogPanelProvider extends VcsTaskDialogPanelProvider.
Because, once they eliminate TaskDialogPanelProvider.getOpenTaskPanel(@NotNull Project, @NotNull Task), VcsTaskDialogPanelProvider.getOpenTaskPanel(@NotNull Project, @NotNull Task) immediately goes away as well.

@enderteszla
Copy link

@fabmars , will you submit PR?
Or should I? I would do that if you don't.

@OpherV
Copy link
Owner Author

OpherV commented Jun 11, 2020

@enderteszla Looks like @fabmars didn't get around to it so if you do a PR that would be appreciated! :)

@enderteszla
Copy link

@OpherV , okay, which branch should I make PR into?

@enderteszla
Copy link

develop?

@enderteszla
Copy link

@OpherV , there are two solutions, one is a plain one and another is a bit more advanced one.

@enderteszla
Copy link

By the way (since I do not know how to ask you in any other way),
Why do they at JetBrains call gitflow4idea again not supported?
What issue should we handle to make them call it supported once again?

@OpherV
Copy link
Owner Author

OpherV commented Jun 11, 2020

yep develop is the one. It would be unbecoming for a git flow plugin to not use git flow 😀
It's not that it's not supported, it's that they're deprecating methods from time to time and so I have to make sure to work around those so that once the APIs are actually removed from an Idea version the plugin is still usable.

Currently the only issue is the one at the top of this thread.

Thanks so much for the PRs! I'll review soon

@fabmars
Copy link

fabmars commented Jun 11, 2020

@enderteszla sorry I'm into some turmoil at the moment (and I have another pretty complex PR in progress on a JBoss project), I can't dive into this right now.

Just to make it clear with my earlier comment about this deprecation, there was no real way to avoid this warning because GitflowTaskDialogPanelProvider extends TaskDialogPanelProvider, an internal Jetbrains class which is itself bound to this deprecation.

If I remember correctly GitflowTaskDialogPanelProvider extends VcsTaskDialogPanelProvider is like putting a plaster on a peg leg cause VcsTaskDialogPanelProvider extends TaskDialogPanelProvider itself! It's just hiding the problem. Solving it in not in our powers.

Therefore, my approach was a "wait & see" one where I would have advised to wait for Jetbrains to update their own classes before the getOpenTaskPanel() method is officially forbidden to use. Clearly TaskDialogPanelProvider triggers the same warning as we have, they will have to change it (else it's a case of "do as I say don't do what I do" :) )

@fabmars
Copy link

fabmars commented Jun 11, 2020

For the sake of double checking I put the latest version of the IJ gradle plugin in the project id 'org.jetbrains.intellij' version '0.4.21'

As of today IJ 2020.1.2 uses api 201.6668.121, so TaskDialogPanelProvider is unchanged.

@enderteszla
Copy link

@fabmars , we cannot wait. @OpherV says, this is why the plugin is deprecated.
I cannot update to new versions of IDEA because there'll be no gitflow4idea there.

@enderteszla
Copy link

enderteszla commented Jun 11, 2020

@fabmars , hmmm. Suddenly my newest IDEA 2020.2 EAP works well with the plugin.

@enderteszla
Copy link

@fabmars , nevertheless. I consider it a good idea to extend VcsTaskDialogPanelProvider for at least two reasons:

  1. gitflow4idea is indeed a VCS Task Manager.
  2. VcsTaskDialogPanelProvider is not marked as deprecated -- you can rely on it. And whatever the solution to this deprecation issue will be -- GitflowTaskDialogPanelProvider will inherit it. Will they eliminate deprecated method -- so will be removed VcsTaskDialogPanelProvider's method. Will they make this method again not deprecated -- it will remain VcsTaskDialogPanelProvider's method. I see no benefit in solving already solved issue. The most sound idea is just to reference it.

@fabmars
Copy link

fabmars commented Jun 11, 2020

yep, fine by me, after all we want to lift those deprecations.
btw I tried to open the project using the 2020.2 EAP api following those guidelines: https://github.com/JetBrains/gradle-intellij-plugin

And I ended up with this error:

Could not determine the dependencies of task ':buildSearchableOptions'.
> Could not resolve all files for configuration ':detachedConfiguration1'.
   > Could not find com.jetbrains.intellij.idea:ideaIC:2020.2.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/jetbrains/intellij/idea/ideaIC/2020.2/ideaIC-2020.2.pom
       - https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea/ideaIC/2020.2/ideaIC-2020.2.pom

Either I need to sleep or I need to wait to be able to have what's needed to build against 2020.2.

@enderteszla
Copy link

enderteszla commented Jun 12, 2020 via email

@enderteszla
Copy link

@OpherV , so, when will we do that?))) strongly looking forward for the new version :-)

@fabmars
Copy link

fabmars commented Jun 18, 2020

Just for this one deprecation?
If needed I'll be happy to work on it...hmmm...on monday I guess.

@enderteszla
Copy link

@fabmars , as @OpherV said, this one and only deprecation makes plugin unsupported in EAP version of IDEA :-(

fabmars pushed a commit to fabmars/gitflow4idea that referenced this issue Jun 23, 2020
@fabmars
Copy link

fabmars commented Jun 23, 2020

So for the record what https://github.com/JetBrains/gradle-intellij-plugin doesn't say clearly enough for me is that the intellij { version } shouldn't be 2020.2 but 202.5792-EAP-CANDIDATE-SNAPSHOT (as of today). Version numbers are available on https://www.jetbrains.com/intellij-repository/snapshots/

Then the fix was trivial: #309

OpherV added a commit that referenced this issue Jul 31, 2020
Solved future deprecation warning on Idea 201/202 #298
@OpherV
Copy link
Owner Author

OpherV commented Jul 31, 2020

Looks like the deprecation issues were sorted out. Thanks!

@OpherV OpherV closed this as completed Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants