This is not an issue with java library content - you don't want to edit java libraries to correct this. This is an issue with conflicting jar files in the userlib directory of your app. To resolve this, I usually:
Hope that helps,
Mike
P.S. here is a forum post with additional information and a different approach to resolving these kinds of errors https://community.mendix.com/link/spaces/java-actions/questions/115161
This looks more like a library/version conflict than an actual logic issue in Misc.java.
From the errors:
BOMInputStream.builder() not found usually means the commons-io version in your project is older than the one expected by the current CommunityCommons code. mergePdf.addSources(sources) failing with List<RandomAccessRead> cannot be converted to List<InputStream> points to a PDFBox API mismatch, again suggesting incompatible jar versions in userlib or vendorlib. This is consistent with CommunityCommons compile issues reported after module/library upgrades. So instead of directly editing javasource\communitycommons\Misc.java first, I would suggest:
There is already a Mendix Community report for the same BOMInputStream.builder() error, and the accepted answer was to remove obsolete jars such as old commons-io and related dependencies from userlib. Another answer also mentions that other modules like SCIM can bring conflicting versions.