Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–72 unchanged (72 lines)
73 private TarArchiveEntry currEntry;
74
75 /** The encoding of the file */
76 private final ZipEncoding zipEncoding;
77
78 // the provided encoding (for unit tests)
79
80 /**
81 * Constructor for TarInputStream.
82 * @param is the input stream to use
83 */
84 public TarArchiveInputStream(InputStream is) {
85 this(is, TarConstants.DEFAULT_BLKSIZE, TarConstants.DEFAULT_RCDSIZE);
…lines 86–135 unchanged (50 lines)
136 * @since 1.4
137 */
138 public TarArchiveInputStream(InputStream is, int blockSize, int recordSize,
139 String encoding) {
140 this.is = is;
141 this.hasHitEOF = false;
142 this.zipEncoding = ZipEncodingHelper.getZipEncoding(encoding);
143 this.recordSize = recordSize;
144 this.blockSize = blockSize;
145 }
146
147 /**
148 * Closes this stream. Calls the TarBuffer's close() method.
…lines 149–723 unchanged (575 lines)

After

…lines 1–72 unchanged (72 lines)
73 private TarArchiveEntry currEntry;
74
75 /** The encoding of the file */
76 private final ZipEncoding zipEncoding;
77
78 // the provided encoding (for unit tests)
79 final String encoding;
80
81 /**
82 * Constructor for TarInputStream.
83 * @param is the input stream to use
84 */
85 public TarArchiveInputStream(InputStream is) {
…lines 86–136 unchanged (51 lines)
137 * @since 1.4
138 */
139 public TarArchiveInputStream(InputStream is, int blockSize, int recordSize,
140 String encoding) {
141 this.is = is;
142 this.hasHitEOF = false;
143 this.encoding = encoding;
144 this.zipEncoding = ZipEncodingHelper.getZipEncoding(encoding);
145 this.recordSize = recordSize;
146 this.blockSize = blockSize;
147 }
148
149 /**
…lines 150–725 unchanged (576 lines)

Before

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) unde"...
block_comment "/*\n * This package is based on the work done by Timothy Gera"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "compress"
. "."
identifier "archivers"
. "."
identifier "tar"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "ByteArrayOutputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "InputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
. "."
identifier "Entry"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "compress"
. "."
identifier "archivers"
. "."
identifier "ArchiveEntry"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "compress"
. "."
identifier "archivers"
. "."
identifier "ArchiveInputStream"
; ";"
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "compress"
. "."
identifier "utils"
. "."
identifier "ArchiveUtils"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "compress"
. "."
identifier "utils"
. "."
identifier "CharsetNames"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "compress"
. "."
identifier "utils"
. "."
identifier "IOUtils"
; ";"
block_comment "/**\n * The TarInputStream reads a UNIX tar archive as an Inp"...
class_declaration
modifiers
public "public"
class "class"
identifier "TarArchiveInputStream"
superclass
extends "extends"
type_identifier "ArchiveInputStream"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "SMALL_BUFFER_SIZE"
= "="
decimal_integer_literal "256"
; ";"
field_declaration (+22 nodes collapsed)
block_comment "/** The size the TAR header */"
field_declaration
modifiers
private "private"
final "final"
integral_type
int "int"
variable_declarator
identifier "recordSize"
; ";"
block_comment "/** The size of a block */"
field_declaration
modifiers
private "private"
final "final"
integral_type
int "int"
variable_declarator
identifier "blockSize"
; ";"
block_comment "/** True if file has hit EOF */"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "hasHitEOF"
; ";"
block_comment "/** Size of the current entry */"
field_declaration
modifiers
private "private"
integral_type
long "long"
variable_declarator
identifier "entrySize"
; ";"
block_comment "/** How far into the entry the stream is at */"
field_declaration
modifiers
private "private"
integral_type
long "long"
variable_declarator
identifier "entryOffset"
; ";"
block_comment "/** An input stream to read from */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "InputStream"
variable_declarator
identifier "is"
; ";"
block_comment "/** The meta-data about the current entry */"
field_declaration
modifiers
private "private"
type_identifier "TarArchiveEntry"
variable_declarator
identifier "currEntry"
; ";"
block_comment "/** The encoding of the file */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "ZipEncoding"
variable_declarator
identifier "zipEncoding"
; ";"
line_comment "// the provided encoding (for unit tests)"
block_comment "/**\n * Constructor for TarInputStream.\n * @param is "...
constructor_declaration (+30 nodes collapsed)
block_comment "/**\n * Constructor for TarInputStream.\n * @param is "...
constructor_declaration (+36 nodes collapsed)
block_comment "/**\n * Constructor for TarInputStream.\n * @param is "...
constructor_declaration (+32 nodes collapsed)
block_comment "/**\n * Constructor for TarInputStream.\n * @param is "...
constructor_declaration (+38 nodes collapsed)
block_comment "/**\n * Constructor for TarInputStream.\n * @param is "...
constructor_declaration (+36 nodes collapsed)
block_comment "/**\n * Constructor for TarInputStream.\n * @param is "...
constructor_declaration
modifiers
public "public"
identifier "TarArchiveInputStream"
formal_parameters
( "("
formal_parameter
type_identifier "InputStream"
identifier "is"
, ","
formal_parameter
integral_type
int "int"
identifier "blockSize"
, ","
formal_parameter
integral_type
int "int"
identifier "recordSize"
, ","
formal_parameter
type_identifier "String"
identifier "encoding"
) ")"
constructor_body
{ "{"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "is"
= "="
identifier "is"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "hasHitEOF"
= "="
false "false"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "zipEncoding"
= "="
method_invocation
identifier "ZipEncodingHelper"
. "."
identifier "getZipEncoding"
argument_list
( "("
identifier "encoding"
) ")"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "recordSize"
= "="
identifier "recordSize"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "blockSize"
= "="
identifier "blockSize"
; ";"
} "}"
block_comment "/**\n * Closes this stream. Calls the TarBuffer's close()"...
method_declaration (+26 nodes collapsed)
block_comment "/**\n * Get the record size being used by this stream's b"...
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getRecordSize"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "recordSize"
; ";"
} "}"
block_comment "/**\n * Get the available data that can be read from the "...
method_declaration (+58 nodes collapsed)
block_comment "/**\n * Skips over and discards <code>n</code> bytes of d"...
method_declaration (+97 nodes collapsed)
block_comment "/**\n * Since we do not support marking just yet, we retu"...
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
boolean_type "boolean"
identifier "markSupported"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Since we do not support marking just yet, we do n"...
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "mark"
formal_parameters
( "("
formal_parameter
integral_type
int "int"
identifier "markLimit"
) ")"
block
{ "{"
} "}"
block_comment "/**\n * Since we do not support marking just yet, we do n"...
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
synchronized "synchronized"
void_type "void"
identifier "reset"
formal_parameters
( "("
) ")"
block
{ "{"
} "}"
block_comment "/**\n * Get the next entry in this tar archive. This will"...
method_declaration (+380 nodes collapsed)
block_comment "/**\n * The last record block should be written at the fu"...
method_declaration (+115 nodes collapsed)
block_comment "/**\n * Get the next entry in this tar archive as longnam"...
method_declaration (+222 nodes collapsed)
block_comment "/**\n * Get the next record in this tar archive. This wil"...
method_declaration (+85 nodes collapsed)
block_comment "/**\n * Determine if an archive record indicate End of Ar"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * Read a record from the input stream and return th"...
method_declaration (+83 nodes collapsed)
method_declaration (+49 nodes collapsed)
method_declaration (+389 nodes collapsed)
method_declaration (+424 nodes collapsed)
block_comment "/**\n * Adds the sparse chunks from the current entry to "...
method_declaration (+102 nodes collapsed)
block_comment "/**\n * Returns the next Archive Entry in this Stream.\n "...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Tries to read the next record rewinding the strea"...
method_declaration (+109 nodes collapsed)
block_comment "/**\n * Reads bytes from the current tar archive entry.\n "...
method_declaration (+193 nodes collapsed)
block_comment "/**\n * Whether this class is able to read the given entr"...
method_declaration (+56 nodes collapsed)
block_comment "/**\n * Get the current TAR Archive Entry that this input"...
method_declaration
modifiers
public "public"
type_identifier "TarArchiveEntry"
identifier "getCurrentEntry"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "currEntry"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
method_declaration
modifiers
protected "protected"
final "final"
boolean_type "boolean"
identifier "isAtEOF"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "hasHitEOF"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
block_comment "/**\n * This method is invoked once the end of the archiv"...
method_declaration (+69 nodes collapsed)
block_comment "/**\n * Checks if the signature matches what is expected "...
method_declaration (+263 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Licensed to the Apache Software Foundation (ASF) unde"...
block_comment "/*\n * This package is based on the work done by Timothy Gera"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "compress"
. "."
identifier "archivers"
. "."
identifier "tar"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "ByteArrayOutputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "IOException"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "io"
. "."
identifier "InputStream"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashMap"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
. "."
identifier "Entry"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "compress"
. "."
identifier "archivers"
. "."
identifier "ArchiveEntry"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "compress"
. "."
identifier "archivers"
. "."
identifier "ArchiveInputStream"
; ";"
import_declaration (+22 nodes collapsed)
import_declaration (+22 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "compress"
. "."
identifier "utils"
. "."
identifier "ArchiveUtils"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "compress"
. "."
identifier "utils"
. "."
identifier "CharsetNames"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "org"
. "."
identifier "apache"
. "."
identifier "commons"
. "."
identifier "compress"
. "."
identifier "utils"
. "."
identifier "IOUtils"
; ";"
block_comment "/**\n * The TarInputStream reads a UNIX tar archive as an Inp"...
class_declaration
modifiers
public "public"
class "class"
identifier "TarArchiveInputStream"
superclass
extends "extends"
type_identifier "ArchiveInputStream"
class_body
{ "{"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "SMALL_BUFFER_SIZE"
= "="
decimal_integer_literal "256"
; ";"
field_declaration (+22 nodes collapsed)
block_comment "/** The size the TAR header */"
field_declaration
modifiers
private "private"
final "final"
integral_type
int "int"
variable_declarator
identifier "recordSize"
; ";"
block_comment "/** The size of a block */"
field_declaration
modifiers
private "private"
final "final"
integral_type
int "int"
variable_declarator
identifier "blockSize"
; ";"
block_comment "/** True if file has hit EOF */"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "hasHitEOF"
; ";"
block_comment "/** Size of the current entry */"
field_declaration
modifiers
private "private"
integral_type
long "long"
variable_declarator
identifier "entrySize"
; ";"
block_comment "/** How far into the entry the stream is at */"
field_declaration
modifiers
private "private"
integral_type
long "long"
variable_declarator
identifier "entryOffset"
; ";"
block_comment "/** An input stream to read from */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "InputStream"
variable_declarator
identifier "is"
; ";"
block_comment "/** The meta-data about the current entry */"
field_declaration
modifiers
private "private"
type_identifier "TarArchiveEntry"
variable_declarator
identifier "currEntry"
; ";"
block_comment "/** The encoding of the file */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "ZipEncoding"
variable_declarator
identifier "zipEncoding"
; ";"
line_comment "// the provided encoding (for unit tests)"
field_declaration
modifiers
final "final"
type_identifier "String"
variable_declarator
identifier "encoding"
; ";"
block_comment "/**\n * Constructor for TarInputStream.\n * @param is "...
constructor_declaration (+30 nodes collapsed)
block_comment "/**\n * Constructor for TarInputStream.\n * @param is "...
constructor_declaration (+36 nodes collapsed)
block_comment "/**\n * Constructor for TarInputStream.\n * @param is "...
constructor_declaration (+32 nodes collapsed)
block_comment "/**\n * Constructor for TarInputStream.\n * @param is "...
constructor_declaration (+38 nodes collapsed)
block_comment "/**\n * Constructor for TarInputStream.\n * @param is "...
constructor_declaration (+36 nodes collapsed)
block_comment "/**\n * Constructor for TarInputStream.\n * @param is "...
constructor_declaration
modifiers
public "public"
identifier "TarArchiveInputStream"
formal_parameters
( "("
formal_parameter
type_identifier "InputStream"
identifier "is"
, ","
formal_parameter
integral_type
int "int"
identifier "blockSize"
, ","
formal_parameter
integral_type
int "int"
identifier "recordSize"
, ","
formal_parameter
type_identifier "String"
identifier "encoding"
) ")"
constructor_body
{ "{"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "is"
= "="
identifier "is"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "hasHitEOF"
= "="
false "false"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "encoding"
= "="
identifier "encoding"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "zipEncoding"
= "="
method_invocation
identifier "ZipEncodingHelper"
. "."
identifier "getZipEncoding"
argument_list
( "("
identifier "encoding"
) ")"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "recordSize"
= "="
identifier "recordSize"
; ";"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "blockSize"
= "="
identifier "blockSize"
; ";"
} "}"
block_comment "/**\n * Closes this stream. Calls the TarBuffer's close()"...
method_declaration (+26 nodes collapsed)
block_comment "/**\n * Get the record size being used by this stream's b"...
method_declaration
modifiers
public "public"
integral_type
int "int"
identifier "getRecordSize"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "recordSize"
; ";"
} "}"
block_comment "/**\n * Get the available data that can be read from the "...
method_declaration (+58 nodes collapsed)
block_comment "/**\n * Skips over and discards <code>n</code> bytes of d"...
method_declaration (+97 nodes collapsed)
block_comment "/**\n * Since we do not support marking just yet, we retu"...
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
boolean_type "boolean"
identifier "markSupported"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
false "false"
; ";"
} "}"
block_comment "/**\n * Since we do not support marking just yet, we do n"...
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
void_type "void"
identifier "mark"
formal_parameters
( "("
formal_parameter
integral_type
int "int"
identifier "markLimit"
) ")"
block
{ "{"
} "}"
block_comment "/**\n * Since we do not support marking just yet, we do n"...
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
public "public"
synchronized "synchronized"
void_type "void"
identifier "reset"
formal_parameters
( "("
) ")"
block
{ "{"
} "}"
block_comment "/**\n * Get the next entry in this tar archive. This will"...
method_declaration (+380 nodes collapsed)
block_comment "/**\n * The last record block should be written at the fu"...
method_declaration (+115 nodes collapsed)
block_comment "/**\n * Get the next entry in this tar archive as longnam"...
method_declaration (+222 nodes collapsed)
block_comment "/**\n * Get the next record in this tar archive. This wil"...
method_declaration (+85 nodes collapsed)
block_comment "/**\n * Determine if an archive record indicate End of Ar"...
method_declaration (+38 nodes collapsed)
block_comment "/**\n * Read a record from the input stream and return th"...
method_declaration (+83 nodes collapsed)
method_declaration (+49 nodes collapsed)
method_declaration (+389 nodes collapsed)
method_declaration (+424 nodes collapsed)
block_comment "/**\n * Adds the sparse chunks from the current entry to "...
method_declaration (+102 nodes collapsed)
block_comment "/**\n * Returns the next Archive Entry in this Stream.\n "...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Tries to read the next record rewinding the strea"...
method_declaration (+109 nodes collapsed)
block_comment "/**\n * Reads bytes from the current tar archive entry.\n "...
method_declaration (+193 nodes collapsed)
block_comment "/**\n * Whether this class is able to read the given entr"...
method_declaration (+56 nodes collapsed)
block_comment "/**\n * Get the current TAR Archive Entry that this input"...
method_declaration
modifiers
public "public"
type_identifier "TarArchiveEntry"
identifier "getCurrentEntry"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "currEntry"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
method_declaration
modifiers
protected "protected"
final "final"
boolean_type "boolean"
identifier "isAtEOF"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "hasHitEOF"
; ";"
} "}"
method_declaration (+21 nodes collapsed)
block_comment "/**\n * This method is invoked once the end of the archiv"...
method_declaration (+69 nodes collapsed)
block_comment "/**\n * Checks if the signature matches what is expected "...
method_declaration (+263 nodes collapsed)
} "}"