texophen opened a new issue, #12450: URL: https://github.com/apache/lucene/issues/12450
### Description I successfully modified Lucene 7.3.0 for using in Android: https://github.com/texophen/lucene-android The modification includes: + Add log feature in org.apache.lucene.LucenePackage + Add org.apache.lucene.util.ADClassValue to replace java.lang.ClassValue in JDK 8 (but not available in Android) + Modify org.apache.lucene.util.AttributeFactory ``` static final MethodHandle findAttributeImplCtor(Class<? extends AttributeImpl> clazz) { try { //org.apache.lucene.LucenePackage.writeLog("AttributeFactory.findAttributeImplCtor() - 1: " + lookup.findConstructor(clazz, NO_ARG_CTOR).toString()); MethodHandle mh = null; if (lookup.findConstructor(clazz, NO_ARG_CTOR).toString().endsWith("PackedTokenAttributeImpl")) { mh = lookup.findConstructor(clazz, NO_ARG_CTOR).asType(MethodType.methodType(org.apache.lucene.analysis.tokenattributes.PackedTokenAttributeImpl.class)); } else { mh = lookup.findConstructor(clazz, NO_ARG_CTOR).asType(NO_ARG_RETURNING_ATTRIBUTEIMPL); } //org.apache.lucene.LucenePackage.writeLog("AttributeFactory.findAttributeImplCtor() - 2: " + mh.toString()); return mh; } catch (NoSuchMethodException | IllegalAccessException e) { throw new IllegalArgumentException("Cannot lookup accessible no-arg constructor for: " + clazz.getName(), e); } } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org