private void try_correct_net(BrdItem p_item){
  if (!(p_item instanceof BrdTracep))   return;
  BrdTracep curr_trace=(BrdTracep)p_item;
  Set<BrdItem> contacts=curr_trace.get_normal_contacts(curr_trace.corner_first(),true);
  contacts.addAll(curr_trace.get_normal_contacts(curr_trace.corner_last(),true));
  int corrected_net_no=0;
  for (  BrdItem curr_contact : contacts) {
    if (curr_contact.net_count() == 1) {
      corrected_net_no=curr_contact.get_net_no(0);
      break;
    }
  }
  if (corrected_net_no != 0) {
    p_item.set_net_no(corrected_net_no);
  }
}

private void try_correct_net ( BrdItem p_item ) { if ( ! ( p_item instanceof BrdTracep ) ) return ; BrdTracep curr_trace = ( BrdTracep ) p_item ; Set < BrdItem > contacts = curr_trace . get_normal_contacts ( curr_trace . corner_first ( ) , true ) ; contacts . addAll ( curr_trace . get_normal_contacts ( curr_trace . corner_last ( ) , true ) ) ; int corrected_net_no = 0 ; for ( BrdItem curr_contact : contacts ) { if ( curr_contact . net_count ( ) == 1 ) { corrected_net_no = curr_contact . get_net_no ( 0 ) ; break ; } } if ( corrected_net_no != 0 ) { p_item . set_net_no ( corrected_net_no ) ; } }
maybe trace of type turret without net in mentor design . try to assig the net by calculating the overlaps .
