- javadoc order
- unneeded casts
- static methods
Change-Id: I98344b7052eee1a58c709665e92d0cb1a0d72b46
Signed-off-by: Robert Varga <rovarga@cisco.com>
* List of failed prerequisites should be used to select right message / error
* type to debug problem in YANG sources.
*
* List of failed prerequisites should be used to select right message / error
* type to debug problem in YANG sources.
*
+ * @param failed collection of prerequisites which were not met
* @throws InferenceException If inference action can not be processed.
* Note that this exception be used for user to debug YANG sources,
* so should provide helpful context to fix issue in sources.
* @throws InferenceException If inference action can not be processed.
* Note that this exception be used for user to debug YANG sources,
* so should provide helpful context to fix issue in sources.
- *
- * @param failed collection of prerequisites which were not met
*/
void prerequisiteFailed(Collection<? extends Prerequisite<?>> failed) throws InferenceException;
}
*/
void prerequisiteFailed(Collection<? extends Prerequisite<?>> failed) throws InferenceException;
}
/**
* adds effective statement to collection of substatements
*
/**
* adds effective statement to collection of substatements
*
+ * @param substatement substatement
* @throws IllegalStateException
* if added in declared phase
* @throws NullPointerException
* if statement parameter is null
* @throws IllegalStateException
* if added in declared phase
* @throws NullPointerException
* if statement parameter is null
- *
- * @param substatement substatement
*/
public void addEffectiveSubstatement(final StatementContextBase<?, ?, ?> substatement) {
*/
public void addEffectiveSubstatement(final StatementContextBase<?, ?, ?> substatement) {
/**
* adds declared statement to collection of substatements
*
/**
* adds declared statement to collection of substatements
*
+ * @param substatement substatement
* @throws IllegalStateException
* if added in effective phase
* @throws NullPointerException
* if statement parameter is null
* @throws IllegalStateException
* if added in effective phase
* @throws NullPointerException
* if statement parameter is null
- *
- * @param substatement substatement
*/
public void addDeclaredSubstatement(final StatementContextBase<?, ?, ?> substatement) {
*/
public void addDeclaredSubstatement(final StatementContextBase<?, ?, ?> substatement) {
import com.google.common.base.Preconditions;
import com.google.common.base.Verify;
import java.util.Collection;
import com.google.common.base.Preconditions;
import com.google.common.base.Verify;
import java.util.Collection;
-import java.util.Objects;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.QNameModule;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.QNameModule;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
}
@SuppressWarnings({"unchecked", "rawtypes"})
}
@SuppressWarnings({"unchecked", "rawtypes"})
- private Mutable<?, ?, EffectiveStatement<?, ?>> tryToFindUnknownStatement(final String localName,
+ private static Mutable<?, ?, EffectiveStatement<?, ?>> tryToFindUnknownStatement(final String localName,
final Mutable<?, ?, EffectiveStatement<?, ?>> current) {
Collection<StmtContext<?, ?, ?>> unknownSubstatements = (Collection)StmtContextUtils.findAllSubstatements(current,
UnknownStatement.class);
final Mutable<?, ?, EffectiveStatement<?, ?>> current) {
Collection<StmtContext<?, ?, ?>> unknownSubstatements = (Collection)StmtContextUtils.findAllSubstatements(current,
UnknownStatement.class);
testIterator(availableIterator);
}
testIterator(availableIterator);
}
- private void testIterator(final Iterator<AugmentationSchema> iterator) {
- AugmentationSchema allAugments;
+ private static void testIterator(final Iterator<AugmentationSchema> iterator) {
while (iterator.hasNext()) {
while (iterator.hasNext()) {
- allAugments = iterator.next();
+ AugmentationSchema allAugments = iterator.next();
final DataSchemaNode currentChoice = allAugments.getChildNodes().iterator().next();
assertTrue(currentChoice instanceof ChoiceCaseNode);
}
final DataSchemaNode currentChoice = allAugments.getChildNodes().iterator().next();
assertTrue(currentChoice instanceof ChoiceCaseNode);
}
verifyBitsTypedefinition(context);
}
verifyBitsTypedefinition(context);
}
- private void verifyEnumTypedefinition(final SchemaContext context) {
+ private static void verifyEnumTypedefinition(final SchemaContext context) {
final DataSchemaNode dataChildByName = context.getDataChildByName(QName
.create("foo", "1970-01-01", "enum-leaf"));
assertTrue(dataChildByName instanceof LeafSchemaNode);
final DataSchemaNode dataChildByName = context.getDataChildByName(QName
.create("foo", "1970-01-01", "enum-leaf"));
assertTrue(dataChildByName instanceof LeafSchemaNode);
- private void verifyBitsTypedefinition(final SchemaContext context) {
+ private static void verifyBitsTypedefinition(final SchemaContext context) {
final DataSchemaNode dataChildByName = context.getDataChildByName(QName
.create("foo", "1970-01-01", "bits-leaf"));
assertTrue(dataChildByName instanceof LeafSchemaNode);
final DataSchemaNode dataChildByName = context.getDataChildByName(QName
.create("foo", "1970-01-01", "bits-leaf"));
assertTrue(dataChildByName instanceof LeafSchemaNode);
EnumPair value0 = values.get(0);
assertEquals("unknown", value0.getName());
EnumPair value0 = values.get(0);
assertEquals("unknown", value0.getName());
- assertEquals(0, (int) value0.getValue());
+ assertEquals(0, value0.getValue());
assertEquals("An unknown or unspecified version of the Internet protocol.", value0.getDescription());
EnumPair value1 = values.get(1);
assertEquals("ipv4", value1.getName());
assertEquals("An unknown or unspecified version of the Internet protocol.", value0.getDescription());
EnumPair value1 = values.get(1);
assertEquals("ipv4", value1.getName());
- assertEquals(1, (int) value1.getValue());
+ assertEquals(1, value1.getValue());
assertEquals("The IPv4 protocol as defined in RFC 791.", value1.getDescription());
EnumPair value2 = values.get(2);
assertEquals("ipv6", value2.getName());
assertEquals("The IPv4 protocol as defined in RFC 791.", value1.getDescription());
EnumPair value2 = values.get(2);
assertEquals("ipv6", value2.getName());
- assertEquals(2, (int) value2.getValue());
+ assertEquals(2, value2.getValue());
assertEquals("The IPv6 protocol as defined in RFC 2460.", value2.getDescription());
}
assertEquals("The IPv6 protocol as defined in RFC 2460.", value2.getDescription());
}
EnumPair value0 = values.get(0);
assertEquals("unknown", value0.getName());
EnumPair value0 = values.get(0);
assertEquals("unknown", value0.getName());
- assertEquals(0, (int) value0.getValue());
+ assertEquals(0, value0.getValue());
assertEquals("An unknown or unspecified version of the Internet protocol.", value0.getDescription());
EnumPair value1 = values.get(1);
assertEquals("ipv4", value1.getName());
assertEquals("An unknown or unspecified version of the Internet protocol.", value0.getDescription());
EnumPair value1 = values.get(1);
assertEquals("ipv4", value1.getName());
- assertEquals(19, (int) value1.getValue());
+ assertEquals(19, value1.getValue());
assertEquals("The IPv4 protocol as defined in RFC 791.", value1.getDescription());
EnumPair value2 = values.get(2);
assertEquals("ipv6", value2.getName());
assertEquals("The IPv4 protocol as defined in RFC 791.", value1.getDescription());
EnumPair value2 = values.get(2);
assertEquals("ipv6", value2.getName());
- assertEquals(7, (int) value2.getValue());
+ assertEquals(7, value2.getValue());
assertEquals("The IPv6 protocol as defined in RFC 2460.", value2.getDescription());
EnumPair value3 = values.get(3);
assertEquals("default", value3.getName());
assertEquals("The IPv6 protocol as defined in RFC 2460.", value2.getDescription());
EnumPair value3 = values.get(3);
assertEquals("default", value3.getName());
- assertEquals(20, (int) value3.getValue());
+ assertEquals(20, value3.getValue());
assertEquals("default ip", value3.getDescription());
}
assertEquals("default ip", value3.getDescription());
}
Bit bit1 = bits.get(0);
assertEquals("disable-nagle", bit1.getName());
Bit bit1 = bits.get(0);
assertEquals("disable-nagle", bit1.getName());
- assertEquals(0L, (long) bit1.getPosition());
+ assertEquals(0L, bit1.getPosition());
Bit bit2 = bits.get(1);
assertEquals("auto-sense-speed", bit2.getName());
Bit bit2 = bits.get(1);
assertEquals("auto-sense-speed", bit2.getName());
- assertEquals(1L, (long) bit2.getPosition());
+ assertEquals(1L, bit2.getPosition());
Bit bit3 = bits.get(2);
assertEquals("10-Mb-only", bit3.getName());
Bit bit3 = bits.get(2);
assertEquals("10-Mb-only", bit3.getName());
- assertEquals(2L, (long) bit3.getPosition());
+ assertEquals(2L, bit3.getPosition());
assertEquals(5, bits.size());
Bit bit0 = bits.get(0);
assertEquals(5, bits.size());
Bit bit0 = bits.get(0);
- assertEquals(0L, (long) bit0.getPosition());
+ assertEquals(0L, bit0.getPosition());
- assertEquals(500L, (long) bit1.getPosition());
+ assertEquals(500L, bit1.getPosition());
- assertEquals(501L, (long) bit2.getPosition());
+ assertEquals(501L, bit2.getPosition());
- assertEquals(502L, (long) bit3.getPosition());
+ assertEquals(502L, bit3.getPosition());
- assertEquals(365L, (long) bit4.getPosition());
+ assertEquals(365L, bit4.getPosition());
EnumPair enum168 = values.get(168);
assertEquals("America/Danmarkshavn", enum168.getName());
EnumPair enum168 = values.get(168);
assertEquals("America/Danmarkshavn", enum168.getName());
- assertEquals(168, (int) enum168.getValue());
+ assertEquals(168, enum168.getValue());
assertEquals("east coast, north of Scoresbysund", enum168.getDescription());
EnumPair enum374 = values.get(374);
assertEquals("America/Indiana/Winamac", enum374.getName());
assertEquals("east coast, north of Scoresbysund", enum168.getDescription());
EnumPair enum374 = values.get(374);
assertEquals("America/Indiana/Winamac", enum374.getName());
- assertEquals(374, (int) enum374.getValue());
+ assertEquals(374, enum374.getValue());
assertEquals("Eastern Time - Indiana - Pulaski County", enum374.getDescription());
}
assertEquals("Eastern Time - Indiana - Pulaski County", enum374.getDescription());
}