Ignore:
Timestamp:
08/14/19 14:22:44 (5 years ago)
Author:
bln4
Message:

Fixed bug for when there are no surrogates left for a primary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/Item.java

    r1429 r1430  
    10431043         * TODO: What does it mean to have a negative ID# (as used in TDFC)? cts16
    10441044         */
    1045         public int getID()
    1046         {
     1045        public int getID() {
    10471046                return _id;
    10481047        }
     
    22192218                }
    22202219        }
     2220       
     2221        /**
     2222         * Function called when a user attempts to set the ID of a Item.  Simply provides
     2223         * feedback to the user telling them that they are not allowed to do this.  This
     2224         * function is provided so that users are able to get the ID of a item when
     2225         * extracting properties.  See {@link org.expeditee.gui.AttributeUtils}.
     2226         *
     2227         * @param newID The requested new ID that will be ignored.
     2228         */
     2229        public void setIDFail(int newID) {
     2230                MessageBay.displayMessage("A user cannot change the ID of an item.");
     2231        }
    22212232
    22222233        /**
     
    41564167
    41574168        public void addToSurrogates(Item surrogate) {
     4169                this.getParent().removeItem(surrogate);
    41584170                this.surrogateItems.add(surrogate);
    41594171                surrogate.setAsSurrogateFor(this);
     
    41624174                EncryptionDetail reencryptOnSave = new EncryptionDetail(EncryptionDetail.Type.ReencryptOnSave);
    41634175                EncryptionDetail unencryptedOnSave = new EncryptionDetail(EncryptionDetail.Type.UnencryptedOnSave);
    4164                 EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave);
    41654176               
    41664177                for (Character tag: DefaultFrameWriter.getItemCharTags().keySet()) {
     
    41794190               
    41804191                for (String tag: DefaultFrameWriter.getItemStrTags().keySet()) {
    4181                         primaryPropertyEncryption.put(tag, inheritanceCheckOnSave.clone());
     4192                        primaryPropertyEncryption.put(tag, unencryptedOnSave.clone());
    41824193                        surrogate.surrogatePropertyInheritance.put(tag + "", true);
    41834194                }
     
    42314242         */
    42324243        protected boolean subjectToInheritanceCheckOnSave(String tag) {
     4244                if (tag.equals(DefaultFrameWriter.TYPE_AND_ID_STR)) {
     4245                        return false;
     4246                }
    42334247                Item primary = getPrimary();
    42344248                if (primary == null) return false;
Note: See TracChangeset for help on using the changeset viewer.