geometer/FBReaderJ — Issue #22: Compilation error
Author: ppawel
Created: 2011-12-29 19:45:41+00:00
State: open

I get the following compilation error when building FBReaderJ. Why is there direct access to fields instead of setters/getters in that code? After I correct it, it works fine. Do you want a patch for that?

```ppawel ~/src/FBReaderJ $ ant debug
Buildfile: /home/ppawel/src/FBReaderJ/build.xml

-set-mode-check:

-set-debug-files:

-set-debug-mode:

-debug-obfuscation-check:

-setup:
[echo] Gathering info for FBReaderJ...
[setup] Android SDK Tools Revision 16
[setup] Project Target: Android 2.2
[setup] API level: 8
[setup]
[setup] ------------------
[setup] Resolving library dependencies:
[setup] No library dependencies.
[setup]
[setup] ------------------
[setup]
[setup] WARNING: Attribute minSdkVersion in AndroidManifest.xml (5) is lower than the project target API level (8)

-build-setup:
[echo] Creating output directories if needed...

init:

check.native.libraries:
[echo] Checking if native libraries are up-to-date...
[echo] DONE (Checking if native libraries are up-to-date)

resources:
[echo] Cleaning up the 'res/drawable' folder...
[delete] Deleting directory /home/ppawel/src/FBReaderJ/res/drawable
[echo] DONE (Cleaning up the 'res/drawable' folder)
[echo] Copying icons files to 'res/drawable/' folder...
[copy] Copying 65 files to /home/ppawel/src/FBReaderJ/res/drawable
[echo] DONE (Copying icons files to 'res/drawable/' folder)

native:

-pre-build:

-code-gen:
[echo] ----------
[echo] Handling aidl files...
[aidl] Found 3 AIDL files.
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] Found modified input file
[aapt] Generating resource IDs...

-pre-compile:

-compile:
[javac] Compiling 425 source files to /home/ppawel/src/FBReaderJ/bin/classes
[javac] /home/ppawel/src/FBReaderJ/src/org/geometerplus/zlibrary/core/tree/ZLTree.java:48: error: addSubTree(T,int) has private access in ZLTree
[javac]	parent.addSubTree((T)this, position);
[javac]	^
[javac] where T is a type-variable:
[javac] T extends ZLTree declared in class ZLTree
[javac] /home/ppawel/src/FBReaderJ/src/org/geometerplus/zlibrary/core/tree/ZLTree.java:83: error: mySize has private access in ZLTree
[javac]	if (subtree.mySize <= index) {
[javac]	^
[javac] /home/ppawel/src/FBReaderJ/src/org/geometerplus/zlibrary/core/tree/ZLTree.java:84: error: mySize has private access in ZLTree
[javac]	index -= subtree.mySize;
[javac]	^
[javac] /home/ppawel/src/FBReaderJ/src/org/geometerplus/zlibrary/core/tree/ZLTree.java:163: error: mySubTrees has private access in ZLTree
[javac]	myCurrentElement = (T)element.mySubTrees.get(0);
[javac]	^
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 4 errors

BUILD FAILED
/opt/android-sdk/tools/ant/build.xml:602: The following error occurred while executing this line:
/opt/android-sdk/tools/ant/build.xml:622: Compile failed; see the compiler error output for details.

Total time: 9 seconds
ppawel ~/src/FBReaderJ $
```