* @param <V> Value type
*/
final class ReadWriteTrieMap<K, V> extends ForwardingMap<K, V> {
- private static final Logger LOG = LoggerFactory.getLogger(ReadOnlyTrieMap.class);
+ private static final Logger LOG = LoggerFactory.getLogger(ReadWriteTrieMap.class);
private final MutableTrieMap<K, V> delegate;
* @param loggerIdentity
* the class to use as logger name for logging uncaught exceptions from the threads.
*/
+ @SuppressWarnings("checkstyle:LoggerFactoryClassParameter") // due to loggerIdentity argument usage
public CachedThreadPoolExecutor(final int maximumPoolSize, final int maximumQueueSize, final String threadPrefix,
Class<?> loggerIdentity) {
// We're using a custom SynchronousQueue that has a backing bounded LinkedBlockingQueue.
* @param loggerIdentity
* the class to use as logger name for logging uncaught exceptions from the threads.
*/
+ @SuppressWarnings("checkstyle:LoggerFactoryClassParameter") // due to loggerIdentity argument usage
public FastThreadPoolExecutor(final int maximumPoolSize, final int maximumQueueSize, final long keepAliveTime,
final TimeUnit unit, final String threadPrefix, Class<?> loggerIdentity) {
// We use all core threads (the first 2 parameters below equal) so, when a task is submitted,
*
* @author Michael Vorburger.ch
*/
+@SuppressWarnings({"checkstyle:LoggerVariableName", "LoggerVariableModifiers"})
public final class LoggingThreadUncaughtExceptionHandler implements UncaughtExceptionHandler {
// This class is also available in infrautils (but yangtools cannot depend on infrautils)
codec.deserialize("abcd");
fail("Exception should have been thrown.");
} catch (final IllegalArgumentException ex) {
- LOG.debug("IllegalArgumentException was thrown as expected: {}", ex);
+ LOG.debug("IllegalArgumentException was thrown as expected", ex);
assertEquals("Supplied value does not match the regular expression ^[A-Z]+$.", ex.getMessage());
}
}
LeafRefValidatation.validate(writeContributorsCandidate,
rootLeafRefContext);
} catch (final LeafRefDataValidationFailedException e) {
- LOG.debug("All validation errors:" + NEW_LINE + e.getMessage());
+ LOG.debug("All validation errors:{}{}", NEW_LINE, e.getMessage());
assertEquals(3, e.getValidationsErrorsCount());
exception = true;
}
LeafRefValidatation.validate(writeContributorsCandidate,
rootLeafRefContext);
} catch (final LeafRefDataValidationFailedException e) {
- LOG.debug("All validation errors:" + NEW_LINE + e.getMessage());
+ LOG.debug("All validation errors:{}{}", NEW_LINE, e.getMessage());
assertEquals(1, e.getValidationsErrorsCount());
exception = true;
}
LeafRefValidatation.validate(writeContributorsCandidate,
rootLeafRefContext);
} catch (final LeafRefDataValidationFailedException e) {
- LOG.debug("All validation errors:" + NEW_LINE + e.getMessage());
+ LOG.debug("All validation errors:{}{}", NEW_LINE, e.getMessage());
assertEquals(2, e.getValidationsErrorsCount());
exception = true;
}
LeafRefValidatation.validate(writeContributorsCandidate,
rootLeafRefContext);
} catch (final LeafRefDataValidationFailedException e) {
- LOG.debug("All validation errors:" + NEW_LINE + e.getMessage());
+ LOG.debug("All validation errors:{}{}", NEW_LINE, e.getMessage());
assertEquals(12, e.getValidationsErrorsCount());
exception = true;
}
LeafRefValidatation.validate(writeContributorsCandidate,
rootLeafRefContext);
} catch (final LeafRefDataValidationFailedException e) {
- LOG.debug("All validation errors:" + NEW_LINE + e.getMessage());
+ LOG.debug("All validation errors:{}{}", NEW_LINE, e.getMessage());
assertEquals(6, e.getValidationsErrorsCount());
exception = true;
}
LeafRefValidatation.validate(deleteContributorsCanditate,
rootLeafRefContext);
} catch (final LeafRefDataValidationFailedException e) {
- LOG.debug("All validation errors:" + NEW_LINE + e.getMessage());
+ LOG.debug("All validation errors:{}{}", NEW_LINE, e.getMessage());
assertEquals(6, e.getValidationsErrorsCount());
exception = true;
}
return contributorMap;
}
-}
\ No newline at end of file
+}
try {
LeafRefValidatation.validate(writeDevicesCandidate, rootLeafRefContext);
} catch (final LeafRefDataValidationFailedException e) {
- LOG.debug("All validation errors:" + NEW_LINE + e.getMessage());
+ LOG.debug("All validation errors:{}{}", NEW_LINE, e.getMessage());
assertEquals(4, e.getValidationsErrorsCount());
exception = true;
return devicesMapEntryBldr.build();
}
-}
\ No newline at end of file
+}
try {
LeafRefValidatation.validate(writeDevicesCandidate, rootLeafRefContext);
} catch (final LeafRefDataValidationFailedException e) {
- LOG.debug("All validation errors:" + NEW_LINE + e.getMessage());
+ LOG.debug("All validation errors:{}{}", NEW_LINE, e.getMessage());
assertEquals(6, e.getValidationsErrorsCount());
exception = true;
}
try {
LeafRefValidatation.validate(mergeDevicesCandidate, rootLeafRefContext);
} catch (final LeafRefDataValidationFailedException e) {
- LOG.debug("All validation errors:" + NEW_LINE + e.getMessage());
+ LOG.debug("All validation errors:{}{}", NEW_LINE, e.getMessage());
// :TODO verify errors count gz
assertEquals(6, e.getValidationsErrorsCount());
exception = true;
return devicesMapEntryBldr.build();
}
-}
\ No newline at end of file
+}
inMemoryDataTree.validate(modificationTree2);
fail("Exception should have been thrown.");
} catch (final ConflictingModificationAppliedException ex) {
- LOG.debug("ConflictingModificationAppliedException - '{}' was thrown as expected.");
+ LOG.debug("ConflictingModificationAppliedException - was thrown as expected", ex);
}
final DataTreeCandidate prepare2 = inMemoryDataTree.prepare(modificationTree2);
inMemoryDataTree.commit(prepare2);
final DataTreeCandidate prepare2 = inMemoryDataTree.prepare(modificationTree2);
inMemoryDataTree.commit(prepare2);
} catch (final ConflictingModificationAppliedException ex) {
- LOG.debug("ConflictingModificationAppliedException - '{}' was thrown as expected.");
+ LOG.debug("ConflictingModificationAppliedException - was thrown as expected", ex);
}
final DataTreeSnapshot snapshotAfterCommits = inMemoryDataTree.takeSnapshot();
final DataTreeCandidate prepare2 = inMemoryDataTree.prepare(modificationTree2);
inMemoryDataTree.commit(prepare2);
} catch (final ConflictingModificationAppliedException ex) {
- LOG.debug("ConflictingModificationAppliedException - '{}' was thrown as expected.");
+ LOG.debug("ConflictingModificationAppliedException - was thrown as expected", ex);
}
final DataTreeSnapshot snapshotAfterCommits = inMemoryDataTree.takeSnapshot();
final DataTreeCandidate prepare2 = inMemoryDataTree.prepare(modificationTree2);
inMemoryDataTree.commit(prepare2);
} catch (final ConflictingModificationAppliedException ex) {
- LOG.debug("ConflictingModificationAppliedException - '{}' was thrown as expected.");
+ LOG.debug("ConflictingModificationAppliedException was thrown as expected", ex);
}
final DataTreeSnapshot snapshotAfterCommits = inMemoryDataTree.takeSnapshot();
final DataTreeCandidate prepare2 = inMemoryDataTree.prepare(modificationTree2);
inMemoryDataTree.commit(prepare2);
} catch (final ConflictingModificationAppliedException ex) {
- LOG.debug("ConflictingModificationAppliedException - '{}' was thrown as expected.");
+ LOG.debug("ConflictingModificationAppliedException was thrown as expected", ex);
}
final DataTreeCandidate prepare2 = inMemoryDataTree.prepare(modificationTree2);
inMemoryDataTree.commit(prepare2);
} catch (final ConflictingModificationAppliedException ex) {
- LOG.debug("ConflictingModificationAppliedException - '{}' was thrown as expected.");
+ LOG.debug("ConflictingModificationAppliedException was thrown as expected", ex);
}
public class DataTreeCandidatesTest {
- private static final Logger LOG = LoggerFactory.getLogger(DataTreeCandidates.class);
+ private static final Logger LOG = LoggerFactory.getLogger(DataTreeCandidatesTest.class);
private static final SchemaContext SCHEMA_CONTEXT = TestModel.createTestContext();
final LeafNode<?> readLeaf = (LeafNode<?>) newModification.readNode(TestModel.INNER_VALUE_PATH).get();
assertEquals(readLeaf, leaf);
}
-}
\ No newline at end of file
+}
inMemoryDataTree.validate(treeModification);
inMemoryDataTree.commit(inMemoryDataTree.prepare(treeModification));
} catch (final IllegalArgumentException ex) {
- LOG.debug("IllegalArgumentException was thrown as expected: {}", ex);
+ LOG.debug("IllegalArgumentException was thrown as expected", ex);
assertTrue(ex.getMessage().contains("Metadata not available for modification NodeModification"));
}
fail("Exception should have been thrown.");
inMemoryDataTree.commit(inMemoryDataTree.prepare(treeModification2));
} catch (ConflictingModificationAppliedException ex) {
- LOG.debug("ConflictingModificationAppliedException was thrown as expected: {}", ex);
+ LOG.debug("ConflictingModificationAppliedException was thrown as expected", ex);
assertTrue(ex.getMessage().contains("Node was replaced by other transaction"));
}
abstract class YangProvider {
private static final class Default extends YangProvider {
- private static final Logger LOG = LoggerFactory.getLogger(YangProvider.class);
+ private static final Logger LOG = LoggerFactory.getLogger(Default.class);
@Override
void addYangsToMetaInf(final MavenProject project, final Collection<YangTextSchemaSource> modelsInProject)
if (!thrown.isEmpty()) {
String message = " One or more code generators failed, including failed list(generatorClass=exception) ";
- LOG.error("{}" + message + "{}", LOG_PREFIX, thrown.toString());
+ LOG.error("{}{}{}", LOG_PREFIX, message, thrown.toString());
throw new MojoFailureException(LOG_PREFIX + message + thrown.toString());
}
}
* @param <T> Resulting {@link TypeDefinition}
*/
public abstract class DerivedTypeBuilder<T extends TypeDefinition<T>> extends TypeBuilder<T> {
- private static final Logger LOG = LoggerFactory.getLogger(DecimalTypeBuilder.class);
+ private static final Logger LOG = LoggerFactory.getLogger(DerivedTypeBuilder.class);
private Object defaultValue;
private String description;
private String reference;
* -o, --output path to output file for logs. Output file will be overwritten.
* -m, --module-name validate yang by module name.
*/
+@SuppressWarnings({"checkstyle:LoggerMustBeSlf4j", "checkstyle:LoggerFactoryClassParameter"})
public final class Main {
private static final Logger LOG = LoggerFactory.getLogger(Main.class);
private static final ch.qos.logback.classic.Logger LOG_ROOT =
abstract class AbstractAugmentStatementSupport extends AbstractStatementSupport<SchemaNodeIdentifier, AugmentStatement,
EffectiveStatement<SchemaNodeIdentifier, AugmentStatement>> {
- private static final Logger LOG = LoggerFactory.getLogger(AugmentStatementImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(AbstractAugmentStatementSupport.class);
private static final Pattern PATH_REL_PATTERN1 = Pattern.compile("\\.\\.?\\s*/(.+)");
private static final Pattern PATH_REL_PATTERN2 = Pattern.compile("//.*");
return allowedAugmentTargets == null || allowedAugmentTargets.isEmpty()
|| allowedAugmentTargets.contains(substatementCtx.getPublicDefinition());
}
-}
\ No newline at end of file
+}
abstract class AbstractDeviateStatementSupport extends AbstractStatementSupport<DeviateKind, DeviateStatement,
EffectiveStatement<DeviateKind, DeviateStatement>> {
- private static final Logger LOG = LoggerFactory.getLogger(DeviateStatementImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(AbstractDeviateStatementSupport.class);
private static final SubstatementValidator DEVIATE_NOT_SUPPORTED_SUBSTATEMENT_VALIDATOR =
SubstatementValidator.builder(YangStmtMapping.DEVIATE).build();
return supportedDeviationTargets == null || supportedDeviationTargets.contains(
deviateTargetCtx.getPublicDefinition());
}
-}
\ No newline at end of file
+}
import static org.junit.Assert.fail;
import static org.opendaylight.yangtools.yang.stmt.StmtTestUtils.sourceForResource;
-import java.util.logging.Logger;
import org.junit.Test;
import org.opendaylight.yangtools.yang.parser.rfc7950.reactor.RFC7950Reactors;
import org.opendaylight.yangtools.yang.parser.spi.meta.ModelProcessingPhase;
import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor.BuildAction;
import org.opendaylight.yangtools.yang.parser.stmt.reactor.EffectiveModelContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class IncludeResolutionTest {
- private static final Logger LOG = Logger.getLogger(IncludeResolutionTest.class.getName());
+ private static final Logger LOG = LoggerFactory.getLogger(IncludeResolutionTest.class);
private static final StatementStreamSource ROOT = sourceForResource(
"/semantic-statement-parser/include-arg-parsing/root-module.yang");
}
public static void log(final Throwable exception, final String indent) {
- LOG.debug(indent + exception.getMessage());
+ LOG.debug("{}{}", indent, exception.getMessage());
final Throwable[] suppressed = exception.getSuppressed();
for (final Throwable throwable : suppressed) {
}
public static void printReferences(final Module module, final boolean isSubmodule, final String indent) {
- LOG.debug(indent + (isSubmodule ? "Submodule " : "Module ") + module.getName());
+ LOG.debug("{}{} {}", indent, (isSubmodule ? "Submodule" : "Module"), module.getName());
final Set<Module> submodules = module.getSubmodules();
for (final Module submodule : submodules) {
printReferences(submodule, true, indent + " ");
public static void printChilds(final Collection<DataSchemaNode> childNodes, final String indent) {
for (final DataSchemaNode child : childNodes) {
- LOG.debug(indent + "Child " + child.getQName().getLocalName());
+ LOG.debug("{}{} {}", indent, "Child", child.getQName().getLocalName());
if (child instanceof DataNodeContainer) {
printChilds(((DataNodeContainer) child).getChildNodes(), indent + " ");
}