Skip to content

Commit

Permalink
remove common io dependencies, it cause crash because using new api
Browse files Browse the repository at this point in the history
  • Loading branch information
tranleduy2000 committed Jun 15, 2018
1 parent 761b9cd commit 5b5ad96
Show file tree
Hide file tree
Showing 22 changed files with 544 additions and 326 deletions.
2 changes: 1 addition & 1 deletion aosp/gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ dependencies {

testImplementation 'junit:junit:4.12'
//noinspection GradleDependency
testImplementation 'commons-io:commons-io:2.3'
//testImplementation 'commons-io:commons-io:2.3'
}
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ dependencies {
api 'com.yqritc:recyclerview-flexibledivider:1.2.9'
api 'com.sothree.slidinguppanel:library:3.4.0'
//noinspection GradleDependency newer version cause crash
api 'commons-io:commons-io:2.2'
// api 'commons-io:commons-io:2.2'
api 'com.simplecityapps:recyclerview-fastscroll:1.0.18'
api 'org.apache.commons:commons-lang3:3.7'
api 'com.google.guava:guava:25.1-android'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@
import com.sun.tools.javac.tree.JCTree;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;

import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -108,9 +106,7 @@ public void loadFromProject(JavaProject project) {
true);
for (File javaFile : javaFiles) {
if (DLog.DEBUG) DLog.d(TAG, "loadFromProject: parsing class " + javaFile);
FileInputStream input = new FileInputStream(javaFile);
String content = IOUtils.toString(input, "UTF-8");
input.close();
String content = com.duy.android.compiler.utils.IOUtils.toString(javaFile);
JCTree.JCCompilationUnit ast = parser.parse(content);
List<IClass> parseClasses = parser.parseClasses(ast);
for (IClass aClass : parseClasses) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import android.widget.EditText;
import android.widget.Toast;

import com.duy.android.compiler.utils.IOUtils;
import com.duy.common.io.IOUtils;
import com.duy.ide.R;
import com.duy.ide.javaide.FileChangeListener;
import com.duy.ide.javaide.editor.autocomplete.internal.PatternFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
import android.util.Log;

import com.android.annotations.NonNull;
import com.duy.ide.javaide.JavaApplication;
import com.duy.android.compiler.java.Java;
import com.duy.android.compiler.utils.IOUtils;
import com.duy.common.io.IOUtils;
import com.duy.ide.R;
import com.duy.ide.javaide.JavaApplication;
import com.duy.ide.javaide.activities.BaseActivity;
import com.duy.ide.javaide.editor.autocomplete.parser.JavaParser;
import com.duy.ide.javaide.run.view.ConsoleEditText;
Expand Down Expand Up @@ -130,7 +130,7 @@ private String resolveMainClass(File mainClassFile) throws IOException {
}

JavaParser parser = new JavaParser();
JCTree.JCCompilationUnit unit = parser.parse(IOUtils.toStringAndClose(mainClassFile));
JCTree.JCCompilationUnit unit = parser.parse(IOUtils.toString(mainClassFile));
JCTree.JCExpression packageName = unit.getPackageName();
String simpleName = mainClassFile.getName().substring(0, mainClassFile.getName().indexOf("."));
return packageName + "." + simpleName;
Expand Down
1 change: 1 addition & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ android {
dependencies {
api "com.android.support:support-v4:$supportLibVersion"
api "com.android.support:appcompat-v7:$supportLibVersion"
api "com.android.support:support-annotations:$supportLibVersion"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

package com.duy.common.interfaces;

import com.android.annotations.Nullable;

import android.support.annotation.Nullable;

public interface Action<T> {
void execute(@Nullable T t);
Expand Down
Loading

0 comments on commit 5b5ad96

Please sign in to comment.