Improved the lmbda patch to sort [ classes to bottom
This commit is contained in:
parent
f36bb9c637
commit
6fc774f9b7
2 changed files with 52 additions and 6 deletions
|
|
@ -1,15 +1,58 @@
|
|||
commit fd66fd3a37cc899b11d97a13e0e23319d86f39c3
|
||||
Author: Jiri Vanek <jvanek@redhat.com>
|
||||
Date: Wed Jan 16 18:03:43 2019 +0100
|
||||
|
||||
Showing Lambdas again, but sorting them to the end.
|
||||
|
||||
diff --git a/runtime-decompiler/src/main/java/org/jrd/backend/core/DecompilerRequestReceiver.java b/runtime-decompiler/src/main/java/org/jrd/backend/core/DecompilerRequestReceiver.java
|
||||
index b7fddea..603c26d 100644
|
||||
--- runtime-decompiler/src/main/java/org/jrd/backend/core/DecompilerRequestReceiver.java
|
||||
+++ runtime-decompiler/src/main/java/org/jrd/backend/core/DecompilerRequestReceiver.java.nw
|
||||
@@ -214,9 +214,9 @@
|
||||
+++ runtime-decompiler/src/main/java/org/jrd/backend/core/DecompilerRequestReceiver.java
|
||||
@@ -8,6 +8,7 @@ import org.jrd.backend.data.VmManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
+import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -146,6 +147,29 @@ public class DecompilerRequestReceiver {
|
||||
return ERROR_RESPONSE;
|
||||
}
|
||||
String[] arrayOfClasses = parseClasses(classes);
|
||||
+ if (arrayOfClasses != null){
|
||||
+ Arrays.sort(arrayOfClasses, new Comparator<String>() {
|
||||
+ @Override
|
||||
+ public int compare(String o1, String o2) {
|
||||
+ if (o1 == null && o2 == null) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ if (o1 == null && o2 != null) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+ if (o1 != null && o2 == null) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (o1.startsWith("[") && !o2.startsWith("[")) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+ if (!o1.startsWith("[") && o2.startsWith("[")) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+ return o1.compareTo(o2);
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
VmDecompilerStatus status = new VmDecompilerStatus();
|
||||
status.setHostname(hostname);
|
||||
status.setListenPort(actualListenPort);
|
||||
@@ -214,9 +238,7 @@ public class DecompilerRequestReceiver {
|
||||
list.removeAll(Arrays.asList("", null));
|
||||
List<String> list1 = new ArrayList<>();
|
||||
for (String s : list) {
|
||||
- if (!(s.contains("Lambda") | s.startsWith("["))){
|
||||
+// if (!(s.contains("Lambda") | s.startsWith("["))){
|
||||
list1.add(s);
|
||||
- }
|
||||
+// }
|
||||
}
|
||||
java.util.Collections.sort(list1);
|
||||
return list1.toArray(new String[]{});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Summary: Application for extraction and decompilation of JVM byte code
|
||||
Name: java-runtime-decompiler
|
||||
Version: 2.0
|
||||
Release: 4%{?dist}
|
||||
Release: 5%{?dist}
|
||||
License: GPLv3
|
||||
URL: https://github.com/pmikova/java-runtime-decompiler
|
||||
Source0: https://github.com/pmikova/%{name}/archive/%{name}-%{version}.tar.gz
|
||||
|
|
@ -81,6 +81,9 @@ desktop-file-install --vendor="fedora" \
|
|||
%license LICENSE
|
||||
|
||||
%changelog
|
||||
* Thu Jan 17 2019 Jiri Vanek <jvanek@redhat.com> - 2.0-5
|
||||
- improved Patch3, includeLambdas.patch to sort the lamdas t the bottom
|
||||
|
||||
* Thu Jan 17 2019 Jiri Vanek <jvanek@redhat.com> - 2.0-4
|
||||
- added depndence of procyon decompiler (currenlty under review
|
||||
- added and applied Patch2, systemProcyon.patch to enable system procyon out of thebox
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue