mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
Fix: Do not execute androidide-cleaner during installation if JAVA_HOME does not exist
This commit is contained in:
@@ -208,8 +208,10 @@ public class DownloadActivity extends StudioActivity {
|
||||
|
||||
sb.append ("echo 'Cleaning unsupported flags in binaries...'");
|
||||
joiner (sb);
|
||||
sb.append ("$BUSYBOX find $JAVA_HOME -type f -exec androidide-cleaner {} \\;");
|
||||
joiner (sb);
|
||||
if (Environment.JAVA_HOME.exists ()) {
|
||||
sb.append ("$BUSYBOX find $JAVA_HOME -type f -exec androidide-cleaner {} \\;");
|
||||
joiner (sb);
|
||||
}
|
||||
String DONE = "DONE";
|
||||
sb.append ("echo ").append (DONE);
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
package com.itsaky.lsp.java.visitors;
|
||||
|
||||
import com.itsaky.androidide.utils.Logger;
|
||||
import com.sun.source.tree.CaseTree;
|
||||
import com.sun.source.tree.CompilationUnitTree;
|
||||
import com.sun.source.tree.ErroneousTree;
|
||||
@@ -82,6 +83,12 @@ public class FindCompletionsAt extends TreePathScanner<TreePath, Long> {
|
||||
@Override
|
||||
public TreePath visitCase (CaseTree t, Long find) {
|
||||
SourcePositions pos = Trees.instance (task).getSourcePositions ();
|
||||
|
||||
// default statements have null expression
|
||||
// if (t.getExpression () != null) {
|
||||
//
|
||||
// }
|
||||
|
||||
long start = pos.getStartPosition (root, t) + "case".length ();
|
||||
long end = pos.getEndPosition (root, t.getExpression ());
|
||||
if (start <= find && find <= end) {
|
||||
@@ -122,4 +129,6 @@ public class FindCompletionsAt extends TreePathScanner<TreePath, Long> {
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
private static final Logger LOG = Logger.instance ("FindCompletionsAt");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user