Avatar billede fredand Forsker
16. august 2023 - 08:12 Der er 2 kommentarer

Is external-src.zip necessary for intelliJ?

Hello,
I am new to IntelliJ, I noticed that for external libarys there is a source-tag available in the iml-file.
Why is that needed for?
If I am not wrong intelliJ seems to decompile those external libs that I do not have any src.zip for any way, letting me browse the code.

Best regards
Fredrik
Avatar billede arne_v Ekspert
16. august 2023 - 17:17 #1
I don't know why IntelliJ works that way. I don't use IntelliJ.

But I can make a guess based on how it works in general.

Java byte code can be decompiled, but there are some limitations to decompilation. Some information is lost.

That includes:
* comments
* names of local variables
* names of arguments

Especially the last can make a big difference for IDE help.

You can see that you need to call the foobar method on someobj, but what are the arguments.

There is a huge difference between seeing:

void foobar(int paramInt, String paramString)

and:

void foobar(int numberThreads, String nameTest)

If the IDE is able to use the java doc comments in the source it can even provide more info about the parameters. Which is very nice.

But in my experience usually just known the real parameter names is sufficient.
Avatar billede fredand Forsker
16. august 2023 - 17:37 #2
Thanks Arne, for that nice summery. Yes sometimes browsing the real code is of course outstanding.
Best regards
Fredrik
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester