Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-2708

Test does not close FileInputStream

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • Major
    • 4.17.35, 5.3.4.Final
    • None
    • Testing
    • None

    Description

      public XARRTestResource(String xarrHelper, File file) throws IOException {
              this.xarrHelper = xarrHelper;
              this.file = file;
              DataInputStream fis = new DataInputStream(new FileInputStream(file));
              final int formatId = fis.readInt();
              final int gtrid_length = fis.readInt();
              final byte[] gtrid = new byte[gtrid_length];
              fis.read(gtrid, 0, gtrid_length);
              final int bqual_length = fis.readInt();
              final byte[] bqual = new byte[bqual_length];
              fis.read(bqual, 0, bqual_length);
              xids.put(file, new Xid() {
      
                  @Override
                  public byte[] getGlobalTransactionId() {
                      return gtrid;
                  }
      
                  @Override
                  public int getFormatId() {
                      return formatId;
                  }
      
                  @Override
                  public byte[] getBranchQualifier() {
                      return bqual;
                  }
              });
              fis.close();
          }
      

      Spotted while working on JBTM-2614 backport

      Attachments

        Activity

          People

            thjenkin@redhat.com Tom Jenkinson
            thjenkin@redhat.com Tom Jenkinson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: