public static void generateMarkersForSecuritySpecification(SecuritySpecModel spec,IProject project){
  removeAllDroidsafeMarkers(project);
  List<MethodModel> methods=new ArrayList<MethodModel>(spec.getEntryPoints());
  Collections.sort(methods);
  Map<MethodModel,List<MethodModel>> inputEventBlocks=spec.getInputEventBlocks();
  if (inputEventBlocks != null) {
    for (    MethodModel inputMethod : inputEventBlocks.keySet()) {
      SourceLocationTag line=inputMethod.getDeclSourceLocation();
      if (line != null) {
        String clz=line.getClz();
        String classPath=DroidsafePluginUtilities.classNamePath(clz);
        IFile file=project.getFile(classPath);
        int lineNbr=line.getLine() - 1;
        if (file.exists()) {
          try {
            addMarkerForMethod(inputMethod,file,inputMethod.getShortSignature(),lineNbr);
            addMarkerForMethod(inputMethod,file,inputMethod.getSignature(),lineNbr);
            if (inputMethod.getReceiverValue() != null) {
              addMarkerForMethod(inputMethod,file,inputMethod.getReceiverValue(),lineNbr);
            }
            if (inputMethod.getPermissions() != null) {
              for (              String permission : inputMethod.getPermissions()) {
                String message="Permission: " + permission;
                addMarkerForMethod(inputMethod,file,message,lineNbr);
              }
            }
          }
 catch (          CoreException ex) {
            ex.printStackTrace();
          }
        }
      }
      for (      MethodModel outputMethod : inputEventBlocks.get(inputMethod)) {
        List<CodeLocationModel> locations=outputMethod.getLines();
        if (locations != null) {
          for (          CodeLocationModel location : locations) {
            String clz=location.getClz();
            String classPath=DroidsafePluginUtilities.classNamePath(clz);
            IFile file=project.getFile(classPath);
            int lineNbr=location.getLine();
            if (file.exists()) {
              try {
                addMarkerForMethod(outputMethod,file,outputMethod.getShortSignature(),lineNbr);
                addMarkerForMethod(outputMethod,file,outputMethod.getSignature(),lineNbr);
                if (outputMethod.getPermissions() != null) {
                  for (                  String permission : outputMethod.getPermissions()) {
                    String message="Permission: " + permission;
                    addMarkerForMethod(outputMethod,file,message,lineNbr);
                  }
                }
                if (outputMethod.getReceiverValue() != null) {
                  addMarkerForMethod(outputMethod,file,outputMethod.getReceiverValue(),lineNbr);
                }
                List<HotspotModel> hotspots=location.getHotspots();
                for (                HotspotModel hotspot : hotspots) {
                  addMarkerForMethod(outputMethod,file,hotspot.toString(),lineNbr);
                }
              }
 catch (              CoreException ex) {
                ex.printStackTrace();
              }
            }
          }
        }
      }
    }
  }
}

public static void generateMarkersForSecuritySpecification ( SecuritySpecModel spec , IProject project ) { removeAllDroidsafeMarkers ( project ) ; List < MethodModel > methods = new ArrayList < MethodModel > ( spec . getEntryPoints ( ) ) ; Collections . sort ( methods ) ; Map < MethodModel , List < MethodModel > > inputEventBlocks = spec . getInputEventBlocks ( ) ; if ( inputEventBlocks != null ) { for ( MethodModel inputMethod : inputEventBlocks . keySet ( ) ) { SourceLocationTag line = inputMethod . getDeclSourceLocation ( ) ; if ( line != null ) { String clz = line . getClz ( ) ; String classPath = DroidsafePluginUtilities . classNamePath ( clz ) ; IFile file = project . getFile ( classPath ) ; int lineNbr = line . getLine ( ) - 1 ; if ( file . exists ( ) ) { try { addMarkerForMethod ( inputMethod , file , inputMethod . getShortSignature ( ) , lineNbr ) ; addMarkerForMethod ( inputMethod , file , inputMethod . getSignature ( ) , lineNbr ) ; if ( inputMethod . getReceiverValue ( ) != null ) { addMarkerForMethod ( inputMethod , file , inputMethod . getReceiverValue ( ) , lineNbr ) ; } if ( inputMethod . getPermissions ( ) != null ) { for ( String permission : inputMethod . getPermissions ( ) ) { String message = "Permission: " + permission ; addMarkerForMethod ( inputMethod , file , message , lineNbr ) ; } } } catch ( CoreException ex ) { ex . printStackTrace ( ) ; } } } for ( MethodModel outputMethod : inputEventBlocks . get ( inputMethod ) ) { List < CodeLocationModel > locations = outputMethod . getLines ( ) ; if ( locations != null ) { for ( CodeLocationModel location : locations ) { String clz = location . getClz ( ) ; String classPath = DroidsafePluginUtilities . classNamePath ( clz ) ; IFile file = project . getFile ( classPath ) ; int lineNbr = location . getLine ( ) ; if ( file . exists ( ) ) { try { addMarkerForMethod ( outputMethod , file , outputMethod . getShortSignature ( ) , lineNbr ) ; addMarkerForMethod ( outputMethod , file , outputMethod . getSignature ( ) , lineNbr ) ; if ( outputMethod . getPermissions ( ) != null ) { for ( String permission : outputMethod . getPermissions ( ) ) { String message = "Permission: " + permission ; addMarkerForMethod ( outputMethod , file , message , lineNbr ) ; } } if ( outputMethod . getReceiverValue ( ) != null ) { addMarkerForMethod ( outputMethod , file , outputMethod . getReceiverValue ( ) , lineNbr ) ; } List < HotspotModel > hotspots = location . getHotspots ( ) ; for ( HotspotModel hotspot : hotspots ) { addMarkerForMethod ( outputMethod , file , hotspot . toString ( ) , lineNbr ) ; } } catch ( CoreException ex ) { ex . printStackTrace ( ) ; } } } } } } } }
creates eclipse task markers for all input events locations in the selected app .
