-6

A Java program works is decompiled by JD-GUI as follows.

Looks like some Classes are missed.

Is there a best way to decompile a Java program without red lines appearing?

ImportTaskTransactionCallback<Integer> tc = new ImportTaskTransactionCallback(this.viewtrackerUpgradeManager, status);
    .
    .
    .

this.viewtrackerUpgradeManager = viewtrackerUpgradeManager;

Thanks for everyone's suggestion, I found the constructor is not completed and fixed it.

skyline
  • 443
  • 9
  • 31
  • 6
    Posting images of code is frowned upon here, because it makes it more difficult for us to help you with your issue. It is always better to copy and paste the relevant code and/or errors into your question directly. Please read [Why not to upload images of code on SO when asking a question?](https://meta.stackoverflow.com/questions/285551/why-not-to-upload-images-of-code-on-so-when-asking-a-question), then [edit] your question accordingly. – Joe C Oct 13 '17 at 06:22
  • *The red lines seem to be related to "Generics class" in Java?* Nope. Far more fundamental than that. I think you need to do some [rubber duck debugging](https://en.wikipedia.org/wiki/Rubber_duck_debugging) – Joe C Oct 13 '17 at 06:29
  • It looks like the InportTaskWhatEver constructor does not expect the `status` to be passed. Without knowing or seeing this class, I have no way to help more – Scary Wombat Oct 13 '17 at 06:31
  • Your constructor only has one parameter, you want to call it with two. Furthermore the type of `T` is not the same type of `ViewtrackerUpgradeManager`. Also in your case `this.t = t` does nothing so far. – QBrute Oct 13 '17 at 06:48

2 Answers2

1

The definition of your constructor is simply not, what your code expects. You want to call it like

ImportTaskTransactionCallback<Integer> tc = new ImportTaskTransactionCallback(this.viewtrackerUpgradeManager, status);

But your defined constructor doesn't match that signature:

public ImportTaskTransactionCallback(T viewtrackerUpgradeManager)

You probably want to define it like so:

public ImportTaskTransactionCallback(ViewtrackerUpgradeManager viewtrackerUpgradeManager, T t)
QBrute
  • 4,405
  • 6
  • 34
  • 40
  • Hi QBrute, could you please delete the comment you left in this question? https://stackoverflow.com/questions/46723649/how-to-decompile-a-java-program-successfully The question has lots of negative feedback and now I cannot ask any questions. – skyline Dec 21 '22 at 09:44
1

First error: The (appropriate) constructor of ImportTaskTransactionCallback isn't defined. In your file I can see only 1 constructor in the "ImportTaskTransactionCallback" class, and it takes only 1 T object.

Second error: You can't convert a T object to a ViewtrackerUpgradeManager object. Datatypes aren't interchangeable.

Like Joe C said, you should put your code inside a code block. You can easily do that by indenting your code by 4 spaces. It makes it much easier for us to help you.

  • Hi Simon Wetting, could you please delete the comment you left in this question? https://stackoverflow.com/questions/46723649/how-to-decompile-a-java-program-successfully The question has lots of negative feedback and now I cannot ask any questions. – skyline Dec 21 '22 at 09:44