Package cuchaz.enigma.bytecode.accessors

Examples of cuchaz.enigma.bytecode.accessors.ConstInfoAccessor


      Object entry = m_getItem.invoke( m_pool, index );
      if( entry == null )
      {
        return null;
      }
      return new ConstInfoAccessor( entry );
    }
    catch( Exception ex )
    {
      throw new Error( ex );
    }
View Full Code Here


  }
 
  private void updateHashWithConstant( MessageDigest digest, ConstPool constants, int index )
  {
    ConstPoolEditor editor = new ConstPoolEditor( constants );
    ConstInfoAccessor item = editor.getItem( index );
    if( item.getType() == InfoType.StringInfo )
    {
      updateHashWithString( digest, constants.getStringInfo( index ) );
    }
    // TODO: other constants
  }
View Full Code Here

    // copy entries over in order of level so the index mapping is easier
    for( InfoType type : InfoType.getSortedByLevel() )
    {
      for( int index : indices )
      {
        ConstInfoAccessor entry = editorSrc.getItem( index );
       
        // skip entries that aren't this type
        if( entry.getType() != type )
        {
          continue;
        }
       
        // make sure the source entry is valid before we copy it
        assert( type.subIndicesAreValid( entry, editorSrc ) );
        assert( type.selfIndexIsValid( entry, editorSrc ) );
       
        // make a copy of the entry so we can modify it safely
        ConstInfoAccessor entryCopy = editorSrc.getItem( index ).copy();
        assert( type.subIndicesAreValid( entryCopy, editorSrc ) );
        assert( type.selfIndexIsValid( entryCopy, editorSrc ) );
       
        // remap the indices
        type.remapIndices( indexMap, entryCopy );
        assert( type.subIndicesAreValid( entryCopy, editorDest ) );
       
        // put the copy in the destination pool
        int newIndex = editorDest.addItem( entryCopy.getItem() );
        entryCopy.setIndex( newIndex );
        assert( type.selfIndexIsValid( entryCopy, editorDest ) ) : type + ", self: " + entryCopy + " dest: " + editorDest.getItem( entryCopy.getIndex() );
       
        // make sure the source entry is unchanged
        assert( type.subIndicesAreValid( entry, editorSrc ) );
        assert( type.selfIndexIsValid( entry, editorSrc ) );
       
View Full Code Here

TOP

Related Classes of cuchaz.enigma.bytecode.accessors.ConstInfoAccessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.