0% found this document useful (0 votes)
11 views3 pages

karthik_Java10commonscompress

The document details a code change in the Apache Commons Compress library, specifically addressing an issue with ZipFile handling unicode extra fields, referenced as COMPRESS-164. The commit modifies the way entries are processed in the ZipFile class, aiming to improve functionality. The changes include removing certain lines of code and altering the logic for handling ZipArchiveEntry objects.

Uploaded by

goutam_dutta123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

karthik_Java10commonscompress

The document details a code change in the Apache Commons Compress library, specifically addressing an issue with ZipFile handling unicode extra fields, referenced as COMPRESS-164. The commit modifies the way entries are processed in the ZipFile class, aiming to improve functionality. The changes include removing certain lines of code and altering the logic for handling ZipArchiveEntry objects.

Uploaded by

goutam_dutta123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

====================Info Start============================

{
"id": 10,
"repo_name": "commons-compress",
"Commit URL":
"https://github.com/apache/commons-compress/commit/347660646cfad588481c13058842d49f
a3779f84?diff=split",
"Issue URL": "https://issues.apache.org/jira/browse/COMPRESS-164",
"language": "Java"
}

====================Info End====================================

====================Additional Info End====================================

For the Code Change area ,


Line of Code starting with "+" represents that the line is REMOVED.
Line of Code starting with "-" represents that the line is ADDED.

While extracting for desired refinement code please be careful in choosing the
right line of code.

Error types = [ code logic , best practice , code quality , security ]

====================Additional Info End====================================

====================Commit Message Start====================================

ZipFile doesn't work properly for unicode extra fields. Based on patc… …h by
Volker Leidl. COMPRESS-164git-svn-id:
https://svn.apache.org/repos/asf/commons/proper/compress/trunk@1210501 13f79535-
47bb-0310-9956-ffa450edef68

====================Commit Message End====================================

====================Code Change Start====================================

diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java


b/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
index b0588695..964c86db 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
@@ -805,11 +805,8 @@ public class ZipFile {
// the hashcode - see COMPRESS-164
// Map needs to be reconstructed in order to keep central
// directory order
- Map<ZipArchiveEntry, OffsetEntry> origMap =
- new LinkedHashMap<ZipArchiveEntry, OffsetEntry>(entries);
- entries.clear();
- for (ZipArchiveEntry ze : origMap.keySet()) {
- OffsetEntry offsetEntry = origMap.get(ze);
+ for (ZipArchiveEntry ze : entries.keySet()) {
+ OffsetEntry offsetEntry = entries.get(ze);
long offset = offsetEntry.headerOffset;
archive.seek(offset + LFH_OFFSET_FOR_FILENAME_LENGTH);
byte[] b = new byte[SHORT];
@@ -842,7 +839,6 @@ public class ZipFile {
nameMap.put(ze.getName(), ze);
}
}
- entries.put(ze, offsetEntry);
}
}

====================Code Change End====================================

====================Additional Info Start====================================

{
"Do you want to reject this annotation": {
"options": [
"1. Yes",
"2. No"
],
"answer": ""
},
"Does the code have a valid bug": {
"options": [
"1. Yes",
"2. No"
],
"answer": ""
},
"Is the provided refinement correct": {
"options": [
"1. Correct",
"2. Not Correct",
"3. Partially Correct"
],
"answer": ""
},

"Annotator Name": "",


"Time taken to annotate (in mins)": ""
}

====================Additional Info End====================================

====================Debug Prompt Start====================================

====================Debug Prompt End=====================================

====================Error Type Start====================================


====================Error Type End=====================================

====================Error Explanation Start====================================

====================Error Explanation End====================================

===================Refinement Summary Start====================================

===================Refinement Summary End====================================

===================Desired Refinement Code


Start====================================

===================Desired Refinement Code End ====================================

===================Alternative Refinement Summary


Start=================================

===================Alternative Refinement Summary


End====================================

===================Alternative Refinement Code


Start====================================

===================Alternative Refinement Code


End====================================

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy