Пример #1
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;
 }
Пример #2
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;
       }
     }
   }
 }