예제 #1
0
 private ArrayList<JniSection> getNativeCodeBodies(String classFile) {
   ArrayList<JniSection> sections = getComments(classFile);
   Iterator<JniSection> iter = sections.iterator();
   while (iter.hasNext()) {
     JniSection section = iter.next();
     if (section.getNativeCode().startsWith("JNI")) iter.remove();
     if (section.getNativeCode().startsWith("-{")) iter.remove();
     if (!CustomIgnoreTag.isEmpty() && section.getNativeCode().startsWith(CustomIgnoreTag))
       iter.remove();
   }
   return sections;
 }
예제 #2
0
 private ArrayList<JniSection> getJniSections(String classFile) {
   ArrayList<JniSection> sections = getComments(classFile);
   Iterator<JniSection> iter = sections.iterator();
   while (iter.hasNext()) {
     JniSection section = iter.next();
     if (!section.getNativeCode().startsWith("JNI")) {
       iter.remove();
     } else {
       section.setNativeCode(section.getNativeCode().substring(3));
     }
   }
   return sections;
 }
예제 #3
0
 private void alignMethodBodies(
     ArrayList<JavaMethod> methods, ArrayList<JniSection> methodBodies) {
   for (JavaMethod method : methods) {
     for (JniSection section : methodBodies) {
       if (method.getEndIndex() == section.getStartIndex()) {
         if (section.getNativeCode().startsWith(JNI_MANUAL)) {
           section.setNativeCode(section.getNativeCode().substring(JNI_MANUAL.length()));
           method.setManual(true);
         }
         method.setNativeCode(section.getNativeCode());
         break;
       }
     }
   }
 }