import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
* @throws SourceException
* instance of SourceException
*/
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static void copyFromSourceToTarget(final StmtContext<?, ?, ?> sourceGrpStmtCtx,
final Mutable<?, ?, ?> targetCtx, final Mutable<QName, UsesStatement, UsesEffectiveStatement> usesNode) {
final var declared = sourceGrpStmtCtx.declaredSubstatements();
final QNameModule newQNameModule = getNewQNameModule(targetCtx, sourceGrpStmtCtx);
for (StmtContext<?, ?, ?> original : declared) {
- if (original.isSupportedByFeatures() && shouldCopy(original)) {
- original.copyAsChildOf(targetCtx, CopyType.ADDED_BY_USES, newQNameModule).ifPresent(buffer::add);
+ if (shouldCopy(original)) {
+ original.copyAsChildOf(targetCtx, CopyType.ADDED_BY_USES, newQNameModule).ifPresent(copy -> {
+ if (!original.isSupportedByFeatures() || !original.isSupportedToBuildEffective()) {
+ copy.setUnsupported();
+ }
+ buffer.add(copy);
+ });
}
}
return null;
}
- @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
- justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static void resolveUsesNode(final Mutable<QName, UsesStatement, UsesEffectiveStatement> usesNode,
final StmtContext<?, ?, ?> targetNodeStmtCtx) {
for (Mutable<?, ?, ?> subStmtCtx : usesNode.mutableDeclaredSubstatements()) {