Skip to content

Commit 5b5ad96

Browse files
committed
remove common io dependencies, it cause crash because using new api
1 parent 761b9cd commit 5b5ad96

File tree

22 files changed

+544
-326
lines changed

22 files changed

+544
-326
lines changed

aosp/gradle/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ dependencies {
2828

2929
testImplementation 'junit:junit:4.12'
3030
//noinspection GradleDependency
31-
testImplementation 'commons-io:commons-io:2.3'
31+
//testImplementation 'commons-io:commons-io:2.3'
3232
}

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ dependencies {
113113
api 'com.yqritc:recyclerview-flexibledivider:1.2.9'
114114
api 'com.sothree.slidinguppanel:library:3.4.0'
115115
//noinspection GradleDependency newer version cause crash
116-
api 'commons-io:commons-io:2.2'
116+
// api 'commons-io:commons-io:2.2'
117117
api 'com.simplecityapps:recyclerview-fastscroll:1.0.18'
118118
api 'org.apache.commons:commons-lang3:3.7'
119119
api 'com.google.guava:guava:25.1-android'

app/src/main/java/com/duy/ide/javaide/editor/autocomplete/parser/JavaClassManager.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@
2828
import com.sun.tools.javac.tree.JCTree;
2929

3030
import org.apache.commons.io.FileUtils;
31-
import org.apache.commons.io.IOUtils;
3231

3332
import java.io.File;
34-
import java.io.FileInputStream;
3533
import java.util.ArrayList;
3634
import java.util.Collection;
3735
import java.util.Collections;
@@ -108,9 +106,7 @@ public void loadFromProject(JavaProject project) {
108106
true);
109107
for (File javaFile : javaFiles) {
110108
if (DLog.DEBUG) DLog.d(TAG, "loadFromProject: parsing class " + javaFile);
111-
FileInputStream input = new FileInputStream(javaFile);
112-
String content = IOUtils.toString(input, "UTF-8");
113-
input.close();
109+
String content = com.duy.android.compiler.utils.IOUtils.toString(javaFile);
114110
JCTree.JCCompilationUnit ast = parser.parse(content);
115111
List<IClass> parseClasses = parser.parseClasses(ast);
116112
for (IClass aClass : parseClasses) {

app/src/main/java/com/duy/ide/javaide/projectview/dialog/DialogNewAndroidResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import android.widget.EditText;
3030
import android.widget.Toast;
3131

32-
import com.duy.android.compiler.utils.IOUtils;
32+
import com.duy.common.io.IOUtils;
3333
import com.duy.ide.R;
3434
import com.duy.ide.javaide.FileChangeListener;
3535
import com.duy.ide.javaide.editor.autocomplete.internal.PatternFactory;

app/src/main/java/com/duy/ide/javaide/run/activities/ExecuteActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
import android.util.Log;
2626

2727
import com.android.annotations.NonNull;
28-
import com.duy.ide.javaide.JavaApplication;
2928
import com.duy.android.compiler.java.Java;
30-
import com.duy.android.compiler.utils.IOUtils;
29+
import com.duy.common.io.IOUtils;
3130
import com.duy.ide.R;
31+
import com.duy.ide.javaide.JavaApplication;
3232
import com.duy.ide.javaide.activities.BaseActivity;
3333
import com.duy.ide.javaide.editor.autocomplete.parser.JavaParser;
3434
import com.duy.ide.javaide.run.view.ConsoleEditText;
@@ -130,7 +130,7 @@ private String resolveMainClass(File mainClassFile) throws IOException {
130130
}
131131

132132
JavaParser parser = new JavaParser();
133-
JCTree.JCCompilationUnit unit = parser.parse(IOUtils.toStringAndClose(mainClassFile));
133+
JCTree.JCCompilationUnit unit = parser.parse(IOUtils.toString(mainClassFile));
134134
JCTree.JCExpression packageName = unit.getPackageName();
135135
String simpleName = mainClassFile.getName().substring(0, mainClassFile.getName().indexOf("."));
136136
return packageName + "." + simpleName;

common/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ android {
2525
dependencies {
2626
api "com.android.support:support-v4:$supportLibVersion"
2727
api "com.android.support:appcompat-v7:$supportLibVersion"
28+
api "com.android.support:support-annotations:$supportLibVersion"
2829
}

app/src/main/java/com/duy/common/interfaces/Action.java renamed to common/src/main/java/com/duy/common/interfaces/Action.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
package com.duy.common.interfaces;
1919

20-
import com.android.annotations.Nullable;
20+
21+
import android.support.annotation.Nullable;
2122

2223
public interface Action<T> {
2324
void execute(@Nullable T t);

0 commit comments

Comments
 (0)