"Goto definition" in decompiler mode may not match bytecode reference due to name shadowing

Đang mở
#389 5 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện lỗi "Goto definition" ở chế độ decompiler với một lớp trong package mặc định và một lớp bị làm rối trong cùng package, sau đó so sánh tham chiếu bytecode với lớp mà Recaf chọn. Kiểm tra đường dẫn điều hướng và phân giải tên của decompiler có liên quan đến CFR và chế độ xem assembler. Công việc được xem là hoàn tất khi điều hướng mở lớp được tham chiếu thay vì lớp che khuất nó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

While I was working on an obfuscated jar, I found a bug that causes you to find yourself in a random class that is not even relevant to what you would expect. Let me introduce a few images to explain.

I was on a pretty clean class and I though there was no problem to use "Goto definiton" option.
image

I used it and... I was here...
image
I was expecting a Packet class but I found a Predicate, my mind just blowed first time I faced this bug

Fortunately, I found a way to find the actual class after I let go of my persistent thoughts about a "clean class". I just opened it in the assembler.
image
It was the actual class. But it was in the default package. This is where the problem starts...
As Java do not allow importing classes in default package from a non-default package class and the other way around (since Java 1.5), we can't import like that. So, CFR couldn't put the import statement of that class. But Recaf somehow recognizes this class as a same-package class I guess (because there is no import statement for that) and redirects me to the same-packaged class. (Both Predicate class named j1 and it's initializer class are in the net.minecraft package)

Ngôn ngữ chính
Java
Star
7.5k
Fork
549
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Col-E/Recaf

Tất cả issue của Col-E/Recaf

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.