Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6926

InitPageOperation does not check before reading and writing

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.12.1.1
    • Fix Version/s: None
    • Component/s: Store
    • Labels:
      None

      Description

      The readExternal and writeExternal methods are not checked before reading and writing. Indeed, other classes do check before that. For example, CompressSpacePageOperation implements the above two methods, and both are checked. In particular, the code of CompressSpacePageOperation.readExternal is:

      public void readExternal(ObjectInput in)
      		 throws IOException, ClassNotFoundException
      	{
      		super.readExternal(in);
      		if( !(this instanceof CompressSpacePageOperation10_2) )
      		{
      			newHighestPage      = in.readInt();
      			num_pages_truncated = CompressedNumber.readInt(in);
      		}
      	}
      

      The code of InitPageOperation.readExternal is:

      public void readExternal(ObjectInput in) 
      		 throws IOException, ClassNotFoundException
      	{
      		super.readExternal(in);
      		nextRecordId = CompressedNumber.readInt(in);
      		initFlag = CompressedNumber.readInt(in);
      		pageOffset = CompressedNumber.readLong(in);
      		pageFormatId = in.readInt();
      	}.
      

      It is better to guide the method as CompressSpacePageOperation does.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              haozhong Hao Zhong
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: