CICS525 / DBLikeProject

DBLikeProject
0 stars 1 forks source link

Metadate compare issue #10

Closed Elitward closed 10 years ago

Elitward commented 10 years ago

MetadataManager.java: public boolean updateLocalMetadata(Metadata aMetadata){ if (LocalMetadata.contains(aMetadata)) { <----- THIS MAY BE A PROBLEM LocalMetadata.remove(aMetadata); //remove the old version } LocalMetadata.add(aMetadata); // add the new version return saveLocalMetadata(); //maybe save at once }

new metadata could only share the same file name with the old one to over write with.

achengscode commented 10 years ago

Metadata needs to have a comparable interface defined, otherwise we use the Object's comparable method.

achengscode commented 10 years ago

Since Metadata does not have Comparable defined, LocalMetadata.contains(aMetadata) always returns false (since it is comparing two essentially different objects, even if the content is the same)