Java Examples for java.util.List
The following java examples will help you to understand the usage of java.util.List. These source code samples are taken from different open source projects.
Example 1
| Project: kraken-master File: TrustManager.java View source code |
boolean verify(NativeConnectionInfo info) {
java.util.List<java.util.List<java.util.List<RFC2253.RDNPair>>> reject = new java.util.LinkedList<java.util.List<java.util.List<RFC2253.RDNPair>>>(), accept = new java.util.LinkedList<java.util.List<java.util.List<RFC2253.RDNPair>>>();
if (!_rejectAll.isEmpty()) {
reject.add(_rejectAll);
}
if (info.incoming) {
if (!_rejectAllServer.isEmpty()) {
reject.add(_rejectAllServer);
}
if (info.adapterName.length() > 0) {
java.util.List<java.util.List<RFC2253.RDNPair>> p = _rejectServer.get(info.adapterName);
if (p != null) {
reject.add(p);
}
}
} else {
if (!_rejectClient.isEmpty()) {
reject.add(_rejectClient);
}
}
if (!_acceptAll.isEmpty()) {
accept.add(_acceptAll);
}
if (info.incoming) {
if (!_acceptAllServer.isEmpty()) {
accept.add(_acceptAllServer);
}
if (info.adapterName.length() > 0) {
java.util.List<java.util.List<RFC2253.RDNPair>> p = _acceptServer.get(info.adapterName);
if (p != null) {
accept.add(p);
}
}
} else {
if (!_acceptClient.isEmpty()) {
accept.add(_acceptClient);
}
}
//
if (reject.isEmpty() && accept.isEmpty()) {
return true;
}
//
if (info.nativeCerts != null && info.nativeCerts.length > 0) {
javax.security.auth.x500.X500Principal subjectDN = (javax.security.auth.x500.X500Principal) ((java.security.cert.X509Certificate) info.nativeCerts[0]).getSubjectX500Principal();
String subjectName = subjectDN.getName(javax.security.auth.x500.X500Principal.RFC2253);
assert subjectName != null;
try {
//
if (_traceLevel > 0) {
if (info.incoming) {
_communicator.getLogger().trace("Security", "trust manager evaluating client:\n" + "subject = " + subjectName + "\n" + "adapter = " + info.adapterName + "\n" + "local addr = " + info.localAddress + ":" + info.localPort + "\n" + "remote addr = " + info.remoteAddress + ":" + info.remotePort);
} else {
_communicator.getLogger().trace("Security", "trust manager evaluating server:\n" + "subject = " + subjectName + "\n" + "local addr = " + info.localAddress + ":" + info.localPort + "\n" + "remote addr = " + info.remoteAddress + ":" + info.remotePort);
}
}
java.util.List<RFC2253.RDNPair> dn = RFC2253.parseStrict(subjectName);
//
for (java.util.List<java.util.List<RFC2253.RDNPair>> matchSet : reject) {
if (_traceLevel > 1) {
StringBuilder s = new StringBuilder("trust manager rejecting PDNs:\n");
stringify(matchSet, s);
_communicator.getLogger().trace("Security", s.toString());
}
if (match(matchSet, dn)) {
return false;
}
}
//
for (java.util.List<java.util.List<RFC2253.RDNPair>> matchSet : accept) {
if (_traceLevel > 1) {
StringBuilder s = new StringBuilder("trust manager accepting PDNs:\n");
stringify(matchSet, s);
_communicator.getLogger().trace("Security", s.toString());
}
if (match(matchSet, dn)) {
return true;
}
}
} catch (RFC2253.ParseException e) {
_communicator.getLogger().warning("IceSSL: unable to parse certificate DN `" + subjectName + "'\nreason: " + e.reason);
}
//
return accept.isEmpty();
}
return false;
}Example 2
| Project: intellij-community-master File: resolveMethodInsideClosure.java View source code |
public java.util.List<java.lang.Integer> foo() { java.util.List<java.lang.Integer> list = new java.util.ArrayList<java.lang.Integer>(java.util.Arrays.asList(1, 2, 3)); return org.codehaus.groovy.runtime.DefaultGroovyMethods.each(list, new groovy.lang.Closure<java.util.List<java.lang.Integer>>(this, this) { public java.util.List<java.lang.Integer> doCall(java.lang.Integer it) { return foo(); } public java.util.List<java.lang.Integer> doCall() { return doCall(null); } }); }
Example 3
| Project: AT4AMParlamentoElettronicoEdition-master File: BasicoptComplexType.java View source code |
/**
* Return <code>java.util.List<Foreign></code> property
*
* @return The property as unmodifiable list
*/
public java.util.List<Foreign> getForeigns() {
java.util.List<Foreign> result = new ArrayList<Foreign>();
for (OverlayWidget widget : getChildOverlayWidgets()) {
if ("Foreign".equalsIgnoreCase(widget.getType()) && "http://www.akomantoso.org/2.0".equalsIgnoreCase(widget.getNamespaceURI())) {
result.add((Foreign) widget);
}
}
return java.util.Collections.unmodifiableList(result);
}Example 4
| Project: nsesa-editor-an-master File: ContainerTypeComplexType.java View source code |
/**
* Return <code>java.util.List<Container></code> property
*
* @return The property as unmodifiable list
*/
public java.util.List<Container> getContainers() {
java.util.List<Container> result = new ArrayList<Container>();
for (OverlayWidget widget : getChildOverlayWidgets()) {
if ("Container".equalsIgnoreCase(widget.getType()) && "http://docs.oasis-open.org/legaldocml/ns/akn/3.0/CSD05".equalsIgnoreCase(widget.getNamespaceURI())) {
result.add((Container) widget);
}
}
return java.util.Collections.unmodifiableList(result);
}Example 5
| Project: restx-master File: TypeHelperTest.java View source code |
@Test
public void should_produce_type_expression() throws Exception {
assertThat(TypeHelper.getTypeExpressionFor("java.lang.String")).isEqualTo("java.lang.String.class");
assertThat(TypeHelper.getTypeExpressionFor("java.util.List<java.lang.String>")).isEqualTo("Types.newParameterizedType(java.util.List.class, java.lang.String.class)");
assertThat(TypeHelper.getTypeExpressionFor("java.util.Map<java.lang.String, java.lang.Integer>")).isEqualTo("Types.newParameterizedType(java.util.Map.class, java.lang.String.class, java.lang.Integer.class)");
assertThat(TypeHelper.getTypeExpressionFor("java.util.List<java.util.List<java.lang.String>>")).isEqualTo("Types.newParameterizedType(java.util.List.class, Types.newParameterizedType(java.util.List.class, java.lang.String.class))");
assertThat(TypeHelper.getTypeExpressionFor("java.util.List<java.util.Map<java.lang.String, java.lang.Integer>>")).isEqualTo("Types.newParameterizedType(java.util.List.class, Types.newParameterizedType(java.util.Map.class, java.lang.String.class, java.lang.Integer.class))");
assertThat(TypeHelper.getTypeExpressionFor("java.util.List<java.util.Map<java.util.Set<java.lang.String>, java.lang.Integer>>")).isEqualTo("Types.newParameterizedType(java.util.List.class, Types.newParameterizedType(java.util.Map.class, Types.newParameterizedType(java.util.Set.class, java.lang.String.class), java.lang.Integer.class))");
}Example 6
| Project: caxap-master File: UseListComprehension.java View source code |
@Override public java.util.List<String> getList() { java.util.List<String> list = new java.util.ArrayList<>(); for (String y : new String[] { "d", "", "e", "f", "" }) { if (!y.isEmpty()) { for (String x : new String[] { "a", "", "b", "c", "" }) { if (!x.isEmpty()) { list.add(x + y); } } } } return list; }
Example 7
| Project: eclipse.jdt.ui-master File: TC.java View source code |
/**
* Runs the test
* @param tr TODO
*/
protected void run(final TR tr) {
List<Integer> integers = null;
tr.startTest(this);
P p = new P() {
public void protect() throws Throwable {
runBare();
tr.handleRun(TC.this);
double d = cos(0);
}
};
tr.runProtected(this, p);
tr.endTest(this);
}Example 8
| Project: pojobuilder-master File: InnerPojoBuilder.java View source code |
/**
* Creates a new {@link OuterPojo.InnerPojo} based on this builder's settings.
*
* @return the created OuterPojo.InnerPojo
*/
public OuterPojo.InnerPojo build() {
try {
OuterPojo.InnerPojo result = PojoFactory.createInnerPojo();
if (isSet$name$java$lang$String) {
result.setName(value$name$java$lang$String);
}
if (isSet$number$int) {
result.number = value$number$int;
}
if (isSet$strings$java$util$List) {
result.strings = value$strings$java$util$List;
}
return result;
} catch (RuntimeException ex) {
throw ex;
} catch (Exception ex) {
throw new java.lang.reflect.UndeclaredThrowableException(ex);
}
}Example 9
| Project: rascal-master File: Tags.java View source code |
@Override
protected void addForLineNumber(int $line, java.util.List<AbstractAST> $result) {
if (getLocation().getBeginLine() == $line) {
$result.add(this);
}
ISourceLocation $l;
for (AbstractAST $elem : tags) {
$l = $elem.getLocation();
if ($l.hasLineColumn() && $l.getBeginLine() <= $line && $l.getEndLine() >= $line) {
$elem.addForLineNumber($line, $result);
}
if ($l.getBeginLine() > $line) {
return;
}
}
}Example 10
| Project: eclipselink.runtime-master File: Sequence.java View source code |
public void setNestedParticles(java.util.List nestedParticles) {
for (int i = 0; i < nestedParticles.size(); i++) {
NestedParticle next = (NestedParticle) nestedParticles.get(i);
if (next instanceof Choice) {
addChoice((Choice) next);
} else if (next instanceof Sequence) {
addSequence((Sequence) next);
}
}
}Example 11
| Project: old-gosu-repo-master File: Union_MemberTypes.java View source code |
public static gw.xml.XmlSimpleValue createSimpleValue(java.util.List<javax.xml.namespace.QName> value) { //noinspection RedundantArrayCreation return (gw.xml.XmlSimpleValue) TYPE.get().getTypeInfo().getMethod("createSimpleValue", gw.lang.reflect.TypeSystem.get(java.util.List.class).getParameterizedType(gw.lang.reflect.TypeSystem.get(javax.xml.namespace.QName.class))).getCallHandler().handleCall(null, new java.lang.Object[] { value }); }
Example 12
| Project: drools-wb-master File: GlobalsParserTest.java View source code |
@Test
public void testSimpleEntry() {
final String content = "global java.util.List myList;";
final List<Pair<String, String>> globals = GlobalsParser.parseGlobals(content);
assertNotNull(globals);
assertEquals(1, globals.size());
assertEquals("myList", globals.get(0).getK1());
assertEquals("java.util.List", globals.get(0).getK2());
}Example 13
| Project: EasyMPermission-master File: ValWeirdTypes.java View source code |
public void testGenerics() {
List<String> list = new ArrayList<String>();
list.add("Hello, World!");
@val final java.lang.String shouldBeString = list.get(0);
@val final java.util.List<java.lang.String> shouldBeListOfString = list;
@val final java.util.List<java.lang.String> shouldBeListOfStringToo = Arrays.asList("hello", "world");
@val final java.lang.String shouldBeString2 = shouldBeListOfString.get(0);
}Example 14
| Project: lombok-intellij-plugin-master File: ValWeirdTypes.java View source code |
public void testGenerics() {
List<String> list = new ArrayList<String>();
list.add("Hello, World!");
final java.lang.String shouldBeString = list.get(0);
final java.util.List<java.lang.String> shouldBeListOfString = list;
final java.util.List<java.lang.String> shouldBeListOfStringToo = Arrays.asList("hello", "world");
final java.lang.String shouldBeString2 = shouldBeListOfString.get(0);
}Example 15
| Project: lombok-master File: ValWeirdTypes.java View source code |
public void testGenerics() {
List<String> list = new ArrayList<String>();
list.add("Hello, World!");
@val final java.lang.String shouldBeString = list.get(0);
@val final java.util.List<java.lang.String> shouldBeListOfString = list;
@val final java.util.List<java.lang.String> shouldBeListOfStringToo = Arrays.asList("hello", "world");
@val final java.lang.String shouldBeString2 = shouldBeListOfString.get(0);
}Example 16
| Project: lombok-pg-master File: ValWeirdTypes.java View source code |
public void testGenerics() {
List<String> list = new ArrayList<String>();
list.add("Hello, World!");
@val final java.lang.String shouldBeString = list.get(0);
@val final java.util.List<java.lang.String> shouldBeListOfString = list;
@val final java.util.List<java.lang.String> shouldBeListOfStringToo = Arrays.asList("hello", "world");
@val final java.lang.String shouldBeString2 = shouldBeListOfString.get(0);
}Example 17
| Project: wb-master File: GlobalsParserTest.java View source code |
@Test
public void testSimpleEntry() {
final String content = "global java.util.List myList;";
final List<Pair<String, String>> globals = GlobalsParser.parseGlobals(content);
assertNotNull(globals);
assertEquals(1, globals.size());
assertEquals("myList", globals.get(0).getK1());
assertEquals("java.util.List", globals.get(0).getK2());
}Example 18
| Project: intellij-generator-plugin-master File: TypeToTextMappingTest.java View source code |
@Test
public void replaceGenericPlaceholder() {
String canonicalTypeName = "java.util.List<List<List<String>>>";
Pattern pattern = Pattern.compile("<.*>");
Matcher matcher = pattern.matcher(canonicalTypeName);
matcher.find();
String genericsText = matcher.group();
String initializerText = "new java.util.Collection.$<>$emptyList($<>$)";
String initializer = initializerText.replaceAll(GENERICS_PLACEHOLDER, genericsText);
assertEquals("new java.util.Collection.<List<List<String>>>emptyList(<List<List<String>>>)", initializer);
}Example 19
| Project: megam_chef-master File: ParmsValidator.java View source code |
/**
* <p>validate.</p>
*
* @param conditionList a {@link java.util.List} object.
* @return a boolean.
*/
public boolean validate(List<Condition> conditionList) {
Boolean isValid = true;
for (Condition conditions : conditionList) {
System.out.println(conditions.name());
System.out.println(conditions.inputAvailable());
isValid = conditions.inputAvailable();
if (!isValid) {
reasonsNotSatisfied.addAll(conditions.getReason());
} else if (!(isValid = conditions.ok())) {
reasonsNotSatisfied.addAll(conditions.getReason());
}
}
return isValid;
}Example 20
| Project: richfaces-cdk-master File: ClassDescriptionTest.java View source code |
@Parameters
public static Collection<String[]> values() {
return Arrays.asList(new String[] { int.class.getName(), "int", "java.lang.Integer", null, null, "int" }, new String[] { "java.util.List<String>", "java.util.List", "java.util.List<String>", "<String>", "java.util", "List<String>" }, new String[] { "java.lang.String[]", "java.lang.String[]", "java.lang.String[]", null, "java.lang", "String[]" }, new String[] { "java.util.List<String>[]", "java.util.List[]", "java.util.List<String>[]", "<String>", "java.util", "List<String>[]" }, new String[] { "java.util.List<java.lang.String>", "java.util.List", "java.util.List<java.lang.String>", "<java.lang.String>", "java.util", "List<java.lang.String>" }, new String[] { double.class.getName(), "double", "java.lang.Double", null, null, "double" });
}Example 21
| Project: eucalyptus-master File: AwsUsageActivitiesClientImpl.java View source code |
@SuppressWarnings({ "unchecked", "rawtypes" })
protected Promise<java.util.List<com.eucalyptus.portal.workflow.AwsUsageRecord>> getAwsReportHourlyUsageRecordImpl(final Promise<String> accountId, final Promise<String> queueName, final ActivitySchedulingOptions optionsOverride, Promise<?>... waitFor) {
ActivityType _activityType = new ActivityType();
_activityType.setName("AwsUsageActivities.getAwsReportHourlyUsageRecord");
_activityType.setVersion("1.0");
Promise[] _input_ = new Promise[2];
_input_[0] = accountId;
_input_[1] = queueName;
return (Promise) scheduleActivity(_activityType, _input_, optionsOverride, java.util.List.class, waitFor);
}Example 22
| Project: CodingSpectator-master File: TC.java View source code |
/**
* Runs the test
* @param tr TODO
*/
protected void run(final TR tr) {
List<Integer> integers = null;
tr.startTest(this);
P p = new P() {
public void protect() throws Throwable {
runBare();
tr.handleRun(TC.this);
double d = cos(0);
}
};
tr.runProtected(this, p);
tr.endTest(this);
}Example 23
| Project: generator-master File: FullyQualifiedJavaTypeTest.java View source code |
@Test
public void testGenericType1() {
FullyQualifiedJavaType fqjt = //$NON-NLS-1$
new FullyQualifiedJavaType("java.util.List<java.lang.String>");
assertTrue(fqjt.isExplicitlyImported());
//$NON-NLS-1$
assertEquals("List<String>", fqjt.getShortName());
//$NON-NLS-1$
assertEquals("java.util.List<java.lang.String>", fqjt.getFullyQualifiedName());
//$NON-NLS-1$
assertEquals("java.util", fqjt.getPackageName());
assertEquals(1, fqjt.getImportList().size());
assertEquals("java.util.List", fqjt.getImportList().get(0));
//$NON-NLS-1$
assertEquals("java.util.List", fqjt.getFullyQualifiedNameWithoutTypeParameters());
}Example 24
| Project: iterator-master File: Integer.java View source code |
public static void encode_(java.lang.Object obj, com.jsoniter.output.JsonStream stream) throws java.io.IOException {
java.util.List list = (java.util.List) obj;
int size = list.size();
if (size == 0) {
return;
}
java.lang.Object e = list.get(0);
if (e == null) {
stream.writeNull();
} else {
stream.writeVal((java.lang.Integer) e);
}
for (int i = 1; i < size; i++) {
stream.write(',');
e = list.get(i);
if (e == null) {
stream.writeNull();
} else {
stream.writeVal((java.lang.Integer) e);
}
}
}Example 25
| Project: metaas-master File: ImportsTests.java View source code |
public void testImports() throws IOException {
ASCompilationUnit unit = fact.newClass("Test");
ASPackage pkg = unit.getPackage();
assertEquals(0, pkg.findImports().size());
pkg.addImport("java.util.List");
assertEquals(1, pkg.findImports().size());
assertEquals("java.util.List", pkg.findImports().get(0));
pkg.addImport("junit.framework.*");
assertEquals(2, pkg.findImports().size());
assertEquals("java.util.List", pkg.findImports().get(0));
assertEquals("junit.framework.*", pkg.findImports().get(1));
assertTrue(pkg.removeImport("java.util.List"));
assertEquals(1, pkg.findImports().size());
assertEquals("junit.framework.*", pkg.findImports().get(0));
assertFalse(pkg.removeImport("missing"));
assertTrue(pkg.removeImport("junit.framework.*"));
assertEquals(0, pkg.findImports().size());
}Example 26
| Project: mybatis-generator-master File: FullyQualifiedJavaTypeTest.java View source code |
@Test
public void testGenericType1() {
FullyQualifiedJavaType fqjt = //$NON-NLS-1$
new FullyQualifiedJavaType("java.util.List<java.lang.String>");
assertTrue(fqjt.isExplicitlyImported());
//$NON-NLS-1$
assertEquals("List<String>", fqjt.getShortName());
//$NON-NLS-1$
assertEquals("java.util.List<java.lang.String>", fqjt.getFullyQualifiedName());
//$NON-NLS-1$
assertEquals("java.util", fqjt.getPackageName());
assertEquals(1, fqjt.getImportList().size());
assertEquals("java.util.List", fqjt.getImportList().get(0));
//$NON-NLS-1$
assertEquals("java.util.List", fqjt.getFullyQualifiedNameWithoutTypeParameters());
}Example 27
| Project: checker-framework-master File: Issue436.java View source code |
public void makeALongFormConditionalLambdaReturningGenerics(boolean makeAll) {
// TypeArgInferenceUtil.assignedTo used to try to use the method return rather than the lambda return
// for those return statements below
Supplier<List<String>> supplier = () -> {
if (makeAll) {
return asList("beer", "peanuts");
} else {
return asList("cheese", "wine");
}
};
}Example 28
| Project: docbag-master File: TableToFOConverterTest.java View source code |
private Table createTable() {
java.util.List<Row> headRows = new ArrayList<Row>();
java.util.List<Cell> headCells = new ArrayList<Cell>();
headCells.add(new Cell("head cell 1"));
headCells.add(new Cell("head cell 2", new HashMap<String, String>(), 0, 0, ""));
headCells.add(new Cell("head cell 3"));
headRows.add(new Row(headCells));
java.util.List<Row> bodyRows = new ArrayList<Row>();
Map<String, String> style = new HashMap<String, String>();
style.put("border", "1px");
style.put("text-align", "center");
for (int i = 0; i < 100; i++) {
java.util.List<Cell> bodyCells = new ArrayList<Cell>();
bodyCells.add(new Cell("body cell 1" + i, new HashMap<String, String>(), 0, 0, ""));
bodyCells.add(new Cell("body cell 2" + i));
bodyCells.add(new Cell("body cell 3" + i, style, 0, 0, ""));
bodyRows.add(new Row(bodyCells));
}
java.util.List<Row> footRows = new ArrayList<Row>();
java.util.List<Cell> footCells = new ArrayList<Cell>();
footCells.add(new Cell("Footer"));
footRows.add(new Row(footCells));
return new Table("table1", headRows, bodyRows, footRows, false);
}Example 29
| Project: ceylon-compiler-master File: TList.java View source code |
void run() {
examples = new LinkedHashMap<java.util.List<String>, List<String>>();
for (String[] values : data) examples.put(Arrays.asList(values), createList(values));
// 6351336: com.sun.tools.javac.util.List shouldn't extend java.util.AbstractList
test_AbstractList();
// general unit tests for java.util.List methods, including...
// 6389198: com.sun.tools.javac.util.List.equals() violates java.util.List.equals() contract
test_add_E();
test_add_int_E();
test_addAll_Collection();
test_addAll_int_Collection();
test_clear();
test_contains_Object();
test_contains_All();
test_equals_Object();
test_get_int();
test_hashCode();
test_indexOf_Object();
test_isEmpty();
test_iterator();
test_lastIndexOf_Object();
test_listIterator();
test_listIterator_int();
test_remove_int();
test_remove_Object();
test_removeAll_Collection();
test_retainAll_Collection();
test_set_int_E();
test_size();
test_subList_int_int();
test_toArray();
test_toArray_TArray();
// tests for additional methods
test_prependList_List();
test_reverse();
}Example 30
| Project: DPJ-master File: TList.java View source code |
void run() {
examples = new LinkedHashMap<java.util.List<String>, List<String>>();
for (String[] values : data) examples.put(Arrays.asList(values), createList(values));
// 6351336: com.sun.tools.javac.util.List shouldn't extend java.util.AbstractList
test_AbstractList();
// general unit tests for java.util.List methods, including...
// 6389198: com.sun.tools.javac.util.List.equals() violates java.util.List.equals() contract
test_add_E();
test_add_int_E();
test_addAll_Collection();
test_addAll_int_Collection();
test_clear();
test_contains_Object();
test_contains_All();
test_equals_Object();
test_get_int();
test_hashCode();
test_indexOf_Object();
test_isEmpty();
test_iterator();
test_lastIndexOf_Object();
test_listIterator();
test_listIterator_int();
test_remove_int();
test_remove_Object();
test_removeAll_Collection();
test_retainAll_Collection();
test_set_int_E();
test_size();
test_subList_int_int();
test_toArray();
test_toArray_TArray();
// tests for additional methods
test_prependList_List();
test_reverse();
}Example 31
| Project: Funcheck-master File: TList.java View source code |
void run() {
examples = new LinkedHashMap<java.util.List<String>, List<String>>();
for (String[] values : data) examples.put(Arrays.asList(values), createList(values));
// 6351336: com.sun.tools.javac.util.List shouldn't extend java.util.AbstractList
test_AbstractList();
// general unit tests for java.util.List methods, including...
// 6389198: com.sun.tools.javac.util.List.equals() violates java.util.List.equals() contract
test_add_E();
test_add_int_E();
test_addAll_Collection();
test_addAll_int_Collection();
test_clear();
test_contains_Object();
test_contains_All();
test_equals_Object();
test_get_int();
test_hashCode();
test_indexOf_Object();
test_isEmpty();
test_iterator();
test_lastIndexOf_Object();
test_listIterator();
test_listIterator_int();
test_remove_int();
test_remove_Object();
test_removeAll_Collection();
test_retainAll_Collection();
test_set_int_E();
test_size();
test_subList_int_int();
test_toArray();
test_toArray_TArray();
// tests for additional methods
test_prependList_List();
test_reverse();
}Example 32
| Project: javappp-master File: TList.java View source code |
void run() {
examples = new LinkedHashMap<java.util.List<String>, List<String>>();
for (String[] values : data) examples.put(Arrays.asList(values), createList(values));
// 6351336: com.sun.tools.javac.util.List shouldn't extend java.util.AbstractList
test_AbstractList();
// general unit tests for java.util.List methods, including...
// 6389198: com.sun.tools.javac.util.List.equals() violates java.util.List.equals() contract
test_add_E();
test_add_int_E();
test_addAll_Collection();
test_addAll_int_Collection();
test_clear();
test_contains_Object();
test_contains_All();
test_equals_Object();
test_get_int();
test_hashCode();
test_indexOf_Object();
test_isEmpty();
test_iterator();
test_lastIndexOf_Object();
test_listIterator();
test_listIterator_int();
test_remove_int();
test_remove_Object();
test_removeAll_Collection();
test_retainAll_Collection();
test_set_int_E();
test_size();
test_subList_int_int();
test_toArray();
test_toArray_TArray();
// tests for additional methods
test_prependList_List();
test_reverse();
}Example 33
| Project: jdk7u-langtools-master File: TList.java View source code |
void run() {
examples = new LinkedHashMap<java.util.List<String>, List<String>>();
for (String[] values : data) examples.put(Arrays.asList(values), createList(values));
// 6351336: com.sun.tools.javac.util.List shouldn't extend java.util.AbstractList
test_AbstractList();
// general unit tests for java.util.List methods, including...
// 6389198: com.sun.tools.javac.util.List.equals() violates java.util.List.equals() contract
test_add_E();
test_add_int_E();
test_addAll_Collection();
test_addAll_int_Collection();
test_clear();
test_contains_Object();
test_contains_All();
test_equals_Object();
test_get_int();
test_hashCode();
test_indexOf_Object();
test_isEmpty();
test_iterator();
test_lastIndexOf_Object();
test_listIterator();
test_listIterator_int();
test_remove_int();
test_remove_Object();
test_removeAll_Collection();
test_retainAll_Collection();
test_set_int_E();
test_size();
test_subList_int_int();
test_toArray();
test_toArray_TArray();
// tests for additional methods
test_prependList_List();
test_reverse();
}Example 34
| Project: jsr308-langtools-master File: TList.java View source code |
void run() {
examples = new LinkedHashMap<java.util.List<String>, List<String>>();
for (String[] values : data) examples.put(Arrays.asList(values), createList(values));
// 6351336: com.sun.tools.javac.util.List shouldn't extend java.util.AbstractList
test_AbstractList();
// general unit tests for java.util.List methods, including...
// 6389198: com.sun.tools.javac.util.List.equals() violates java.util.List.equals() contract
test_add_E();
test_add_int_E();
test_addAll_Collection();
test_addAll_int_Collection();
test_clear();
test_contains_Object();
test_contains_All();
test_equals_Object();
test_get_int();
test_hashCode();
test_indexOf_Object();
test_isEmpty();
test_iterator();
test_lastIndexOf_Object();
test_listIterator();
test_listIterator_int();
test_remove_int();
test_remove_Object();
test_removeAll_Collection();
test_retainAll_Collection();
test_set_int_E();
test_size();
test_subList_int_int();
test_toArray();
test_toArray_TArray();
// tests for additional methods
test_prependList_List();
test_reverse();
}Example 35
| Project: ManagedRuntimeInitiative-master File: TList.java View source code |
void run() {
examples = new LinkedHashMap<java.util.List<String>, List<String>>();
for (String[] values : data) examples.put(Arrays.asList(values), createList(values));
// 6351336: com.sun.tools.javac.util.List shouldn't extend java.util.AbstractList
test_AbstractList();
// general unit tests for java.util.List methods, including...
// 6389198: com.sun.tools.javac.util.List.equals() violates java.util.List.equals() contract
test_add_E();
test_add_int_E();
test_addAll_Collection();
test_addAll_int_Collection();
test_clear();
test_contains_Object();
test_contains_All();
test_equals_Object();
test_get_int();
test_hashCode();
test_indexOf_Object();
test_isEmpty();
test_iterator();
test_lastIndexOf_Object();
test_listIterator();
test_listIterator_int();
test_remove_int();
test_remove_Object();
test_removeAll_Collection();
test_retainAll_Collection();
test_set_int_E();
test_size();
test_subList_int_int();
test_toArray();
test_toArray_TArray();
// tests for additional methods
test_prependList_List();
test_reverse();
}Example 36
| Project: openjdk-master File: TList.java View source code |
void run() {
examples = new LinkedHashMap<java.util.List<String>, List<String>>();
for (String[] values : data) examples.put(Arrays.asList(values), createList(values));
// 6351336: com.sun.tools.javac.util.List shouldn't extend java.util.AbstractList
test_AbstractList();
// general unit tests for java.util.List methods, including...
// 6389198: com.sun.tools.javac.util.List.equals() violates java.util.List.equals() contract
test_add_E();
test_add_int_E();
test_addAll_Collection();
test_addAll_int_Collection();
test_clear();
test_contains_Object();
test_contains_All();
test_equals_Object();
test_get_int();
test_hashCode();
test_indexOf_Object();
test_isEmpty();
test_iterator();
test_lastIndexOf_Object();
test_listIterator();
test_listIterator_int();
test_remove_int();
test_remove_Object();
test_removeAll_Collection();
test_retainAll_Collection();
test_set_int_E();
test_size();
test_subList_int_int();
test_toArray();
test_toArray_TArray();
// tests for additional methods
test_prependList_List();
test_reverse();
}Example 37
| Project: OpenJML-master File: TList.java View source code |
void run() {
examples = new LinkedHashMap<java.util.List<String>, List<String>>();
for (String[] values : data) examples.put(Arrays.asList(values), createList(values));
// 6351336: com.sun.tools.javac.util.List shouldn't extend java.util.AbstractList
test_AbstractList();
// general unit tests for java.util.List methods, including...
// 6389198: com.sun.tools.javac.util.List.equals() violates java.util.List.equals() contract
test_add_E();
test_add_int_E();
test_addAll_Collection();
test_addAll_int_Collection();
test_clear();
test_contains_Object();
test_contains_All();
test_equals_Object();
test_get_int();
test_hashCode();
test_indexOf_Object();
test_isEmpty();
test_iterator();
test_lastIndexOf_Object();
test_listIterator();
test_listIterator_int();
test_remove_int();
test_remove_Object();
test_removeAll_Collection();
test_retainAll_Collection();
test_set_int_E();
test_size();
test_subList_int_int();
test_toArray();
test_toArray_TArray();
// tests for additional methods
test_prependList_List();
test_reverse();
}Example 38
| Project: kaa-master File: NotificationSyncRequest.java View source code |
// Used by DatumReader. Applications should not call.
@SuppressWarnings(value = "unchecked")
public void put(int field$, java.lang.Object value$) {
switch(field$) {
case 0:
topicListHash = (java.lang.Integer) value$;
break;
case 1:
topicStates = (java.util.List<org.kaaproject.kaa.common.endpoint.gen.TopicState>) value$;
break;
case 2:
acceptedUnicastNotifications = (java.util.List<java.lang.String>) value$;
break;
case 3:
subscriptionCommands = (java.util.List<org.kaaproject.kaa.common.endpoint.gen.SubscriptionCommand>) value$;
break;
default:
throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}Example 39
| Project: codegen-master File: TypeTest.java View source code |
@Test
public void GetGenericNameBoolean() {
assertEquals("java.util.Locale", locale.getGenericName(true));
assertEquals("java.util.Locale", locale2.getGenericName(true));
assertEquals("java.util.List<String>", stringList.getGenericName(true));
assertEquals("java.util.List<String>", stringList2.getGenericName(true));
assertEquals("java.util.Map<String, String>", stringMap.getGenericName(true));
assertEquals("java.util.Map<String, String>", stringMap2.getGenericName(true));
assertEquals("String", string.getGenericName(true));
assertEquals("String", string2.getGenericName(true));
}Example 40
| Project: teiid-designer-master File: EAnnotationContentsMatcher.java View source code |
/**
* @see org.teiid.designer.core.compare.EObjectMatcher#addMappings(org.eclipse.emf.ecore.EReference, java.util.List, java.util.List, org.eclipse.emf.mapping.Mapping, org.eclipse.emf.mapping.MappingFactory)
*/
@Override
public void addMappings(final EReference reference, final List inputs, final List outputs, final Mapping mapping, final MappingFactory factory) {
// Handle only the trivial case
if (inputs.size() == 1 && outputs.size() == 1) {
final EObject input = (EObject) inputs.get(0);
final EObject output = (EObject) outputs.get(0);
inputs.clear();
outputs.clear();
addMapping(input, output, mapping, factory);
}
}Example 41
| Project: roaster-master File: TypesTest.java View source code |
@Test
public void testArray() {
assertTrue(Types.isArray("byte[]"));
assertTrue(Types.isArray("java.lang.Boolean[]"));
assertTrue(Types.isArray("java.util.Vector[]"));
assertTrue(Types.isArray(byte[].class.getName()));
assertTrue(Types.isArray(Boolean[].class.getName()));
assertTrue(Types.isArray(Types[].class.getName()));
assertTrue(Types.isArray("Map<String,List<Long>>[]"));
assertEquals("byte", Types.stripArray(byte[].class.getSimpleName()));
assertEquals("Boolean", Types.stripArray(Boolean[].class.getSimpleName()));
assertEquals("Vector", Types.stripArray(Vector[].class.getSimpleName()));
assertEquals("byte", Types.stripArray(byte[].class.getName()));
assertEquals("java.lang.Boolean", Types.stripArray(Boolean[].class.getName()));
assertEquals("java.util.Vector", Types.stripArray(Vector[].class.getName()));
assertEquals("java.util.Map<org.foo.String[],T>", Types.stripArray("java.util.Map<org.foo.String[],T>[]"));
assertEquals("int", Types.stripArray(int[][][][][].class.getName()));
assertEquals("int", Types.stripArray(int[][][][][].class.getSimpleName()));
assertEquals("List<Long>", Types.stripArray("List<Long>[]"));
assertEquals("java.lang.Class<?>", Types.stripArray("java.lang.Class<?>[]"));
assertEquals("java.lang.Class<T>", Types.stripArray("java.lang.Class<T>[]"));
assertEquals("java.lang.Class<LONG_TYPE_VARIABLE_NAME>", Types.stripArray("java.lang.Class<LONG_TYPE_VARIABLE_NAME>[]"));
assertEquals("java.lang.Class<? extends Number>", Types.stripArray("java.lang.Class<? extends Number>[]"));
assertEquals("java.lang.Class<E extends Enum<E>>", Types.stripArray("java.lang.Class<E extends Enum<E>>[]"));
assertEquals("java.util.Map<org.Foo.MyEnum<T>,java.lang.Object>", Types.stripArray("java.util.Map<org.Foo.MyEnum<T>,java.lang.Object>[][]"));
}Example 42
| Project: gluster-ovirt-poc-master File: SanStorageModel.java View source code |
private void ClearItems() {
if (getItems() == null) {
return;
}
if (getIsGrouppedByTarget()) {
java.util.List<SanTargetModel> items = (java.util.List<SanTargetModel>) getItems();
for (SanTargetModel target : Linq.ToList(items)) {
boolean found = false;
//Ensure remove targets that are not in last dicovered targets list.
if (Linq.FirstOrDefault(lastDiscoveredTargets, new Linq.TargetPredicate(target)) != null) {
found = true;
} else {
//Ensure remove targets that are not contain already included LUNs.
for (LunModel lun : target.getLuns()) {
LunModel foundItem = Linq.FirstOrDefault(includedLUNs, new Linq.LunPredicate(lun));
if (foundItem == null) {
found = true;
break;
}
}
}
if (!found) {
items.remove(target);
}
}
} else {
java.util.List<LunModel> items = (java.util.List<LunModel>) getItems();
//Ensure remove targets that are not contain already included LUNs.
for (LunModel lun : Linq.ToList(items)) {
LunModel foundItem = Linq.FirstOrDefault(includedLUNs, new Linq.LunPredicate(lun));
if (foundItem == null) {
items.remove(lun);
}
}
}
}Example 43
| Project: FreeBuilder-master File: ModelTest.java View source code |
@Test
public void typeMirror_string_nestedGenericType() {
TypeMirror t1 = model.typeMirror("java.util.Map<String,java.util.List<Integer>>");
assertEquals("java.util.Map<java.lang.String,java.util.List<java.lang.Integer>>", t1.toString());
TypeMirror t2 = model.typeMirror("java.util.Map<String,java.util.List<Integer>>");
assertTrue("Same type", model.typeUtils().isSameType(t1, t2));
}Example 44
| Project: axis2-java-master File: ParameterParsingTests.java View source code |
public void testNonHolderGenric() {
String inputString = "java.util.List<org.apache.axis2.jaxws.description.builder.MyObject>";
ParameterDescriptionComposite pdc = new ParameterDescriptionComposite();
pdc.setParameterType(inputString);
assertEquals("java.util.List<org.apache.axis2.jaxws.description.builder.MyObject>", pdc.getParameterType());
assertFalse(pdc.isHolderType());
String genericType = pdc.getRawType();
assertEquals("java.util.List", genericType);
assertEquals(java.util.List.class, pdc.getParameterTypeClass());
// This should be null since the generic is not a Holder type
String actualParam = pdc.getHolderActualType();
assertNull(actualParam);
assertNull(pdc.getHolderActualTypeClass());
}Example 45
| Project: fragmentargs-master File: CastedArrayListArgsBundler.java View source code |
@Override public void put(String key, List<? extends Parcelable> value, Bundle bundle) { if (!(value instanceof ArrayList)) { throw new ClassCastException("CastedArrayListArgsBundler assumes that the List is instance of ArrayList, but it's instance of " + value.getClass().getCanonicalName()); } bundle.putParcelableArrayList(key, (ArrayList<? extends Parcelable>) value); }
Example 46
| Project: aws-sdk-android-master File: DescribeImagesRequestMarshaller.java View source code |
public Request<DescribeImagesRequest> marshall(DescribeImagesRequest describeImagesRequest) {
if (describeImagesRequest == null) {
throw new AmazonClientException("Invalid argument passed to marshall(...)");
}
Request<DescribeImagesRequest> request = new DefaultRequest<DescribeImagesRequest>(describeImagesRequest, "AmazonEC2");
request.addParameter("Action", "DescribeImages");
request.addParameter("Version", "2015-10-01");
java.util.List<String> imageIdsList = describeImagesRequest.getImageIds();
int imageIdsListIndex = 1;
for (String imageIdsListValue : imageIdsList) {
if (imageIdsListValue != null) {
request.addParameter("ImageId." + imageIdsListIndex, StringUtils.fromString(imageIdsListValue));
}
imageIdsListIndex++;
}
java.util.List<String> ownersList = describeImagesRequest.getOwners();
int ownersListIndex = 1;
for (String ownersListValue : ownersList) {
if (ownersListValue != null) {
request.addParameter("Owner." + ownersListIndex, StringUtils.fromString(ownersListValue));
}
ownersListIndex++;
}
java.util.List<String> executableUsersList = describeImagesRequest.getExecutableUsers();
int executableUsersListIndex = 1;
for (String executableUsersListValue : executableUsersList) {
if (executableUsersListValue != null) {
request.addParameter("ExecutableBy." + executableUsersListIndex, StringUtils.fromString(executableUsersListValue));
}
executableUsersListIndex++;
}
java.util.List<Filter> filtersList = describeImagesRequest.getFilters();
int filtersListIndex = 1;
for (Filter filtersListValue : filtersList) {
Filter filterMember = filtersListValue;
if (filterMember != null) {
if (filterMember.getName() != null) {
request.addParameter("Filter." + filtersListIndex + ".Name", StringUtils.fromString(filterMember.getName()));
}
java.util.List<String> valuesList = filterMember.getValues();
int valuesListIndex = 1;
for (String valuesListValue : valuesList) {
if (valuesListValue != null) {
request.addParameter("Filter." + filtersListIndex + ".Value." + valuesListIndex, StringUtils.fromString(valuesListValue));
}
valuesListIndex++;
}
}
filtersListIndex++;
}
return request;
}Example 47
| Project: jOOQ-master File: DefaultSchema.java View source code |
private final java.util.List<org.jooq.Table<?>> getTables0() {
return java.util.Arrays.<org.jooq.Table<?>>asList(org.jooq.util.firebird.rdb.tables.Rdb$fields.RDB$FIELDS, org.jooq.util.firebird.rdb.tables.Rdb$generators.RDB$GENERATORS, org.jooq.util.firebird.rdb.tables.Rdb$indexSegments.RDB$INDEX_SEGMENTS, org.jooq.util.firebird.rdb.tables.Rdb$procedures.RDB$PROCEDURES, org.jooq.util.firebird.rdb.tables.Rdb$procedureParameters.RDB$PROCEDURE_PARAMETERS, org.jooq.util.firebird.rdb.tables.Rdb$refConstraints.RDB$REF_CONSTRAINTS, org.jooq.util.firebird.rdb.tables.Rdb$relations.RDB$RELATIONS, org.jooq.util.firebird.rdb.tables.Rdb$relationConstraints.RDB$RELATION_CONSTRAINTS, org.jooq.util.firebird.rdb.tables.Rdb$relationFields.RDB$RELATION_FIELDS);
}Example 48
| Project: beast-mcmc-master File: ChannelColorScheme.java View source code |
public Color getColor(java.util.List<Double> input, java.util.List<Double> min, java.util.List<Double> max) { java.util.List<Color> colors = new ArrayList<Color>(); // assumes the same length as input, min, max final int channels = schemes.length; for (int i = 0; i < channels; ++i) { colors.add(schemes[i].getColor(input.get(i), min.get(i), max.get(i))); } return blend(colors); }
Example 49
| Project: HBaseToolbox-master File: AvroPolyline.java View source code |
// Used by DatumReader. Applications should not call.
@SuppressWarnings(value = "unchecked")
public void put(int field$, java.lang.Object value$) {
switch(field$) {
case 0:
spatialReference = (com.esri.AvroSpatialReference) value$;
break;
case 1:
paths = (java.util.List<java.util.List<com.esri.AvroCoord>>) value$;
break;
default:
throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}Example 50
| Project: kaif-android-master File: RetrofitServiceMethodTest.java View source code |
@Test
public void generateCodeWithRetryStaleIfRequired_annotations() throws Exception {
List<MethodSpec> methodSpecs = singleMethodInfo(Foo4.class).generateCodeWithRetryStaleIfRequired();
assertEquals("@retrofit.http.GET(\"/hoge\")\n" + "@retrofit.http.Headers({\n" + " \"A: B\",\n" + " \"C: D\"\n" + "})\n" + "public abstract java.util.List<java.lang.String> bar(java.util.List<java.lang.String> arg0, @retrofit.http.Query(\"bar\") int arg1);", methodSpecs.get(0).toString().trim());
}Example 51
| Project: Kite-master File: ArrayInUnionTestRecord.java View source code |
// Used by DatumReader. Applications should not call.
@Override
@SuppressWarnings(value = "unchecked")
public void put(final int field$, final java.lang.Object value$) {
switch(field$) {
case 0:
items = (java.util.List<java.lang.String>) value$;
break;
case 1:
itemsInUnion = (java.util.List<java.lang.String>) value$;
break;
default:
throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}Example 52
| Project: mdk-master File: DocGenViewDBSwitch.java View source code |
@Override
public DocumentElement caseTable(Table object) {
DBTable res = new DBTable();
java.util.List<java.util.List<DocumentElement>> headers = new java.util.ArrayList<java.util.List<DocumentElement>>();
java.util.List<java.util.List<DocumentElement>> body = new java.util.ArrayList<java.util.List<DocumentElement>>();
if (object.getBody() != null) {
for (TableRow row : object.getBody()) {
java.util.List<DocumentElement> newrow = new java.util.ArrayList<DocumentElement>();
body.add(newrow);
for (ViewElement ve : row.getChildren()) {
newrow.add(this.doSwitch(ve));
}
}
}
if (object.getHeaders() != null) {
for (TableRow row : object.getHeaders()) {
java.util.List<DocumentElement> newrow = new java.util.ArrayList<DocumentElement>();
headers.add(newrow);
for (ViewElement ve : row.getChildren()) {
newrow.add(this.doSwitch(ve));
}
}
}
res.setBody(body);
res.setHeaders(headers);
res.setCaption(object.getCaption());
if (object.getCols() == 0) {
int max = 0;
for (java.util.List<DocumentElement> row : body) {
if (row.size() > max) {
max = row.size();
}
}
res.setCols(max);
} else {
res.setCols(object.getCols());
}
if (object.getColspecs() != null) {
java.util.List<DBColSpec> colspecs = new java.util.ArrayList<DBColSpec>();
for (ColSpec cs : object.getColspecs()) {
colspecs.add((DBColSpec) this.doSwitch(cs));
}
res.setColspecs(colspecs);
}
setVe(object, res);
return res;
}Example 53
| Project: mobicents-master File: SimpleSingletonElector.java View source code |
/* (non-Javadoc) * @see org.mobicents.ftf.election.SingletonElector#elect(java.util.List) */ public Address elect(List<Address> list) { //FIXME: add something better Collections.sort(list, new Comparator<Address>() { public int compare(Address o1, Address o2) { if (o1 == null) { return -1; } if (o2 == null) { return 1; } if (o1 == o2) { return 0; } return o1.toString().compareTo(o2.toString()); } }); return list.get(0); }
Example 54
| Project: openmrs-core-master File: HibernateObsDAOTest.java View source code |
/** * @see org.openmrs.api.db.hibernate.HibernateObsDAO#getObservations(java.util.List, java.util.List, java.util.List, java.util.List, java.util.List, java.util.List, java.util.List, Integer, Integer, java.util.Date, java.util.Date, boolean) */ @Test public void getObservations_shouldBeOrderedCorrectly() { Session session = sessionFactory.getCurrentSession(); List<Obs> obsListActual; List<Obs> obsListExpected; //Order by id desc obsListExpected = session.createCriteria(Obs.class, "obs").addOrder(Order.desc("id")).list(); obsListActual = dao.getObservations(null, null, null, null, null, null, Arrays.asList("id"), null, null, null, null, false, null); Assert.assertArrayEquals(obsListExpected.toArray(), obsListActual.toArray()); obsListActual = dao.getObservations(null, null, null, null, null, null, Arrays.asList("id desc"), null, null, null, null, false, null); Assert.assertArrayEquals(obsListExpected.toArray(), obsListActual.toArray()); //Order by id asc obsListExpected = session.createCriteria(Obs.class, "obs").addOrder(Order.asc("id")).list(); obsListActual = dao.getObservations(null, null, null, null, null, null, Arrays.asList("id asc"), null, null, null, null, false, null); Assert.assertArrayEquals(obsListExpected.toArray(), obsListActual.toArray()); //Order by person_id asc and id desc obsListExpected = session.createCriteria(Obs.class, "obs").addOrder(Order.asc("person.id")).addOrder(Order.desc("id")).list(); obsListActual = dao.getObservations(null, null, null, null, null, null, Arrays.asList("person.id asc", "id"), null, null, null, null, false, null); Assert.assertArrayEquals(obsListExpected.toArray(), obsListActual.toArray()); //Order by person_id asc and id asc obsListExpected = session.createCriteria(Obs.class, "obs").addOrder(Order.asc("person.id")).addOrder(Order.asc("id")).list(); obsListActual = dao.getObservations(null, null, null, null, null, null, Arrays.asList("person.id asc", "id asc"), null, null, null, null, false, null); Assert.assertArrayEquals(obsListExpected.toArray(), obsListActual.toArray()); }
Example 55
| Project: rapid-framework-master File: SqlParameterTest.java View source code |
public void test_toListParam_listParam_true() {
p.setListParam(true);
p.setParameterClass("Long");
assertEquals(p.getPreferredParameterJavaType(), "java.util.List<Long>");
p.setParameterClass("long");
assertEquals(p.getPreferredParameterJavaType(), "java.util.List<Long>");
p.setParameterClass("java.lang.Set");
assertEquals(p.getPreferredParameterJavaType(), "java.lang.Set");
p.setParameterClass("String[]");
assertEquals(p.getPreferredParameterJavaType(), "String[]");
}Example 56
| Project: SerializableParcelableGenerator-master File: ParcelableListSerializerFactory.java View source code |
@Override
public TypeSerializer getSerializer(PsiType psiType) {
if (PsiUtils.isTypedClass(psiType, "java.util.List", "blue.stack.serializableParcelable.IParcelable")) {
return mSPSerializer;
}
// There might actually be a way to do this w/ a Collection, but it might not be order-safe
if (PsiUtils.isTypedClass(psiType, "java.util.List", "android.os.Parcelable")) {
return mSerializer;
}
return null;
}Example 57
| Project: smooks-master File: TokenizedStringParameterDecoderTest.java View source code |
/*
* Class under test for Object decodeValue(String)
*/
@Test
public void testDecodeValue_string_list() {
Collection collection = getParameter("string-list", "a,b,c,d ,");
assertTrue("Expected to get back a java.util.List parameter", (collection instanceof List));
List paramsList = (List) collection;
assertTrue("Expected java.util.List to contain value.", paramsList.contains("a"));
assertTrue("Expected java.util.List to contain value.", paramsList.contains("b"));
assertTrue("Expected java.util.List to contain value.", paramsList.contains("c"));
assertTrue("Expected java.util.List to contain value.", paramsList.contains("d"));
assertFalse("Expected java.util.List to NOT contain value.", paramsList.contains("e"));
}Example 58
| Project: sonar-java-master File: SimpleClassNameCheckWithWildCard.java View source code |
void wildcardImport() {
java.util.List<String> // If we remove java.util.List, the code won't compile, because of the ambiguity with java.awt.List.
myList = new java.util.ArrayList<String>();
com.google.common.collect.ImmutableMap map;
// OK
java.awt.image.ImageProducer x;
java.nio.charset.Charset.defaultCharset().name();
}Example 59
| Project: Tstream-master File: UnanchoredSend.java View source code |
public static void send(TopologyContext topologyContext, TaskSendTargets taskTargets, TaskTransfer transfer_fn, String stream, List<Object> values) { java.util.List<Integer> tasks = taskTargets.get(stream, values); if (tasks.size() == 0) { return; } Integer taskId = topologyContext.getThisTaskId(); for (Integer task : tasks) { TupleImplExt tup = new TupleImplExt(topologyContext, values, taskId, stream); tup.setTargetTaskId(task); transfer_fn.transfer(tup); } }
Example 60
| Project: vertx-codegen-master File: HelperTest.java View source code |
@Test
public void testResolveMethodSignature() throws Exception {
Utils.assertProcess(( processingEnv, roundEnv) -> {
assertSignature(processingEnv, "java.util.Locale#createConstant", "java.util.Locale", "createConstant", "java.lang.String", "java.lang.String");
assertSignature(processingEnv, "java.util.Locale#createConstant(String,String)", "java.util.Locale", "createConstant", "java.lang.String", "java.lang.String");
assertSignature(processingEnv, "java.util.Locale#createConstant(java.lang.String,java.lang.String)", "java.util.Locale", "createConstant", "java.lang.String", "java.lang.String");
assertSignature(processingEnv, "java.util.List#containsAll", "java.util.List", "containsAll", "java.util.Collection<?>");
assertSignature(processingEnv, "java.util.List#containsAll(Collection)", "java.util.List", "containsAll", "java.util.Collection<?>");
assertSignature(processingEnv, "java.util.List#containsAll(java.util.Collection)", "java.util.List", "containsAll", "java.util.Collection<?>");
assertSignature(processingEnv, "java.util.List#get", "java.util.List", "get", "int");
assertSignature(processingEnv, "java.util.List#get(int)", "java.util.List", "get", "int");
assertSignature(processingEnv, "java.util.List#toArray(Object[])", "java.util.List", "toArray", "T[]");
});
}Example 61
| Project: vnTagger-master File: PlainOutputer.java View source code |
/* (non-Javadoc) * @see vn.hus.nlp.tagger.io.IOutputer#output(java.util.List) */ public String output(List<WordTag> list) { StringBuffer result = new StringBuffer(1024); for (WordTag wordTag : list) { result.append(wordTag.word()); result.append(IConstants.DELIM); result.append(wordTag.tag()); result.append(" "); } result.append("\n"); return result.toString(); }
Example 62
| Project: wonder-master File: _Gallery.java View source code |
public static Gallery fetchOne(ObjectContext oc, Expression expression) {
java.util.List<Gallery> objects = fetch(oc, expression);
Gallery obj;
int count = objects.size();
if (count == 0) {
obj = null;
} else if (count == 1) {
obj = objects.get(0);
} else {
throw new IllegalStateException("There was more than one Gallery that matched the qualifier '" + expression + "'.");
}
return obj;
}Example 63
| Project: wss4j-master File: ResultsOrderTest.java View source code |
/**
*/
@Test
public void testOrder() throws Exception {
CustomHandler handler = new CustomHandler();
java.util.List<WSSecurityEngineResult> results = new java.util.ArrayList<WSSecurityEngineResult>();
results.add(new WSSecurityEngineResult(WSConstants.UT));
results.add(new WSSecurityEngineResult(WSConstants.TS));
results.add(new WSSecurityEngineResult(WSConstants.SC));
results.add(new WSSecurityEngineResult(WSConstants.SIGN));
java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
actions.add(WSConstants.UT);
actions.add(WSConstants.TS);
actions.add(WSConstants.SIGN);
assertTrue(handler.checkResults(results, actions));
assertTrue(handler.checkResultsAnyOrder(results, actions));
}Example 64
| Project: xmind-master File: CheckOpenFilesProcess.java View source code |
/*
* (non-Javadoc)
*
* @see
* org.xmind.cathy.internal.jobs.OpenFilesJob#filterFilesToOpen(java.util
* .List, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
protected void filterFilesToOpen(List<String> filesToOpen) {
Log opening = Log.get(Log.OPENING);
if (opening.exists()) {
String[] contents = opening.getContents();
for (String line : contents) {
if (line.startsWith("xmind:") || new File(line).exists()) {
//$NON-NLS-1$
filesToOpen.add(line);
}
}
opening.delete();
}
}Example 65
| Project: xmind-source-master File: CheckOpenFilesJob.java View source code |
/*
* (non-Javadoc)
*
* @see
* org.xmind.cathy.internal.jobs.OpenFilesJob#filterFilesToOpen(java.util
* .List, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
protected void filterFilesToOpen(List<String> filesToOpen, IProgressMonitor monitor) {
monitor.beginTask(WorkbenchMessages.CheckOpenFilesJob_CheckFiles_name, 1);
Log opening = Log.get(Log.OPENING);
if (opening.exists()) {
String[] contents = opening.getContents();
for (String line : contents) {
if (!line.startsWith("-")) {
//$NON-NLS-1$
filesToOpen.add(line);
}
}
opening.delete();
}
monitor.done();
}Example 66
| Project: xmind3-master File: CheckOpenFilesJob.java View source code |
/*
* (non-Javadoc)
*
* @see
* org.xmind.cathy.internal.jobs.OpenFilesJob#filterFilesToOpen(java.util
* .List, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
protected void filterFilesToOpen(List<String> filesToOpen, IProgressMonitor monitor) {
monitor.beginTask(WorkbenchMessages.CheckOpenFilesJob_CheckFiles_name, 1);
Log opening = Log.get(Log.OPENING);
if (opening.exists()) {
String[] contents = opening.getContents();
for (String line : contents) {
if (!line.startsWith("-")) {
//$NON-NLS-1$
filesToOpen.add(line);
}
}
opening.delete();
}
monitor.done();
}Example 67
| Project: datanucleus-core-master File: AbstractLazyLoadList.java View source code |
public Object[] toArray(Object[] a) {
if (a == null) {
// Throw NPE as per javadoc
throw new NullPointerException("null argument is illegal!");
}
Object[] array = a;
int ourSize = size();
if (a.length < ourSize) {
// java.util.List.toArray() : If the input array isn't big enough, then allocate one
array = new Object[size()];
}
for (int i = 0; i < ourSize; i++) {
if (itemsByIndex != null && itemsByIndex.containsKey(i)) {
array[i] = itemsByIndex.get(i);
} else {
array[i] = retrieveObjectForIndex(i);
}
}
return array;
}Example 68
| Project: whatstodo-master File: ListSynchronizer.java View source code |
public List getList(long listId) throws SynchronizationException { try { String URL = baseURL + "/" + user + "/" + listId; JsonElement receivedJson = HttpClient.sendHttpGet(URL); List list = null; if (!receivedJson.isJsonNull()) { ListDTO dto = gson.fromJson(receivedJson, ListDTO.class); list = List.fromDTO(dto); } return list; } catch (Exception e) { throw new SynchronizationException(e); } }
Example 69
| Project: nodeclipse-1-master File: GeneratedToolsProtocolParser.java View source code |
@Override public java.util.List<java.util.List<java.lang.Object>> asListTabsData() throws org.chromium.sdk.internal.protocolparser.JsonProtocolParseException { java.util.List<java.util.List<java.lang.Object>> result = lazyCachedField_0.get(); if (result != null) { return result; } if (underlying instanceof org.json.simple.JSONArray == false) { throw new org.chromium.sdk.internal.protocolparser.JsonProtocolParseException("Array value expected"); } final org.json.simple.JSONArray arrayValue1 = (org.json.simple.JSONArray) underlying; int size2 = arrayValue1.size(); java.util.List<java.util.List<java.lang.Object>> list3 = new java.util.ArrayList<java.util.List<java.lang.Object>>(size2); for (int index4 = 0; index4 < size2; index4++) { if (arrayValue1.get(index4) instanceof org.json.simple.JSONArray == false) { throw new org.chromium.sdk.internal.protocolparser.JsonProtocolParseException("Array value expected"); } final org.json.simple.JSONArray arrayValue6 = (org.json.simple.JSONArray) arrayValue1.get(index4); int size7 = arrayValue6.size(); java.util.List<java.lang.Object> list8 = new java.util.ArrayList<java.lang.Object>(size7); for (int index9 = 0; index9 < size7; index9++) { java.lang.Object arrayComponent10 = (java.lang.Object) arrayValue6.get(index9); list8.add(arrayComponent10); } java.util.List<java.lang.Object> arrayComponent5 = java.util.Collections.unmodifiableList(list8); list3.add(arrayComponent5); } java.util.List<java.util.List<java.lang.Object>> parseResult0 = java.util.Collections.unmodifiableList(list3); if (parseResult0 != null) { lazyCachedField_0.compareAndSet(null, parseResult0); java.util.List<java.util.List<java.lang.Object>> cachedResult = lazyCachedField_0.get(); parseResult0 = cachedResult; } return parseResult0; }
Example 70
| Project: javaslang-master File: JavaConvertersTest.java View source code |
@SuppressWarnings("unchecked")
@Parameterized.Parameters(name = "{index}: {0} [{2}]")
public static java.util.Collection<Object[]> data() {
return asList(new Object[][] { // -- immutable classes
{ "java.util.Arrays$ArrayList", new ListFactory(java.util.Arrays::asList), IMMUTABLE, GENERIC, NULLABLE }, { Array.class.getName(), new ListFactory( ts -> Array.of(ts).asJava()), IMMUTABLE, GENERIC, NULLABLE }, { CharSeq.class.getName(), new ListFactory( ts -> (java.util.List<Object>) (Object) CharSeq.ofAll((List<Character>) (Object) (List.of(ts))).asJava()), IMMUTABLE, FIXED, NON_NULLABLE }, { List.class.getName(), new ListFactory( ts -> List.of(ts).asJava()), IMMUTABLE, GENERIC, NULLABLE }, { Queue.class.getName(), new ListFactory( ts -> Queue.of(ts).asJava()), IMMUTABLE, GENERIC, NULLABLE }, { Stream.class.getName(), new ListFactory( ts -> Stream.of(ts).asJava()), IMMUTABLE, GENERIC, NULLABLE }, { Vector.class.getName(), new ListFactory( ts -> Vector.of(ts).asJava()), IMMUTABLE, GENERIC, NULLABLE }, // -- mutable classes
{ java.util.ArrayList.class.getName(), new ListFactory( ts -> {
final java.util.List<Object> list = new java.util.ArrayList<>();
java.util.Collections.addAll(list, ts);
return list;
}), MUTABLE, GENERIC, NULLABLE }, { Array.class.getName(), new ListFactory( ts -> Array.of(ts).asJavaMutable()), MUTABLE, GENERIC, NULLABLE }, { CharSeq.class.getName(), new ListFactory( ts -> (java.util.List<Object>) (Object) CharSeq.ofAll((List<Character>) (Object) (List.of(ts))).asJavaMutable()), MUTABLE, FIXED, NON_NULLABLE }, { List.class.getName(), new ListFactory( ts -> List.of(ts).asJavaMutable()), MUTABLE, GENERIC, NULLABLE }, { Queue.class.getName(), new ListFactory( ts -> Queue.of(ts).asJavaMutable()), MUTABLE, GENERIC, NULLABLE }, { Stream.class.getName(), new ListFactory( ts -> Stream.of(ts).asJavaMutable()), MUTABLE, GENERIC, NULLABLE }, { Vector.class.getName(), new ListFactory( ts -> Vector.of(ts).asJavaMutable()), MUTABLE, GENERIC, NULLABLE } });
}Example 71
| Project: vavr-master File: JavaConvertersTest.java View source code |
@SuppressWarnings("unchecked")
@Parameterized.Parameters(name = "{index}: {0} [{2}]")
public static java.util.Collection<Object[]> data() {
return asList(new Object[][] { // -- immutable classes
{ "java.util.Arrays$ArrayList", new ListFactory(java.util.Arrays::asList), IMMUTABLE, GENERIC, NULLABLE }, { Array.class.getName(), new ListFactory( ts -> Array.of(ts).asJava()), IMMUTABLE, GENERIC, NULLABLE }, { CharSeq.class.getName(), new ListFactory( ts -> (java.util.List<Object>) (Object) CharSeq.ofAll((List<Character>) (Object) (List.of(ts))).asJava()), IMMUTABLE, FIXED, NON_NULLABLE }, { List.class.getName(), new ListFactory( ts -> List.of(ts).asJava()), IMMUTABLE, GENERIC, NULLABLE }, { Queue.class.getName(), new ListFactory( ts -> Queue.of(ts).asJava()), IMMUTABLE, GENERIC, NULLABLE }, { Stream.class.getName(), new ListFactory( ts -> Stream.of(ts).asJava()), IMMUTABLE, GENERIC, NULLABLE }, { Vector.class.getName(), new ListFactory( ts -> Vector.of(ts).asJava()), IMMUTABLE, GENERIC, NULLABLE }, // -- mutable classes
{ java.util.ArrayList.class.getName(), new ListFactory( ts -> {
final java.util.List<Object> list = new java.util.ArrayList<>();
java.util.Collections.addAll(list, ts);
return list;
}), MUTABLE, GENERIC, NULLABLE }, { Array.class.getName(), new ListFactory( ts -> Array.of(ts).asJavaMutable()), MUTABLE, GENERIC, NULLABLE }, { CharSeq.class.getName(), new ListFactory( ts -> (java.util.List<Object>) (Object) CharSeq.ofAll((List<Character>) (Object) (List.of(ts))).asJavaMutable()), MUTABLE, FIXED, NON_NULLABLE }, { List.class.getName(), new ListFactory( ts -> List.of(ts).asJavaMutable()), MUTABLE, GENERIC, NULLABLE }, { Queue.class.getName(), new ListFactory( ts -> Queue.of(ts).asJavaMutable()), MUTABLE, GENERIC, NULLABLE }, { Stream.class.getName(), new ListFactory( ts -> Stream.of(ts).asJavaMutable()), MUTABLE, GENERIC, NULLABLE }, { Vector.class.getName(), new ListFactory( ts -> Vector.of(ts).asJavaMutable()), MUTABLE, GENERIC, NULLABLE } });
}Example 72
| Project: ABPlayer-master File: ProcessHelper.java View source code |
public static boolean isProcessRunning(Context ctx, String name) {
ActivityManager am = (ActivityManager) ctx.getSystemService(Context.ACTIVITY_SERVICE);
List<RunningAppProcessInfo> apps = am.getRunningAppProcesses();
for (RunningAppProcessInfo app : apps) {
if (app.processName.equals(name)) {
return true;
}
}
return false;
}Example 73
| Project: actor-platform-master File: StringMatcher.java View source code |
public static List<StringMatch> findMatches(String text, String query) {
text = text.toLowerCase();
query = query.toLowerCase();
ArrayList<StringMatch> matches = new ArrayList<StringMatch>();
if (text.startsWith(query)) {
matches.add(new StringMatch(0, query.length()));
}
int index = text.indexOf(" " + query);
if (index >= 0) {
matches.add(new StringMatch(index + 1, query.length()));
}
return matches;
}Example 74
| Project: agile-itsm-master File: Porta.java View source code |
public List<ItemTrabalho> resolve() throws Exception { SequenciaFluxo sequenciaFluxo = new SequenciaFluxo(instanciaFluxo); boolean bTodosExecutados = true; List<ItemTrabalho> origens = sequenciaFluxo.getOrigens(this); if (origens != null) { for (ItemTrabalho itemOrigem : origens) { if (!itemOrigem.finalizado()) { bTodosExecutados = false; break; } } } if (bTodosExecutados) return sequenciaFluxo.getDestinos(this); else return null; }
Example 75
| Project: AirCastingAndroidClient-master File: Search.java View source code |
public static <T> int binarySearch(List<? extends T> sortedList, Visitor<T> visitor) {
int low = 0;
int high = sortedList.size();
while (high - low > 1) {
int mid = (high + low) / 2;
T value = sortedList.get(mid);
if (visitor.compareTo(value) >= 0) {
low = mid;
} else {
high = mid;
}
}
return low;
}Example 76
| Project: AirPlay-Receiver-on-Android-master File: ProcessHelper.java View source code |
public static boolean isProcessRunning(Context ctx, String name) {
ActivityManager am = (ActivityManager) ctx.getSystemService(Context.ACTIVITY_SERVICE);
List<RunningAppProcessInfo> apps = am.getRunningAppProcesses();
for (RunningAppProcessInfo app : apps) {
if (app.processName.equals(name)) {
return true;
}
}
return false;
}Example 77
| Project: AlgoDS-master File: FizzBuzz.java View source code |
public List<String> fizzBuzz(int n) { List<String> list = new ArrayList<>(n); for (int i = 1; i <= n; i++) { if (i % 3 == 0 && i % 5 == 0) list.add("FizzBuzz"); else if (i % 3 == 0) list.add("Fizz"); else if (i % 5 == 0) list.add("Buzz"); else list.add(String.valueOf(i)); } return list; }
Example 78
| Project: algorithmic-programming-master File: TopologicalSortTest.java View source code |
@Test
public void testComputeTopologicalSort() throws Exception {
TopologicalSort topologicalSort = new TopologicalSort();
List<Vertex> sorted = topologicalSort.computeTopologicalSort(GraphFactory.getDirectedAcyclicGraph());
final String expected = "[Vertex{label=4}, Vertex{label=2}, Vertex{label=3}, Vertex{label=1}, Vertex{label=5}]";
assertEquals(expected, sorted.toString());
}Example 79
| Project: aranea-master File: Configuration.java View source code |
@Bean(name = "exposedBeanNames")
public List<String> exposedBeanNames() {
return Arrays.asList("authenticationManager", "compass", "transactionManager", "validator", "mailCleaner", "personsEditor", "timeEditor", "sectionEditor", "calendarEditor", "checkBoxEditor", "rolesEditor", "tagsEditor", "pageImageService", "imageCaptchaService", "mailSender", "imageDirectory");
}Example 80
| Project: audit4j-core-master File: ConcurrentTimelyBufferedArrayListTest.java View source code |
@Test
public void testList() {
ConcurrentTimelyBufferedArrayList<String> list = new ConcurrentTimelyBufferedArrayList<>(10, new BufferedListener<String>() {
@Override
public void accept(List<String> buffered) {
System.out.println(buffered.toString());
}
});
list.add("1");
list.add("2");
list.add("3");
}Example 81
| Project: baas.io-sdk-android-master File: ObjectUtils.java View source code |
public static boolean isEmpty(Object s) {
if (s == null) {
return true;
}
if ((s instanceof String) && (((String) s).trim().length() == 0)) {
return true;
}
if (s instanceof Map) {
return ((Map<?, ?>) s).isEmpty();
}
if (s instanceof List) {
return ((List<?>) s).isEmpty();
}
if (s instanceof Object[]) {
return (((Object[]) s).length == 0);
}
return false;
}Example 82
| Project: betsy-master File: CollectionsUtil.java View source code |
public static <T> List<T> union(List<List<T>> collections) { if (collections.size() <= 0) { return new LinkedList<>(); } else if (collections.size() == 1) { return collections.get(0); } else { List<T> result = new LinkedList<>(); for (List<T> list : collections) { result.addAll(list); } return result; } }
Example 83
| Project: BigSemanticsJava-master File: PersistenceMetaInfo.java View source code |
List<ParsedURL> getRawAdditionalLocations() { List<MetadataParsedURL> additionalLocations = getAdditionalLocations(); if (additionalLocations != null) { List<ParsedURL> result = new ArrayList<ParsedURL>(); for (MetadataParsedURL purl : additionalLocations) { result.add(purl.getValue()); } return result; } return null; }
Example 84
| Project: bindgen-master File: MethodWithGenericsExampleTest.java View source code |
public void testReadWrite() {
MethodWithGenericsExample e = new MethodWithGenericsExample();
MethodWithGenericsExampleBinding b = new MethodWithGenericsExampleBinding(e);
List<String> originalList = e.getList();
Assert.assertSame(originalList, b.list().get());
b.list().set(new ArrayList<String>());
Assert.assertNotSame(originalList, b.list().get());
}Example 85
| Project: blaze-utils-master File: FireHistoryUtils.java View source code |
public static List<FireHistoryEntry> getEntries() throws SchedulerException {
Scheduler sched = StdSchedulerFactory.getDefaultScheduler();
FireHistoryPlugin plugin = (FireHistoryPlugin) sched.getListenerManager().getTriggerListener("FireHistoryPlugin");
if (plugin == null)
throw new SchedulerException("Plugin not installed!");
return plugin.getEntries();
}Example 86
| Project: brainslug-master File: ArrayListTaskStoreTest.java View source code |
@Test
public void shouldReturnOverdueTasks() {
ArrayListTriggerStore taskStore = new ArrayListTriggerStore();
taskStore.storeTrigger(new AsyncTrigger().withDueDate(0));
taskStore.storeTrigger(new AsyncTrigger().withDueDate(1));
taskStore.storeTrigger(new AsyncTrigger().withDueDate(2));
List<AsyncTrigger> tasks = taskStore.getTriggers(new AsyncTriggerQuery().withOverdueDate(new Date(1)));
Assertions.assertThat(tasks).hasSize(2);
}Example 87
| Project: codeine-master File: ConfiguredProjectUtils.java View source code |
public List<NodeMonitor> dependsOn(NodeMonitor collector, ProjectJson p) { throw new UnsupportedOperationException(); // final List<HttpCollector> l = Lists.newLinkedList(); // for (HttpCollector c : p.collectors) // { // for (String name1 : collector.dependsOn) // { // if (name1.equals(c.name)) // { // l.add(c); // } // } // } // return l; }
Example 88
| Project: coding2017-master File: Josephus.java View source code |
public static List<Integer> execute(int n, int m) { CircleQueue<Integer> queue = new CircleQueue<>(n); for (int i = 0; i < n; i++) { queue.enQueue(i); } List<Integer> resultList = new ArrayList<>(n); int flag = 0; while (!queue.isEmpty()) { flag++; if (flag % m == 0) { resultList.add(queue.deQueue()); } } return resultList; }
Example 89
| Project: codjo-data-process-master File: ArgumentModifierExample.java View source code |
public String proceed(Connection con, List<String> parameters) {
//showParameters(parameters);
StringBuilder result = new StringBuilder();
for (String parameter : parameters) {
result.append(parameter).append('-');
}
if (!parameters.isEmpty()) {
result = result.deleteCharAt(result.length() - 1);
}
return result.toString();
}Example 90
| Project: contra-master File: StatementsDemo.java View source code |
public static void main(String args[]) {
Node firstMsg = new PrintNode(new NumberNode(1), "newline");
Node secondMsg = new PrintNode(new NumberNode(2), "newline");
Node wait = new WaitNode(new NumberNode(new Integer(2000)));
List<Node> script = new LinkedList<Node>();
script.add(firstMsg);
script.add(wait);
script.add(secondMsg);
for (Node statement : script) statement.eval();
}Example 91
| Project: cooper-master File: TestConfigUtil.java View source code |
public static List<String> getSelfPath() { List<String> self = new ArrayList<String>(); String[] envpath = System.getProperty("java.class.path").split(";"); for (String path : envpath) { if (path.endsWith("classes") || path.indexOf("cooper.jar") != -1 || (path.indexOf("cooper-") != -1 && path.endsWith(".jar"))) { self.add(path); } } return self; }
Example 92
| Project: CryodexSource-master File: PlayerExport.java View source code |
public static void exportPlayersDetail() {
List<Player> players = CryodexController.getPlayers();
StringBuilder sb = new StringBuilder();
ExportUtils.addTableStart(sb);
ExportUtils.addTableHeader(sb, "Name", "Group", "Email");
for (Player p : players) {
ExportUtils.addTableRow(sb, p.getName(), p.getGroupName(), p.getEmail());
}
ExportUtils.addTableEnd(sb);
ExportUtils.displayHTML(sb.toString(), "players");
}Example 93
| Project: CupCarbon-master File: MonAlgoClass.java View source code |
public void run() {
List<SensorNode> capteurs = DeviceList.sensors;
for (SensorNode capteur : capteurs) {
System.out.print(capteur.getId() + " -> ");
for (SensorNode voisin : capteurs) {
if (capteur.radioDetect(voisin)) {
System.out.print(voisin.getId() + " ");
}
}
System.out.println();
}
}Example 94
| Project: deepnighttwo-master File: FixTextTooLong.java View source code |
public static void main(String... strings) throws IOException {
String fileName = "BuyerUnhealthyExclusions.2012-07-08.tsv";
List<String> lines = FileUtil.readFileAsLines(fileName);
for (String line : lines) {
String[] row = line.split("\t");
if (row[6].length() >= 256) {
System.out.println(row[6].length() + "\t" + row[6]);
}
}
}Example 95
| Project: Desktop-master File: DirectoryFileFilter.java View source code |
public boolean accept(File file) {
if (file.isDirectory()) {
List<String> subfolders = getStringList(DocearController.getPropertiesController().getProperty("docear_subdirs_to_ignore", null));
for (String subfolder : subfolders) {
if (file.getName().equals(subfolder)) {
return false;
}
}
return true;
} else {
return false;
}
}Example 96
| Project: Distributed-Speaker-Diarization-System-master File: TransformerChain.java View source code |
@Override public List<double[]> transform(List<double[]> features) { if (featureVectorsTransformers == null || featureVectorsTransformers.length == 0) { return features; } else { List<double[]> featuresTransformed = features; for (IFeatureVectorsTransformer featureVectorsTransformer : featureVectorsTransformers) { featuresTransformed = featureVectorsTransformer.transform(featuresTransformed); } return featuresTransformed; } }
Example 97
| Project: dss-master File: CommonTrustedCertificateSourceTest.java View source code |
@Test
public void importKeyStore() {
CommonTrustedCertificateSource ctcs = new CommonTrustedCertificateSource();
KeyStoreCertificateSource keyStore = new KeyStoreCertificateSource("src/test/resources/keystore.jks", "dss-password");
ctcs.importAsTrusted(keyStore);
List<CertificateToken> certificates = ctcs.getCertificates();
assertTrue(Utils.isCollectionNotEmpty(certificates));
}Example 98
| Project: dwoss-master File: LastCharSorterTest.java View source code |
@Test
public void testSorter() {
List<String> unsorted = Arrays.asList("11118", "11111", "11117", "11113", "11112", "11115", "71116", "11119", "31110", "51114");
List<String> sorted = Arrays.asList("31110", "11111", "11112", "11113", "51114", "11115", "71116", "11117", "11118", "11119");
Collections.sort(unsorted, new LastCharSorter());
assertEquals(sorted, unsorted);
}Example 99
| Project: EclipseCodeFormatter-master File: MockAnnotationUtil.java View source code |
public static List<Field> findFieldsThatAreMarkedForMocking(EasyMockTest clazz) { List<Field> results = new ArrayList<Field>(); Class<?> current = clazz.getClass(); while (current != Object.class) { Field[] fields = current.getDeclaredFields(); for (Field f : fields) { if (f.isAnnotationPresent(Mocked.class)) { results.add(f); } } current = current.getSuperclass(); } return results; }
Example 100
| Project: elements-of-programming-interviews-master File: EvenThreadTest.java View source code |
@Test
public void test() throws Exception {
List<Integer> result = new ArrayList<>();
Thread t1 = new ImplementThreadSyncronization.OddThread(result);
Thread t2 = new ImplementThreadSyncronization.EvenThread(result);
t1.start();
t2.start();
t1.join();
t2.join();
assertEquals(StreamUtil.sequence(100), result);
}Example 101
| Project: elmis-master File: LatestSyncedStrategy.java View source code |
@Override
public StockCardEntryKV reduce(List<StockCardEntryKV> list) {
if (null == list || list.isEmpty())
return null;
StockCardEntryKV max = new StockCardEntryKV("", "", new Date(0));
for (StockCardEntryKV item : list) {
if (item.getSyncedDate().after(max.getSyncedDate())) {
max = item;
}
}
return max;
}