[abc-users] compiler error when compiling berkeley DB

From: Thomas Pawlitzki <mailinglist_at_pawlitzki.name>
Date: Mon, 10 Mar 2008 15:01:02 +0100

Hello,

during my test with the head branch of the abc I tried to compile the
berkeley DB (2.1.30).

By compiling the sources the abc throws the following error:
     [java] abc started on Mon Mar 10 14:21:57 CET 2008
     [java] abc-head-berkeley\je-2.1.30\src\com\sleepycat\je\dbi\CursorImpl.java:1538-1542:
     [java] Missing return statement.
     [java] public OperationStatus getNextDuplicate(DatabaseEntry foundKey,
     [java] ^-------------------------------------------------------
     [java] ...
     [java] boolean alreadyLatched)
     [java] ----------------------^
     [java]
     [java] 1 error.
     [java] Java Result: 5

The indicated method looks like this:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 /**
     * Enter with dupBin unlatched. Pass foundKey == null to just advance
     * cursor to next duplicate without fetching data.
     */
    public OperationStatus getNextDuplicate(DatabaseEntry foundKey,
                                            DatabaseEntry foundData,
                                            LockType lockType,
                                            boolean forward,
                                            boolean alreadyLatched)
        throws DatabaseException {

        assert assertCursorState(true) : dumpToString(true);
        assert checkAlreadyLatched(alreadyLatched) : dumpToString(true);
        try {
            while (dupBin != null) {
                if (!alreadyLatched) {
                    latchDBIN();
                } else {
                    alreadyLatched = false;
                }

                if (DEBUG) {
                    verifyCursor(dupBin);
                }

                /* Are we still on this DBIN? */
                if ((forward && ++dupIndex < dupBin.getNEntries()) ||
                    (!forward && --dupIndex > -1)) {

                    OperationStatus ret = OperationStatus.SUCCESS;
                    if (foundKey != null) {
                        ret = getCurrentAlreadyLatched(foundKey, foundData,
                                                       lockType, forward);
                    } else {
                        releaseDBIN();
                    }
                    if (ret == OperationStatus.SUCCESS) {
                        incrementLNCount();
                        return ret;
                    } else {
                        assert LatchSupport.countLatchesHeld() == 0;

                        if (dupBinToBeRemoved != null) {
                            flushDBINToBeRemoved();
                        }

                        continue;
                    }

                } else {

                    /*
                     * We need to go to the next DBIN. Remove the cursor and
                     * be sure to change the dupBin field after removing the
                     * cursor.
                     */
                    if (dupBinToBeRemoved != null) {
                        flushDBINToBeRemoved();
                    }
                    dupBinToBeRemoved = dupBin;

                    dupBin = null;
                    dupBinToBeRemoved.releaseLatch();

                    TreeWalkerStatsAccumulator treeStatsAccumulator =
                        getTreeStatsAccumulator();
                    if (treeStatsAccumulator != null) {
                        latchBIN();
                        try {
                            if (index < 0) {
                                /* This duplicate tree has been deleted. */
                                return OperationStatus.NOTFOUND;
                            }

                            DIN duplicateRoot = (DIN) bin.fetchTarget(index);
                            duplicateRoot.latch();
                            try {
                                DupCountLN dcl = duplicateRoot.getDupCountLN();
                                if (dcl != null) {
                                    dcl.accumulateStats(treeStatsAccumulator);
                                }
                            } finally {
                                duplicateRoot.releaseLatch();
                            }
                        } finally {
                            releaseBIN();
                        }
                    }
                    assert (LatchSupport.countLatchesHeld() == 0);

                    dupBinToBeRemoved.latch();
                    DBIN newDupBin;

                    if (forward) {
                        newDupBin = (DBIN) database.getTree().getNextBin
                            (dupBinToBeRemoved,
                                true /* traverseWithinDupTree*/);
                    } else {
                        newDupBin = (DBIN) database.getTree().getPrevBin
                            (dupBinToBeRemoved,
                             true /* traverseWithinDupTree*/);
                    }

                    if (newDupBin == null) {
                        return OperationStatus.NOTFOUND;
                    } else {
                        if (forward) {
                            dupIndex = -1;
                        } else {
                            dupIndex = newDupBin.getNEntries();
                        }
                        addCursor(newDupBin);

                        /*
                         * Ensure that setting dupBin is under newDupBin's
                         * latch.
                         */
                        dupBin = newDupBin;
                        alreadyLatched = true;
                    }
                }
            }
        } finally {
            assert LatchSupport.countLatchesHeld() == 0;
            if (dupBinToBeRemoved != null) {
                flushDBINToBeRemoved();
            }
        }

        return OperationStatus.NOTFOUND;
    }
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

In my opinion there is return statement for each case in this method.
And if no return is done during the metjod then the return after the
finally-block shoulb be invoked.

Perhaps it has something to do with the asserions?

Has anyone an idea why the compiler aborts at this method?

Greetings,
Thomas
Received on Mon Mar 10 2008 - 14:01:05 GMT

This archive was generated by hypermail 2.2.0 : Tue Mar 11 2008 - 07:30:10 GMT