~ubuntu-branches/ubuntu/wily/proguard/wily-proposed

« back to all changes in this revision

Viewing changes to src/proguard/classfile/editor/Utf8Shrinker.java

  • Committer: Package Import Robot
  • Author(s): komal Sukhani
  • Date: 2015-08-31 14:45:54 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20150831144554-v4gb9hzo8xldfky9
Tags: 5.2.1-1
* Team upload
* New upstream release
* Add new patches
  - correct_properties_file_path
  - enable_building_of_gradle_task
* Add gradle package in build depends
* d/control: Switch Vcs-Browser field to cgit

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * ProGuard -- shrinking, optimization, obfuscation, and preverification
3
3
 *             of Java bytecode.
4
4
 *
5
 
 * Copyright (c) 2002-2014 Eric Lafortune (eric@graphics.cornell.edu)
 
5
 * Copyright (c) 2002-2015 Eric Lafortune @ GuardSquare
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or modify it
8
8
 * under the terms of the GNU General Public License as published by the Free
450
450
        // Shift the used constant pool entries together.
451
451
        for (int index = 1; index < length; index++)
452
452
        {
453
 
            constantIndexMap[index] = counter;
454
 
 
455
453
            Constant constant = constantPool[index];
456
454
 
457
 
            // Don't update the flag if this is the second half of a long entry.
 
455
            // Is the constant being used? Don't update the flag if this is the
 
456
            // second half of a long entry.
458
457
            if (constant != null)
459
458
            {
460
459
                isUsed = constant.getTag() != ClassConstants.CONSTANT_Utf8 ||
463
462
 
464
463
            if (isUsed)
465
464
            {
 
465
                // Remember the new index.
 
466
                constantIndexMap[index] = counter;
 
467
 
 
468
                // Shift the constant pool entry.
466
469
                constantPool[counter++] = constant;
467
470
            }
 
471
            else
 
472
            {
 
473
                // Remember an invalid index.
 
474
                constantIndexMap[index] = -1;
 
475
            }
468
476
        }
469
477
 
470
478
        // Clear the remaining constant pool elements.