简体   繁体   中英

Why is final variable not inspectable?

I'm reworking some code to make it usable with the new RootTools 3.0 (which fixes an important bug) :

One section I rewrote looks like this, with a callback-class for better readability. I'm adding the size of two directories to tell the total of browser cache that may be cleared:

@Override
protected void onResume() {
    super.onResume();
    //Refresh views:
    try {
        //Show browser's cache size:
        ShellCommands.getListing("/data/data/com.android.browser/app_databases/", null, new Callback<SumSize>() {
            @Override
            public void call(SumSize localstore) throws InterruptedException, IOException, TimeoutException, RootDeniedException {
                final SumSize total = localstore;
                getFirefoxProfiles(new Callback<String>() {
                    @Override
                    public void call(String input) throws InterruptedException, IOException, TimeoutException, RootDeniedException {
                        ShellCommands.getListing(input+"/Cache/", null, new Callback<SumSize>() {
                            @Override
                            public void call(SumSize input) {
                                total.add(input);
                                ((TextView)findViewById(R.id.lblClearBrowser)).setText(total.getReadable());
                            }
                        });
                    }
                });
            }
        });

A bit more complex than it was with the .waitforfinish , but I'm having a serious problem in debugging: the inner most call(SumSize input) seems to work correctly, but there is no way to see what the total is when debugging. Is this a bug in Java with final outer variables? A bug in Android? A bug in Eclipse?

Your Variables view needs to be set to Show Constants. You can toggle this from the Java section of its local menu.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM