diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-07-27 01:38:44 -0700 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-07-27 14:09:39 -0700 |
commit | ced7214959c05eb5fcf55b79f4a6691d2d8dc987 (patch) | |
tree | 766061115a22d03f76c017a42c5abff0713ee2b3 /test/files/presentation | |
parent | 56b7c0f8fa6c1037905867aec88520476dbd3baa (diff) | |
download | scala-ced7214959c05eb5fcf55b79f4a6691d2d8dc987.tar.gz scala-ced7214959c05eb5fcf55b79f4a6691d2d8dc987.tar.bz2 scala-ced7214959c05eb5fcf55b79f4a6691d2d8dc987.zip |
Move ICodeReader-specific logic out of ClassfileParser.
ClassfileParser contained some ICodeReader-specific logic
like `forceMangledName` and `getMemberSymbol` methods.
The `getMemberSymbol` method was defined in ConstantPool class
because it must access some internal state of ConstantPool. In order
to move that method to ICodeReader we had two options:
1. Make all internal state accessible from outside of ConstantPool
class so getMemberSymbol could be implemented outside of
ConstantPool hierarchy
2. Make it possible to subclass ConstantPool in ICodeReader so
getMemberSymbol can be implemented in a subclass and can access
internal state of ConstantPool
Given the fact that getMemberSymbol mutates ConstantPool's internal
state I decided that subclassing is a cleaner approach. It required
significant refactoring because we had to make sure that we create
an instance of proper class when initializing the `pool` variable.
I ended up introducing `ConstantPoolManager` class which is essentially
a mutable variable that can be reset multiple times.
This change makes ClassfileParser independent from the ICodeReader and
its implementation details.
Diffstat (limited to 'test/files/presentation')
0 files changed, 0 insertions, 0 deletions