Add&Convert Java Android file through Fire seems to not work

I tried to convert a Java source file to Swift Fire File > Add & Convert > Convert to Switf > Add & Convert Java file(s) but it seems to not work on my following environment (nothing happened, nothing in console):

  • Fire: 8.1.82.1719, built 2015-3-13
  • Internal Mono: 3.10.0 (64-bit)
  • Internal Elements: 8.1.82.1719
  • Java SDK: jdk1.7.0_45
  • Android SDK: r21 + Android Studio v1.1.0

With a specific file, or any file? Does Paste as Java work? Do any of the other conversions (e.g. import Java as C#)?

So it works for C# files and Java files, I was not sufficiently clear in my post.
But does not work with Java Android file (following file for example), picked randomly on Github):

package com.sudarmuthu.android.taskmanager;

import static com.sudarmuthu.android.taskmanager.tasks.TasksSQLiteOpenHelper.TASKS_TABLE;
import static com.sudarmuthu.android.taskmanager.tasks.TasksSQLiteOpenHelper.TASK_COMPLETE;
import static com.sudarmuthu.android.taskmanager.tasks.TasksSQLiteOpenHelper.TASK_ID;
import static com.sudarmuthu.android.taskmanager.tasks.TasksSQLiteOpenHelper.TASK_NAME;

import java.util.ArrayList;

import android.app.Application;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

import com.sudarmuthu.android.taskmanager.tasks.Task;
import com.sudarmuthu.android.taskmanager.tasks.TasksSQLiteOpenHelper;

public class TaskManagerApplication extends Application {

	private static final String SHARED_PREFS_FILE = "shared_prefs_file";
	private static final String TASKS = "tasks";
	private ArrayList<Task> currentTasks;
	private SQLiteDatabase database;

	@Override
	public void onCreate() {
		super.onCreate();
		TasksSQLiteOpenHelper helper = new TasksSQLiteOpenHelper(this);
		database = helper.getWritableDatabase();
		
		if (null == currentTasks) {
			loadTasks();
		}

		//	load tasks from preference		
//		SharedPreferences prefs = getSharedPreferences(SHARED_PREFS_FILE, Context.MODE_PRIVATE);
//
//		try {
//			currentTasks = (ArrayList<Task>) ObjectSerializer.deserialize(prefs.getString(TASKS, ObjectSerializer.serialize(new ArrayList<Task>())));
//		} catch (IOException e) {
//			e.printStackTrace();
//		} catch (ClassNotFoundException e) {
//			e.printStackTrace();
//		}		
	}
	
	private void loadTasks() {
		currentTasks = new ArrayList<Task>();
		Cursor tasksCursor = database.query(TASKS_TABLE, 
				new String[] {TASK_ID, TASK_NAME, TASK_COMPLETE}, 
				null, null, null, null, String.format("%s,%s", TASK_COMPLETE, TASK_NAME));
		
		tasksCursor.moveToFirst();
		Task t;
		if (! tasksCursor.isAfterLast()) {
			do {
				int id = tasksCursor.getInt(0);
				String name = tasksCursor.getString(1);
				String boolValue = tasksCursor.getString(2);
				boolean complete = Boolean.parseBoolean(boolValue);
				t = new Task(name);
				t.setId(id);
				t.setComplete(complete);
				currentTasks.add(t);
			} while(tasksCursor.moveToNext());
		}
	}

	public void setCurrentTasks(ArrayList<Task> currentTasks) {
		this.currentTasks  = currentTasks;
	}
	
	public ArrayList<Task> getCurrentTasks() {
		return currentTasks;
	}
	
	public void addTask(Task t) {
		assert(null != t);
		
		ContentValues values = new ContentValues();
		values.put(TASK_NAME, t.getName());
		values.put(TASK_COMPLETE, Boolean.toString(t.isComplete()));
		
		t.setId(database.insert(TASKS_TABLE, null, values));
		currentTasks.add(t);

		
		//save the task list to preference
//		SharedPreferences prefs = getSharedPreferences(SHARED_PREFS_FILE, Context.MODE_PRIVATE);		
//		Editor editor = prefs.edit();
//		try {
//			editor.putString(TASKS, ObjectSerializer.serialize(currentTasks));
//		} catch (IOException e) {
//			e.printStackTrace();
//		}
//		editor.commit();
	}
	
	public void saveTask(Task t) {
		assert (null != t);
		
		ContentValues values = new ContentValues();
		values.put(TASK_NAME, t.getName());
		values.put(TASK_COMPLETE, Boolean.toString(t.isComplete()));
		
		long id = t.getId();
		String where = String.format("%s = %d", TASK_ID, id);
		database.update(TASKS_TABLE, values, where, null);
	
	}
	
	public void deleteTasks(Long[] ids) {
		StringBuffer idList = new StringBuffer();
		for (int i =0; i< ids.length; i++) {
			idList.append(ids[i]);
			if (i < ids.length -1 ) {
				idList.append(",");
			}
		}
		
		String where = String.format("%s in (%s)", TASK_ID, idList);
		database.delete(TASKS_TABLE, where, null);
	}
}

Maybe Java Android files are not in the scope of Convert tool.

But if not, I think it can be useful to import source code implemented with Android Studio or other Android application source code previously implemented by the user, and convert it in one click with Convert tool.

gotta be something specific to the file in question. technically, thorns’ difference between Java and “Android Java”. It’s probably some specific code element that throws the parser off. i’ll test with the file you attached.

Reproiuced:

2015-03-19 13:13:20.877 Fire[21386:2097448] Oxidizer Exception: System.NotSupportedException: Operation is not supported.
at g.K.A (G.n ) [0x00000] in :0
at g.K.A (g.g ) [0x00000] in :0
at g.K.A (G.K ) [0x00000] in :0
at g.K.A (G.g ) [0x00000] in :0
at g.K.A (G.N ) [0x00000] in :0
at g.K.A (System.String , System.String , S , Boolean , System.Collections.Generic.List`1 ) [0x00000] in :0
at RemObjects.Oxygene.Oxidizer.OxidizerEditor.Convert (RemObjects.Oxygene.Code.Compiler.CodeCompletionCompiler aCompiler, System.String aCode, OxidizerLanguage aSourceLanguage, GeneratorLanguage aTargetLanguage) [0x00000] in :0
at (wrapper native-to-managed) RemObjects.Oxygene.Oxidizer.OxidizerEditor:Convert (RemObjects.Oxygene.Code.Compiler.CodeCompletionCompiler,string,RemObjects.Oxygene.Oxidizer.OxidizerLanguage,RemObjects.Oxygene.GeneratorLanguage,System.Exception&)

Thanks, logged as bugs://71547

bugs://71547 got closed with status fixed.