Examples of ConstructorEntry


Examples of cuchaz.enigma.mapping.ConstructorEntry

  }

  @Test
  public void subIntIntInt( )
  {
    BehaviorEntry source = new ConstructorEntry( m_subClass, "(III)V" );
    assertThat( m_index.getBehaviorReferences( source ), is( empty() ) );
  }
View Full Code Here

Examples of cuchaz.enigma.mapping.ConstructorEntry

  @Test
  @SuppressWarnings( "unchecked" )
  public void subsubInt( )
  {
    BehaviorEntry source = new ConstructorEntry( m_subsubClass, "(I)V" );
    assertThat( m_index.getBehaviorReferences( source ), containsInAnyOrder(
      newBehaviorReferenceByMethod( source, m_callerClass.getName(), "f", "()V" )
    ) );
  }
View Full Code Here

Examples of cuchaz.enigma.mapping.ConstructorEntry

  @Test
  @SuppressWarnings( "unchecked" )
  public void defaultConstructable( )
  {
    BehaviorEntry source = new ConstructorEntry( m_defaultClass, "()V" );
    assertThat( m_index.getBehaviorReferences( source ), containsInAnyOrder(
      newBehaviorReferenceByMethod( source, m_callerClass.getName(), "g", "()V" )
    ) );
  }
View Full Code Here

Examples of cuchaz.enigma.mapping.ConstructorEntry

  {
    BehaviorEntry source;
    Collection<EntryReference<BehaviorEntry,BehaviorEntry>> references;
   
    // baseClass constructor
    source = new ConstructorEntry( m_baseClass, "(Ljava/lang/String;)V" );
    references = m_index.getBehaviorReferences( source );
    assertThat( references, containsInAnyOrder(
      newBehaviorReferenceByConstructor( source, m_subClassA.getName(), "(Ljava/lang/String;)V" ),
      newBehaviorReferenceByConstructor( source, m_subClassB.getName(), "()V" )
    ) );
   
    // subClassA constructor
    source = new ConstructorEntry( m_subClassA, "(Ljava/lang/String;)V" );
    references = m_index.getBehaviorReferences( source );
    assertThat( references, containsInAnyOrder(
      newBehaviorReferenceByConstructor( source, m_subClassAA.getName(), "()V" )
    ) );
   
View Full Code Here

Examples of cuchaz.enigma.mapping.ConstructorEntry

    return new MethodEntry( newClass( className ), methodName, methodSignature );
  }
 
  public static ConstructorEntry newConstructor( String className, String signature )
  {
    return new ConstructorEntry( newClass( className ), signature );
  }
View Full Code Here

Examples of cuchaz.enigma.mapping.ConstructorEntry

        MethodEntry methodEntry = new MethodEntry( classEntry, method.getName(), method.getSignature() );
        m_access.put( methodEntry, Access.get( method ) );
      }
      for( CtConstructor constructor : c.getDeclaredConstructors() )
      {
        ConstructorEntry constructorEntry = new ConstructorEntry( classEntry, constructor.getSignature() );
        m_access.put( constructorEntry, Access.get( constructor ) );
      }
    }
   
    // step 3: index extends, implements, fields, and methods
View Full Code Here

Examples of cuchaz.enigma.mapping.ConstructorEntry

       
        @Override
        public void edit( ConstructorCall call )
        {
          String className = Descriptor.toJvmName( call.getClassName() );
          ConstructorEntry calledConstructorEntry = new ConstructorEntry(
            new ClassEntry( className ),
            call.getSignature()
          );
          EntryReference<BehaviorEntry,BehaviorEntry> reference = new EntryReference<BehaviorEntry,BehaviorEntry>(
            calledConstructorEntry,
            call.getMethodName(),
            behaviorEntry
          );
          m_behaviorReferences.put( calledConstructorEntry, reference );
        }
       
        @Override
        public void edit( NewExpr call )
        {
          String className = Descriptor.toJvmName( call.getClassName() );
          ConstructorEntry calledConstructorEntry = new ConstructorEntry(
            new ClassEntry( className ),
            call.getSignature()
          );
          EntryReference<BehaviorEntry,BehaviorEntry> reference = new EntryReference<BehaviorEntry,BehaviorEntry>(
            calledConstructorEntry,
View Full Code Here

Examples of cuchaz.enigma.mapping.ConstructorEntry

      {
        continue;
      }
     
      ClassEntry classEntry = new ClassEntry( Descriptor.toJvmName( c.getName() ) );
      ConstructorEntry constructorEntry = new ConstructorEntry( classEntry, constructor.getMethodInfo().getDescriptor() );
     
      // gather the classes from the illegally-set synthetic fields
      Set<ClassEntry> illegallySetClasses = Sets.newHashSet();
      for( String type : syntheticFieldTypes )
      {
View Full Code Here

Examples of cuchaz.enigma.mapping.ConstructorEntry

      return null;
    }
    CtConstructor constructor = c.getDeclaredConstructors()[0];
   
    // is this constructor called exactly once?
    ConstructorEntry constructorEntry = new ConstructorEntry( innerClassEntry, constructor.getMethodInfo().getDescriptor() );
    Collection<EntryReference<BehaviorEntry,BehaviorEntry>> references = getBehaviorReferences( constructorEntry );
    if( references.size() != 1 )
    {
      return null;
    }
View Full Code Here

Examples of cuchaz.enigma.mapping.ConstructorEntry

   
    if( m_reference.entry instanceof ClassEntry )
    {
      // look for calls to the default constructor
      // TODO: get a list of all the constructors and find calls to all of them
      BehaviorReferenceTreeNode node = m_controller.getMethodReferences( new ConstructorEntry( (ClassEntry)m_reference.entry, "()V" ) );
      m_callsTree.setModel( new DefaultTreeModel( node ) );
    }
    else if( m_reference.entry instanceof FieldEntry )
    {
      FieldReferenceTreeNode node = m_controller.getFieldReferences( (FieldEntry)m_reference.entry );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.