text
stringlengths 6
99.5k
| meta
dict |
|---|---|
package com.salesforce.phoenix.filter;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import junit.framework.TestCase;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.filter.Filter.ReturnCode;
import org.apache.hadoop.hbase.util.Bytes;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import com.salesforce.phoenix.query.KeyRange;
import com.salesforce.phoenix.query.QueryConstants;
import com.salesforce.phoenix.schema.ColumnModifier;
import com.salesforce.phoenix.schema.PDataType;
import com.salesforce.phoenix.schema.PDatum;
import com.salesforce.phoenix.schema.RowKeySchema.RowKeySchemaBuilder;
import com.salesforce.phoenix.util.ByteUtil;
//reset()
//filterAllRemaining() -> true indicates scan is over, false, keep going on.
//filterRowKey(byte[],int,int) -> true to drop this row, if false, we will also call
//filterKeyValue(KeyValue) -> true to drop this key/value
//filterRow(List) -> allows direct modification of the final list to be submitted
//filterRow() -> last chance to drop entire row based on the sequence of filterValue() calls. Eg: filter a row if it doesn't contain a specified column.
@RunWith(Parameterized.class)
public class SkipScanFilterTest extends TestCase {
private final SkipScanFilter skipper;
private final List<List<KeyRange>> cnf;
private final List<Expectation> expectations;
public SkipScanFilterTest(List<List<KeyRange>> cnf, int[] widths, List<Expectation> expectations) {
this.expectations = expectations;
this.cnf = cnf;
RowKeySchemaBuilder builder = new RowKeySchemaBuilder(widths.length);
for (final int width : widths) {
builder.addField(
new PDatum() {
@Override
public boolean isNullable() {
return width <= 0;
}
@Override
public PDataType getDataType() {
return width <= 0 ? PDataType.VARCHAR : PDataType.CHAR;
}
@Override
public Integer getByteSize() {
return width <= 0 ? null : width;
}
@Override
public Integer getMaxLength() {
return getByteSize();
}
@Override
public Integer getScale() {
return null;
}
@Override
public ColumnModifier getColumnModifier() {
return null;
}
}, width <= 0, null);
}
skipper = new SkipScanFilter(cnf, builder.build());
}
@Test
public void test() {
System.out.println("CNF: " + cnf + "\n" + "Expectations: " + expectations);
for (Expectation expectation : expectations) {
expectation.examine(skipper);
}
}
@Parameters(name="{0} {1} {2}")
public static Collection<Object> data() {
List<Object> testCases = Lists.newArrayList();
testCases.addAll(
foreach(new KeyRange[][]{{
PDataType.CHAR.getKeyRange(Bytes.toBytes("abc"), true, Bytes.toBytes("def"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("dzy"), false, Bytes.toBytes("xyz"), false),
},
{
PDataType.CHAR.getKeyRange(Bytes.toBytes("AA"), true, Bytes.toBytes("AB"), false),
},
{
PDataType.CHAR.getKeyRange(Bytes.toBytes("AA"), true, Bytes.toBytes("AB"), false),
},
{
PDataType.CHAR.getKeyRange(Bytes.toBytes("AA"), true, Bytes.toBytes("AB"), false),
},
{
PDataType.CHAR.getKeyRange(Bytes.toBytes("AA"), true, Bytes.toBytes("AB"), false),
}},
new int[]{3,2,2,2,2},
//new SeekNext("abcABABABAB", "abdAAAAAAAA"),
new SeekNext("defAAABABAB", "dzzAAAAAAAA"),
new Finished("xyyABABABAB"))
);
testCases.addAll(
foreach(new KeyRange[][]{{
PDataType.VARCHAR.getKeyRange(Bytes.toBytes("j"), false, Bytes.toBytes("k"), true),
}},
new int[]{0},
new SeekNext(Bytes.toBytes("a"), ByteUtil.nextKey(new byte[] {'j',QueryConstants.SEPARATOR_BYTE})),
new Include("ja"),
new Include("jz"),
new Include("k"),
new Finished("ka")));
testCases.addAll(
foreach(new KeyRange[][]{{
PDataType.CHAR.getKeyRange(Bytes.toBytes("aaa"), true, Bytes.toBytes("aaa"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("aac"), true, Bytes.toBytes("aad"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("abc"), true, Bytes.toBytes("def"), true)
}},
new int[]{3},
new SeekNext("aab", "aac"),
new SeekNext("abb", "abc"),
new Include("abc"),
new Include("abe"),
new Include("def"),
new Finished("deg")));
testCases.addAll(
foreach(new KeyRange[][]{{
PDataType.CHAR.getKeyRange(Bytes.toBytes("aaa"), true, Bytes.toBytes("aaa"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("abc"), false, Bytes.toBytes("def"), true)
}},
new int[]{3},
new SeekNext("aba", "abd"),
new Include("abe"),
new Include("def"),
new Finished("deg")));
testCases.addAll(
foreach(new KeyRange[][]{{
PDataType.CHAR.getKeyRange(Bytes.toBytes("aaa"), true, Bytes.toBytes("aaa"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("abc"), false, Bytes.toBytes("def"), false)
}},
new int[]{3},
new SeekNext("aba", "abd"),
new Finished("def"))
);
testCases.addAll(
foreach(new KeyRange[][]{{
PDataType.CHAR.getKeyRange(Bytes.toBytes("abc"), true, Bytes.toBytes("def"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("dzy"), false, Bytes.toBytes("xyz"), false),
}},
new int[]{3},
new Include("def"),
new SeekNext("deg", "dzz"),
new Include("eee"),
new Finished("xyz"))
);
testCases.addAll(
foreach(new KeyRange[][]{{
PDataType.CHAR.getKeyRange(Bytes.toBytes("aaa"), true, Bytes.toBytes("aaa"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("abc"), true, Bytes.toBytes("abc"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("def"), true, Bytes.toBytes("def"), true),
},
{
PDataType.CHAR.getKeyRange(Bytes.toBytes("AB"), true, Bytes.toBytes("AX"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("EA"), false, Bytes.toBytes("EZ"), false),
PDataType.CHAR.getKeyRange(Bytes.toBytes("PO"), true, Bytes.toBytes("PP"), false),
}},
new int[]{3,2},
new Include("abcAB"),
new SeekNext("abcAY","abcEB"),
new Include("abcEF"),
new SeekNext("abcPP","defAB"),
new SeekNext("defEZ","defPO"),
new Include("defPO"),
new Finished("defPP")
)
);
testCases.addAll(
foreach(new KeyRange[][]{{
PDataType.CHAR.getKeyRange(Bytes.toBytes("AB"), true, Bytes.toBytes("AX"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("EA"), false, Bytes.toBytes("EZ"), false),
PDataType.CHAR.getKeyRange(Bytes.toBytes("PO"), true, Bytes.toBytes("PP"), false),
},
{
PDataType.CHAR.getKeyRange(Bytes.toBytes("abc"), true, Bytes.toBytes("abc"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("def"), true, Bytes.toBytes("def"), true),
}},
new int[]{2,3},
new Include("ABabc"),
new SeekNext("ABdeg","ACabc"),
new Include("AMabc"),
new SeekNext("AYabc","EBabc"),
new Include("EFabc"),
new SeekNext("EZdef","POabc"),
new SeekNext("POabd","POdef"),
new Include("POdef"),
new Finished("PPabc"))
);
testCases.addAll(
foreach(new KeyRange[][]{{
PDataType.CHAR.getKeyRange(Bytes.toBytes("PO"), true, Bytes.toBytes("PP"), false),
},
{
PDataType.CHAR.getKeyRange(Bytes.toBytes("def"), true, Bytes.toBytes("def"), true),
}},
new int[]{2,3},
new Include("POdef"),
new Finished("POdeg"))
);
testCases.addAll(
foreach(new KeyRange[][]{{
PDataType.CHAR.getKeyRange(Bytes.toBytes("PO"), true, Bytes.toBytes("PO"), true),
},
{
PDataType.CHAR.getKeyRange(Bytes.toBytes("def"), true, Bytes.toBytes("def"), true),
}},
new int[]{2,3},
new Include("POdef"))
);
testCases.addAll(
foreach(new KeyRange[][]{{
PDataType.CHAR.getKeyRange(Bytes.toBytes("AAA"), true, Bytes.toBytes("AAA"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("abc"), true, Bytes.toBytes("def"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("dzy"), false, Bytes.toBytes("xyz"), false),
},
{
PDataType.CHAR.getKeyRange(Bytes.toBytes("AB"), true, Bytes.toBytes("AX"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("EA"), false, Bytes.toBytes("EZ"), false),
PDataType.CHAR.getKeyRange(Bytes.toBytes("PO"), true, Bytes.toBytes("PP"), false),
}},
new int[]{3,2},
new SeekNext("aaaAA", "abcAB"),
new SeekNext("abcZZ", "abdAB"),
new SeekNext("abdZZ", "abeAB"),
new SeekNext(new byte[]{'d','e','a',(byte)0xFF,(byte)0xFF}, new byte[]{'d','e','b','A','B'}),
new Include("defAB"),
new Include("defAC"),
new Include("defAW"),
new Include("defAX"),
new Include("defEB"),
new Include("defPO"),
new SeekNext("degAB", "dzzAB"),
new Include("dzzAX"),
new Include("dzzEY"),
new SeekNext("dzzEZ", "dzzPO"),
new Include("eeeAB"),
new Include("eeeAC"),
new SeekNext("eeeEA", "eeeEB"),
new Include("eeeEF"),
new SeekNext("eeeEZ","eeePO"),
new Finished("xyzAA"))
);
testCases.addAll(
foreach(new KeyRange[][]{{
PDataType.CHAR.getKeyRange(Bytes.toBytes("aaa"), true, Bytes.toBytes("aaa"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("abc"), true, Bytes.toBytes("def"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("dzz"), true, Bytes.toBytes("xyz"), false),
}},
new int[]{3},
new SeekNext("abb", "abc"),
new Include("abc"),
new Include("abe"),
new Finished("xyz"))
);
testCases.addAll(
foreach(new KeyRange[][]{{
PDataType.CHAR.getKeyRange(Bytes.toBytes("abc"), true, Bytes.toBytes("def"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("dzy"), false, Bytes.toBytes("xyz"), false),
},
{
PDataType.CHAR.getKeyRange(Bytes.toBytes("AB"), true, Bytes.toBytes("AX"), true),
PDataType.CHAR.getKeyRange(Bytes.toBytes("EA"), false, Bytes.toBytes("EZ"), false),
PDataType.CHAR.getKeyRange(Bytes.toBytes("PO"), true, Bytes.toBytes("PP"), false),
},
{
PDataType.CHAR.getKeyRange(Bytes.toBytes("100"), true, Bytes.toBytes("250"), false),
PDataType.CHAR.getKeyRange(Bytes.toBytes("700"), false, Bytes.toBytes("901"), false),
}},
new int[]{3,2,3},
new SeekNext("abcEB700", "abcEB701"),
new Include("abcEB701"),
new SeekNext("dzzAB250", "dzzAB701"),
new Finished("zzzAA000"))
);
// TODO variable length columns
// testCases.addAll(
// foreach(new KeyRange[][]{{
// PDataType.CHAR.getKeyRange(Bytes.toBytes("apple"), true, Bytes.toBytes("lemon"), true),
// PDataType.CHAR.getKeyRange(Bytes.toBytes("pear"), false, Bytes.toBytes("yam"), false),
// },
// {
// PDataType.CHAR.getKeyRange(Bytes.toBytes("AB"), true, Bytes.toBytes("AX"), true),
// PDataType.CHAR.getKeyRange(Bytes.toBytes("EA"), false, Bytes.toBytes("EZ"), false),
// PDataType.CHAR.getKeyRange(Bytes.toBytes("PO"), true, Bytes.toBytes("PP"), false),
// },
// {
// PDataType.CHAR.getKeyRange(Bytes.toBytes("100"), true, Bytes.toBytes("250"), false),
// PDataType.CHAR.getKeyRange(Bytes.toBytes("700"), false, Bytes.toBytes("901"), false),
// }},
// new int[]{3,3})
// );
return testCases;
}
private static Collection<?> foreach(KeyRange[][] ranges, int[] widths, Expectation... expectations) {
List<List<KeyRange>> cnf = Lists.transform(Lists.newArrayList(ranges), ARRAY_TO_LIST);
List<Object> ret = Lists.newArrayList();
ret.add(new Object[] {cnf, widths, Arrays.asList(expectations)} );
return ret;
}
private static final Function<KeyRange[], List<KeyRange>> ARRAY_TO_LIST = new Function<KeyRange[], List<KeyRange>>() {
@Override public List<KeyRange> apply(KeyRange[] input) {
return Lists.newArrayList(input);
}
};
static interface Expectation {
void examine(SkipScanFilter skipper);
}
private static final class SeekNext implements Expectation {
private final byte[] rowkey, hint;
public SeekNext(String rowkey, String hint) {
this.rowkey = Bytes.toBytes(rowkey);
this.hint = Bytes.toBytes(hint);
}
public SeekNext(byte[] rowkey, byte[] hint) {
this.rowkey = rowkey;
this.hint = hint;
}
@Override public void examine(SkipScanFilter skipper) {
KeyValue kv = KeyValue.createFirstOnRow(rowkey);
skipper.reset();
assertFalse(skipper.filterAllRemaining());
assertFalse(skipper.filterRowKey(kv.getBuffer(), kv.getRowOffset(), kv.getRowLength()));
assertEquals(ReturnCode.SEEK_NEXT_USING_HINT, skipper.filterKeyValue(kv));
assertEquals(KeyValue.createFirstOnRow(hint), skipper.getNextKeyHint(kv));
}
@Override public String toString() {
return "rowkey=" + Bytes.toStringBinary(rowkey)+", expected seek next using hint: " + Bytes.toStringBinary(hint);
}
}
private static final class Include implements Expectation {
private final byte[] rowkey;
public Include(String rowkey) {
this.rowkey = Bytes.toBytes(rowkey);
}
@Override public void examine(SkipScanFilter skipper) {
KeyValue kv = KeyValue.createFirstOnRow(rowkey);
skipper.reset();
assertFalse(skipper.filterAllRemaining());
assertFalse(skipper.filterRowKey(kv.getBuffer(), kv.getRowOffset(), kv.getRowLength()));
assertEquals(kv.toString(), ReturnCode.INCLUDE, skipper.filterKeyValue(kv));
}
@Override public String toString() {
return "rowkey=" + Bytes.toStringBinary(rowkey)+", expected include";
}
}
private static final class Finished implements Expectation {
private final byte[] rowkey;
public Finished(String rowkey) {
this.rowkey = Bytes.toBytes(rowkey);
}
@Override public void examine(SkipScanFilter skipper) {
KeyValue kv = KeyValue.createFirstOnRow(rowkey);
skipper.reset();
assertEquals(ReturnCode.NEXT_ROW,skipper.filterKeyValue(kv));
skipper.reset();
assertTrue(skipper.filterAllRemaining());
}
@Override public String toString() {
return "rowkey=" + Bytes.toStringBinary(rowkey)+", expected finished";
}
}
}
|
{
"pile_set_name": "Github"
}
|
// Targeted by JavaCPP version 1.5.4: DO NOT EDIT THIS FILE
package org.bytedeco.arrow;
import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;
import static org.bytedeco.javacpp.presets.javacpp.*;
import static org.bytedeco.arrow.global.arrow.*;
/** \brief Status outcome object (success or error)
*
* The Status object is an object holding the outcome of an operation.
* The outcome is represented as a StatusCode, either success
* (StatusCode::OK) or an error (any other of the StatusCode enumeration values).
*
* Additionally, if an error occurred, a specific error message is generally
* attached. */
@Namespace("arrow") @NoOffset @Properties(inherit = org.bytedeco.arrow.presets.arrow.class)
public class Status extends Pointer {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public Status(Pointer p) { super(p); }
/** Native array allocator. Access with {@link Pointer#position(long)}. */
public Status(long size) { super((Pointer)null); allocateArray(size); }
private native void allocateArray(long size);
@Override public Status position(long position) {
return (Status)super.position(position);
}
@Override public Status getPointer(long i) {
return new Status(this).position(position + i);
}
// Create a success status.
public Status() { super((Pointer)null); allocate(); }
@NoException private native void allocate();
public Status(StatusCode code, @StdString String msg) { super((Pointer)null); allocate(code, msg); }
private native void allocate(StatusCode code, @StdString String msg);
public Status(@Cast("arrow::StatusCode") byte code, @StdString BytePointer msg) { super((Pointer)null); allocate(code, msg); }
private native void allocate(@Cast("arrow::StatusCode") byte code, @StdString BytePointer msg);
/** \brief Pluggable constructor for use by sub-systems. detail cannot be null. */
public Status(StatusCode code, @StdString String msg, @SharedPtr StatusDetail detail) { super((Pointer)null); allocate(code, msg, detail); }
private native void allocate(StatusCode code, @StdString String msg, @SharedPtr StatusDetail detail);
public Status(@Cast("arrow::StatusCode") byte code, @StdString BytePointer msg, @SharedPtr StatusDetail detail) { super((Pointer)null); allocate(code, msg, detail); }
private native void allocate(@Cast("arrow::StatusCode") byte code, @StdString BytePointer msg, @SharedPtr StatusDetail detail);
// Copy the specified status.
public Status(@Const @ByRef Status s) { super((Pointer)null); allocate(s); }
private native void allocate(@Const @ByRef Status s);
public native @ByRef @Name("operator =") Status put(@Const @ByRef Status s);
// Move the specified status.
public native @Cast("bool") boolean Equals(@Const @ByRef Status s);
// AND the statuses.
public native @ByVal @Name("operator &") @NoException Status and(@Const @ByRef Status s);
public native @ByRef @Name("operator &=") @NoException Status andPut(@Const @ByRef Status s);
/** Return a success status */
public static native @ByVal Status OK();
/** Return an error status for out-of-memory conditions */
/** Return an error status for failed key lookups (e.g. column name in a table) */
/** Return an error status for type errors (such as mismatching data types) */
/** Return an error status for unknown errors */
/** Return an error status when an operation or a combination of operation and
* data types is unimplemented */
/** Return an error status for invalid data (for example a string that fails parsing) */
/** Return an error status when an index is out of bounds */
/** Return an error status when a container's capacity would exceed its limits */
/** Return an error status when some IO-related operation failed */
/** Return an error status when some (de)serialization operation failed */
/** Return true iff the status indicates success. */
public native @Cast("bool") boolean ok();
/** Return true iff the status indicates an out-of-memory error. */
public native @Cast("bool") boolean IsOutOfMemory();
/** Return true iff the status indicates a key lookup error. */
public native @Cast("bool") boolean IsKeyError();
/** Return true iff the status indicates invalid data. */
public native @Cast("bool") boolean IsInvalid();
/** Return true iff the status indicates an IO-related failure. */
public native @Cast("bool") boolean IsIOError();
/** Return true iff the status indicates a container reaching capacity limits. */
public native @Cast("bool") boolean IsCapacityError();
/** Return true iff the status indicates an out of bounds index. */
public native @Cast("bool") boolean IsIndexError();
/** Return true iff the status indicates a type error. */
public native @Cast("bool") boolean IsTypeError();
/** Return true iff the status indicates an unknown error. */
public native @Cast("bool") boolean IsUnknownError();
/** Return true iff the status indicates an unimplemented operation. */
public native @Cast("bool") boolean IsNotImplemented();
/** Return true iff the status indicates a (de)serialization failure */
public native @Cast("bool") boolean IsSerializationError();
/** Return true iff the status indicates a R-originated error. */
public native @Cast("bool") boolean IsRError();
public native @Cast("bool") boolean IsCodeGenError();
public native @Cast("bool") boolean IsExpressionValidationError();
public native @Cast("bool") boolean IsExecutionError();
///
public native @Cast("bool") boolean IsAlreadyExists();
/** \brief Return a string representation of this status suitable for printing.
*
* The string "OK" is returned for success. */
public native @StdString String ToString();
/** \brief Return a string representation of the status code, without the message
* text or POSIX code information. */
public native @StdString String CodeAsString();
public static native @StdString String CodeAsString(StatusCode arg0);
public static native @StdString BytePointer CodeAsString(@Cast("arrow::StatusCode") byte arg0);
/** \brief Return the StatusCode value attached to this status. */
public native StatusCode code();
/** \brief Return the specific error message attached to this status. */
public native @StdString String message();
/** \brief Return the status detail attached to this message. */
public native @SharedPtr StatusDetail detail();
/** \brief Return a new Status copying the existing status, but
* updating with the existing detail. */
public native @ByVal Status WithDetail(@SharedPtr StatusDetail new_detail);
/** \brief Return a new Status with changed message, copying the
* existing status code and detail. */
public native void Abort(@StdString String message);
public native void Abort(@StdString BytePointer message);
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2019 Hai Zhang <dreaming.in.code.zh@gmail.com>
~ All Rights Reserved.
-->
<View
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swatch"
android:layout_width="36dp"
android:layout_height="36dp"
android:background="@drawable/color_preference_widget_background" />
|
{
"pile_set_name": "Github"
}
|
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
org.apache.ws.security.crypto.merlin.keystore.type=jks
org.apache.ws.security.crypto.merlin.keystore.password=password
org.apache.ws.security.crypto.merlin.keystore.alias=bob
org.apache.ws.security.crypto.merlin.keystore.file=keys/bob.jks
|
{
"pile_set_name": "Github"
}
|
package org.dcache.services.info.gathers;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Required;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import dmg.cells.nucleus.CellLifeCycleAware;
import dmg.cells.nucleus.EnvironmentAware;
import dmg.cells.nucleus.UOID;
import org.dcache.util.NDC;
import org.dcache.services.info.base.StateExhibitor;
import org.dcache.services.info.base.StateUpdateManager;
import static com.google.common.base.Preconditions.checkState;
/**
* This thread is responsible for scheduling various data-gathering activity.
* Multiple DataGatheringActivity instances can be registered, each will operate
* independently. The frequency at which they trigger, or even whether they are
* periodic, is completely under the control of the DGA.
* <p>
* These DataGatheringActivities can (in principle) do anything when
* triggered, but will typically send one or more messages to dCache.
*
* @author Paul Millar <paul.millar@desy.de>
*/
public class DataGatheringScheduler implements Runnable, EnvironmentAware, CellLifeCycleAware
{
private static final long FIVE_MINUTES = 5*60*1000;
private static final Logger LOGGER_SCHED = LoggerFactory.getLogger(DataGatheringScheduler.class);
private static final Logger LOGGER_RA = LoggerFactory.getLogger(RegisteredActivity.class);
private boolean _timeToQuit;
private final List<RegisteredActivity> _activity = new ArrayList<>();
private Map<String,Object> _environment;
private Iterable<DgaFactoryService> _factories;
private StateUpdateManager _sum;
private StateExhibitor _exhibitor;
private MessageSender _sender;
private MessageMetadataRepository<UOID> _repository;
private Thread _thread;
/**
* Class holding a periodically repeated DataGatheringActivity
* @author Paul Millar <paul.millar@desy.de>
*/
private static class RegisteredActivity
{
/** Min. delay (in ms). We prevent Schedulables from triggering more frequently than this */
private static final long MINIMUM_DGA_DELAY = 50;
private final Schedulable _dga;
/** The delay until this DataGatheringActivity should be next triggered */
private Date _nextTriggered;
/** Whether we should include this activity when scheduling next activity */
private boolean _enabled = true;
/**
* Create a new PeriodicActvity, with specified DataGatheringActivity, that
* is triggered with a fixed period. The initial delay is a randomly chosen
* fraction of the period.
* @param dga the DataGatheringActivity to be triggered periodically
* @param period the period between successive triggering in milliseconds.
*/
RegisteredActivity(Schedulable dga)
{
_dga = dga;
updateNextTrigger();
}
/**
* Try to make sure we don't hit the system with lots of queries at the same
* time
* @param period
*/
private void updateNextTrigger()
{
Date nextTrigger = _dga.shouldNextBeTriggered();
if (nextTrigger == null) {
LOGGER_RA.error("registered dga returned null Date");
nextTrigger = new Date(System.currentTimeMillis() + FIVE_MINUTES);
} else {
// Safety! Check we wont trigger too quickly
if (nextTrigger.getTime() - System.currentTimeMillis() < MINIMUM_DGA_DELAY) {
LOGGER_RA.warn("DGA {} triggering too quickly ({}ms): engaging safety.",
_dga, nextTrigger.getTime() - System.currentTimeMillis());
nextTrigger = new Date (System.currentTimeMillis() + MINIMUM_DGA_DELAY);
}
}
_nextTriggered = nextTrigger;
}
/**
* Update this PeriodicActivity so it's trigger time is <i>now</i>.
*/
public void shouldTriggerNow()
{
_nextTriggered = new Date();
}
/**
* Check the status of this activity. If the time has elapsed,
* this will cause the DataGatheringActivity to be triggered
* and the timer to be reset.
* @return true if the DataGatheringActivity was triggered.
*/
boolean checkAndTrigger(Date now)
{
if (!_enabled) {
return false;
}
if (now.before(_nextTriggered)) {
return false;
}
NDC.push(_dga.toString());
_dga.trigger();
NDC.pop();
updateNextTrigger();
return true;
}
/**
* Calculate the duration until the event has triggered.
* @return duration, in milliseconds, until event or zero if it
* should have been triggered already.
*/
long getDelay()
{
long delay = _nextTriggered.getTime() - System.currentTimeMillis();
return delay > 0 ? delay : 0;
}
/**
* Return the time this will be next triggered.
* @return
*/
long getNextTriggered()
{
return _nextTriggered.getTime();
}
boolean isEnabled()
{
return _enabled;
}
void disable()
{
_enabled = false;
}
/**
* Enable a periodic activity.
*/
void enable()
{
if (!_enabled) {
_enabled = true;
updateNextTrigger();
}
}
/**
* A human-understandable name for this DGA
* @return the underlying DGA's name
*/
@Override
public String toString()
{
return _dga.toString();
}
/**
* Render current status into a human-understandable form.
* @return single-line String describing current status.
*/
public String getStatus()
{
StringBuilder sb = new StringBuilder();
sb.append(this.toString());
sb.append(" [");
sb.append(_enabled ? "enabled" : "disabled");
if (_enabled) {
sb.append(String
.format(", next %1$.1fs", getDelay() / 1000.0));
}
sb.append("]");
return sb.toString();
}
}
@Override
public synchronized void afterStart()
{
checkState(_thread == null, "DataGatheringScheduler already started");
for (DgaFactoryService factory : _factories) {
if (factory instanceof EnvironmentAware) {
((EnvironmentAware)factory).setEnvironment(_environment);
}
for (Schedulable dga : factory.createDgas(_exhibitor, _sender,
_sum, _repository)) {
_activity.add(new RegisteredActivity(dga));
}
}
_thread = new Thread(this);
_thread.setName("DGA-Scheduler");
_thread.start();
}
@Override
public void setEnvironment(Map<String,Object> environment)
{
_environment = environment;
}
@Required
public void setDgaFactories(Iterable<DgaFactoryService> factories)
{
_factories = factories;
}
@Required
public void setStateUpdateManager(StateUpdateManager sum)
{
_sum = sum;
}
@Required
public void setStateExhibitor(StateExhibitor exhibitor)
{
_exhibitor = exhibitor;
}
@Required
public void setMessageSender(MessageSender sender)
{
_sender = sender;
}
@Required
public void setMessageMetadataRepository(MessageMetadataRepository<UOID> repository)
{
_repository = repository;
}
/**
* Main loop for this thread triggering DataGatheringActivity.
*/
@Override
public void run()
{
long delay;
Date now = new Date();
LOGGER_SCHED.debug("DGA Scheduler thread starting.");
synchronized (_activity) {
do {
now.setTime(System.currentTimeMillis());
for (RegisteredActivity pa : _activity) {
pa.checkAndTrigger(now);
}
delay = getWaitTimeout();
try {
_activity.wait(delay);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
} while (!_timeToQuit);
}
LOGGER_SCHED.debug("DGA Scheduler thread shutting down.");
}
/**
* Search through out list of activity and find the one that matches this name.
* <p>
* This method assumes that the current thread already owns the _allActivity
* monitor
* @param name the name of the activity to fine
* @return the corresponding PeriodicActivity object, or null if not found.
*/
private RegisteredActivity findActivity(String name)
{
RegisteredActivity foundPA = null;
for (RegisteredActivity pa : _activity) {
if (pa.toString().equals(name)) {
foundPA = pa;
break;
}
}
return foundPA;
}
/**
* Enable a data-gathering activity, based on a human-readable name.
* @param name - name of the DGA.
* @return null if successful or an error message if there was a problem.
*/
public String enableActivity(String name)
{
RegisteredActivity pa;
boolean haveEnabled = false;
synchronized (_activity) {
pa = findActivity(name);
if (pa != null && !pa._enabled) {
pa.enable();
_activity.notify();
haveEnabled = true;
}
}
return haveEnabled ? null : pa == null ? "Unknown DGA " + name : "DGA " + name + " already enabled";
}
/**
* Disabled a data-gathering activity, based on a human-readable name.
* @param name - name of the DGA.
* @return null if successful or an error message if there was a problem.
*/
public String disableActivity(String name)
{
RegisteredActivity pa;
boolean haveDisabled = false;
synchronized (_activity) {
pa = findActivity(name);
if (pa != null && pa._enabled) {
pa.disable();
_activity.notify();
haveDisabled = true;
}
}
return haveDisabled ? null : pa == null ? "Unknown DGA " + name : "DGA " + name + " already disabled";
}
/**
* Trigger a periodic activity right now.
* @param name the PeriodicActivity to trigger
* @return null if successful, an error message if there was a problem.
*/
public String triggerActivity(String name)
{
RegisteredActivity pa;
synchronized (_activity) {
pa = findActivity(name);
if (pa != null) {
pa.shouldTriggerNow();
_activity.notify();
}
}
return pa != null ? null : "Unknown DGA " + name;
}
/**
* Request that this thread sends no more requests
* for data.
*/
@Override
public void beforeStop()
{
LOGGER_SCHED.debug("Requesting DGA Scheduler to shutdown.");
synchronized (_activity) {
_timeToQuit = true;
_activity.notify();
}
}
/**
* Calculate the delay, in milliseconds, until the next
* PeriodicActivity is to be triggered, or 0 if there is
* no registered Schedulable objects.
* <p>
* <i>NB</i> we assume that the current thread has already obtained the monitor for
* _allActivity!
* @return delay, in milliseconds, until next trigger or zero if there
* is no recorded delay.
*/
private long getWaitTimeout()
{
long earliestTrig=0;
synchronized (_activity) {
for (RegisteredActivity thisPa : _activity) {
if (!thisPa.isEnabled()) {
continue;
}
long thisTrig = thisPa.getNextTriggered();
if (thisTrig < earliestTrig || earliestTrig == 0) {
earliestTrig = thisTrig;
}
}
}
long delay = 0;
if (earliestTrig > 0) {
delay = earliestTrig - System.currentTimeMillis();
delay = delay < 1 ? 1 : delay; // enforce >1 to distinguish between "should trigger now" and "no registered activity".
}
return delay;
}
/**
* Return a human-readable list of known activity.
* @return
*/
public List<String> listActivity()
{
List<String> activityList = new ArrayList<>();
synchronized (_activity) {
for (RegisteredActivity thisRa : _activity) {
activityList.add(thisRa.getStatus());
}
}
return activityList;
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12118" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12086"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ReferenceViewController">
<connections>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="游戏介绍" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tqv-hb-vlQ">
<rect key="frame" x="149" y="66" width="77.5" height="21"/>
<constraints>
<constraint firstAttribute="width" constant="77.5" id="HJM-XC-37x"/>
<constraint firstAttribute="height" constant="21" id="Nk8-ng-QBO"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="19"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" 通过滑动手势上下左右控制蛇的方向,寻找吃的东西,每吃一口就能得到一定的积分,而且蛇的身子会越吃越长,身子越长玩的难度就越大,不能碰墙,不能咬到自己的身体,更不能咬自己的尾巴。
本游戏不设关卡。
向经典致敬。" lineBreakMode="clip" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NhL-aB-nim">
<rect key="frame" x="37.5" y="113" width="300" height="169"/>
<constraints>
<constraint firstAttribute="width" constant="300" id="f4p-rl-MAS"/>
<constraint firstAttribute="height" constant="169" id="kKy-UU-JgT"/>
</constraints>
<fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="16"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="svQ-qY-LSe">
<rect key="frame" x="170" y="582" width="35" height="35"/>
<constraints>
<constraint firstAttribute="height" constant="35" id="kI3-00-VnM"/>
<constraint firstAttribute="width" constant="35" id="ndr-Nd-dhj"/>
</constraints>
<state key="normal" image="close.png"/>
<connections>
<action selector="dismissAction:" destination="-1" eventType="touchUpInside" id="2NQ-1K-oHJ"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="0.80784313730000001" blue="0.94509803920000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="NhL-aB-nim" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="T6t-UM-7IG"/>
<constraint firstItem="svQ-qY-LSe" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="e9U-hE-vo0"/>
<constraint firstItem="NhL-aB-nim" firstAttribute="top" secondItem="tqv-hb-vlQ" secondAttribute="bottom" constant="26" id="eB4-5B-lM7"/>
<constraint firstAttribute="bottom" secondItem="svQ-qY-LSe" secondAttribute="bottom" constant="50" id="ue0-Js-ds6"/>
<constraint firstItem="tqv-hb-vlQ" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="ujf-i4-RS3"/>
<constraint firstItem="tqv-hb-vlQ" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="66" id="ule-HV-pZR"/>
</constraints>
<point key="canvasLocation" x="234.5" y="41.5"/>
</view>
</objects>
<resources>
<image name="close.png" width="128" height="128"/>
</resources>
</document>
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env bash
export PATH=~/tools/emacswin/bin/:/bin:/usr/bin:"$PATH"
rm TAGS
find . \( '-path' '*/CVS' \
'-o' '-path' '*/.svn' \
'-o' '-path' '*/autom4te.cache' \
'-o' '-path' '*/{arch}' \
'-o' '-path' '*/.hg' \
'-o' '-path' '*/_darcs' \
'-o' '-path' '*/.git' \
'-o' '-path' '*/.bzr' \
'-o' '-path' '*~*' \
'-o' '-path' '*#' \
'-o' '-path' '*/TAGS' \
'-o' '-path' '*/semantic.cache' \
'-o' '-iname' '*.o' \
'-o' '-iname' '*.class' \
'-o' '-iname' '*.obj' \
'-o' '-iname' '*.pyc' \
'-o' '-path' '*/.ignore' \) -prune \
-o -type f \( -iname '*.cpp' \
-o -iname '*.hpp' \
-o -iname '*.s' \
-o -iname '*.h' \
-o -iname '*.c' \
-o -iname '*.cc' \
-o -iname '*.py' \
-o -iname '*.java' \
-o -iname '*.el' \
-o -iname '*.pl' \
-o -iname '*.inl' \
-o -iname '*.aidl' \
\) -print0 |xargs -0 etags -a "$@"
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!-- DEPRECATED!!! PLEASE USE "org/springframework/cloud/gcp/logging/logback-appender.xml" -->
<!--
Stackdriver appender logback configuration provided for import.
-->
<included>
<property name="STACKDRIVER_LOG_NAME" value="${STACKDRIVER_LOG_NAME:-spring.log}"/>
<property name="STACKDRIVER_LOG_FLUSH_LEVEL" value="${STACKDRIVER_LOG_FLUSH_LEVEL:-WARN}"/>
<appender name="STACKDRIVER" class="org.springframework.cloud.gcp.logging.LoggingAppender">
<log>${STACKDRIVER_LOG_NAME}</log> <!-- Optional : default java.log -->
<enhancer>org.springframework.cloud.gcp.logging.TraceIdLoggingEnhancer</enhancer>
<flushLevel>${STACKDRIVER_LOG_FLUSH_LEVEL}</flushLevel> <!-- Optional : default ERROR -->
</appender>
</included>
|
{
"pile_set_name": "Github"
}
|
package me.saket.dank.utils;
import android.graphics.Point;
import android.text.Spannable;
import android.text.style.ClickableSpan;
import android.view.MotionEvent;
import android.widget.TextView;
import me.saket.bettermovementmethod.BetterLinkMovementMethod;
import me.saket.dank.utils.markdown.markwon.SpoilerRevealClickListenerSpan;
/**
* Extension of BetterLinkMovementMethod that also tracks the coordinates of a clicked link.
*/
public class DankLinkMovementMethod extends BetterLinkMovementMethod {
private Point clickedUrlCoordinates;
public static DankLinkMovementMethod newInstance() {
return new DankLinkMovementMethod();
}
public Point getLastUrlClickCoordinates() {
return clickedUrlCoordinates;
}
@Override
public boolean onTouchEvent(TextView view, Spannable text, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_UP) {
// A link is potentially going to be clicked.
clickedUrlCoordinates = new Point((int) event.getRawX(), (int) event.getRawY());
}
return super.onTouchEvent(view, text, event);
}
@Override
protected void highlightUrl(TextView textView, ClickableSpan clickableSpan, Spannable text) {
if (clickableSpan instanceof SpoilerRevealClickListenerSpan) {
return;
}
super.highlightUrl(textView, clickableSpan, text);
}
@Override
protected void dispatchUrlClick(TextView textView, ClickableSpan clickableSpan) {
if (clickableSpan instanceof SpoilerRevealClickListenerSpan) {
clickableSpan.onClick(textView);
return;
}
super.dispatchUrlClick(textView, clickableSpan);
}
@Override
protected void dispatchUrlLongClick(TextView textView, ClickableSpan clickableSpan) {
if (!(clickableSpan instanceof SpoilerRevealClickListenerSpan)) {
super.dispatchUrlLongClick(textView, clickableSpan);
}
}
}
|
{
"pile_set_name": "Github"
}
|
ks.type = "sparql"
ks.url = "http://live.dbpedia.org/sparql"
ks.defaultGraphURIs = {"http://dbpedia.org"}
alg.type = "objectproperty range learner"
alg.source = component:ks
alg.propertyToDescribe = "http://dbpedia.org/ontology/leader"
|
{
"pile_set_name": "Github"
}
|
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
echo Found %WRAPPER_JAR%
) else (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
echo Finished downloading %WRAPPER_JAR%
)
@REM End of extension
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%
|
{
"pile_set_name": "Github"
}
|
package com.earth2me.essentials.storage;
import net.ess3.api.IEssentials;
import org.bukkit.Bukkit;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.logging.Level;
public abstract class AbstractDelayedYamlFileWriter implements Runnable {
private final transient File file;
public AbstractDelayedYamlFileWriter(IEssentials ess, File file) {
this.file = file;
ess.runTaskAsynchronously(this);
}
public abstract StorageObject getObject();
@Override
public void run() {
PrintWriter pw = null;
try {
final StorageObject object = getObject();
final File folder = file.getParentFile();
if (!folder.exists()) {
folder.mkdirs();
}
pw = new PrintWriter(file);
new YamlStorageWriter(pw).save(object);
} catch (FileNotFoundException ex) {
Bukkit.getLogger().log(Level.SEVERE, file.toString(), ex);
} finally {
onFinish();
if (pw != null) {
pw.close();
}
}
}
public abstract void onFinish();
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchdefinition.processing;
import com.yahoo.document.DataType;
import com.yahoo.document.Field;
import com.yahoo.document.ReferenceDataType;
import com.yahoo.searchdefinition.DocumentGraphValidator;
import com.yahoo.searchdefinition.Search;
import com.yahoo.searchdefinition.SearchBuilder;
import com.yahoo.searchdefinition.document.SDDocumentType;
import com.yahoo.searchdefinition.parser.ParseException;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
/**
* @author bjorncs
*/
public class ReferenceFieldTestCase {
@Rule
public final ExpectedException exceptionRule = ExpectedException.none();
@Test
public void reference_fields_are_parsed_from_search_definition() throws ParseException {
SearchBuilder builder = new SearchBuilder();
String campaignSdContent =
"search campaign {\n" +
" document campaign {\n" +
" }\n" +
"}";
String salespersonSdContent =
"search salesperson {\n" +
" document salesperson {\n" +
" }\n" +
"}";
String adSdContent =
"search ad {\n" +
" document ad {\n" +
" field campaign_ref type reference<campaign> { indexing: attribute }\n" +
" field salesperson_ref type reference<salesperson> { indexing: attribute }\n" +
" }\n" +
"}";
builder.importString(campaignSdContent);
builder.importString(salespersonSdContent);
builder.importString(adSdContent);
builder.build();
Search search = builder.getSearch("ad");
assertSearchContainsReferenceField("campaign_ref", "campaign", search.getDocument());
assertSearchContainsReferenceField("salesperson_ref", "salesperson", search.getDocument());
}
@Test
public void cyclic_document_dependencies_are_detected() throws ParseException {
SearchBuilder builder = new SearchBuilder();
String campaignSdContent =
"search campaign {\n" +
" document campaign {\n" +
" field ad_ref type reference<ad> { indexing: attribute }\n" +
" }\n" +
"}";
String adSdContent =
"search ad {\n" +
" document ad {\n" +
" field campaign_ref type reference<campaign> { indexing: attribute }\n" +
" }\n" +
"}";
builder.importString(campaignSdContent);
builder.importString(adSdContent);
exceptionRule.expect(DocumentGraphValidator.DocumentGraphException.class);
exceptionRule.expectMessage("Document dependency cycle detected: campaign->ad->campaign.");
builder.build();
}
private static void assertSearchContainsReferenceField(String expectedFieldname,
String referencedDocType,
SDDocumentType documentType) {
Field field = documentType.getDocumentType().getField(expectedFieldname);
assertNotNull("Field does not exist in document type: " + expectedFieldname, field);
DataType dataType = field.getDataType();
assertThat(dataType, instanceOf(ReferenceDataType.class));
ReferenceDataType refField = (ReferenceDataType) dataType;
assertEquals(referencedDocType, refField.getTargetType().getName());
}
}
|
{
"pile_set_name": "Github"
}
|
package com.shreyaspatil.MaterialNavigationDrawer.example.ui.home
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import com.shreyaspatil.MaterialNavigationDrawer.example.R
class HomeFragment : Fragment() {
private lateinit var homeViewModel: HomeViewModel
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
homeViewModel =
ViewModelProviders.of(this).get(HomeViewModel::class.java)
val root = inflater.inflate(R.layout.fragment_home, container, false)
val textView: TextView = root.findViewById(R.id.text_home)
homeViewModel.text.observe(this, Observer {
textView.text = it
})
return root
}
}
|
{
"pile_set_name": "Github"
}
|
interface I {}
@:cs.using("System")
class Main2 {
public static function main():Void {
trace('ko');
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.setupwizardlib.view;
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build.VERSION_CODES;
import android.util.AttributeSet;
import android.widget.Checkable;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
/**
* A LinearLayout which is checkable. This will set the checked state when
* {@link #onCreateDrawableState(int)} is called, and can be used with
* {@code android:duplicateParentState} to propagate the drawable state to child views.
*/
public class CheckableLinearLayout extends LinearLayout implements Checkable {
private boolean mChecked = false;
public CheckableLinearLayout(Context context) {
super(context);
}
public CheckableLinearLayout(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
@TargetApi(VERSION_CODES.HONEYCOMB)
public CheckableLinearLayout(
Context context,
@Nullable AttributeSet attrs,
int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@TargetApi(VERSION_CODES.LOLLIPOP)
public CheckableLinearLayout(
Context context,
AttributeSet attrs,
int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
{
setFocusable(true);
}
@Override
protected int[] onCreateDrawableState(int extraSpace) {
if (mChecked) {
final int[] superStates = super.onCreateDrawableState(extraSpace + 1);
final int[] checked = new int[] { android.R.attr.state_checked };
return mergeDrawableStates(superStates, checked);
} else {
return super.onCreateDrawableState(extraSpace);
}
}
@Override
public void setChecked(boolean checked) {
mChecked = checked;
refreshDrawableState();
}
@Override
public boolean isChecked() {
return mChecked;
}
@Override
public void toggle() {
setChecked(!isChecked());
}
}
|
{
"pile_set_name": "Github"
}
|
package de.vogella.rcp.commands.enable;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "de.vogella.rcp.commands.enable";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
/**
* Returns an image descriptor for the image file at the given
* plug-in relative path
*
* @param path the path
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
}
|
{
"pile_set_name": "Github"
}
|
package com.jojoldu.blogcode.springbootjpa.querydsl.store;
import com.jojoldu.blogcode.springbootjpa.domain.QStore;
import com.jojoldu.blogcode.springbootjpa.domain.Store;
import com.querydsl.jpa.impl.JPAQueryFactory;
import lombok.RequiredArgsConstructor;
import java.util.List;
import static com.jojoldu.blogcode.springbootjpa.domain.QStore.store;
/**
* Created by jojoldu@gmail.com on 03/11/2019
* Blog : http://jojoldu.tistory.com
* Github : http://github.com/jojoldu
*/
@RequiredArgsConstructor
public class StoreQuerydslRepositoryImpl implements StoreQuerydslRepositoryCustom {
private final JPAQueryFactory queryFactory;
@Override
public List<Store> findAllByQuerydsl () {
return queryFactory.selectFrom(store)
.join(store.employees).fetchJoin()
.join(store.products).fetchJoin()
.fetch();
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2014 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.netflix.spinnaker.cats.cache;
import com.netflix.spinnaker.kork.annotations.Beta;
import java.util.Collection;
import java.util.Map;
/**
* CacheData is stored in a Cache. Attributes are facts about the CacheData that can be updated by
* CachingAgents. Relationships are links to other CacheData.
*
* <p>Note: Not all caches may support a per record ttl
*/
@Beta
public interface CacheData {
String getId();
/** @return The ttl (in seconds) for this CacheData */
int getTtlSeconds();
Map<String, Object> getAttributes();
/**
* @return relationships for this CacheData, keyed by type returning a collection of ids for that
* type
*/
Map<String, Collection<String>> getRelationships();
}
|
{
"pile_set_name": "Github"
}
|
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
package Ice;
/**
* Instantiates user exceptions.
*
* @see InputStream#throwException
**/
public interface UserExceptionFactory
{
/**
* Instantiate a user exception with the given Slice type ID (such as <code>::Module::MyException</code>)
* and throw it. If the implementation does not throw an exception, the Ice run time will fall back
* to using its default behavior for instantiating the user exception.
*
* @param typeId The Slice type ID of the user exception to be created.
* @throws UserException A user exception instance corresponding to the type ID.
**/
void createAndThrow(String typeId)
throws UserException;
}
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_23) on Mon May 02 03:14:24 KST 2011 -->
<TITLE>
Uses of Class org.eclipse.cdt.managedbuilder.llvm.ui.preferences.LibraryPathListEditor
</TITLE>
<META NAME="date" CONTENT="2011-05-02">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.eclipse.cdt.managedbuilder.llvm.ui.preferences.LibraryPathListEditor";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../org/eclipse/cdt/managedbuilder/llvm/ui/preferences/LibraryPathListEditor.html" title="class in org.eclipse.cdt.managedbuilder.llvm.ui.preferences"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../../index.html?org/eclipse/cdt/managedbuilder/llvm/ui/preferences/\class-useLibraryPathListEditor.html" target="_top"><B>FRAMES</B></A>
<A HREF="LibraryPathListEditor.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.eclipse.cdt.managedbuilder.llvm.ui.preferences.LibraryPathListEditor</B></H2>
</CENTER>
No usage of org.eclipse.cdt.managedbuilder.llvm.ui.preferences.LibraryPathListEditor
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../org/eclipse/cdt/managedbuilder/llvm/ui/preferences/LibraryPathListEditor.html" title="class in org.eclipse.cdt.managedbuilder.llvm.ui.preferences"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../../index.html?org/eclipse/cdt/managedbuilder/llvm/ui/preferences/\class-useLibraryPathListEditor.html" target="_top"><B>FRAMES</B></A>
<A HREF="LibraryPathListEditor.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
* This file is part of the GNU LIBICONV Library.
*
* The GNU LIBICONV Library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* The GNU LIBICONV Library is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with the GNU LIBICONV Library; see the file COPYING.LIB.
* If not, see <http://www.gnu.org/licenses/>.
*/
/*
* CP1125
*/
static const unsigned short cp1125_2uni[80] = {
/* 0xb0 */
0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,
0x2555, 0x2563, 0x2551, 0x2557, 0x255d, 0x255c, 0x255b, 0x2510,
/* 0xc0 */
0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x255e, 0x255f,
0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x2567,
/* 0xd0 */
0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256b,
0x256a, 0x2518, 0x250c, 0x2588, 0x2584, 0x258c, 0x2590, 0x2580,
/* 0xe0 */
0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
/* 0xf0 */
0x0401, 0x0451, 0x0490, 0x0491, 0x0404, 0x0454, 0x0406, 0x0456,
0x0407, 0x0457, 0x00b7, 0x221a, 0x2116, 0x00a4, 0x25a0, 0x00a0,
};
static int
cp1125_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
{
unsigned char c = *s;
if (c < 0x80)
*pwc = (ucs4_t) c;
else if (c < 0xb0)
*pwc = (ucs4_t) c + 0x0390;
else
*pwc = (ucs4_t) cp1125_2uni[c-0xb0];
return 1;
}
static const unsigned char cp1125_page00[24] = {
0xff, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa8-0xaf */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, /* 0xb0-0xb7 */
};
static const unsigned char cp1125_page04[152] = {
0x00, 0xf0, 0x00, 0x00, 0xf4, 0x00, 0xf6, 0xf8, /* 0x00-0x07 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, /* 0x10-0x17 */
0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, /* 0x18-0x1f */
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, /* 0x20-0x27 */
0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, /* 0x28-0x2f */
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, /* 0x30-0x37 */
0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, /* 0x38-0x3f */
0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0x40-0x47 */
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0x48-0x4f */
0x00, 0xf1, 0x00, 0x00, 0xf5, 0x00, 0xf7, 0xf9, /* 0x50-0x57 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x80-0x87 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x88-0x8f */
0xf2, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
};
static const unsigned char cp1125_page25[168] = {
0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */
0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */
0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */
0xd9, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x00, /* 0x18-0x1f */
0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, /* 0x20-0x27 */
0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x00, 0x00, /* 0x28-0x2f */
0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, /* 0x30-0x37 */
0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, /* 0x38-0x3f */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */
0xcd, 0xba, 0xd5, 0xd6, 0xc9, 0xb8, 0xb7, 0xbb, /* 0x50-0x57 */
0xd4, 0xd3, 0xc8, 0xbe, 0xbd, 0xbc, 0xc6, 0xc7, /* 0x58-0x5f */
0xcc, 0xb5, 0xb6, 0xb9, 0xd1, 0xd2, 0xcb, 0xcf, /* 0x60-0x67 */
0xd0, 0xca, 0xd8, 0xd7, 0xce, 0x00, 0x00, 0x00, /* 0x68-0x6f */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */
0xdf, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, /* 0x80-0x87 */
0xdb, 0x00, 0x00, 0x00, 0xdd, 0x00, 0x00, 0x00, /* 0x88-0x8f */
0xde, 0xb0, 0xb1, 0xb2, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x98-0x9f */
0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */
};
static int
cp1125_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
{
unsigned char c = 0;
if (wc < 0x0080) {
*r = wc;
return 1;
}
else if (wc >= 0x00a0 && wc < 0x00b8)
c = cp1125_page00[wc-0x00a0];
else if (wc >= 0x0400 && wc < 0x0498)
c = cp1125_page04[wc-0x0400];
else if (wc == 0x2116)
c = 0xfc;
else if (wc == 0x221a)
c = 0xfb;
else if (wc >= 0x2500 && wc < 0x25a8)
c = cp1125_page25[wc-0x2500];
if (c != 0) {
*r = c;
return 1;
}
return RET_ILUNI;
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.lang.model.util;
import javax.lang.model.type.*;
import javax.annotation.processing.SupportedSourceVersion;
import static javax.lang.model.SourceVersion.*;
import javax.lang.model.SourceVersion;
/**
* A visitor of types based on their {@linkplain TypeKind kind} with
* default behavior appropriate for the {@link SourceVersion#RELEASE_7
* RELEASE_7} source version. For {@linkplain
* TypeMirror types} <tt><i>XYZ</i></tt> that may have more than one
* kind, the <tt>visit<i>XYZ</i></tt> methods in this class delegate
* to the <tt>visit<i>XYZKind</i></tt> method corresponding to the
* first argument's kind. The <tt>visit<i>XYZKind</i></tt> methods
* call {@link #defaultAction defaultAction}, passing their arguments
* to {@code defaultAction}'s corresponding parameters.
*
* <p> Methods in this class may be overridden subject to their
* general contract. Note that annotating methods in concrete
* subclasses with {@link java.lang.Override @Override} will help
* ensure that methods are overridden as intended.
*
* <p> <b>WARNING:</b> The {@code TypeVisitor} interface implemented
* by this class may have methods added to it in the future to
* accommodate new, currently unknown, language structures added to
* future versions of the Java™ programming language.
* Therefore, methods whose names begin with {@code "visit"} may be
* added to this class in the future; to avoid incompatibilities,
* classes which extend this class should not declare any instance
* methods with names beginning with {@code "visit"}.
*
* <p>When such a new visit method is added, the default
* implementation in this class will be to call the {@link
* #visitUnknown visitUnknown} method. A new type kind visitor class
* will also be introduced to correspond to the new language level;
* this visitor will have different default behavior for the visit
* method in question. When the new visitor is introduced, all or
* portions of this visitor may be deprecated.
*
* <p>Note that adding a default implementation of a new visit method
* in a visitor class will occur instead of adding a <em>default
* method</em> directly in the visitor interface since a Java SE 8
* language feature cannot be used to this version of the API since
* this version is required to be runnable on Java SE 7
* implementations. Future versions of the API that are only required
* to run on Java SE 8 and later may take advantage of default methods
* in this situation.
*
* @param <R> the return type of this visitor's methods. Use {@link
* Void} for visitors that do not need to return results.
* @param <P> the type of the additional parameter to this visitor's
* methods. Use {@code Void} for visitors that do not need an
* additional parameter.
*
* @see TypeKindVisitor6
* @see TypeKindVisitor8
* @since 1.7
*/
@SupportedSourceVersion(RELEASE_7)
public class TypeKindVisitor7<R, P> extends TypeKindVisitor6<R, P> {
/**
* Constructor for concrete subclasses to call; uses {@code null}
* for the default value.
*/
protected TypeKindVisitor7() {
super(null);
}
/**
* Constructor for concrete subclasses to call; uses the argument
* for the default value.
*
* @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
*/
protected TypeKindVisitor7(R defaultValue) {
super(defaultValue);
}
/**
* This implementation visits a {@code UnionType} by calling
* {@code defaultAction}.
*
* @param t {@inheritDoc}
* @param p {@inheritDoc}
* @return the result of {@code defaultAction}
*/
@Override
public R visitUnion(UnionType t, P p) {
return defaultAction(t, p);
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Default' ">
<StartAction>Project</StartAction>
<ExternalConsole>false</ExternalConsole>
</PropertyGroup>
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Extra' ">
<StartAction>Project</StartAction>
<ExternalConsole>false</ExternalConsole>
</PropertyGroup>
</Project>
|
{
"pile_set_name": "Github"
}
|
// Licensed to Cloudera, Inc. under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. Cloudera, Inc. licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.cloudera.csd.validation.monitoring.constraints;
import com.cloudera.csd.descriptors.MetricDescriptor;
import com.cloudera.csd.validation.monitoring.AbstractMonitoringValidator;
import com.cloudera.csd.validation.monitoring.MonitoringValidationContext;
import com.cloudera.csd.validation.references.components.DescriptorPathImpl;
import com.google.common.base.Preconditions;
import java.util.List;
import javax.validation.ConstraintViolation;
import org.apache.commons.lang.StringUtils;
/**
* See getDescription for more details.
*/
public class ConsistentMetricDefinitionValidator
extends AbstractMonitoringValidator<MetricDescriptor> {
@Override
public String getDescription() {
return
"Validates that metric definitions are consistent if that metric is " +
"defined for multiple entity types.";
}
@Override
public <T> List<ConstraintViolation<T>> validate(
MonitoringValidationContext context,
MetricDescriptor metricDescriptor,
DescriptorPathImpl path) {
Preconditions.checkNotNull(context);
Preconditions.checkNotNull(metricDescriptor);
Preconditions.checkNotNull(path);
MetricDescriptor definition =
context.metricsDefined.get(metricDescriptor.getName());
Preconditions.checkNotNull(definition);
if (!StringUtils.equals(
metricDescriptor.getLabel(),
definition.getLabel())) {
String msg = String.format(
"Inconsistent labels for metric '%s': '%s' and '%s'. ",
metricDescriptor.getName(),
metricDescriptor.getLabel(),
definition.getLabel());
return forViolation(
msg, metricDescriptor, metricDescriptor.getLabel(), path);
}
if (!StringUtils.equals(
metricDescriptor.getDescription(),
definition.getDescription())) {
String msg = String.format(
"Inconsistent descriptions for metric '%s': '%s' and '%s'. ",
metricDescriptor.getName(),
metricDescriptor.getDescription(),
definition.getDescription());
return forViolation(
msg, metricDescriptor, metricDescriptor.getDescription(), path);
}
if (!StringUtils.equals(
metricDescriptor.getNumeratorUnit(),
definition.getNumeratorUnit())) {
String msg = String.format(
"Inconsistent numerator units for metric '%s': '%s' and '%s'. ",
metricDescriptor.getName(),
metricDescriptor.getNumeratorUnit(),
definition.getNumeratorUnit());
return forViolation(
msg, metricDescriptor, metricDescriptor.getNumeratorUnit(), path);
}
if (!StringUtils.equals(
metricDescriptor.getDenominatorUnit(),
definition.getDenominatorUnit())) {
String msg = String.format(
"Inconsistent denominator units for metric '%s': '%s' and '%s'. ",
metricDescriptor.getName(),
metricDescriptor.getDenominatorUnit(),
definition.getDenominatorUnit());
return forViolation(
msg, metricDescriptor, metricDescriptor.getDenominatorUnit(), path);
}
if (metricDescriptor.isCounter() != definition.isCounter()) {
String msg = String.format(
"Inconsistent counter definitions for metric '%s': '%s' and '%s'. ",
metricDescriptor.getName(),
metricDescriptor.isCounter(),
definition.isCounter());
return forViolation(
msg, metricDescriptor, metricDescriptor.isCounter(), path);
}
if (!StringUtils.equals(
metricDescriptor.getWeightingMetricName(),
definition.getWeightingMetricName())) {
String msg = String.format(
"Inconsistent weighting metric names for metric '%s': '%s' and '%s'. ",
metricDescriptor.getName(),
metricDescriptor.getWeightingMetricName(),
definition.getWeightingMetricName());
return forViolation(
msg, metricDescriptor, metricDescriptor.getWeightingMetricName(), path);
}
return noViolations();
}
}
|
{
"pile_set_name": "Github"
}
|
package com.wzgiceman.rxretrofitlibrary.retrofit_rx;
import android.app.Application;
/**
* 全局app
* Created by WZG on 2016/12/12.
*/
public class RxRetrofitApp {
private static Application application;
private static boolean debug;
public static void init(Application app){
setApplication(app);
setDebug(true);
}
public static void init(Application app,boolean debug){
setApplication(app);
setDebug(debug);
}
public static Application getApplication() {
return application;
}
private static void setApplication(Application application) {
RxRetrofitApp.application = application;
}
public static boolean isDebug() {
return debug;
}
public static void setDebug(boolean debug) {
RxRetrofitApp.debug = debug;
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2019-2020, somewhere (somewhere0813@gmail.com).
* <p>
* Licensed under the GNU Lesser General Public License 3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* https://www.gnu.org/licenses/lgpl.html
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.albedo.java.modules.tool.repository;
import com.albedo.java.common.persistence.repository.BaseRepository;
import com.albedo.java.modules.tool.domain.EmailConfig;
/**
* @author somewhere
* @since 2019/2/1
*/
public interface EmailConfigRepository extends BaseRepository<EmailConfig> {
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8" ?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://my.netscape.com/rdf/simple/0.9/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<dc:title>My Title</dc:title>
</channel>
</rdf:RDF>
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>haskell@gentoo.org</email>
<name>Gentoo Haskell</name>
</maintainer>
<use>
<flag name="binary">enable binary instances</flag>
<flag name="hashable">enable hashable instances</flag>
<flag name="template-haskell">enable template_haskell</flag>
</use>
</pkgmetadata>
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>spring-boot-samples</artifactId>
<groupId>thinking-in-spring-boot</groupId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>thinking-in-spring-boot</groupId>
<artifactId>shared-libraries</artifactId>
<name>《Spring Boot 编程思想》共享库 - 主工程</name>
<packaging>pom</packaging>
<modules>
<module>shared-model</module>
<module>shared-servlet31</module>
</modules>
<dependencies>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
</dependency>
</dependencies>
</project>
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ignite.platform;
import java.io.Serializable;
import javax.cache.event.CacheEntryEvent;
import javax.cache.event.CacheEntryListenerException;
import org.apache.ignite.Ignite;
import org.apache.ignite.binary.BinaryObject;
import org.apache.ignite.cache.CacheEntryEventSerializableFilter;
import org.apache.ignite.resources.IgniteInstanceResource;
/**
* Test filter factory
*/
public class PlatformCacheEntryEventFilterFactory implements Serializable,
PlatformJavaObjectFactory<CacheEntryEventSerializableFilter> {
/** Property to be set from platform. */
private String startsWith = "-";
/** Injected instance. */
@IgniteInstanceResource
private Ignite ignite;
/** {@inheritDoc} */
@Override public CacheEntryEventSerializableFilter create() {
assert ignite != null;
return new CacheEntryEventSerializableFilter() {
@Override public boolean evaluate(CacheEntryEvent event) throws CacheEntryListenerException {
Object value = event.getValue();
if (value instanceof String)
return ((String)value).startsWith(startsWith);
assert value instanceof BinaryObject;
return ((String)((BinaryObject)value).field("String")).startsWith(startsWith);
}
};
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8152.3" systemVersion="14E46" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8124.4"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2016-2018 John Grosh (jagrosh) & Kaidan Gustave (TheMonitorLizard)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jagrosh.jdautilities.menu;
import java.awt.Color;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import com.jagrosh.jdautilities.commons.waiter.EventWaiter;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.MessageBuilder;
import net.dv8tion.jda.api.entities.Emote;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.MessageChannel;
import net.dv8tion.jda.api.entities.MessageReaction.ReactionEmote;
import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.events.message.react.MessageReactionAddEvent;
import net.dv8tion.jda.api.requests.RestAction;
import net.dv8tion.jda.internal.utils.Checks;
/**
* A {@link com.jagrosh.jdautilities.menu.Menu Menu} implementation that creates
* a organized display of emotes/emojis as buttons paired with options, and below
* the menu reactions corresponding to each button.
*
* @author John Grosh
*/
public class ButtonMenu extends Menu
{
private final Color color;
private final String text;
private final String description;
private final List<String> choices;
private final Consumer<ReactionEmote> action;
private final Consumer<Message> finalAction;
ButtonMenu(EventWaiter waiter, Set<User> users, Set<Role> roles, long timeout, TimeUnit unit,
Color color, String text, String description, List<String> choices, Consumer<ReactionEmote> action, Consumer<Message> finalAction)
{
super(waiter, users, roles, timeout, unit);
this.color = color;
this.text = text;
this.description = description;
this.choices = choices;
this.action = action;
this.finalAction = finalAction;
}
/**
* Shows the ButtonMenu as a new {@link net.dv8tion.jda.api.entities.Message Message}
* in the provided {@link net.dv8tion.jda.api.entities.MessageChannel MessageChannel}.
*
* @param channel
* The MessageChannel to send the new Message to
*/
@Override
public void display(MessageChannel channel)
{
initialize(channel.sendMessage(getMessage()));
}
/**
* Displays this ButtonMenu by editing the provided {@link net.dv8tion.jda.api.entities.Message Message}.
*
* @param message
* The Message to display the Menu in
*/
@Override
public void display(Message message)
{
initialize(message.editMessage(getMessage()));
}
// Initializes the ButtonMenu using a Message RestAction
// This is either through editing a previously existing Message
// OR through sending a new one to a TextChannel.
private void initialize(RestAction<Message> ra)
{
ra.queue(m -> {
for(int i=0; i<choices.size(); i++)
{
// Get the emote to display.
Emote emote;
try {
emote = m.getJDA().getEmoteById(choices.get(i));
} catch(Exception e) {
emote = null;
}
// If the emote is null that means that it might be an emoji.
// If it's neither, that's on the developer and we'll let it
// throw an error when we queue a rest action.
RestAction<Void> r = emote==null ? m.addReaction(choices.get(i)) : m.addReaction(emote);
if(i+1<choices.size())
r.queue(); // If there is still more reactions to add we delay using the EventWaiter
else
{
// This is the last reaction added.
r.queue(v -> {
waiter.waitForEvent(MessageReactionAddEvent.class, event -> {
// If the message is not the same as the ButtonMenu
// currently being displayed.
if(!event.getMessageId().equals(m.getId()))
return false;
// If the reaction is an Emote we get the Snowflake,
// otherwise we get the unicode value.
String re = event.getReaction().getReactionEmote().isEmote()
? event.getReaction().getReactionEmote().getId()
: event.getReaction().getReactionEmote().getName();
// If the value we got is not registered as a button to
// the ButtonMenu being displayed we return false.
if(!choices.contains(re))
return false;
// Last check is that the person who added the reaction
// is a valid user.
return isValidUser(event.getUser(), event.isFromGuild() ? event.getGuild() : null);
}, (MessageReactionAddEvent event) -> {
// What happens next is after a valid event
// is fired and processed above.
// Preform the specified action with the ReactionEmote
action.accept(event.getReaction().getReactionEmote());
finalAction.accept(m);
}, timeout, unit, () -> finalAction.accept(m));
});
}
}
});
}
// Generates a ButtonMenu message
private Message getMessage()
{
MessageBuilder mbuilder = new MessageBuilder();
if(text!=null)
mbuilder.append(text);
if(description!=null)
mbuilder.setEmbed(new EmbedBuilder().setColor(color).setDescription(description).build());
return mbuilder.build();
}
/**
* The {@link com.jagrosh.jdautilities.menu.Menu.Builder Menu.Builder} for
* a {@link com.jagrosh.jdautilities.menu.ButtonMenu ButtonMenu}.
*
* @author John Grosh
*/
public static class Builder extends Menu.Builder<Builder, ButtonMenu>
{
private Color color;
private String text;
private String description;
private final List<String> choices = new LinkedList<>();
private Consumer<ReactionEmote> action;
private Consumer<Message> finalAction = (m) -> {};
/**
* Builds the {@link com.jagrosh.jdautilities.menu.ButtonMenu ButtonMenu}
* with this Builder.
*
* @return The OrderedMenu built from this Builder.
*
* @throws java.lang.IllegalArgumentException
* If one of the following is violated:
* <ul>
* <li>No {@link com.jagrosh.jdautilities.commons.waiter.EventWaiter EventWaiter} was set.</li>
* <li>No choices were set.</li>
* <li>No action {@link java.util.function.Consumer Consumer} was set.</li>
* <li>Neither text nor description were set.</li>
* </ul>
*/
@Override
public ButtonMenu build()
{
Checks.check(waiter != null, "Must set an EventWaiter");
Checks.check(!choices.isEmpty(), "Must have at least one choice");
Checks.check(action != null, "Must provide an action consumer");
Checks.check(text != null || description != null, "Either text or description must be set");
return new ButtonMenu(waiter, users, roles, timeout, unit, color, text, description, choices, action, finalAction);
}
/**
* Sets the {@link java.awt.Color Color} of the {@link net.dv8tion.jda.api.entities.MessageEmbed MessageEmbed}.
*
* @param color
* The Color of the MessageEmbed
*
* @return This builder
*/
public Builder setColor(Color color)
{
this.color = color;
return this;
}
/**
* Sets the text of the {@link net.dv8tion.jda.api.entities.Message Message} to be displayed
* when the {@link com.jagrosh.jdautilities.menu.ButtonMenu ButtonMenu} is built.
*
* <p>This is displayed directly above the embed.
*
* @param text
* The Message content to be displayed above the embed when the ButtonMenu is built
*
* @return This builder
*/
public Builder setText(String text)
{
this.text = text;
return this;
}
/**
* Sets the description to be placed in an {@link net.dv8tion.jda.api.entities.MessageEmbed MessageEmbed}.
* <br>If this is {@code null}, no MessageEmbed will be displayed
*
* @param description
* The content of the MessageEmbed's description
*
* @return This builder
*/
public Builder setDescription(String description)
{
this.description = description;
return this;
}
/**
* Sets the {@link java.util.function.Consumer Consumer} action to perform upon selecting a button.
*
* @param action
* The Consumer action to perform upon selecting a button
*
* @return This builder
*/
public Builder setAction(Consumer<ReactionEmote> action)
{
this.action = action;
return this;
}
/**
* Sets the {@link java.util.function.Consumer Consumer} to perform if the
* {@link com.jagrosh.jdautilities.menu.ButtonMenu ButtonMenu} is done,
* either via cancellation, a timeout, or a selection being made.<p>
*
* This accepts the message used to display the menu when called.
*
* @param finalAction
* The Runnable action to perform if the ButtonMenu is done
*
* @return This builder
*/
public Builder setFinalAction(Consumer<Message> finalAction)
{
this.finalAction = finalAction;
return this;
}
/**
* Adds a single String unicode emoji as a button choice.
*
* <p>Any non-unicode {@link net.dv8tion.jda.api.entities.Emote Emote} should be
* added using {@link ButtonMenu.Builder#addChoice(Emote)
* ButtonMenu.Builder#addChoice(Emote)}.
*
* @param emoji
* The String unicode emoji to add
*
* @return This builder
*/
public Builder addChoice(String emoji)
{
this.choices.add(emoji);
return this;
}
/**
* Adds a single custom {@link net.dv8tion.jda.api.entities.Emote Emote} as button choices.
*
* <p>Any regular unicode emojis should be added using {@link
* ButtonMenu.Builder#addChoice(String)
* ButtonMenu.Builder#addChoice(String)}.
*
* @param emote
* The Emote object to add
*
* @return This builder
*/
public Builder addChoice(Emote emote)
{
return addChoice(emote.getId());
}
/**
* Adds String unicode emojis as button choices.
*
* <p>Any non-unicode {@link net.dv8tion.jda.api.entities.Emote Emote}s should be
* added using {@link ButtonMenu.Builder#addChoices(Emote...)
* ButtonMenu.Builder#addChoices(Emote...)}.
*
* @param emojis
* The String unicode emojis to add
*
* @return This builder
*/
public Builder addChoices(String... emojis)
{
for(String emoji : emojis)
addChoice(emoji);
return this;
}
/**
* Adds custom {@link net.dv8tion.jda.api.entities.Emote Emote}s as button choices.
*
* <p>Any regular unicode emojis should be added using {@link
* ButtonMenu.Builder#addChoices(String...)
* ButtonMenu.Builder#addChoices(String...)}.
*
* @param emotes
* The Emote objects to add
*
* @return This builder
*/
public Builder addChoices(Emote... emotes)
{
for(Emote emote : emotes)
addChoice(emote);
return this;
}
/**
* Sets the String unicode emojis as button choices.
*
* <p>Any non-unicode {@link net.dv8tion.jda.api.entities.Emote Emote}s should be
* set using {@link ButtonMenu.Builder#setChoices(Emote...)
* ButtonMenu.Builder#setChoices(Emote...)}.
*
* @param emojis
* The String unicode emojis to set
*
* @return This builder
*/
public Builder setChoices(String... emojis)
{
this.choices.clear();
return addChoices(emojis);
}
/**
* Sets the {@link net.dv8tion.jda.api.entities.Emote Emote}s as button choices.
*
* <p>Any regular unicode emojis should be set using {@link
* ButtonMenu.Builder#setChoices(String...)
* ButtonMenu.Builder#setChoices(String...)}.
*
* @param emotes
* The Emote objects to set
*
* @return This builder
*/
public Builder setChoices(Emote... emotes)
{
this.choices.clear();
return addChoices(emotes);
}
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2013-2020 The OpenZipkin Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package brave.propagation;
import brave.Span;
import brave.Tracer;
import brave.Tracer.SpanInScope;
import brave.Tracing;
import brave.internal.Nullable;
import java.util.ArrayDeque;
/**
* This type allows you to place a span in scope in one method and access it in another without
* using an explicit request parameter.
*
* <p>Many libraries expose a callback model as opposed to an interceptor one. When creating new
* instrumentation, you may find places where you need to place a span in scope in one callback
* (like `onStart()`) and end the scope in another callback (like `onFinish()`).
*
* <p>Provided the library guarantees these run on the same thread, you can simply propagate the
* result of {@link Tracer#startScopedSpan(String)} or {@link Tracer#withSpanInScope(Span)} from the
* starting callback to the closing one. This is typically done with a request-scoped attribute.
*
* Here's an example:
* <pre>{@code
* class MyFilter extends Filter {
* public void onStart(Request request, Attributes attributes) {
* // Assume you have code to start the span and add relevant tags...
*
* // We now set the span in scope so that any code between here and
* // the end of the request can see it with Tracer.currentSpan()
* SpanInScope spanInScope = tracer.withSpanInScope(span);
*
* // We don't want to leak the scope, so we place it somewhere we can
* // lookup later
* attributes.put(SpanInScope.class, spanInScope);
* }
*
* public void onFinish(Response response, Attributes attributes) {
* // as long as we are on the same thread, we can read the span started above
* Span span = tracer.currentSpan();
*
* // Assume you have code to complete the span
*
* // We now remove the scope (which implicitly detaches it from the span)
* attributes.remove(SpanInScope.class).close();
* }
* }
* }</pre>
*
* <p>Sometimes you have to instrument a library where There's no attribute namespace shared across
* request and response. For this scenario, you can use {@link ThreadLocalSpan} to temporarily store
* the span between callbacks.
*
* Here's an example:
* <pre>{@code
* class MyFilter extends Filter {
* final ThreadLocalSpan threadLocalSpan;
*
* public void onStart(Request request) {
* // Allocates a span and places it in scope so that code between here and onFinish can see it
* Span span = threadLocalSpan.next();
* if (span == null || span.isNoop()) return; // skip below logic on noop
*
* // Assume you have code to start the span and add relevant tags...
* }
*
* public void onFinish(Response response, Attributes attributes) {
* // as long as we are on the same thread, we can read the span started above
* Span span = threadLocalSpan.remove();
* if (span == null || span.isNoop()) return; // skip below logic on noop
*
* // Assume you have code to complete the span
* }
* }
* }</pre>
*/
public class ThreadLocalSpan {
/**
* This uses the {@link Tracing#currentTracer()}, which means calls to {@link #next()} may return
* null. Use this when you have no other means to get a reference to the tracer. For example, JDBC
* connections, as they often initialize prior to the tracing component.
*/
public static final ThreadLocalSpan CURRENT_TRACER = new ThreadLocalSpan(null);
public static ThreadLocalSpan create(Tracer tracer) {
if (tracer == null) throw new NullPointerException("tracer == null");
return new ThreadLocalSpan(tracer);
}
@Nullable final Tracer tracer;
ThreadLocalSpan(Tracer tracer) {
this.tracer = tracer;
}
Tracer tracer() {
return tracer != null ? tracer : Tracing.currentTracer();
}
/**
* Returns the {@link Tracer#nextSpan(TraceContextOrSamplingFlags)} or null if {@link
* #CURRENT_TRACER} and tracing isn't available.
*/
@Nullable public Span next(TraceContextOrSamplingFlags extracted) {
Tracer tracer = tracer();
if (tracer == null) return null;
Span next = tracer.nextSpan(extracted);
SpanAndScope spanAndScope = new SpanAndScope(next, tracer.withSpanInScope(next));
getCurrentSpanInScopeStack().addFirst(spanAndScope);
return next;
}
/**
* Returns the {@link Tracer#nextSpan()} or null if {@link #CURRENT_TRACER} and tracing isn't
* available.
*/
@Nullable public Span next() {
Tracer tracer = tracer();
if (tracer == null) return null;
Span next = tracer.nextSpan();
SpanAndScope spanAndScope = new SpanAndScope(next, tracer.withSpanInScope(next));
getCurrentSpanInScopeStack().addFirst(spanAndScope);
return next;
}
static final class SpanAndScope {
final Span span;
final SpanInScope spanInScope;
SpanAndScope(Span span, SpanInScope spanInScope) {
this.span = span;
this.spanInScope = spanInScope;
}
}
/**
* Returns the span set in scope via {@link #next()} or null if there was none.
*
* <p>When assertions are on, this will throw an assertion error if the span returned was not the
* one currently in context. This could happen if someone called {@link
* Tracer#withSpanInScope(Span)} or {@link CurrentTraceContext#newScope(TraceContext)} outside a
* try/finally block.
*/
@Nullable public Span remove() {
Tracer tracer = tracer();
Span currentSpan = tracer != null ? tracer.currentSpan() : null;
SpanAndScope spanAndScope = getCurrentSpanInScopeStack().pollFirst();
if (spanAndScope == null) return currentSpan;
Span span = spanAndScope.span;
spanAndScope.spanInScope.close();
assert span.equals(currentSpan) :
"Misalignment: scoped span " + span + " != current span " + currentSpan;
return currentSpan;
}
/**
* This keeps track of a stack with a normal array dequeue. Redundant stacking of the same span is
* not possible because there is no api to place an arbitrary span in scope using this api.
*/
@SuppressWarnings("ThreadLocalUsage") // intentional: to support multiple Tracer instances
final ThreadLocal<ArrayDeque<SpanAndScope>> currentSpanInScopeStack = new ThreadLocal<>();
ArrayDeque<SpanAndScope> getCurrentSpanInScopeStack() {
ArrayDeque<SpanAndScope> stack = currentSpanInScopeStack.get();
if (stack == null) {
stack = new ArrayDeque<>();
currentSpanInScopeStack.set(stack);
}
return stack;
}
}
|
{
"pile_set_name": "Github"
}
|
<component name="libraryTable">
<library name="Maven: org.springframework.cloud:spring-cloud-bus:1.3.0.RELEASE">
<CLASSES>
<root url="jar://$USER_HOME$/.m2/repository/org/springframework/cloud/spring-cloud-bus/1.3.0.RELEASE/spring-cloud-bus-1.3.0.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.m2/repository/org/springframework/cloud/spring-cloud-bus/1.3.0.RELEASE/spring-cloud-bus-1.3.0.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.m2/repository/org/springframework/cloud/spring-cloud-bus/1.3.0.RELEASE/spring-cloud-bus-1.3.0.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>
|
{
"pile_set_name": "Github"
}
|
// Copyright 2020 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.
package errorutil
// TenantSQLDeprecatedWrapper is a helper to annotate uses of components that
// are in the progress of being phased out due to work towards multi-tenancy.
// It is usually usually used under a layer of abstraction that is aware of
// the wrapped object's type.
//
// Deprecated objects are broadly objects that reach deeply into the KV layer
// and which will be inaccessible from a SQL tenant server. Their uses in SQL
// fall into two categories:
//
// - functionality essential for multi-tenancy, i.e. a use which will
// have to be removed before we can start SQL tenant servers.
// - non-essential functionality, which will be disabled when run in
// a SQL tenant server. It may or may not be a long-term goal to remove
// this usage; this is determined on a case-by-case basis.
//
// As work towards multi-tenancy is taking place, semi-dedicated SQL tenant
// servers are supported. These are essentially SQL tenant servers that get
// to reach into the KV layer as needed while the first category above is
// being whittled down.
//
// This wrapper aids that process by offering two methods corresponding to
// the categories above:
//
// Deprecated() trades in a reference to Github issue (tracking the removal of
// an essential usage) for the wrapped object; OptionalErr() returns the wrapped
// object only if the wrapper was set up to allow this.
//
// Note that the wrapped object will in fact always have to be present as long
// as calls to Deprecated() exist. However, when running semi-dedicated SQL
// tenants, the wrapper should be set up with exposed=false so that it can
// pretend that the object is in fact not available.
//
// Finally, once all Deprecated() calls have been removed, it is possible to
// treat the wrapper as a pure option type, i.e. wrap a nil value with
// exposed=false.
type TenantSQLDeprecatedWrapper struct {
v interface{}
exposed bool
}
// MakeTenantSQLDeprecatedWrapper wraps an arbitrary object. When the 'exposed'
// parameter is set to true, Optional() will return the object.
func MakeTenantSQLDeprecatedWrapper(v interface{}, exposed bool) TenantSQLDeprecatedWrapper {
return TenantSQLDeprecatedWrapper{v: v, exposed: exposed}
}
// Optional returns the wrapped object if it is available (meaning that the
// wrapper was set up to make it available). This should be called by
// functionality that relies on the wrapped object but can be disabled when this
// is desired.
//
// Optional functionality should be used sparingly as it increases the
// maintenance and testing burden. It is preferable to use OptionalErr()
// (and return the error) where possible.
func (w TenantSQLDeprecatedWrapper) Optional() (interface{}, bool) {
if !w.exposed {
return nil, false
}
return w.v, true
}
// OptionalErr calls Optional and returns an error (referring to the optionally
// supplied Github issues) if the wrapped object is not available.
func (w TenantSQLDeprecatedWrapper) OptionalErr(issue int) (interface{}, error) {
v, ok := w.Optional()
if !ok {
return nil, UnsupportedWithMultiTenancy(issue)
}
return v, nil
}
|
{
"pile_set_name": "Github"
}
|
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in D:\Android\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
|
{
"pile_set_name": "Github"
}
|
package mods.eln.node;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.eln.misc.Direction;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import java.io.DataInputStream;
public interface INodeEntity {
String getNodeUuid();
void serverPublishUnserialize(DataInputStream stream);
void serverPacketUnserialize(DataInputStream stream);
@SideOnly(Side.CLIENT)
GuiScreen newGuiDraw(Direction side, EntityPlayer player);
Container newContainer(Direction side, EntityPlayer player);
}
|
{
"pile_set_name": "Github"
}
|
/*
* $Id: TestRequestUtilsPopulate.java 471754 2006-11-06 14:55:09Z husted $
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts.util;
import javax.servlet.ServletException;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.util.RequestUtils;
import org.apache.struts.Globals;
import org.apache.struts.mock.TestMockBase;
import org.apache.struts.mock.MockFormBean;
import org.apache.struts.mock.MockMultipartRequestHandler;
/**
* Unit tests for the RequestUtil's <code>populate</code> method.
*
* @version $Rev: 471754 $
*/
public class TestRequestUtilsPopulate extends TestMockBase {
/**
* Defines the testcase name for JUnit.
*
* @param theName the testcase's name.
*/
public TestRequestUtilsPopulate(String theName) {
super(theName);
}
/**
* Start the tests.
*
* @param theArgs the arguments. Not used
*/
public static void main(String[] theArgs) {
junit.awtui.TestRunner.main(
new String[] { TestRequestUtilsPopulate.class.getName()});
}
/**
* @return a test suite (<code>TestSuite</code>) that includes all methods
* starting with "test"
*/
public static Test suite() {
// All methods starting with "test" will be executed in the test suite.
return new TestSuite(TestRequestUtilsPopulate.class);
}
public void setUp() {
super.setUp();
}
public void tearDown() {
super.tearDown();
}
/**
* Ensure that the getMultipartRequestHandler cannot be seen in
* a subclass of ActionForm.
*
* The purpose of this test is to ensure that Bug #38534 is fixed.
*
*/
public void testMultipartVisibility() throws Exception {
String mockMappingName = "mockMapping";
String stringValue = "Test";
MockFormBean mockForm = new MockFormBean();
ActionMapping mapping = new ActionMapping();
mapping.setName(mockMappingName);
// Set up the mock HttpServletRequest
request.setMethod("POST");
request.setContentType("multipart/form-data");
request.setAttribute(Globals.MULTIPART_KEY, MockMultipartRequestHandler.class.getName());
request.setAttribute(Globals.MAPPING_KEY, mapping);
request.addParameter("stringProperty", stringValue);
request.addParameter("multipartRequestHandler.mapping.name", "Bad");
// Check the Mapping/ActionForm before
assertNull("Multipart Handler already set", mockForm.getMultipartRequestHandler());
assertEquals("Mapping name not set correctly", mockMappingName, mapping.getName());
// Try to populate
try {
RequestUtils.populate(mockForm, request);
} catch(ServletException se) {
// Expected BeanUtils.populate() to throw a NestedNullException
// which gets wrapped in RequestUtils in a ServletException
assertEquals("Unexpected type of Exception thrown", "BeanUtils.populate", se.getMessage());
}
// Check the Mapping/ActionForm after
assertNotNull("Multipart Handler Missing", mockForm.getMultipartRequestHandler());
assertEquals("Mapping name has been modified", mockMappingName, mapping.getName());
}
}
|
{
"pile_set_name": "Github"
}
|
(ns restql.core.statement.resolve-chained-values-test
(:require [clojure.test :refer :all]
[restql.core.statement.resolve-chained-values :refer [resolve-chained-values]]))
(deftest resolve-chained-values-test
(testing "Do nothing if theres no with chained"
(is (= {:from :resource-name :with {:id 1}}
(resolve-chained-values {:from :resource-name :with {:id 1}}
{}))))
(testing "Returns a statement with :empty-chained as value if done-resource status code is not in 399 >= status >= 200"
(is (= {:from :resource-name, :with {:id :empty-chained}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id]}}
[[:done-resource {:status 422 :body "ERROR"}]])))
(is (= {:from :resource-name :with {:id [:empty-chained 2]}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id]}}
[[:done-resource [{:status 400 :body "ERROR"} {:body {:id 2}}]]]))))
(testing "Returns a statement with single done resource value"
(is (= {:from :resource-name :with {:id 1}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id]}}
[[:done-resource {:body {:id 1}}]])))
(is (= {:from :resource-name :with {:id 1 :name "clojurist"}}
(resolve-chained-values {:from :resource-name :with {:id 1 :name [:done-resource :resource-id]}}
[[:done-resource {:body {:resource-id "clojurist"}}]])))
(is (= {:from :resource-name :with {:id 1 :name ["clojurist"]}}
(resolve-chained-values {:from :resource-name :with {:id 1 :name [:done-resource :resource-id]}}
[[:done-resource {:body {:resource-id ["clojurist"]}}]]))))
(testing "Returns a statement with multiple done resource value"
(is (= {:from :resource-name :with {:id [1 2]}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id]}}
[[:done-resource [{:body {:id 1}} {:body {:id 2}}]]]))))
(testing "Returns a statement with single list value"
(is (= {:from :resource-name :with {:id [1 2] :name ["a" "b"]}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id] :name ["a" "b"]}}
[[:done-resource {:body {:id [1 2]}}]]))))
(testing "Returns a statement with single list value"
(is (= {:from :resource-name :with {:id [[1 2] [2 3]] :name ["a" "b"]}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id] :name ["a" "b"]}}
[[:done-resource [{:body {:id [1 2]}}
{:body {:id [2 3]}}]]]))))
(testing "Returns a statement with multiple list value"
(is (= {:from :sidekick :with {:id [[1 2] [3 4]]} :method :get}
(resolve-chained-values {:from :sidekick :with {:id [:heroes :sidekickId]} :method :get}
[[:heroes {:resource :heroes :body [{:id "A" :sidekickId [1 2]}
{:id "B" :sidekickId [3 4]}]}]])))
(is (= {:from :sidekick :with {:id [[[1 2] [3 4]]]} :method :get}
(resolve-chained-values {:from :sidekick :with {:id [:heroes :sidekickId]} :method :get}
[[:heroes [{:resource :heroes :body [{:id "A" :sidekickId [1 2]}
{:id "B" :sidekickId [3 4]}]}]]]))))
(testing "Returns a statement with single list value"
(is (= {:from :resource-name :with {:id [1 nil] :name ["a" "b"]}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id] :name ["a" "b"]}}
[[:done-resource [{:body {:id 1 :class "rest"}} {:body {:id nil :class "rest"}}]]]))))
(testing "Returns a statement with empty param"
(is (= {:from :resource-name :with {:id [1 nil] :name ["a" "b"]}}
(resolve-chained-values {:from :resource-name :with {:id [:done-resource :id] :name ["a" "b"]}}
[[:done-resource [{:body {:id 1 :class "rest"}} {:body {:class "rest"}}]]]))))
(testing "Resolve a statement with lists and nested values"
(is (= {:from :done-resource :with {:name ["clojure" "java"]}}
(resolve-chained-values {:from :done-resource :with {:name [:resource-id :language :id]}}
[[:resource-id {:body {:language {:id ["clojure" "java"]}}}]])))
(is (= {:from :done-resource :with {:name "clojure"}}
(resolve-chained-values {:from :done-resource :with {:name [:resource-id :language :id]}}
[[:resource-id {:body {:language {:id "clojure"}}}]])))
(is (= {:from :done-resource :with {:name ["clojure"]}}
(resolve-chained-values {:from :done-resource :with {:name [:resource-id :language :id]}}
[[:resource-id {:body {:language [{:id "clojure"}]}}]])))
(is (= {:from :done-resource :with {:name ["clojure" "java"]}}
(resolve-chained-values {:from :done-resource :with {:name [:resource-id :language :id]}}
[[:resource-id {:body {:language [{:id "clojure"} {:id "java"}]}}]])))
(is (= {:from :done-resource :with {:name ["python" "elixir"]}}
(resolve-chained-values {:from :done-resource :with {:name [:resource-id :language :xpto :id]}}
[[:resource-id {:body {:language [{:xpto {:id "python"}} {:xpto {:id "elixir"}}]}}]])))
(is (= {:from :done-resource :with {:name [["python" "123"] ["elixir" "345"]]}}
(resolve-chained-values {:from :done-resource :with {:name [:resource-id :language :xpto :id]}}
[[:resource-id {:body {:language [{:xpto {:id ["python" "123"]}} {:xpto {:id ["elixir" "345"]}}]}}]])))
(is (= {:from :done-resource :with {:name [["python" "123"] ["elixir" "345"]]}}
(resolve-chained-values {:from :done-resource :with {:name [:resource-id :language :xpto :asdf :id]}}
[[:resource-id {:body {:language [{:xpto {:asdf [{:id "python"} {:id "123"}]}} {:xpto {:asdf [{:id "elixir"} {:id "345"}]}}]}}]])))
(is (= {:from :weapon, :in :villain.weapons, :with {:id [[["DAGGER"] ["GUN"]] [["SWORD"] ["SHOTGUN"]]]}, :method :get}
(resolve-chained-values {:from :weapon, :in :villain.weapons, :with {:id [:villain :weapons]}, :method :get}
[[:villain [[{:body {:name "1", :weapons ["DAGGER"]}} {:body {:name "2", :weapons ["GUN"]}}]
[{:body {:name "3", :weapons ["SWORD"]}} {:body {:name "4", :weapons ["SHOTGUN"]}}]]]]))))
(testing "Resolve with encoder"
(is (= (binding [*print-meta* true]
(pr-str {:from :resource-name :with {:id ^{:encoder :json} [1 nil] :name ["a" "b"]}}))
(binding [*print-meta* true]
(pr-str (resolve-chained-values {:from :resource-name :with {:id ^{:encoder :json} [:done-resource :id] :name ["a" "b"]}}
[[:done-resource [{:body {:id 1 :class "rest"}} {:body {:class "rest"}}]]]))))))
(testing "Resolve with encoder on single return value"
(is (= (binding [*print-meta* true]
(pr-str {:from :resource-name :with {:id ^{:encoder :json} {} :name ["a" "b"]}}))
(binding [*print-meta* true]
(pr-str (resolve-chained-values {:from :resource-name :with {:id ^{:encoder :json} [:done-resource :id] :name ["a" "b"]}}
[[:done-resource {:body {:id {} :class "rest"}}]]))))))
(testing "Returns a statement with chained param inside list"
(is (= {:from :resource-name :with {:weapon-class ["melee"]}}
(resolve-chained-values {:from :resource-name :with {:weapon-class [:done-resource :heroes :weapons :type :class]}}
[[:done-resource {:body {:heroes [{:weapons {:type {:class "melee"}}}]}}]])))
(is (= {:from :resource-name :with {:weapon-class [["melee"]]}}
(resolve-chained-values {:from :resource-name :with {:weapon-class [[:done-resource :heroes :weapons :type :class]]}}
[[:done-resource {:body {:heroes [{:weapons {:type {:class "melee"}}}]}}]])))
(is (= {:from :resource-name :with {:weapon-class [[]]}}
(resolve-chained-values {:from :resource-name :with {:weapon-class [[:done-resource :heroes :weapons :type :class]]}}
[[:done-resource {:body {:heroes []}}]])))
(is (= {:from :resource-name :with {:weapon-class [[[]]]}}
(resolve-chained-values {:from :resource-name :with {:weapon-class [[[:done-resource :heroes :weapons :type :class]]]}}
[[:done-resource {:body {:heroes []}}]])))))
|
{
"pile_set_name": "Github"
}
|
using Models.Produce.NH;
using NHibernate;
using NHibernate.Cfg;
namespace Sample_WebApi.Controllers {
public static class ProduceNHConfig {
private static Configuration _configuration;
private static ISessionFactory _sessionFactory;
static ProduceNHConfig()
{
var modelAssembly = typeof(ItemOfProduce).Assembly;
// Configure NHibernate
_configuration = new Configuration();
_configuration.Configure(); //configure from the app.config
_configuration.SetProperty("connection.connection_string_name", "ProduceTPHConnection");
_configuration.AddAssembly(modelAssembly); // mapping is in this assembly
_sessionFactory = _configuration.BuildSessionFactory();
}
public static Configuration Configuration
{
get { return _configuration; }
}
public static ISessionFactory SessionFactory
{
get { return _sessionFactory; }
}
public static ISession OpenSession()
{
ISession session = _sessionFactory.OpenSession();
return session;
}
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2016 Crown Copyright
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package stroom.explorer.client.event;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HasHandlers;
import com.gwtplatform.mvp.client.Layer;
import stroom.widget.tab.client.presenter.TabData;
public class OpenExplorerTabEvent extends GwtEvent<OpenExplorerTabEvent.Handler> {
private static Type<Handler> TYPE;
private final TabData tabData;
private final Layer layer;
private OpenExplorerTabEvent(final TabData tabData, final Layer layer) {
this.tabData = tabData;
this.layer = layer;
}
public static void fire(final HasHandlers handlers, final TabData tabData, final Layer layer) {
handlers.fireEvent(new OpenExplorerTabEvent(tabData, layer));
}
public static Type<Handler> getType() {
if (TYPE == null) {
TYPE = new Type<>();
}
return TYPE;
}
@Override
public Type<Handler> getAssociatedType() {
return getType();
}
@Override
protected void dispatch(final Handler handler) {
handler.onOpen(this);
}
public TabData getTabData() {
return tabData;
}
public Layer getLayer() {
return layer;
}
public interface Handler extends EventHandler {
void onOpen(OpenExplorerTabEvent event);
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2013-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.cloudfoundry.client.v2.spacequotadefinitions;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.immutables.value.Value;
/**
* The request payload for the Retrieve a Particular Space Quota Definition operation
*/
@Value.Immutable
abstract class _GetSpaceQuotaDefinitionRequest {
/**
* The space quota definition id
*/
@JsonIgnore
abstract String getSpaceQuotaDefinitionId();
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.codeInsight.completion.originInfo;
/**
* @author Max Medvedev
*/
public interface OriginInfoAwareElement {
@javax.annotation.Nullable
String getOriginInfo();
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradle.integtests.tooling.r22
import org.gradle.integtests.tooling.CancellationSpec
import org.gradle.integtests.tooling.fixture.TestResultHandler
import org.gradle.integtests.tooling.r18.BrokenAction
import org.gradle.tooling.BuildCancelledException
import org.gradle.tooling.GradleConnector
import org.gradle.tooling.ProjectConnection
import org.gradle.tooling.model.GradleProject
class CancellationCrossVersionSpec extends CancellationSpec {
def "can cancel build during settings phase"() {
settingsFile << waitForCancel()
buildFile << """
throw new RuntimeException("should not run")
"""
def cancel = GradleConnector.newCancellationTokenSource()
def sync = server.expectAndBlock("registered")
def resultHandler = new TestResultHandler()
when:
withConnection { ProjectConnection connection ->
def build = connection.newBuild()
build.forTasks(':sub:broken')
build.withCancellationToken(cancel.token())
collectOutputs(build)
build.run(resultHandler)
sync.waitForAllPendingCalls(resultHandler)
cancel.cancel()
sync.releaseAll()
resultHandler.finished()
}
then:
buildWasCancelled(resultHandler)
}
def "can cancel build during configuration phase"() {
file("gradle.properties") << "org.gradle.configureondemand=${configureOnDemand}"
setupCancelInConfigurationBuild()
def cancel = GradleConnector.newCancellationTokenSource()
def sync = server.expectAndBlock("registered")
def resultHandler = new TestResultHandler()
when:
withConnection { ProjectConnection connection ->
def build = connection.newBuild()
build.forTasks(':sub:broken')
build.withCancellationToken(cancel.token())
collectOutputs(build)
build.run(resultHandler)
sync.waitForAllPendingCalls(resultHandler)
cancel.cancel()
sync.releaseAll()
resultHandler.finished()
}
then:
buildWasCancelled(resultHandler)
where:
configureOnDemand << [true, false]
}
def "can cancel model creation during configuration phase"() {
file("gradle.properties") << "org.gradle.configureondemand=${configureOnDemand}"
setupCancelInConfigurationBuild()
def cancel = GradleConnector.newCancellationTokenSource()
def sync = server.expectAndBlock("registered")
def resultHandler = new TestResultHandler()
when:
withConnection { ProjectConnection connection ->
def model = connection.model(GradleProject)
model.withCancellationToken(cancel.token())
collectOutputs(model)
model.get(resultHandler)
sync.waitForAllPendingCalls(resultHandler)
cancel.cancel()
sync.releaseAll()
resultHandler.finished()
}
then:
configureWasCancelled(resultHandler, "Could not fetch model of type 'GradleProject' using")
where:
configureOnDemand << [true, false]
}
def "can cancel build action execution during configuration phase"() {
file("gradle.properties") << "org.gradle.configureondemand=${configureOnDemand}"
setupCancelInConfigurationBuild()
def cancel = GradleConnector.newCancellationTokenSource()
def sync = server.expectAndBlock("registered")
def resultHandler = new TestResultHandler()
when:
withConnection { ProjectConnection connection ->
def action = connection.action(new BrokenAction())
action.withCancellationToken(cancel.token())
collectOutputs(action)
action.run(resultHandler)
sync.waitForAllPendingCalls(resultHandler)
cancel.cancel()
sync.releaseAll()
resultHandler.finished()
}
then:
configureWasCancelled(resultHandler, "Could not run build action using")
where:
configureOnDemand << [true, false]
}
def "can cancel build and skip some tasks"() {
buildFile << """
task hang {
doLast {
${waitForCancel()}
}
}
task notExecuted(dependsOn: hang) {
doLast {
throw new RuntimeException("should not run")
}
}
"""
def cancel = GradleConnector.newCancellationTokenSource()
def sync = server.expectAndBlock("registered")
def resultHandler = new TestResultHandler()
when:
withConnection { ProjectConnection connection ->
def build = connection.newBuild()
build.forTasks('notExecuted')
build.withCancellationToken(cancel.token())
collectOutputs(build)
build.run(resultHandler)
sync.waitForAllPendingCalls(resultHandler)
cancel.cancel()
sync.releaseAll()
resultHandler.finished()
}
then:
taskWasCancelled(resultHandler, ":hang")
}
def "does not fail when scheduled tasks complete within the cancellation timeout"() {
buildFile << """
task hang {
doLast {
${waitForCancel()}
}
}
"""
def cancel = GradleConnector.newCancellationTokenSource()
def sync = server.expectAndBlock("registered")
def resultHandler = new TestResultHandler()
when:
withConnection { ProjectConnection connection ->
def build = connection.newBuild()
build.forTasks('hang')
build.withCancellationToken(cancel.token())
collectOutputs(build)
build.run(resultHandler)
sync.waitForAllPendingCalls(resultHandler)
cancel.cancel()
sync.releaseAll()
resultHandler.finished()
}
then:
noExceptionThrown()
}
def "can cancel build through forced stop"() {
// in-process call does not support forced stop
toolingApi.requireDaemons()
buildFile << """
task hang {
doLast {
${server.callFromBuild("waiting")}
}
}
"""
def cancel = GradleConnector.newCancellationTokenSource()
def sync = server.expectAndBlock("waiting")
def resultHandler = new TestResultHandler()
when:
withConnection { ProjectConnection connection ->
def build = connection.newBuild()
build.forTasks('hang')
build.withCancellationToken(cancel.token())
collectOutputs(build)
build.run(resultHandler)
sync.waitForAllPendingCalls(resultHandler)
cancel.cancel()
resultHandler.finished()
}
then:
resultHandler.assertFailedWith(BuildCancelledException)
resultHandler.failure.message.startsWith("Could not execute build using")
if (targetDist.toolingApiHasCauseOnForcedCancel) {
resultHandler.failure.cause.message.startsWith("Daemon was stopped to handle build cancel request.")
}
// TODO - should have a failure report in the logging output
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9D5C83B5-70D5-4CC2-9DB7-78B23DC8F255}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Xamarin.Android.LocaleTests</RootNamespace>
<AndroidApplication>True</AndroidApplication>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AssemblyName>Xamarin.Android.Locale-Tests</AssemblyName>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<AndroidSupportedAbis>armeabi-v7a;x86</AndroidSupportedAbis>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
</PropertyGroup>
<Import Project="..\..\..\Configuration.props" />
<PropertyGroup>
<TargetFrameworkVersion>$(AndroidFrameworkVersion)</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<OutputPath>..\..\..\bin\TestDebug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>..\..\..\bin\TestRelease</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
<Reference Include="Xamarin.Android.NUnitLite" />
</ItemGroup>
<ItemGroup>
<Compile Include="EnvironmentTests.cs" />
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestInstrumentation.cs" />
<Compile Include="SatelliteAssemblyTests.cs" />
<Compile Include="GlobalizationTests.cs" />
<Compile Include="TimeZoneTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
<None Include="Assets\AboutAssets.txt" />
<None Include="Properties\AndroidManifest.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\Icon.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="Xamarin.Android.Locale-Tests.projitems" />
<Import Project="..\..\..\build-tools\scripts\TestApks.targets" />
<ItemGroup>
<EmbeddedResource Include="strings.de-DE.resx" />
<EmbeddedResource Include="strings.fr-FR.resx" />
<EmbeddedResource Include="strings.resx" />
</ItemGroup>
<ItemGroup>
<AndroidEnvironment Include="Environment.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LibraryResources\LibraryResources.csproj">
<Project>{05768F39-7BAF-43E6-971E-712F5771E88E}</Project>
<Name>LibraryResources</Name>
</ProjectReference>
</ItemGroup>
</Project>
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2016 chronicle.software
~
~ Licensed under the *Apache License, Version 2.0* (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>net.openhft</groupId>
<artifactId>java-parent-pom</artifactId>
<version>1.1.23</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>compiler</artifactId>
<version>2.3.7-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>OpenHFT/Java-Runtime-Compiler</name>
<description>Java Runtime Compiler library.</description>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>net.openhft</groupId>
<artifactId>third-party-bom</artifactId>
<type>pom</type>
<version>3.19.2</version>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>compiler-test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<classpathScope>test</classpathScope>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<classpath/>
<argument>net.openhft.compiler.CompilerTest</argument>
</arguments>
</configuration>
</plugin>
<!--
generate maven dependencies versions file that can be used later
to install the right bundle in test phase.
The file is:
target/classes/META-INF/maven/dependencies.properties
-->
<plugin>
<groupId>org.apache.servicemix.tooling</groupId>
<artifactId>depends-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<id>generate-depends-file</id>
<goals>
<goal>generate-depends-file</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.1</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>OpenHFT :: ${project.artifactId}</Bundle-Name>
<Bundle-Version>${project.version}</Bundle-Version>
<Export-Package>
net.openhft.compiler.*;-noimport:=true
</Export-Package>
</instructions>
</configuration>
<executions>
<!--
This execution makes sure that the manifest is available
when the tests are executed
-->
<execution>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<scm>
<url>scm:git:git@github.com:OpenHFT/Java-Runtime-Compiler.git</url>
<connection>scm:git:git@github.com:OpenHFT/Java-Runtime-Compiler.git</connection>
<developerConnection>scm:git:git@github.com:OpenHFT/Java-Runtime-Compiler.git
</developerConnection>
<tag>master</tag>
</scm>
</project>
|
{
"pile_set_name": "Github"
}
|
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 1997-2017 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://oss.oracle.com/licenses/CDDL+GPL-1.1
* or LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package com.sun.xml.bind.v2.model.nav;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
/**
* @author Kohsuke Kawaguchi
*/
abstract class TypeVisitor<T,P> {
public final T visit( Type t, P param ) {
assert t!=null;
if (t instanceof Class)
return onClass((Class)t,param);
if (t instanceof ParameterizedType)
return onParameterizdType( (ParameterizedType)t,param);
if(t instanceof GenericArrayType)
return onGenericArray((GenericArrayType)t,param);
if(t instanceof WildcardType)
return onWildcard((WildcardType)t,param);
if(t instanceof TypeVariable)
return onVariable((TypeVariable)t,param);
// covered all the cases
assert false;
throw new IllegalArgumentException();
}
protected abstract T onClass(Class c, P param);
protected abstract T onParameterizdType(ParameterizedType p, P param);
protected abstract T onGenericArray(GenericArrayType g, P param);
protected abstract T onVariable(TypeVariable v, P param);
protected abstract T onWildcard(WildcardType w, P param);
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
dd
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<android.support.v7.view.menu.ActionMenuItemView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:focusable="true"
android:paddingTop="4dip"
android:paddingBottom="4dip"
android:paddingLeft="8dip"
android:paddingRight="8dip"
android:textAppearance="?attr/actionMenuTextAppearance"
android:textColor="?attr/actionMenuTextColor"
style="?attr/actionButtonStyle"/>
|
{
"pile_set_name": "Github"
}
|
package org.bndtools.core.editors.pkginfo;
import org.bndtools.core.editors.BndResourceMarkerAnnotationModel;
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.ui.editors.text.TextFileDocumentProvider;
public class PackageInfoDocumentProvider extends TextFileDocumentProvider {
@Override
protected IAnnotationModel createAnnotationModel(IFile file) {
return new BndResourceMarkerAnnotationModel(file);
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.sysds.runtime.data;
import org.apache.commons.lang.math.IntRange;
import org.apache.sysds.common.Types.ValueType;
import org.apache.sysds.runtime.DMLRuntimeException;
import java.io.Serializable;
import java.util.Arrays;
import java.util.stream.IntStream;
import static org.apache.sysds.runtime.data.TensorBlock.DEFAULT_DIMS;
public class DataTensorBlock implements Serializable {
private static final long serialVersionUID = 3410679389807309521L;
private static final int VALID_VALUE_TYPES_LENGTH = ValueType.values().length - 1;
protected int[] _dims;
protected BasicTensorBlock[] _colsdata = new BasicTensorBlock[VALID_VALUE_TYPES_LENGTH];
protected ValueType[] _schema = null;
/**
* Contains the (column) index in `_colsdata` for a certain column of the `DataTensor`. Which `_colsdata` to use is specified by the `_schema`
*/
protected int[] _colsToIx = null;
/**
* Contains the column of `DataTensor` an `_colsdata` (column) index corresponds to.
*/
protected int[][] _ixToCols = null;
public DataTensorBlock() {
this(new ValueType[0], DEFAULT_DIMS);
}
public DataTensorBlock(int ncols, ValueType vt) {
this(vt, new int[]{0, ncols});
}
public DataTensorBlock(ValueType[] schema) {
_dims = new int[]{0, schema.length};
_schema = schema;
_colsToIx = new int[_schema.length];
_ixToCols = new int[VALID_VALUE_TYPES_LENGTH][];
int[] typeIxCounter = new int[VALID_VALUE_TYPES_LENGTH];
for (int i = 0; i < schema.length; i++) {
int type = schema[i].ordinal();
_colsToIx[i] = typeIxCounter[type]++;
}
for (int i = 0; i < schema.length; i++) {
int type = schema[i].ordinal();
if (_ixToCols[type] == null) {
_ixToCols[type] = new int[typeIxCounter[type]];
typeIxCounter[type] = 0;
}
_ixToCols[type][typeIxCounter[type]++] = i;
}
}
public DataTensorBlock(ValueType[] schema, int[] dims) {
_dims = dims;
_schema = schema;
_colsToIx = new int[_schema.length];
_ixToCols = new int[VALID_VALUE_TYPES_LENGTH][];
int[] typeIxCounter = new int[VALID_VALUE_TYPES_LENGTH];
for (int i = 0; i < schema.length; i++) {
int type = schema[i].ordinal();
_colsToIx[i] = typeIxCounter[type]++;
}
for (int i = 0; i < schema.length; i++) {
int type = schema[i].ordinal();
if (_ixToCols[type] == null) {
_ixToCols[type] = new int[typeIxCounter[type]];
typeIxCounter[type] = 0;
}
_ixToCols[type][typeIxCounter[type]++] = i;
}
reset();
}
public DataTensorBlock(ValueType vt, int[] dims) {
_dims = dims;
_schema = new ValueType[getDim(1)];
Arrays.fill(_schema, vt);
_colsToIx = new IntRange(0, getDim(1)).toArray();
_ixToCols = new int[VALID_VALUE_TYPES_LENGTH][];
_ixToCols[vt.ordinal()] = new IntRange(0, getDim(1)).toArray();
reset();
}
public DataTensorBlock(ValueType[] schema, int[] dims, String[][] data) {
this(schema, dims);
allocateBlock();
for (int i = 0; i < schema.length; i++) {
int[] ix = new int[dims.length];
ix[1] = _colsToIx[i];
BasicTensorBlock current = _colsdata[schema[i].ordinal()];
for (int j = 0; j < data[i].length; j++) {
current.set(ix, data[i][j]);
TensorBlock.getNextIndexes(_dims, ix);
if (ix[1] != _colsToIx[i]) {
// We want to stay in the current column
if (ix[1] == 0)
ix[1] = _colsToIx[i];
else {
ix[1] = _colsToIx[i];
ix[0]++;
}
}
}
}
}
public DataTensorBlock(double val) {
_dims = new int[]{1, 1};
_schema = new ValueType[]{ValueType.FP64};
_colsToIx = new int[]{0};
_ixToCols = new int[VALID_VALUE_TYPES_LENGTH][];
_ixToCols[ValueType.FP64.ordinal()] = new int[]{0};
_colsdata = new BasicTensorBlock[VALID_VALUE_TYPES_LENGTH];
_colsdata[ValueType.FP64.ordinal()] = new BasicTensorBlock(val);
}
public DataTensorBlock(DataTensorBlock that) {
copy(that);
}
public DataTensorBlock(BasicTensorBlock that) {
_dims = that._dims;
_schema = new ValueType[_dims[1]];
Arrays.fill(_schema, that._vt);
_colsToIx = IntStream.range(0, _dims[1]).toArray();
_ixToCols = new int[VALID_VALUE_TYPES_LENGTH][];
_ixToCols[that._vt.ordinal()] = IntStream.range(0, _dims[1]).toArray();
_colsdata = new BasicTensorBlock[VALID_VALUE_TYPES_LENGTH];
_colsdata[that._vt.ordinal()] = that;
}
public void reset() {
reset(_dims);
}
public void reset(int[] dims) {
if (dims.length < 2)
throw new DMLRuntimeException("DataTensor.reset(int[]) invalid number of tensor dimensions: " + dims.length);
if (dims[1] > _dims[1])
throw new DMLRuntimeException("DataTensor.reset(int[]) columns can not be added without a provided schema," +
" use reset(int[],ValueType[]) instead");
for (int i = 0; i < dims.length; i++) {
if (dims[i] < 0)
throw new DMLRuntimeException("DataTensor.reset(int[]) invalid dimension " + i + ": " + dims[i]);
}
_dims = dims;
if (getDim(1) < _schema.length) {
ValueType[] schema = new ValueType[getDim(1)];
System.arraycopy(_schema, 0, schema, 0, getDim(1));
_schema = schema;
}
reset(_dims, _schema);
}
public void reset(int[] dims, ValueType[] schema) {
if (dims.length < 2)
throw new DMLRuntimeException("DataTensor.reset(int[],ValueType[]) invalid number of tensor dimensions: " + dims.length);
if (dims[1] != schema.length)
throw new DMLRuntimeException("DataTensor.reset(int[],ValueType[]) column dimension and schema length does not match");
for (int i = 0; i < dims.length; i++)
if (dims[i] < 0)
throw new DMLRuntimeException("DataTensor.reset(int[],ValueType[]) invalid dimension " + i + ": " + dims[i]);
_dims = dims;
_schema = schema;
_colsToIx = new int[_schema.length];
int[] typeIxCounter = new int[VALID_VALUE_TYPES_LENGTH];
for (int i = 0; i < schema.length; i++) {
int type = schema[i].ordinal();
_colsToIx[i] = typeIxCounter[type]++;
}
int[] colCounters = new int[VALID_VALUE_TYPES_LENGTH];
for (int i = 0; i < getDim(1); i++) {
int type = _schema[i].ordinal();
if (_ixToCols[type] == null || _ixToCols[type].length != typeIxCounter[type]) {
_ixToCols[type] = new int[typeIxCounter[type]];
}
_ixToCols[type][colCounters[type]++] = i;
}
// typeIxCounter now has the length of the BasicTensors
if (_colsdata == null) {
allocateBlock();
}
else {
for (int i = 0; i < _colsdata.length; i++) {
if (_colsdata[i] != null) {
_colsdata[i].reset(toInternalDims(dims, typeIxCounter[i]));
}
else if (typeIxCounter[i] != 0) {
int[] colDims = toInternalDims(_dims, typeIxCounter[i]);
_colsdata[i] = new BasicTensorBlock(ValueType.values()[i], colDims, false);
_colsdata[i].allocateBlock();
}
}
}
}
public DataTensorBlock allocateBlock() {
if (_colsdata == null)
_colsdata = new BasicTensorBlock[VALID_VALUE_TYPES_LENGTH];
int[] colDataColumnLength = new int[_colsdata.length];
for (ValueType valueType : _schema)
colDataColumnLength[valueType.ordinal()]++;
for (int i = 0; i < _colsdata.length; i++) {
if (colDataColumnLength[i] != 0) {
int[] dims = toInternalDims(_dims, colDataColumnLength[i]);
// TODO sparse
_colsdata[i] = new BasicTensorBlock(ValueType.values()[i], dims, false);
_colsdata[i].allocateBlock();
}
}
return this;
}
public boolean isAllocated() {
if (_colsdata == null)
return false;
for (BasicTensorBlock block : _colsdata) {
if (block != null && block.isAllocated())
return true;
}
return false;
}
public boolean isEmpty(boolean safe) {
if (!isAllocated()) {
return true;
}
for (BasicTensorBlock tb : _colsdata) {
if (tb != null && !tb.isEmpty(safe))
return false;
}
return true;
}
public long getNonZeros() {
if (!isAllocated()) {
return 0;
}
long nnz = 0;
for (BasicTensorBlock bt : _colsdata) {
if (bt != null)
nnz += bt.getNonZeros();
}
return nnz;
}
public int getNumRows() {
return getDim(0);
}
public int getNumColumns() {
return getDim(1);
}
public int getNumDims() {
return _dims.length;
}
public int getDim(int i) {
return _dims[i];
}
public int[] getDims() {
return _dims;
}
public ValueType[] getSchema() {
return _schema;
}
public ValueType getColValueType(int col) {
return _schema[col];
}
public Object get(int[] ix) {
int columns = ix[1];
int[] internalIx = toInternalIx(ix, _colsToIx[columns]);
return _colsdata[_schema[columns].ordinal()].get(internalIx);
}
public double get(int r, int c) {
if (getNumDims() != 2)
throw new DMLRuntimeException("DataTensor.get(int,int) dimension mismatch: expected=2 actual=" + getNumDims());
return _colsdata[_schema[c].ordinal()].get(r, _colsToIx[c]);
}
public void set(Object v) {
for (BasicTensorBlock bt : _colsdata)
bt.set(v);
}
public void set(int[] ix, Object v) {
int columns = ix[1];
int[] internalIx = toInternalIx(ix, _colsToIx[columns]);
_colsdata[_schema[columns].ordinal()].set(internalIx, v);
}
public void set(int r, int c, double v) {
if (getNumDims() != 2)
throw new DMLRuntimeException("DataTensor.set(int,int,double) dimension mismatch: expected=2 actual=" + getNumDims());
_colsdata[_schema[c].ordinal()].set(r, _colsToIx[c], v);
}
public void copy(DataTensorBlock that) {
_dims = that._dims.clone();
_schema = that._schema.clone();
_colsToIx = that._colsToIx.clone();
_ixToCols = new int[that._ixToCols.length][];
for (int i = 0; i < _ixToCols.length; i++)
if (that._ixToCols[i] != null)
_ixToCols[i] = that._ixToCols[i].clone();
if (that.isAllocated()) {
for (int i = 0; i < _colsdata.length; i++) {
if (that._colsdata[i] != null) {
_colsdata[i] = new BasicTensorBlock(that._colsdata[i]);
}
}
}
}
/**
* Copy a part of another <code>DataTensorBlock</code>
* @param lower lower index of elements to copy (inclusive)
* @param upper upper index of elements to copy (exclusive)
* @param src source <code>DataTensorBlock</code>
*/
public void copy(int[] lower, int[] upper, DataTensorBlock src) {
int[] subLower = lower.clone();
if (upper[1] == 0) {
upper[1] = getDim(1);
upper[0]--;
}
int[] subUpper = upper.clone();
for (int i = 0; i < VALID_VALUE_TYPES_LENGTH; i++) {
if (src._colsdata[i] == null)
continue;
subLower[1] = lower[1];
subUpper[1] = lower[1] + src._colsdata[i].getNumColumns();
_colsdata[i].copy(subLower, subUpper, src._colsdata[i]);
}
}
private static int[] toInternalIx(int[] ix, int col) {
int[] internalIx = ix.clone();
internalIx[1] = col;
return internalIx;
}
private static int[] toInternalDims(int[] dims, int cols) {
int[] internalDims = dims.clone();
internalDims[1] = cols;
return internalDims;
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.spark.examples.ml;
import org.apache.spark.sql.SparkSession;
// $example on$
import java.util.Arrays;
import org.apache.spark.ml.feature.VectorAssembler;
import org.apache.spark.ml.linalg.VectorUDT;
import org.apache.spark.ml.linalg.Vectors;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.RowFactory;
import org.apache.spark.sql.types.*;
import static org.apache.spark.sql.types.DataTypes.*;
// $example off$
public class JavaVectorAssemblerExample {
public static void main(String[] args) {
SparkSession spark = SparkSession
.builder()
.appName("JavaVectorAssemblerExample")
.getOrCreate();
// $example on$
StructType schema = createStructType(new StructField[]{
createStructField("id", IntegerType, false),
createStructField("hour", IntegerType, false),
createStructField("mobile", DoubleType, false),
createStructField("userFeatures", new VectorUDT(), false),
createStructField("clicked", DoubleType, false)
});
Row row = RowFactory.create(0, 18, 1.0, Vectors.dense(0.0, 10.0, 0.5), 1.0);
Dataset<Row> dataset = spark.createDataFrame(Arrays.asList(row), schema);
VectorAssembler assembler = new VectorAssembler()
.setInputCols(new String[]{"hour", "mobile", "userFeatures"})
.setOutputCol("features");
Dataset<Row> output = assembler.transform(dataset);
System.out.println("Assembled columns 'hour', 'mobile', 'userFeatures' to vector column " +
"'features'");
output.select("features", "clicked").show(false);
// $example off$
spark.stop();
}
}
|
{
"pile_set_name": "Github"
}
|
package com.ullink.slack.simpleslackapi;
import lombok.Data;
@Data
public class SlackTeam {
private final String id;
private final String name;
private final String domain;
}
|
{
"pile_set_name": "Github"
}
|
activeContentFilterList=*.makefile,makefile,*.Makefile,Makefile,Makefile.*,*.mk,MANIFEST.MF
addNewLine=true
convertActionOnSaave=AnyEdit.CnvrtSpacesToTabs
eclipse.preferences.version=1
ignoreBlankLinesWhenTrimming=false
inActiveContentFilterList=
javaTabWidthForJava=true
org.eclipse.jdt.ui.editor.tab.width=2
projectPropsEnabled=true
removeTrailingSpaces=true
replaceAllSpaces=false
replaceAllTabs=false
saveAndAddLine=false
saveAndConvert=true
saveAndTrim=true
useModulo4Tabs=false
|
{
"pile_set_name": "Github"
}
|
#Updated at Fri Sep 21 12:24:06 EDT 2012
#Fri Sep 21 12:24:06 EDT 2012
application_version=1.0
com.jd.survey.domain.settings.department_label=Dipartimento
com.jd.survey.domain.settings.department_label_short=Dipartimento
com.jd.survey.domain.settings.department_label_plural=Dipartimenti
com.jd.survey.domain.settings.department.id_label=ID
com.jd.survey.domain.settings.department.version_label=Versione
com.jd.survey.domain.settings.department.name_label=Nome
com.jd.survey.domain.settings.department.description_label=Descrizione
com.jd.survey.domain.settings.department.surveys_label=Nome sondaggio
com.jd.survey.domain.settings.department_menu=Dipartimenti
com.jd.survey.domain.settings.department_list_menu=Dipartimenti
com.jd.survey.domain.settings.department_new_menu=Dipartimento
com.jd.survey.domain.settings.department.surveydefinition.name_label=Nome della definizione di sondaggio
com.jd.survey.domain.settings.department.surveydefinition.file_label=File di definizione di sondaggio
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.surveydefinition_label=Sondaggio
com.jd.survey.domain.settings.surveydefinition_label_short=Sondaggio
com.jd.survey.domain.settings.surveydefinition_label_plural=Sondaggi
com.jd.survey.domain.settings.surveydefinition.id_label=ID
com.jd.survey.domain.settings.surveydefinition.version_label=Versione
com.jd.survey.domain.settings.surveydefinition.name_label=Nome
com.jd.survey.domain.settings.surveydefinition.logo_label=Immagine del logo
com.jd.survey.domain.settings.surveydefinition.description_label=Descrizione
com.jd.survey.domain.settings.surveydefinition.department_label=Nome del reparto
com.jd.survey.domain.settings.surveydefinition.pages_label=Pagine
com.jd.survey.domain.settings.surveydefinition_menu=Sondaggi
com.jd.survey.domain.settings.surveydefinition_list_menu=Sondaggi
com.jd.survey.domain.settings.surveydefinition_new_menu=Sondaggio
com.jd.survey.domain.settings.surveydefinition.ispublic_label=Disponibile al pubblico
com.jd.survey.domain.settings.surveydefinition.status_label=Status
com.jd.survey.domain.settings.surveydefinition.allowmultiplesubmissions_label=Permettono molte osservazioni
com.jd.survey.domain.settings.surveydefinition.isavailabletopublic_label=Public
com.jd.survey.domain.settings.surveydefinition.surveytheme_label=Tema
com.jd.survey.domain.settings.surveydefinition.emailinvitationtemplate_label=Modello invito e-mail
com.jd.survey.domain.settings.surveydefinition.completedsurveytemplate_label=Sondaggio completato template\t\t
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.questionoption_label=Opzione di domanda
com.jd.survey.domain.settings.questionoption_label_short=Opzione di domanda
com.jd.survey.domain.settings.questionoption_label_plural=Opzioni di interrogazione
com.jd.survey.domain.settings.questionoption.id_label=ID
com.jd.survey.domain.settings.questionoption.version_label=Versione
com.jd.survey.domain.settings.questionoption.order_label=Elemento ordine
com.jd.survey.domain.settings.questionoption.value_label=Valore dell'elemento
com.jd.survey.domain.settings.questionoption.value_tip=Immettere un massimo di 3 personaggi qui
com.jd.survey.domain.settings.questionoption.text_label=Testo di un elemento
com.jd.survey.domain.settings.questionoption.question_label=Domanda
com.jd.survey.domain.settings.questionoption_menu=Opzioni di interrogazione
com.jd.survey.domain.settings.questionoption_list_menu=Opzioni di interrogazione
com.jd.survey.domain.settings.questionoption_new_menu=Opzione di domanda
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.questionrowlabel_label=Etichetta di riga
com.jd.survey.domain.settings.questionrowlabel_label_short=Etichetta di riga
com.jd.survey.domain.settings.questionrowlabel_label_plural=Etichette di riga
com.jd.survey.domain.settings.questionrowlabel.id_label=ID
com.jd.survey.domain.settings.questionrowlabel.version_label=Versione
com.jd.survey.domain.settings.questionrowlabel.order_label=Ordine delle righe
com.jd.survey.domain.settings.questionrowlabel.label_tip=Immettere un massimo di 75 caratteri qui
com.jd.survey.domain.settings.questionrowlabel.label_label=Etichetta di riga
com.jd.survey.domain.settings.questionrowlabel.question_label=Domanda
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.questioncolumnlabel_label=Etichetta di colonna
com.jd.survey.domain.settings.questioncolumnlabel_label_short=Etichetta di colonna
com.jd.survey.domain.settings.questioncolumnlabel_label_plural=Etichette di colonna
com.jd.survey.domain.settings.questioncolumnlabel.id_label=ID
com.jd.survey.domain.settings.questioncolumnlabel.version_label=Versione
com.jd.survey.domain.settings.questioncolumnlabel.order_label=Ordine delle colonne
com.jd.survey.domain.settings.questioncolumnlabel.label_tip=Immettere un massimo di 75 caratteri qui
com.jd.survey.domain.settings.questioncolumnlabel.label_label=Etichetta di colonna
com.jd.survey.domain.settings.questioncolumnlabel.question_label=Domanda
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.surveydefinitionpage_label=Pagina sondaggio
com.jd.survey.domain.settings.surveydefinitionpage_label_short=Pagina
com.jd.survey.domain.settings.surveydefinitionpage_label_plural=Pagine di indagine
com.jd.survey.domain.settings.surveydefinitionpage.id_label=ID
com.jd.survey.domain.settings.surveydefinitionpage.version_label=Versione
com.jd.survey.domain.settings.surveydefinitionpage.instructions_label=Istruzioni
com.jd.survey.domain.settings.surveydefinitionpage.order_label=Ordine
com.jd.survey.domain.settings.surveydefinitionpage.title_label=Titolo
com.jd.survey.domain.settings.surveydefinitionpage.department.name_label=Nome del reparto
com.jd.survey.domain.settings.surveydefinitionpage.surveydefinition.name_label=Nome sondaggio
com.jd.survey.domain.settings.surveydefinitionpage.surveydefinition.description_label=Sondaggio Descrizione
com.jd.survey.domain.settings.surveydefinitionpage.questions_label=Domande
com.jd.survey.domain.settings.surveydefinitionpage.visibilityexpression_tip=MVEL espressione che restituisce true o false. utilizzare questo per ramificazione avanzato e che si biforcano.
com.jd.survey.domain.settings.surveydefinitionpage.visibilityexpression_label=Espressione di visibilitÃ
com.jd.survey.domain.settings.surveydefinitionpage_menu=Pagine di indagine
com.jd.survey.domain.settings.surveydefinitionpage_list_menu=Pagine di indagine
com.jd.survey.domain.settings.surveydefinitionpage_new_menu=Pagina
com.jd.survey.domain.settings.surveydefinitionpage.randomizequestions_label=Domande in modo casuale
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
#com.jd.survey.domain.settings.questiontype_label=Question Type
#com.jd.survey.domain.settings.questiontype_label_short=Page
#com.jd.survey.domain.settings.questiontype_label_plural=Question Types
#com.jd.survey.domain.settings.questiontype.id_label=Id
#com.jd.survey.domain.settings.questiontype.version_label=Version
#com.jd.survey.domain.settings.questiontype.name_label=Name
#com.jd.survey.domain.settings.questiontype.text_label=Text
#com.jd.survey.domain.settings.questiontype.description_label=Description
#com.jd.survey.domain.settings.questiontype_menu=Question Types
#com.jd.survey.domain.settings.questiontype_list_menu=Question Types
#com.jd.survey.domain.settings.questiontype_new_menu=Question Type
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.datasetitem_label=Elemento DataSet
com.jd.survey.domain.settings.datasetitem_label_short=Elemento DataSet
com.jd.survey.domain.settings.datasetitem_label_plural=Oggetti DataSet
com.jd.survey.domain.settings.datasetitem.id_label=ID
com.jd.survey.domain.settings.datasetitem.version_label=Versione
com.jd.survey.domain.settings.datasetitem.order_label=Ordine
com.jd.survey.domain.settings.datasetitem.value_label=Valore
com.jd.survey.domain.settings.datasetitem.value_tip=Immettere un massimo di 10 caratteri qui
com.jd.survey.domain.settings.datasetitem.text_label=Testo
com.jd.survey.domain.settings.datasetitem.question_label=Domanda
com.jd.survey.domain.settings.datasetitem_menu=Oggetti DataSet
com.jd.survey.domain.settings.datasetitem_list_menu=Oggetti DataSet
com.jd.survey.domain.settings.datasetitem_new_menu=Elemento DataSet
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.question_header_label=Informazioni domanda
com.jd.survey.domain.settings.question_validation_label=Informazioni di convalida
com.jd.survey.domain.settings.question_label=Domanda
com.jd.survey.domain.settings.question_label_short=Domanda
com.jd.survey.domain.settings.question_label_plural=Domande
com.jd.survey.domain.settings.question.id_label=ID
com.jd.survey.domain.settings.question.version_label=Versione
com.jd.survey.domain.settings.question.page_label=Pagina
com.jd.survey.domain.settings.question.type_label=Tipo di domanda
com.jd.survey.domain.settings.question.direction_label=Direzione
com.jd.survey.domain.settings.question.allowothertextbox_label=Consentire l'altro
com.jd.survey.domain.settings.question.visible_label=Visibile
com.jd.survey.domain.settings.question.order_label= Ordine di domande
com.jd.survey.domain.settings.question.datasetcode_label=DataSet
com.jd.survey.domain.settings.question.questiontext_label=Testo della domanda
com.jd.survey.domain.settings.question.tip_label=Punta
com.jd.survey.domain.settings.question.regularexpresion_label=Espressione regolare
com.jd.survey.domain.settings.question.options_label=Opzioni
com.jd.survey.domain.settings.question_menu=Domanda
com.jd.survey.domain.settings.question_list_menu=Domande
com.jd.survey.domain.settings.question_new_menu=Domanda
com.jd.survey.domain.settings.question.required_label=Obbligatorio
com.jd.survey.domain.settings.question.integerminimum_label=Valore integer minimo
com.jd.survey.domain.settings.question.integermaximum_label=Integer massimo
com.jd.survey.domain.settings.question.longminimum_label=Lunghezza minima
com.jd.survey.domain.settings.question.longmaximum_label=Lunghezza massima
com.jd.survey.domain.settings.question.doubleminimum_label=Doppio minimo
com.jd.survey.domain.settings.question.doublemaximum_label=Doppio massimo
com.jd.survey.domain.settings.question.dateminimum_label=Data minima
com.jd.survey.domain.settings.question.datemaximum_label=Data massima
com.jd.survey.domain.settings.question.decimalminimum_label=Decimal minimo
com.jd.survey.domain.settings.question.decimalmaximum_label=Massimo decimale
com.jd.survey.domain.settings.question.multimedialink_label=Link a file multimediali
com.jd.survey.domain.settings.question.height_label=Altezza
com.jd.survey.domain.settings.question.width_label=Larghezza
com.jd.survey.domain.settings.question.randomize_label=Le opzioni in modo casuale
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.security.group_label=Gruppo
com.jd.survey.domain.security.group.internal_label=Gruppo interno
com.jd.survey.domain.security.group.external_label=Gruppo esterno
com.jd.survey.domain.security.group_label_short=Gruppo
com.jd.survey.domain.security.group_label_plural=Gruppi
com.jd.survey.domain.security.group.id_label=ID
com.jd.survey.domain.security.group.version_label=Versione
com.jd.survey.domain.security.group.type_label=Tipo
com.jd.survey.domain.security.group.name_label=Nome
com.jd.survey.domain.security.group.description_label=Descrizione
com.jd.survey.domain.security.group.authorities_label=Autorita
com.jd.survey.domain.security.group_menu=Gruppi
com.jd.survey.domain.security.group_list_menu=Gruppi
com.jd.survey.domain.security.group_new_menu=Gruppo
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.security.user_label=Utente
com.jd.survey.domain.security.user.internal_label=Utente interno
com.jd.survey.domain.security.user.external_label=Utente esterno
com.jd.survey.domain.security.user_label_short=Utente
com.jd.survey.domain.security.user_label_plural=Utenti
com.jd.survey.domain.security.user_internal_label_plural=Utenti interni
com.jd.survey.domain.security.user_external_label_plural=Utenti esterni
com.jd.survey.domain.security.user.id_label=ID
com.jd.survey.domain.security.user.version_label=Versione
com.jd.survey.domain.security.user.type_label=Tipo
com.jd.survey.domain.security.user.login_label=Login (indirizzo e-mail)
com.jd.survey.domain.security.user.firstname_label=Primo Nome
com.jd.survey.domain.security.user.middlename_label=Middle name
com.jd.survey.domain.security.user.lastname_label=Cognome
####
com.jd.survey.domain.security.user.search_label=Ricerca per:
com.jd.survey.domain.security.user.name_label=Nome
com.jd.survey.domain.security.user.dateofbirth_label=Data di nascita
com.jd.survey.domain.security.user.email_label=Posta elettronica
com.jd.survey.domain.security.user.password_label=Password
com.jd.survey.domain.security.user.cofirmpassword_label=Conferma password
com.jd.survey.domain.security.user.enabled_label=Abilitato
com.jd.survey.domain.security.user_menu=Utenti
com.jd.survey.domain.security.user_list_menu=Utenti
com.jd.survey.domain.security.user_new_menu=Utente
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.security.authority_label=Ruolo
com.jd.survey.domain.security.authority_label_short=Ruolo
com.jd.survey.domain.security.authority_label_plural= Ruoli di sistema
com.jd.survey.domain.security.authority.version_label=Versione
com.jd.survey.domain.security.authority.name_label=Nome
com.jd.survey.domain.security.authority.type_label=Tipo
com.jd.survey.domain.security.authority.description_label=Descrizione
com.jd.survey.domain.security.authority.id=Identificazione del ruolo
com.jd.survey.domain.security.authority_menu=Ruoli
com.jd.survey.domain.security.authority_list_menu=Ruoli
com.jd.survey.domain.security.authority_new_menu=Ruolo
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.velocitytemplate_label=Modello
com.jd.survey.domain.settings.velocitytemplate_label_short=Modello
com.jd.survey.domain.settings.velocitytemplate_label_plural=Modelli
com.jd.survey.domain.settings.velocitytemplate.id_label=ID
com.jd.survey.domain.settings.velocitytemplate.version_label=Versione
com.jd.survey.domain.settings.velocitytemplate.name_label=Nome
com.jd.survey.domain.settings.velocitytemplate.definition_label=Definizione
com.jd.survey.domain.settings.velocitytemplate_menu=Modelli
com.jd.survey.domain.settings.velocitytemplate_list_menu=Modelli
com.jd.survey.domain.settings.velocitytemplate_new_menu=Modello
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.dataset_label=DataSet
com.jd.survey.domain.settings.dataset_label_short=DataSet
com.jd.survey.domain.settings.dataset_label_plural=DataSet
com.jd.survey.domain.settings.dataset.id_label=ID
com.jd.survey.domain.settings.dataset.version_label=Versione
com.jd.survey.domain.settings.dataset.code_label=Identificatore univoco (codice)
com.jd.survey.domain.settings.dataset.name_label=Nome
com.jd.survey.domain.settings.dataset.description_label=Descrizione
com.jd.survey.domain.settings.dataset.items_label=Elementi
com.jd.survey.domain.settings.dataset_menu=DataSet
com.jd.survey.domain.settings.dataset_list_menu=DataSet
com.jd.survey.domain.settings.dataset_new_menu=DataSet
com.jd.survey.domain.settings.datasetitem.dataset_label=DataSet
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.surveygroup_menu=Menu gruppo di indagine
#--------------------------------------------------------------------------------------------------
#added on 11-19-2012
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.surveystatistic_label=Statistica di indagine
com.jd.survey.domain.settings.surveystatistic_label_short=Statistica di indagine
com.jd.survey.domain.settings.surveystatistic_label_plural=Indagine statistica
com.jd.survey.domain.survey.surveystatistic.surveydefinitionid_label=Id di indagine
com.jd.survey.domain.survey.surveystatistic.departmentname_label=Nome del reparto
com.jd.survey.domain.survey.surveystatistic.surveyname_label=Nome sondaggio
com.jd.survey.domain.survey.surveystatistic.icompletedcount_label=Incompleta
com.jd.survey.domain.survey.surveystatistic.submittedcount_label=Completato
com.jd.survey.domain.survey.surveystatistic.deletedcount_label=Eliminato
com.jd.survey.domain.survey.surveystatistic.totalcount_label=Totale
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.questionstatistic_label=Statistiche di domanda
com.jd.survey.domain.settings.questionstatistic_label_short=Statistiche
com.jd.survey.domain.settings.questionstatistic_label_plural=Statistiche di domanda
com.jd.survey.domain.survey.questionstatistic.entry_label=Voce
com.jd.survey.domain.survey.questionstatistic.count_label=Conte
com.jd.survey.domain.survey.questionstatistic.min_label=Minimo
com.jd.survey.domain.survey.questionstatistic.max_label=Massimo
com.jd.survey.domain.survey.questionstatistic.average_label=Media
com.jd.survey.domain.survey.questionstatistic.frequency_label=Frequenza
com.jd.survey.domain.survey.questionstatistic.samplestandarddeviation_label=Deviazione STD
com.jd.survey.domain.survey.questionstatistic.values_label=Valori
com.jd.survey.domain.survey.surveystatistic.answer_label=Opzioni
com.jd.survey.domain.survey.questionstatistic.chart_label=Grafico
com.jd.survey.domain.surveyentry_label=Sondaggio voce informazioni
com.jd.survey.domain.surveyentry.surveyid_label=Id di indagine
com.jd.survey.domain.surveyentry.surveydefinitionid_label=Id della definizione di sondaggio
com.jd.survey.domain.surveyentry.departmentname_label=Nome del reparto
com.jd.survey.domain.surveyentry.surveyname_label=Nome sondaggio
com.jd.survey.domain.surveyentry.createdbylogin_label=Creato da login
com.jd.survey.domain.surveyentry.createdbyipaddress_label=Indirizzo IP
com.jd.survey.domain.surveyentry.createdbyfullname_label=Creato da
com.jd.survey.domain.surveyentry.createdbyfirstname_label=Creato da Nome
com.jd.survey.domain.surveyentry.createdbymiddlename_label=Creato da middle name
com.jd.survey.domain.surveyentry.createdbylastname_label=Creato da cognome
com.jd.survey.domain.surveyentry.creationdate_label=Data di creazione
com.jd.survey.domain.surveyentry.lastupdatedate_label=Data ultimo aggiornamento
com.jd.survey.domain.surveyentry.submissiondate_label=Data di completamento
com.jd.survey.domain.surveyentry.status_label=Status
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.survey_label_short=Sondaggio
com.jd.survey.domain.survey_label=Sondaggio
com.jd.survey.domain.survey_label_plural=Sondaggi
com.jd.survey.domain.survey.id_label=ID
com.jd.survey.domain.survey.version_label=Versione
com.jd.survey.domain.survey.typename_label=Nome sondaggio
com.jd.survey.domain.survey.ipaddress_label=Indirizzo IP
com.jd.survey.domain.survey.creationdate_label=Data di creazione
com.jd.survey.domain.survey.lastupdatedate_label=Data ultimo aggiornamento
com.jd.survey.domain.survey.submissiondate_label=Data di presentazione
com.jd.survey.domain.survey.status_label=Status
com.jd.survey.domain.survey.pages_label=Pagine
#--------------------------------------------------------------------------------------------------
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.survey.surveypage_label=Pagina sondaggio
com.jd.survey.domain.survey.surveypage_label_short=Pagina
com.jd.survey.domain.survey.surveypage_label_plural=Pagine di indagine
com.jd.survey.domain.survey.surveypage.id_label=ID
com.jd.survey.domain.survey.surveypage.version_label=Versione
com.jd.survey.domain.survey.surveypage.order_label=Ordine
com.jd.survey.domain.survey.surveypage.title_label=Titolo
com.jd.survey.domain.survey.surveypage.instructions_label=Istruzioni
#--------------------------------------------------------------------------------------------------
com.jd.survey.domain.survey_new_menu = Nuovo
#-------------------------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.regularexpression_label=Maschera
com.jd.survey.domain.settings.regularexpression_label_short=Maschera
com.jd.survey.domain.settings.regularexpression_label_plural=Maschere
com.jd.survey.domain.settings.regularexpression.id_label=ID
com.jd.survey.domain.settings.regularexpression.version_label= Versione
com.jd.survey.domain.settings.regularexpression.name_label=Nome
com.jd.survey.domain.settings.regularexpression.regex_label=Regex
com.jd.survey.domain.settings.regularexpression.description_label=Descrizione
com.jd.survey.domain.settings.regularexpression_new_menu=Maschera
com.jd.survey.domain.settings.question.regularexpression_label=Maschera
#-------------------------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.invitation_label=Sondaggio invito
com.jd.survey.domain.settings.invitation_label_short=Invito
com.jd.survey.domain.settings.invitation_label_plural=Inviti
com.jd.survey.domain.settings.invitation.id_label=ID
com.jd.survey.domain.settings.invitation.version_label=Versione
com.jd.survey.domain.settings.invitation.invitationemailsentdate_label=Data email inviata
com.jd.survey.domain.settings.invitation.invitationemailopeneddate_label=e-mail open data
com.jd.survey.domain.settings.invitation.firstname_label=Primo Nome
com.jd.survey.domain.settings.invitation.middlename_label=Middle name
com.jd.survey.domain.settings.invitation.lastname_label=Cognome
com.jd.survey.domain.settings.invitation.fullname_label=Nome e cognome
com.jd.survey.domain.settings.invitation.email_label=Posta elettronica
com.jd.survey.domain.settings.invitation.surveydefinition_label=Sondaggio
com.jd.survey.domain.settings.invitation.totalsent_label=Email totale inviti inviati
com.jd.survey.domain.settings.invitation.totalopened_label=Totali inviti e-mail aperto
#----------------------------------------------Password reset
com.jd.survey.domain.security.user.confirmnewpassword_label=Conferma password
com.jd.survey.domain.security.user.oldpassword_label=password corrente
#---------------------------------------------------------------------
com.jd.survey.domain.security.myaccount_update_label=aggiornare il mio account
com.jd.survey.domain.security.myaccount_show_label=Visualizza il mio account
#Sector---------------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.sector_label=Settore
com.jd.survey.domain.settings.sector_label_short=Settore
com.jd.survey.domain.settings.sector_label_plural=Settori
com.jd.survey.domain.settings.sector.id_label=ID
com.jd.survey.domain.settings.sector.version_label=Versione
com.jd.survey.domain.settings.sector.name_label=Nome
com.jd.survey.domain.settings.sector.description_label=Descrizione
com.jd.survey.domain.settings.sector_menu=Settori
com.jd.survey.domain.settings.sector_list_menu=Settori
com.jd.survey.domain.settings.sector_new_menu=Settore
com.jd.survey.domain.settings.sector.title_label=Selezionare Modello
com.jd.survey.domain.settings.sector.surveytemplate_label_plural=Modelli di indagine
#SurveyTemplate--------------------------------------------------------------------------------------------
com.jd.survey.domain.settings.surveytemplate_label=Modello di indagine
com.jd.survey.domain.settings.surveytemplate_label_short=Modello di indagine
com.jd.survey.domain.settings.surveytemplate_label_plural=Modelli di indagine
com.jd.survey.domain.settings.surveytemplate.id_label=ID
com.jd.survey.domain.settings.surveytemplate.version_label=Versione
com.jd.survey.domain.settings.surveytemplate.name_label=Nome
com.jd.survey.domain.settings.surveytemplate.description_label=Descrizione
com.jd.survey.domain.settings.surveytemplate_menu=Modelli di indagine
com.jd.survey.domain.settings.surveytemplate_list_menu=Modelli di indagine
com.jd.survey.domain.settings.surveytemplate_new_menu=Modello di indagine
com.jd.survey.domain.settings.surveytemplate.title_label=Importare da Modello di indagine
com.jd.survey.domain.settings.surveytemplate.saveTemplate_label=Salvare come Modello di indagine
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scicos
*
* Copyright (C) INRIA - METALAU Project <scicos@inria.fr> (HTML version)
* Copyright (C) DIGITEO - Scilab Consortium (XML Docbook version)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* See the file ./license.txt
-->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
xml:id="GENERAL_f" xml:lang="en_US">
<refnamediv>
<refname>GENERAL_f</refname>
<refpurpose>GENERAL_f title</refpurpose>
</refnamediv>
<refsection>
<title>Block Screenshot</title>
<inlinemediaobject>
<imageobject>
<imagedata fileref="../../../../images/palettes/GENERAL_f.png" align="center"/>
</imageobject>
</inlinemediaobject>
</refsection>
<refsection id="Contents_GENERAL_f">
<title>Contents</title>
<itemizedlist>
<listitem>
<xref linkend="Description_GENERAL_f">Description</xref>
</listitem>
<listitem>
<xref linkend="Dialogbox_GENERAL_f">Parameters</xref>
</listitem>
<listitem>
<xref linkend="Defaultproperties_GENERAL_f">Default properties</xref>
</listitem>
<listitem>
<xref linkend="Interfacingfunction_GENERAL_f">Interfacing function</xref>
</listitem>
<listitem>
<xref linkend="Computationalfunction_GENERAL_f">Computational function</xref>
</listitem>
</itemizedlist>
</refsection>
<refsection id="Description_GENERAL_f">
<title>Description</title>
<para>
Add here a paragraph of the function description
</para>
</refsection>
<refsection id="Dialogbox_GENERAL_f">
<title>Parameters</title>
<inlinemediaobject>
<imageobject>
<imagedata fileref="../../../../images/gui/GENERAL_f_gui.gif" align="center" style="float:right"/>
<!-- align => Javahelp, style => Online -->/>
</imageobject>
</inlinemediaobject>
<itemizedlist>
<listitem>
<para>
<emphasis role="bold">Input size</emphasis>
</para>
<para> The parameter description 1.</para>
<para> Properties : Type 'vec' of size 1. </para>
</listitem>
<listitem>
<para>
<emphasis role="bold">Number of event output</emphasis>
</para>
<para> The parameter description 2.</para>
<para> Properties : Type 'vec' of size 1.</para>
</listitem>
</itemizedlist>
</refsection>
<refsection id="Defaultproperties_GENERAL_f">
<title>Default properties</title>
<itemizedlist>
<listitem>
<para>
<emphasis role="bold">always active:</emphasis> no
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold">direct-feedthrough:</emphasis> yes
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold">zero-crossing:</emphasis> yes
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold">mode:</emphasis> no
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold">regular inputs:</emphasis>
</para>
<para>
<emphasis role="bold">- port 1 : size [1,1] / type 1</emphasis>
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold">number/sizes of activation inputs:</emphasis> 0
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold">number/sizes of activation outputs:</emphasis> 1
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold">continuous-time state:</emphasis> no
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold">discrete-time state:</emphasis> no
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold">object discrete-time state:</emphasis> no
</para>
</listitem>
<listitem>
<para>
<emphasis role="bold">name of computational function:</emphasis>
<emphasis role="italic">zcross</emphasis>
</para>
</listitem>
</itemizedlist>
<para/>
</refsection>
<refsection id="Interfacingfunction_GENERAL_f">
<title>Interfacing function</title>
<itemizedlist>
<listitem>
<para> SCI/modules/scicos_blocks/macros/Threshold/GENERAL_f.sci</para>
</listitem>
</itemizedlist>
</refsection>
<refsection id="Computationalfunction_GENERAL_f">
<title>Computational function</title>
<itemizedlist>
<listitem>
<para> SCI/modules/scicos_blocks/src/fortran/zcross.f (Type 1)</para>
</listitem>
</itemizedlist>
</refsection>
</refentry>
|
{
"pile_set_name": "Github"
}
|
// Copyright 2010 Todd Ditchendorf
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#import "TDJsonParserTest.h"
#import "TDJsonParser.h"
#import "TDFastJsonParser.h"
@implementation TDJsonParserTest
- (void)setUp {
p = (TDJsonParser *)[TDJsonParser parser];
}
- (void)testForAppleBossResultTokenization {
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"apple-boss" ofType:@"json"];
s = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
PKTokenizer *t = [[[PKTokenizer alloc] initWithString:s] autorelease];
PKToken *eof = [PKToken EOFToken];
PKToken *tok = nil;
while (eof != (tok = [t nextToken])) {
//NSLog(@"tok: %@", tok);
}
}
- (void)testForAppleBossResult {
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"apple-boss" ofType:@"json"];
s = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
@try {
result = [p parse:s];
}
@catch (NSException *e) {
//NSLog(@"\n\n\nexception:\n\n %@", [e reason]);
}
//NSLog(@"result %@", result);
}
- (void)testEmptyString {
s = @"";
a = [PKTokenAssembly assemblyWithString:s];
result = [p bestMatchFor:a];
TDNil(result);
}
- (void)testNum {
s = @"456";
a = [PKTokenAssembly assemblyWithString:s];
result = [[p numberParser] bestMatchFor:a];
TDNotNil(result);
TDEqualObjects(@"[456]456^", [result description]);
id obj = [result pop];
TDNotNil(obj);
TDEqualObjects([NSNumber numberWithFloat:456], obj);
s = @"-3.47";
a = [PKTokenAssembly assemblyWithString:s];
result = [[p numberParser] bestMatchFor:a];
TDNotNil(result);
TDEqualObjects(@"[-3.47]-3.47^", [result description]);
obj = [result pop];
TDNotNil(obj);
TDEqualObjects([NSNumber numberWithFloat:-3.47], obj);
}
- (void)testString {
s = @"'foobar'";
a = [PKTokenAssembly assemblyWithString:s];
result = [[p stringParser] bestMatchFor:a];
TDNotNil(result);
TDEqualObjects(@"[foobar]'foobar'^", [result description]);
id obj = [result pop];
TDNotNil(obj);
TDEqualObjects(@"foobar", obj);
s = @"\"baz boo boo\"";
a = [PKTokenAssembly assemblyWithString:s];
result = [[p stringParser] bestMatchFor:a];
TDNotNil(result);
TDEqualObjects(@"[baz boo boo]\"baz boo boo\"^", [result description]);
obj = [result pop];
TDNotNil(obj);
TDEqualObjects(@"baz boo boo", obj);
}
- (void)testBoolean {
s = @"true";
a = [PKTokenAssembly assemblyWithString:s];
result = [[p booleanParser] bestMatchFor:a];
TDNotNil(result);
TDEqualObjects(@"[1]true^", [result description]);
id obj = [result pop];
TDNotNil(obj);
TDEqualObjects([NSNumber numberWithBool:YES], obj);
s = @"false";
a = [PKTokenAssembly assemblyWithString:s];
result = [[p booleanParser] bestMatchFor:a];
TDNotNil(result);
TDEqualObjects(@"[0]false^", [result description]);
obj = [result pop];
TDNotNil(obj);
TDEqualObjects([NSNumber numberWithBool:NO], obj);
}
- (void)testArray {
s = @"[1, 2, 3]";
a = [PKTokenAssembly assemblyWithString:s];
result = [[p arrayParser] bestMatchFor:a];
// NSLog(@"result: %@", result);
TDNotNil(result);
id obj = [result pop];
TDEquals((int)3, (int)[obj count]);
TDEqualObjects([NSNumber numberWithInteger:1], [obj objectAtIndex:0]);
TDEqualObjects([NSNumber numberWithInteger:2], [obj objectAtIndex:1]);
TDEqualObjects([NSNumber numberWithInteger:3], [obj objectAtIndex:2]);
TDEqualObjects(@"[][/1/,/2/,/3/]^", [result description]);
s = @"[true, 'garlic jazz!', .888]";
a = [PKTokenAssembly assemblyWithString:s];
result = [[p arrayParser] bestMatchFor:a];
TDNotNil(result);
//TDEqualObjects(@"[true, 'garlic jazz!', .888]true/'garlic jazz!'/.888^", [result description]);
obj = [result pop];
TDEqualObjects([NSNumber numberWithBool:YES], [obj objectAtIndex:0]);
TDEqualObjects(@"garlic jazz!", [obj objectAtIndex:1]);
TDEqualObjects([NSNumber numberWithFloat:.888], [obj objectAtIndex:2]);
s = @"[1, [2, [3, 4]]]";
a = [PKTokenAssembly assemblyWithString:s];
result = [[p arrayParser] bestMatchFor:a];
TDNotNil(result);
//NSLog(@"result: %@", [a stack]);
TDEqualObjects([NSNumber numberWithInteger:1], [obj objectAtIndex:0]);
}
- (void)testObject {
s = @"{'key': 'value'}";
a = [PKTokenAssembly assemblyWithString:s];
result = [[p objectParser] bestMatchFor:a];
TDNotNil(result);
id obj = [result pop];
TDEqualObjects([obj objectForKey:@"key"], @"value");
s = @"{'foo': false, 'bar': true, \"baz\": -9.457}";
a = [PKTokenAssembly assemblyWithString:s];
result = [[p objectParser] bestMatchFor:a];
TDNotNil(result);
obj = [result pop];
TDEqualObjects([obj objectForKey:@"foo"], [NSNumber numberWithBool:NO]);
TDEqualObjects([obj objectForKey:@"bar"], [NSNumber numberWithBool:YES]);
TDEqualObjects([obj objectForKey:@"baz"], [NSNumber numberWithFloat:-9.457]);
s = @"{'baz': {'foo': [1,2]}}";
a = [PKTokenAssembly assemblyWithString:s];
result = [[p objectParser] bestMatchFor:a];
TDNotNil(result);
obj = [result pop];
NSDictionary *dict = [obj objectForKey:@"baz"];
TDTrue([dict isKindOfClass:[NSDictionary class]]);
NSArray *arr = [dict objectForKey:@"foo"];
TDTrue([arr isKindOfClass:[NSArray class]]);
TDEqualObjects([NSNumber numberWithInteger:1], [arr objectAtIndex:0]);
// TDEqualObjects(@"['baz', 'foo', 1, 2]'baz'/'foo'/1/2^", [result description]);
}
- (void)testCrunchBaseJsonParser {
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"yahoo" ofType:@"json"];
s = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
TDJsonParser *parser = [[[TDJsonParser alloc] init] autorelease];
[parser parse:s];
// id res = [parser parse:s];
//NSLog(@"res %@", res);
}
- (void)testCrunchBaseJsonParserTokenization {
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"yahoo" ofType:@"json"];
s = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
PKTokenizer *t = [[[PKTokenizer alloc] initWithString:s] autorelease];
PKToken *eof = [PKToken EOFToken];
PKToken *tok = nil;
while (eof != (tok = [t nextToken])) {
//NSLog(@"tok: %@", tok);
}
}
- (void)testCrunchBaseJsonTokenParser {
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"yahoo" ofType:@"json"];
s = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
TDFastJsonParser *parser = [[[TDFastJsonParser alloc] init] autorelease];
[parser parse:s];
// id res = [parser parse:s];
//NSLog(@"res %@", res);
}
- (void)testYahoo1 {
s =
@"{"
@"\"name\": \"Yahoo!\","
@"\"permalink\": \"yahoo\","
@"\"homepage_url\": \"http://www.yahoo.com\","
@"\"blog_url\": \"http://yodel.yahoo.com/\","
@"\"blog_feed_url\": \"http://ycorpblog.com/feed/\","
@"\"category_code\": \"web\","
@"\"number_of_employees\": 13600,"
@"\"founded_year\": 1994,"
@"\"founded_month\": null,"
@"\"founded_day\": null,"
@"\"deadpooled_year\": null,"
@"\"deadpooled_month\": null,"
@"\"deadpooled_day\": null,"
@"\"deadpooled_url\": null,"
@"\"tag_list\": \"search, portal, webmail, photos\","
@"\"email_address\": \"\","
@"\"phone_number\": \"(408) 349-3300\""
@"}";
result = [p parse:s];
//NSLog(@"result %@", result);
TDNotNil(result);
id d = result;
TDNotNil(d);
TDTrue([d isKindOfClass:[NSDictionary class]]);
TDEqualObjects([d objectForKey:@"name"], @"Yahoo!");
TDEqualObjects([d objectForKey:@"permalink"], @"yahoo");
TDEqualObjects([d objectForKey:@"homepage_url"], @"http://www.yahoo.com");
TDEqualObjects([d objectForKey:@"blog_url"], @"http://yodel.yahoo.com/");
TDEqualObjects([d objectForKey:@"blog_feed_url"], @"http://ycorpblog.com/feed/");
TDEqualObjects([d objectForKey:@"category_code"], @"web");
TDEqualObjects([d objectForKey:@"number_of_employees"], [NSNumber numberWithInteger:13600]);
TDEqualObjects([d objectForKey:@"founded_year"], [NSNumber numberWithInteger:1994]);
TDEqualObjects([d objectForKey:@"founded_month"], [NSNull null]);
TDEqualObjects([d objectForKey:@"founded_day"], [NSNull null]);
TDEqualObjects([d objectForKey:@"deadpooled_year"], [NSNull null]);
TDEqualObjects([d objectForKey:@"deadpooled_month"], [NSNull null]);
TDEqualObjects([d objectForKey:@"deadpooled_day"], [NSNull null]);
TDEqualObjects([d objectForKey:@"deadpooled_url"], [NSNull null]);
TDEqualObjects([d objectForKey:@"tag_list"], @"search, portal, webmail, photos");
TDEqualObjects([d objectForKey:@"email_address"], @"");
TDEqualObjects([d objectForKey:@"phone_number"], @"(408) 349-3300");
}
- (void)testYahoo2 {
s = @"{\"image\":"
@" {\"available_sizes\":"
@" [[[150, 37],"
@" \"assets/images/resized/0001/0836/10836v1-max-250x150.png\"],"
@" [[200, 50],"
@" \"assets/images/resized/0001/0836/10836v1-max-250x250.png\"],"
@" [[200, 50],"
@" \"assets/images/resized/0001/0836/10836v1-max-450x450.png\"]],"
@" \"attribution\": null}"
@"}";
result = [p parse:s];
//NSLog(@"result %@", result);
TDNotNil(result);
id d = result;
TDNotNil(d);
TDTrue([d isKindOfClass:[NSDictionary class]]);
id image = [d objectForKey:@"image"];
TDNotNil(image);
TDTrue([image isKindOfClass:[NSDictionary class]]);
NSArray *sizes = [image objectForKey:@"available_sizes"];
TDNotNil(sizes);
TDTrue([sizes isKindOfClass:[NSArray class]]);
TDEquals(3, (int)[sizes count]);
NSArray *first = [sizes objectAtIndex:0];
TDNotNil(first);
TDTrue([first isKindOfClass:[NSArray class]]);
TDEquals(2, (int)[first count]);
NSArray *firstKey = [first objectAtIndex:0];
TDNotNil(firstKey);
TDTrue([firstKey isKindOfClass:[NSArray class]]);
TDEquals(2, (int)[firstKey count]);
TDEqualObjects([NSNumber numberWithInteger:150], [firstKey objectAtIndex:0]);
TDEqualObjects([NSNumber numberWithInteger:37], [firstKey objectAtIndex:1]);
NSArray *second = [sizes objectAtIndex:1];
TDNotNil(second);
TDTrue([second isKindOfClass:[NSArray class]]);
TDEquals(2, (int)[second count]);
NSArray *secondKey = [second objectAtIndex:0];
TDNotNil(secondKey);
TDTrue([secondKey isKindOfClass:[NSArray class]]);
TDEquals(2, (int)[secondKey count]);
TDEqualObjects([NSNumber numberWithInteger:200], [secondKey objectAtIndex:0]);
TDEqualObjects([NSNumber numberWithInteger:50], [secondKey objectAtIndex:1]);
NSArray *third = [sizes objectAtIndex:2];
TDNotNil(third);
TDTrue([third isKindOfClass:[NSArray class]]);
TDEquals(2, (int)[third count]);
NSArray *thirdKey = [third objectAtIndex:0];
TDNotNil(thirdKey);
TDTrue([thirdKey isKindOfClass:[NSArray class]]);
TDEquals(2, (int)[thirdKey count]);
TDEqualObjects([NSNumber numberWithInteger:200], [thirdKey objectAtIndex:0]);
TDEqualObjects([NSNumber numberWithInteger:50], [thirdKey objectAtIndex:1]);
// TDEqualObjects([d objectForKey:@"name"], @"Yahoo!");
}
- (void)testYahoo3 {
s =
@"{\"products\":"
@"["
@"{\"name\": \"Yahoo.com\", \"permalink\": \"yahoo-com\"},"
@"{\"name\": \"Yahoo! Mail\", \"permalink\": \"yahoo-mail\"},"
@"{\"name\": \"Yahoo! Search\", \"permalink\": \"yahoo-search\"},"
@"{\"name\": \"Yahoo! Directory\", \"permalink\": \"yahoo-directory\"},"
@"{\"name\": \"Yahoo! Finance\", \"permalink\": \"yahoo-finance\"},"
@"{\"name\": \"My Yahoo\", \"permalink\": \"my-yahoo\"},"
@"{\"name\": \"Yahoo! News\", \"permalink\": \"yahoo-news\"},"
@"{\"name\": \"Yahoo! Groups\", \"permalink\": \"yahoo-groups\"},"
@"{\"name\": \"Yahoo! Messenger\", \"permalink\": \"yahoo-messenger\"},"
@"{\"name\": \"Yahoo! Games\", \"permalink\": \"yahoo-games\"},"
@"{\"name\": \"Yahoo! People Search\", \"permalink\": \"yahoo-people-search\"},"
@"{\"name\": \"Yahoo! Movies\", \"permalink\": \"yahoo-movies\"},"
@"{\"name\": \"Yahoo! Weather\", \"permalink\": \"yahoo-weather\"},"
@"{\"name\": \"Yahoo! Video\", \"permalink\": \"yahoo-video\"},"
@"{\"name\": \"Yahoo! Music\", \"permalink\": \"yahoo-music\"},"
@"{\"name\": \"Yahoo! Sports\", \"permalink\": \"yahoo-sports\"},"
@"{\"name\": \"Yahoo! Maps\", \"permalink\": \"yahoo-maps\"},"
@"{\"name\": \"Yahoo! Auctions\", \"permalink\": \"yahoo-auctions\"},"
@"{\"name\": \"Yahoo! Widgets\", \"permalink\": \"yahoo-widgets\"},"
@"{\"name\": \"Yahoo! Shopping\", \"permalink\": \"yahoo-shopping\"},"
@"{\"name\": \"Yahoo! Real Estate\", \"permalink\": \"yahoo-real-estate\"},"
@"{\"name\": \"Yahoo! Travel\", \"permalink\": \"yahoo-travel\"},"
@"{\"name\": \"Yahoo! Classifieds\", \"permalink\": \"yahoo-classifieds\"},"
@"{\"name\": \"Yahoo! Answers\", \"permalink\": \"yahoo-answers\"},"
@"{\"name\": \"Yahoo! Mobile\", \"permalink\": \"yahoo-mobile\"},"
@"{\"name\": \"Yahoo! Buzz\", \"permalink\": \"yahoo-buzz\"},"
@"{\"name\": \"Yahoo! Open Search Platform\", \"permalink\": \"yahoo-open-search-platform\"},"
@"{\"name\": \"Fire Eagle\", \"permalink\": \"fireeagle\"},"
@"{\"name\": \"Shine\", \"permalink\": \"shine\"},"
@"{\"name\": \"Yahoo! Shortcuts\", \"permalink\": \"yahoo-shortcuts\"}"
@"]"
@"}";
result = [p parse:s];
//NSLog(@"result %@", result);
TDNotNil(result);
id d = result;
TDNotNil(d);
TDTrue([d isKindOfClass:[NSDictionary class]]);
NSArray *products = [d objectForKey:@"products"];
TDNotNil(products);
TDTrue([products isKindOfClass:[NSArray class]]);
}
- (void)testYahoo4 {
s = @"["
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,"
@"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
@"]";
p = (id)[[[TDFastJsonParser alloc] init] autorelease];
result = [p parse:s];
//NSLog(@"result %@", result);
TDNotNil(result);
id d = result;
TDNotNil(d);
TDTrue([d isKindOfClass:[NSArray class]]);
// NSArray *products = [d objectForKey:@"products"];
// TDNotNil(products);
// TDTrue([products isKindOfClass:[NSArray class]]);
}
@end
|
{
"pile_set_name": "Github"
}
|
/*****************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
****************************************************************/
package org.apache.cayenne.testdo.java8;
import org.apache.cayenne.testdo.java8.auto._LocalTimeTestEntity;
public class LocalTimeTestEntity extends _LocalTimeTestEntity {
private static final long serialVersionUID = 1L;
}
|
{
"pile_set_name": "Github"
}
|
<?php
namespace oasis\names\specification\ubl\schema\xsd\CommonAggregateComponents_2;
/**
* @xmlNamespace urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2
* @xmlType PeriodType
* @xmlName InvoicePeriod
* @var oasis\names\specification\ubl\schema\xsd\CommonAggregateComponents_2\InvoicePeriod
*/
class InvoicePeriod
extends PeriodType
{
} // end class InvoicePeriod
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id$
*/
#if !defined(XERCESC_INCLUDE_GUARD_KEYVALUEPAIR_HPP)
#define XERCESC_INCLUDE_GUARD_KEYVALUEPAIR_HPP
#include <xercesc/util/XMemory.hpp>
XERCES_CPP_NAMESPACE_BEGIN
template <class TKey, class TValue> class KeyValuePair : public XMemory
{
public :
// -------------------------------------------------------------------
// Constructors and Destructor
// -------------------------------------------------------------------
KeyValuePair();
KeyValuePair(const TKey& key, const TValue& value);
KeyValuePair(const KeyValuePair<TKey,TValue>& toCopy);
~KeyValuePair();
// -------------------------------------------------------------------
// Getters
// -------------------------------------------------------------------
const TKey& getKey() const;
TKey& getKey();
const TValue& getValue() const;
TValue& getValue();
// -------------------------------------------------------------------
// Setters
// -------------------------------------------------------------------
TKey& setKey(const TKey& newKey);
TValue& setValue(const TValue& newValue);
private :
// unimplemented:
KeyValuePair<TKey,TValue>& operator=(const KeyValuePair<TKey,TValue>&);
// -------------------------------------------------------------------
// Private data members
//
// fKey
// The object that represents the key of the pair
//
// fValue
// The object that represents the value of the pair
// -------------------------------------------------------------------
TKey fKey;
TValue fValue;
};
XERCES_CPP_NAMESPACE_END
#if !defined(XERCES_TMPLSINC)
#include <xercesc/util/KeyValuePair.c>
#endif
#endif
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2007-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradle.api;
/**
* <p>A {@code Rule} represents some action to perform when an unknown domain object is referenced. The rule can use the
* domain object name to add an implicit domain object.</p>
*/
public interface Rule {
/**
* Returns the description of the rule. This is used for reporting purposes.
*
* @return the description. should not return null.
*/
String getDescription();
/**
* Applies this rule for the given unknown domain object. The rule can choose to ignore this name, or add a domain
* object with the given name.
*
* @param domainObjectName The name of the unknown domain object.
*/
void apply(String domainObjectName);
}
|
{
"pile_set_name": "Github"
}
|
resource_registry:
OS::TripleO::DeployedServerEnvironment: ../deployed-server/deployed-server-environment-output.yaml
|
{
"pile_set_name": "Github"
}
|
[ 1; 2; 3; 4; 5; 6 ]
|> List.groupBy (fun i -> i / 2)
|> List.map (fun (group, xs) -> xs.Length)
|> List.toSeq
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F3D05B12-5F2F-489B-A634-3B3BD44F85A2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>com.esri.gpt.csw</RootNamespace>
<AssemblyName>CswClient</AssemblyName>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<PublishUrl>http://localhost/CswClient/</PublishUrl>
<Install>true</Install>
<InstallFrom>Web</InstallFrom>
<UpdateEnabled>true</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>true</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\..\Bin\CswClient.XML</DocumentationFile>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\Bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\..\Bin\CswClient.XML</DocumentationFile>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="BoundingBox.cs" />
<Compile Include="CswCatalog.cs" />
<Compile Include="CswCatalogCapabilities.cs" />
<Compile Include="CswCatalogs.cs" />
<Compile Include="CswClient.cs" />
<Compile Include="CswManager.cs" />
<Compile Include="CswObjects.cs" />
<Compile Include="CswProfile.cs" />
<Compile Include="CswProfiles.cs" />
<Compile Include="CswRecord.cs" />
<Compile Include="CswRecords.cs" />
<Compile Include="CswSearchCriteria.cs" />
<Compile Include="CswSearchRequest.cs" />
<Compile Include="CswSearchResponse.cs" />
<Compile Include="DcList.cs" />
<Compile Include="Envelope.cs" />
<Compile Include="MapServiceInfo.cs" />
<Compile Include="PromptCredentials.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PromptCredentials.Designer.cs">
<DependentUpon>PromptCredentials.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Utils.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="PromptCredentials.resx">
<DependentUpon>PromptCredentials.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="CswClient.properties" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\AppLogger\trunk\src\AppLogger.csproj">
<Project>{2FFDEA64-1BC3-4FBF-BFEB-44C09499036C}</Project>
<Name>AppLogger</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.accumulo.core.client;
import static com.google.common.base.Preconditions.checkArgument;
import java.io.File;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.conf.PropertyType;
import org.apache.commons.configuration2.CompositeConfiguration;
import org.apache.commons.configuration2.Configuration;
import org.apache.commons.configuration2.MapConfiguration;
import org.apache.commons.configuration2.PropertiesConfiguration;
import org.apache.commons.configuration2.builder.FileBasedConfigurationBuilder;
import org.apache.commons.configuration2.builder.fluent.Parameters;
import org.apache.commons.configuration2.ex.ConfigurationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
/**
* Contains a list of property keys recognized by the Accumulo client and convenience methods for
* setting them.
*
* @since 1.6.0
* @deprecated since 2.0.0, replaced by {@link Accumulo#newClient()}
*/
@Deprecated(since = "2.0.0")
public class ClientConfiguration {
private static final Logger log = LoggerFactory.getLogger(ClientConfiguration.class);
public static final String USER_ACCUMULO_DIR_NAME = ".accumulo";
public static final String USER_CONF_FILENAME = "config";
public static final String GLOBAL_CONF_FILENAME = "client.conf";
private final CompositeConfiguration compositeConfig;
public enum ClientProperty {
// SSL
RPC_SSL_TRUSTSTORE_PATH(Property.RPC_SSL_TRUSTSTORE_PATH),
RPC_SSL_TRUSTSTORE_PASSWORD(Property.RPC_SSL_TRUSTSTORE_PASSWORD),
RPC_SSL_TRUSTSTORE_TYPE(Property.RPC_SSL_TRUSTSTORE_TYPE),
RPC_SSL_KEYSTORE_PATH(Property.RPC_SSL_KEYSTORE_PATH),
RPC_SSL_KEYSTORE_PASSWORD(Property.RPC_SSL_KEYSTORE_PASSWORD),
RPC_SSL_KEYSTORE_TYPE(Property.RPC_SSL_KEYSTORE_TYPE),
RPC_USE_JSSE(Property.RPC_USE_JSSE),
GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS(Property.GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS),
INSTANCE_RPC_SSL_CLIENT_AUTH(Property.INSTANCE_RPC_SSL_CLIENT_AUTH),
INSTANCE_RPC_SSL_ENABLED(Property.INSTANCE_RPC_SSL_ENABLED),
// ZooKeeper
INSTANCE_ZK_HOST(Property.INSTANCE_ZK_HOST),
INSTANCE_ZK_TIMEOUT(Property.INSTANCE_ZK_TIMEOUT),
// Instance information
INSTANCE_NAME("instance.name", null, PropertyType.STRING,
"Name of Accumulo instance to connect to"),
INSTANCE_ID("instance.id", null, PropertyType.STRING,
"UUID of Accumulo instance to connect to"),
// Tracing
TRACE_SPAN_RECEIVERS(Property.TRACE_SPAN_RECEIVERS),
TRACE_SPAN_RECEIVER_PREFIX(Property.TRACE_SPAN_RECEIVER_PREFIX),
TRACE_ZK_PATH(Property.TRACE_ZK_PATH),
// SASL / GSSAPI(Kerberos)
/**
* @since 1.7.0
*/
INSTANCE_RPC_SASL_ENABLED(Property.INSTANCE_RPC_SASL_ENABLED),
/**
* @since 1.7.0
*/
RPC_SASL_QOP(Property.RPC_SASL_QOP),
/**
* @since 1.7.0
*/
KERBEROS_SERVER_PRIMARY("kerberos.server.primary", "accumulo", PropertyType.STRING,
"The first component of the Kerberos principal, the 'primary', "
+ "that Accumulo servers use to login");
private String key;
private String defaultValue;
private PropertyType type;
private String description;
private ClientProperty(Property prop) {
this(prop.getKey(), prop.getDefaultValue(), prop.getType(), prop.getDescription());
}
private ClientProperty(String key, String defaultValue, PropertyType type, String description) {
this.key = key;
this.defaultValue = defaultValue;
this.type = type;
this.description = description;
}
public String getKey() {
return key;
}
public String getDefaultValue() {
return defaultValue;
}
private PropertyType getType() {
return type;
}
public String getDescription() {
return description;
}
public static ClientProperty getPropertyByKey(String key) {
for (ClientProperty prop : ClientProperty.values())
if (prop.getKey().equals(key))
return prop;
return null;
}
}
private ClientConfiguration(List<? extends Configuration> configs) {
compositeConfig = new CompositeConfiguration(configs);
}
/**
* Attempts to load a configuration file from the system using the default search paths. Uses the
* <em>ACCUMULO_CLIENT_CONF_PATH</em> environment variable, split on <em>File.pathSeparator</em>,
* for a list of target files.
* <p>
* If <em>ACCUMULO_CLIENT_CONF_PATH</em> is not set, uses the following in this order:
* <ul>
* <li>~/.accumulo/config
* <li><em>$ACCUMULO_CONF_DIR</em>/client.conf, if <em>$ACCUMULO_CONF_DIR</em> is defined.
* <li>/etc/accumulo/client.conf
* <li>/etc/accumulo/conf/client.conf
* </ul>
* <p>
* A client configuration will then be read from each location using
* <em>PropertiesConfiguration</em> to construct a configuration. That means the latest item will
* be the one in the configuration.
*
* @see PropertiesConfiguration
* @see File#pathSeparator
*/
public static ClientConfiguration loadDefault() {
return loadFromSearchPath(getDefaultSearchPath());
}
/**
* Initializes an empty configuration object to be further configured with other methods on the
* class.
*
* @since 1.9.0
*/
public static ClientConfiguration create() {
return new ClientConfiguration(Collections.emptyList());
}
/**
* Initializes a configuration object from the contents of a configuration file. Currently
* supports Java "properties" files. The returned object can be further configured with subsequent
* calls to other methods on this class.
*
* @param file
* the path to the configuration file
* @since 1.9.0
*/
public static ClientConfiguration fromFile(File file) {
FileBasedConfigurationBuilder<PropertiesConfiguration> propsBuilder =
new FileBasedConfigurationBuilder<>(PropertiesConfiguration.class)
.configure(new Parameters().properties().setFile(file));
try {
return new ClientConfiguration(Collections.singletonList(propsBuilder.getConfiguration()));
} catch (ConfigurationException e) {
throw new IllegalArgumentException("Bad configuration file: " + file, e);
}
}
/**
* Initializes a configuration object from the contents of a map. The returned object can be
* further configured with subsequent calls to other methods on this class.
*
* @param properties
* a map containing the configuration properties to use
* @since 1.9.0
*/
public static ClientConfiguration fromMap(Map<String,String> properties) {
MapConfiguration mapConf = new MapConfiguration(properties);
return new ClientConfiguration(Collections.singletonList(mapConf));
}
@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN",
justification = "process runs in same security context as user who provided path")
private static ClientConfiguration loadFromSearchPath(List<String> paths) {
List<Configuration> configs = new LinkedList<>();
for (String path : paths) {
File conf = new File(path);
if (conf.isFile() && conf.canRead()) {
FileBasedConfigurationBuilder<PropertiesConfiguration> propsBuilder =
new FileBasedConfigurationBuilder<>(PropertiesConfiguration.class)
.configure(new Parameters().properties().setFile(conf));
try {
configs.add(propsBuilder.getConfiguration());
log.info("Loaded client configuration file {}", conf);
} catch (ConfigurationException e) {
throw new IllegalStateException("Error loading client configuration file " + conf, e);
}
}
}
// We couldn't find the client configuration anywhere
if (configs.isEmpty()) {
log.debug(
"Found no client.conf in default paths. Using default client configuration values.");
}
return new ClientConfiguration(configs);
}
public static ClientConfiguration deserialize(String serializedConfig) {
PropertiesConfiguration propConfig = new PropertiesConfiguration();
try {
propConfig.getLayout().load(propConfig, new StringReader(serializedConfig));
} catch (ConfigurationException e) {
throw new IllegalArgumentException(
"Error deserializing client configuration: " + serializedConfig, e);
}
return new ClientConfiguration(Collections.singletonList(propConfig));
}
/**
* Muck the value of {@code clientConfPath} if it points to a directory by appending
* {@code client.conf} to the end of the file path. This is a no-op if the value is not a
* directory on the filesystem.
*
* @param clientConfPath
* The value of ACCUMULO_CLIENT_CONF_PATH.
*/
@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN",
justification = "process runs in same security context as user who provided path")
static String getClientConfPath(String clientConfPath) {
if (clientConfPath == null) {
return null;
}
File filePath = new File(clientConfPath);
// If clientConfPath is a directory, tack on the default client.conf file name.
if (filePath.exists() && filePath.isDirectory()) {
return new File(filePath, "client.conf").toString();
}
return clientConfPath;
}
private static List<String> getDefaultSearchPath() {
String clientConfSearchPath = getClientConfPath(System.getenv("ACCUMULO_CLIENT_CONF_PATH"));
List<String> clientConfPaths;
if (clientConfSearchPath != null) {
clientConfPaths = Arrays.asList(clientConfSearchPath.split(File.pathSeparator));
} else {
// if $ACCUMULO_CLIENT_CONF_PATH env isn't set, priority from top to bottom is:
// ~/.accumulo/config
// $ACCUMULO_CONF_DIR/client.conf
// /etc/accumulo/client.conf
// /etc/accumulo/conf/client.conf
clientConfPaths = new LinkedList<>();
clientConfPaths.add(System.getProperty("user.home") + File.separator + USER_ACCUMULO_DIR_NAME
+ File.separator + USER_CONF_FILENAME);
if (System.getenv("ACCUMULO_CONF_DIR") != null) {
clientConfPaths
.add(System.getenv("ACCUMULO_CONF_DIR") + File.separator + GLOBAL_CONF_FILENAME);
}
clientConfPaths.add("/etc/accumulo/" + GLOBAL_CONF_FILENAME);
clientConfPaths.add("/etc/accumulo/conf/" + GLOBAL_CONF_FILENAME);
}
return clientConfPaths;
}
public String serialize() {
PropertiesConfiguration propConfig = new PropertiesConfiguration();
propConfig.copy(compositeConfig);
StringWriter writer = new StringWriter();
try {
propConfig.getLayout().save(propConfig, writer);
} catch (ConfigurationException e) {
// this should never happen
throw new IllegalStateException(e);
}
return writer.toString();
}
/**
* Returns the value for prop, the default value if not present.
*
*/
public String get(ClientProperty prop) {
if (compositeConfig.containsKey(prop.getKey()))
return compositeConfig.getString(prop.getKey());
else
return prop.getDefaultValue();
}
private void checkType(ClientProperty property, PropertyType type) {
if (!property.getType().equals(type)) {
String msg = "Configuration method intended for type " + type + " called with a "
+ property.getType() + " argument (" + property.getKey() + ")";
throw new IllegalArgumentException(msg);
}
}
/**
* Gets all properties under the given prefix in this configuration.
*
* @param property
* prefix property, must be of type PropertyType.PREFIX
* @return a map of property keys to values
* @throws IllegalArgumentException
* if property is not a prefix
*/
public Map<String,String> getAllPropertiesWithPrefix(ClientProperty property) {
checkType(property, PropertyType.PREFIX);
Map<String,String> propMap = new HashMap<>();
String prefix = property.getKey();
if (prefix.endsWith(".")) {
prefix = prefix.substring(0, prefix.length() - 1);
}
Iterator<?> iter = compositeConfig.getKeys(prefix);
while (iter.hasNext()) {
String p = (String) iter.next();
propMap.put(p, compositeConfig.getString(p));
}
return propMap;
}
/**
* Sets the value of property to value
*
*/
public void setProperty(ClientProperty prop, String value) {
with(prop, value);
}
/**
* Same as {@link #setProperty(ClientProperty, String)} but returns the ClientConfiguration for
* chaining purposes
*/
public ClientConfiguration with(ClientProperty prop, String value) {
return with(prop.getKey(), value);
}
/**
* Sets the value of property to value
*
* @since 1.9.0
*/
public void setProperty(String prop, String value) {
with(prop, value);
}
/**
* Same as {@link #setProperty(String, String)} but returns the ClientConfiguration for chaining
* purposes
*
* @since 1.9.0
*/
public ClientConfiguration with(String prop, String value) {
compositeConfig.setProperty(prop, value);
return this;
}
/**
* Same as {@link #with(ClientProperty, String)} for ClientProperty.INSTANCE_NAME
*
*/
public ClientConfiguration withInstance(String instanceName) {
checkArgument(instanceName != null, "instanceName is null");
return with(ClientProperty.INSTANCE_NAME, instanceName);
}
/**
* Same as {@link #with(ClientProperty, String)} for ClientProperty.INSTANCE_ID
*
*/
public ClientConfiguration withInstance(UUID instanceId) {
checkArgument(instanceId != null, "instanceId is null");
return with(ClientProperty.INSTANCE_ID, instanceId.toString());
}
/**
* Same as {@link #with(ClientProperty, String)} for ClientProperty.INSTANCE_ZK_HOST
*
*/
public ClientConfiguration withZkHosts(String zooKeepers) {
checkArgument(zooKeepers != null, "zooKeepers is null");
return with(ClientProperty.INSTANCE_ZK_HOST, zooKeepers);
}
/**
* Same as {@link #with(ClientProperty, String)} for ClientProperty.INSTANCE_ZK_TIMEOUT
*
*/
public ClientConfiguration withZkTimeout(int timeout) {
return with(ClientProperty.INSTANCE_ZK_TIMEOUT, String.valueOf(timeout));
}
/**
* Same as {@link #withSsl(boolean, boolean)} with useJsseConfig set to false
*
*/
public ClientConfiguration withSsl(boolean sslEnabled) {
return withSsl(sslEnabled, false);
}
/**
* Same as {@link #with(ClientProperty, String)} for ClientProperty.INSTANCE_RPC_SSL_ENABLED and
* ClientProperty.RPC_USE_JSSE
*
*/
public ClientConfiguration withSsl(boolean sslEnabled, boolean useJsseConfig) {
return with(ClientProperty.INSTANCE_RPC_SSL_ENABLED, String.valueOf(sslEnabled))
.with(ClientProperty.RPC_USE_JSSE, String.valueOf(useJsseConfig));
}
/**
* Same as {@link #withTruststore(String, String, String)} with password null and type null
*
*/
public ClientConfiguration withTruststore(String path) {
return withTruststore(path, null, null);
}
/**
* Same as {@link #with(ClientProperty, String)} for ClientProperty.RPC_SSL_TRUSTORE_PATH,
* ClientProperty.RPC_SSL_TRUSTORE_PASSWORD, and ClientProperty.RPC_SSL_TRUSTORE_TYPE
*
*/
public ClientConfiguration withTruststore(String path, String password, String type) {
checkArgument(path != null, "path is null");
setProperty(ClientProperty.RPC_SSL_TRUSTSTORE_PATH, path);
if (password != null)
setProperty(ClientProperty.RPC_SSL_TRUSTSTORE_PASSWORD, password);
if (type != null)
setProperty(ClientProperty.RPC_SSL_TRUSTSTORE_TYPE, type);
return this;
}
/**
* Same as {@link #withKeystore(String, String, String)} with password null and type null
*
*/
public ClientConfiguration withKeystore(String path) {
return withKeystore(path, null, null);
}
/**
* Same as {@link #with(ClientProperty, String)} for ClientProperty.INSTANCE_RPC_SSL_CLIENT_AUTH,
* ClientProperty.RPC_SSL_KEYSTORE_PATH, ClientProperty.RPC_SSL_KEYSTORE_PASSWORD, and
* ClientProperty.RPC_SSL_KEYSTORE_TYPE
*
*/
public ClientConfiguration withKeystore(String path, String password, String type) {
checkArgument(path != null, "path is null");
setProperty(ClientProperty.INSTANCE_RPC_SSL_CLIENT_AUTH, "true");
setProperty(ClientProperty.RPC_SSL_KEYSTORE_PATH, path);
if (password != null)
setProperty(ClientProperty.RPC_SSL_KEYSTORE_PASSWORD, password);
if (type != null)
setProperty(ClientProperty.RPC_SSL_KEYSTORE_TYPE, type);
return this;
}
/**
* Same as {@link #with(ClientProperty, String)} for ClientProperty.INSTANCE_RPC_SASL_ENABLED.
*
* @since 1.7.0
*/
public ClientConfiguration withSasl(boolean saslEnabled) {
return with(ClientProperty.INSTANCE_RPC_SASL_ENABLED, String.valueOf(saslEnabled));
}
/**
* Show whether SASL has been set on this configuration.
*
* @since 1.9.0
*/
public boolean hasSasl() {
return compositeConfig.getBoolean(ClientProperty.INSTANCE_RPC_SASL_ENABLED.getKey(),
Boolean.parseBoolean(ClientProperty.INSTANCE_RPC_SASL_ENABLED.getDefaultValue()));
}
/**
* Same as {@link #with(ClientProperty, String)} for ClientProperty.INSTANCE_RPC_SASL_ENABLED and
* ClientProperty.GENERAL_KERBEROS_PRINCIPAL.
*
* @param saslEnabled
* Should SASL(kerberos) be enabled
* @param kerberosServerPrimary
* The 'primary' component of the Kerberos principal Accumulo servers use to login (e.g.
* 'accumulo' in 'accumulo/_HOST@REALM')
* @since 1.7.0
*/
public ClientConfiguration withSasl(boolean saslEnabled, String kerberosServerPrimary) {
return withSasl(saslEnabled).with(ClientProperty.KERBEROS_SERVER_PRIMARY,
kerberosServerPrimary);
}
public boolean containsKey(String key) {
return compositeConfig.containsKey(key);
}
public Iterator<String> getKeys() {
return compositeConfig.getKeys();
}
public String getString(String key) {
return compositeConfig.getString(key);
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* $Id$
*
* SARL is an general-purpose agent programming language.
* More details on http://www.sarl.io
*
* Copyright (C) 2014-2020 the original authors or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.sarl.lang.tests.modules.actionprototype;
import static io.sarl.tests.api.tools.TestAssertions.assertContainsStrings;
import static io.sarl.tests.api.tools.TestEObjects.file;
import static io.sarl.tests.api.tools.TestEObjects.getType;
import static io.sarl.tests.api.tools.TestMockito.mock;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import com.google.inject.Inject;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.ECollections;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.xtend.core.xtend.XtendParameter;
import org.eclipse.xtext.common.types.JvmAnnotationReference;
import org.eclipse.xtext.common.types.JvmAnnotationType;
import org.eclipse.xtext.common.types.JvmFormalParameter;
import org.eclipse.xtext.common.types.JvmIdentifiableElement;
import org.eclipse.xtext.common.types.JvmTypeReference;
import org.eclipse.xtext.common.types.TypesPackage;
import org.eclipse.xtext.xbase.XExpression;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentMatchers;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.opentest4j.AssertionFailedError;
import io.sarl.lang.annotation.DefaultValue;
import io.sarl.lang.sarl.SarlAction;
import io.sarl.lang.sarl.SarlAgent;
import io.sarl.lang.sarl.SarlFormalParameter;
import io.sarl.lang.sarl.SarlScript;
import io.sarl.lang.sarl.actionprototype.ActionParameterTypes;
import io.sarl.lang.sarl.actionprototype.ActionPrototype;
import io.sarl.lang.sarl.actionprototype.DefaultActionPrototypeProvider;
import io.sarl.lang.sarl.actionprototype.FormalParameterProvider;
import io.sarl.lang.sarl.actionprototype.IActionPrototypeContext;
import io.sarl.lang.sarl.actionprototype.InferredPrototype;
import io.sarl.lang.sarl.actionprototype.InferredStandardParameter;
import io.sarl.lang.sarl.actionprototype.InferredValuedParameter;
import io.sarl.lang.sarl.actionprototype.QualifiedActionName;
import io.sarl.tests.api.AbstractSarlTest;
import io.sarl.tests.api.Nullable;
/**
* @author $Author: sgalland$
* @version $FullVersion$
* @mavengroupid $GroupId$
* @mavenartifactid $ArtifactId$
*/
@SuppressWarnings({"javadoc", "nls", "incomplete-switch"})
@DisplayName("DefaultActionPrototypeProvider")
@Tag("core")
@Tag("unit")
public class DefaultActionPrototypeProviderTest extends AbstractSarlTest {
static int index;
static JvmIdentifiableElement createJvmIdentifiableElementStub() {
++index;
Resource resource = mock(Resource.class);
when(resource.getURI()).thenReturn(URI.createFileURI("/path/to/io/sarl/tests/Stub" + index + ".sarl"));
JvmIdentifiableElement container = mock(JvmIdentifiableElement.class);
when(container.eResource()).thenReturn(resource);
when(container.getQualifiedName()).thenReturn("io.sarl.tests.Stub" + index);
return container;
}
static void assertSameFormalParameters(List<? extends XtendParameter> expected, FormalParameterProvider actual) {
assertEquals(expected.size(), actual.getFormalParameterCount());
for (int i = 0; i < expected.size(); ++i) {
assertEquals(expected.get(i).getName(), actual.getFormalParameterName(i));
assertEquals(expected.get(i).getParameterType().getQualifiedName(),
actual.getFormalParameterType(i, false));
if (expected.get(i) instanceof SarlFormalParameter) {
assertSame(((SarlFormalParameter) expected.get(i)).getDefaultValue(),
actual.getFormalParameterDefaultValue(i));
} else {
assertNull(actual.getFormalParameterDefaultValue(i));
}
}
}
static void assertSameJvmFormalParameters(List<? extends JvmFormalParameter> expected, FormalParameterProvider actual) {
assertEquals(expected.size(), actual.getFormalParameterCount());
for (int i = 0; i < expected.size(); ++i) {
assertEquals(expected.get(i).getName(), actual.getFormalParameterName(i));
assertEquals(expected.get(i).getParameterType().getQualifiedName(),
actual.getFormalParameterType(i, false));
}
}
private static boolean matchPrototype(List<InferredStandardParameter> parameters, Object[] expected) {
int i = 0;
for (InferredStandardParameter parameter : parameters) {
if (i >= expected.length || !((Class<?>) expected[i]).isInstance(parameter)) {
return false;
}
++i;
if (i >= expected.length || !parameter.getType().getIdentifier().equals(expected[i])) {
return false;
}
++i;
if (i >= expected.length || !parameter.getName().equals(expected[i])) {
return false;
}
++i;
if (parameter instanceof InferredValuedParameter) {
String arg = ((InferredValuedParameter) parameter).getCallingArgument();
if (i >= expected.length || !arg.equals(expected[i])) {
return false;
}
++i;
}
}
return true;
}
private static void assertPrototypes(
List<InferredStandardParameter> parameters,
Collection<Object[]> expected,
Object[][] originalExpected) {
Iterator<Object[]> iterator = expected.iterator();
while (iterator.hasNext()) {
if (matchPrototype(parameters, iterator.next())) {
iterator.remove();
return;
}
}
throw new AssertionFailedError("Not same parameter prototype.",
parameters.toString(), toString(originalExpected));
}
private static String toString(Object[][] array) {
StringBuilder b = new StringBuilder();
b.append("[\n");
boolean addcoma = false;
for (Object[] d : array) {
if (addcoma) {
b.append(",\n");
} else {
addcoma = true;
}
b.append(toString(d));
}
b.append("]");
return b.toString();
}
private static String toString(Object[] array) {
StringBuilder b = new StringBuilder();
b.append(" [ ");
boolean addcoma = false;
for (Object o : array) {
if (addcoma) {
b.append(",\n ");
} else {
addcoma = true;
}
b.append(o==null ? "null" : o.toString());
}
b.append(" ]");
return b.toString();
}
static void assertPrototypes(
Map<ActionParameterTypes, List<InferredStandardParameter>> elements,
Object[]... expected) {
Collection<Object[]> expectedElements = new ArrayList<>();
for (int i = 0; i < expected.length; ++i) {
expectedElements.add(expected[i]);
}
for (List<InferredStandardParameter> parameters : elements.values()) {
assertPrototypes(parameters, expectedElements, expected);
}
if (!expectedElements.isEmpty()) {
throw new AssertionFailedError(
"Not same prototypes", expectedElements.toString(), elements.toString());
}
}
static void assertPrototypes(
List<InferredStandardParameter> elements,
Object... expected) {
if (!matchPrototype(elements, expected)) {
fail("Expected elements: " + toString(expected)
+ "; but is: " + elements.toString());
}
}
/**
* @author $Author: sgalland$
* @version $FullVersion$
* @mavengroupid $GroupId$
* @mavenartifactid $ArtifactId$
*/
@Nested
@DisplayName("DefaultActionPrototypeProvider without default values")
public class NoDefaultValues extends AbstractSarlTest {
@Inject
private DefaultActionPrototypeProvider provider;
@Nullable
private IActionPrototypeContext context;
@Nullable
private FormalParameterProvider parameterProvider;
@Nullable
private EList<SarlFormalParameter> sarlParameters;
@Nullable
private EList<JvmFormalParameter> jvmParameters;
@BeforeEach
public void setUp() throws Exception {
this.context = this.provider.createContext();
this.parameterProvider = mock(FormalParameterProvider.class);
when(this.parameterProvider.getFormalParameterCount()).thenReturn(3);
when(this.parameterProvider.getFormalParameterName(ArgumentMatchers.anyInt())).thenAnswer(new Answer<String>() {
@Override
public String answer(InvocationOnMock invocation) throws Throwable {
switch(((Integer) invocation.getArguments()[0]).intValue()) {
case 0:
return "firstarg";
case 1:
return "secondarg";
case 2:
return "thirdarg";
}
return null;
}
});
when(this.parameterProvider.getFormalParameterType(ArgumentMatchers.anyInt(),
ArgumentMatchers.anyBoolean())).thenAnswer(new Answer<String>() {
@Override
public String answer(InvocationOnMock invocation) throws Throwable {
switch(((Integer) invocation.getArguments()[0]).intValue()) {
case 0:
return "java.lang.String";
case 1:
return "float";
case 2:
return "java.lang.Object[]";
}
return null;
}
});
//
SarlFormalParameter p;
this.sarlParameters = new BasicEList<>();
p = mock(SarlFormalParameter.class);
when(p.getName()).thenReturn("firstarg");
JvmTypeReference ref = getType(getParseHelper(), "java.lang.String");
when(p.getParameterType()).thenReturn(ref);
this.sarlParameters.add(p);
p = mock(SarlFormalParameter.class);
when(p.getName()).thenReturn("secondarg");
ref = getType(getParseHelper(), "float");
when(p.getParameterType()).thenReturn(ref);
this.sarlParameters.add(p);
p = mock(SarlFormalParameter.class);
when(p.getName()).thenReturn("thirdarg");
ref = getType(getParseHelper(), "java.lang.Object");
when(p.getParameterType()).thenReturn(ref);
this.sarlParameters.add(p);
//
JvmFormalParameter jp;
this.jvmParameters = new BasicEList<>();
jp = mock(JvmFormalParameter.class);
when(jp.getName()).thenReturn("firstarg");
ref = getType(getParseHelper(), "java.lang.String");
when(jp.getParameterType()).thenReturn(ref);
when(jp.getAnnotations()).thenReturn(new BasicEList<JvmAnnotationReference>());
this.jvmParameters.add(jp);
jp = mock(JvmFormalParameter.class);
when(jp.getName()).thenReturn("secondarg");
ref = getType(getParseHelper(), "float");
when(jp.getParameterType()).thenReturn(ref);
when(jp.getAnnotations()).thenReturn(new BasicEList<JvmAnnotationReference>());
this.jvmParameters.add(jp);
jp = mock(JvmFormalParameter.class);
when(jp.getName()).thenReturn("thirdarg");
ref = getType(getParseHelper(), "java.lang.Object[]");
when(jp.getParameterType()).thenReturn(ref);
when(jp.getAnnotations()).thenReturn(new BasicEList<JvmAnnotationReference>());
this.jvmParameters.add(jp);
}
@Test
public void validateTypeOfVarArgInSarl() throws Exception {
SarlScript s = file(getParseHelper(), "agent Foo { def fooFct(a : float, b : Object*) {} }");
SarlFormalParameter param = (SarlFormalParameter) ((SarlAction) ((SarlAgent) s.getXtendTypes().get(0))
.getMembers().get(0)).getParameters().get(1);
assertNotNull(param);
assertEquals("java.lang.Object", param.getParameterType().getIdentifier());
}
@Test
public void createQualifiedActionName() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
final String xtextResourceID = container.eResource().getURI().toString();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
assertNotNull(qn);
assertEquals("myfct", qn.getActionName());
// xtextResourceID == "file:/path/to/io/sarl/tests/Stub"+index+".sarl"
assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index, qn.getContainerID());
assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index+"#myfct", qn.toString());
}
@Test
public void createConstructorQualifiedName() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
final String xtextResourceID = container.eResource().getURI().toString();
QualifiedActionName qn = this.provider.createConstructorQualifiedName(container);
assertNotNull(qn);
assertEquals("new", qn.getActionName());
// xtextResourceID == "file:/path/to/io/sarl/tests/Stub"+index+".sarl"
assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index, qn.getContainerID());
assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index+"#new", qn.toString());
}
@Test
public void createParameterTypesForVoid() {
ActionParameterTypes key = this.provider.createParameterTypesForVoid();
assertNotNull(key);
assertFalse(key.isVarArg());
assertTrue(key.isVoid());
assertEquals("", key.toString());
assertTrue(key.isEmpty());
}
@Test
public void createParameterTypes_varArgs() {
ActionParameterTypes key = this.provider.createParameterTypes(true, this.parameterProvider);
assertNotNull(key);
assertTrue(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float,java.lang.Object*", key.toString());
assertEquals(3, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float", key.get(1));
assertEquals("java.lang.Object[]", key.get(2));
}
@Test
public void createParameterTypes_noVarArgs() {
ActionParameterTypes key = this.provider.createParameterTypes(false, this.parameterProvider);
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float,java.lang.Object[]", key.toString());
assertEquals(3, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float", key.get(1));
assertEquals("java.lang.Object[]", key.get(2));
}
@Test
public void createParameterTypesFromString_empty() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("");
assertNotNull(key);
assertFalse(key.isVarArg());
assertTrue(key.isVoid());
assertEquals("", key.toString());
assertTrue(key.isEmpty());
}
@Test
public void createParameterTypesFromString_void() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("void");
assertNotNull(key);
assertFalse(key.isVarArg());
assertTrue(key.isVoid());
assertEquals("", key.toString());
assertTrue(key.isEmpty());
}
@Test
public void createParameterTypesFromString_Void() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.Void");
assertNotNull(key);
assertFalse(key.isVarArg());
assertTrue(key.isVoid());
assertEquals("", key.toString());
assertTrue(key.isEmpty());
}
@Test
public void createParameterTypesFromString_String_noVargArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String");
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String", key.toString());
assertEquals(1, key.size());
assertEquals("java.lang.String", key.get(0));
}
@Test
public void createParameterTypesFromString_StringFloat_noVargArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float");
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float", key.toString());
assertEquals(2, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float", key.get(1));
}
@Test
public void createParameterTypesFromString_StringFloatObject_noVargArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float,java.lang.Object");
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float,java.lang.Object", key.toString());
assertEquals(3, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float", key.get(1));
assertEquals("java.lang.Object", key.get(2));
}
@Test
public void createParameterTypesFromString_String_vargArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String*");
assertNotNull(key);
assertTrue(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String*", key.toString());
assertEquals(1, key.size());
assertEquals("java.lang.String[]", key.get(0));
}
@Test
public void createParameterTypesFromString_StringFloat_vargArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float*");
assertNotNull(key);
assertTrue(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float*", key.toString());
assertEquals(2, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float[]", key.get(1));
}
@Test
public void createParameterTypesFromString_StringFloatObject_vargArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float,java.lang.Object*");
assertNotNull(key);
assertTrue(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float,java.lang.Object*", key.toString());
assertEquals(3, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float", key.get(1));
assertEquals("java.lang.Object[]", key.get(2));
}
@Test
public void createParameterTypesFromString_String_noVargArg_array() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String[]");
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String[]", key.toString());
assertEquals(1, key.size());
assertEquals("java.lang.String[]", key.get(0));
}
@Test
public void createParameterTypesFromString_StringFloat_noVargArg_array() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float[]");
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float[]", key.toString());
assertEquals(2, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float[]", key.get(1));
}
@Test
public void createParameterTypesFromString_StringFloatObject_noVargArg_array() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float,java.lang.Object[]");
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float,java.lang.Object[]", key.toString());
assertEquals(3, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float", key.get(1));
assertEquals("java.lang.Object[]", key.get(2));
}
@Test
public void createParameterTypesFromSarlModell_void() {
ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(false,
new BasicEList<SarlFormalParameter>());
assertNotNull(key);
assertFalse(key.isVarArg());
assertTrue(key.isVoid());
assertTrue(key.isEmpty());
}
@Test
public void createParameterTypesFromSarlModel_noVarArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters);
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float,java.lang.Object", key.toString());
assertEquals(3, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float", key.get(1));
assertEquals("java.lang.Object", key.get(2));
}
@Test
public void createParameterTypesFromSarlModel_varArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(true, this.sarlParameters);
assertNotNull(key);
assertTrue(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float,java.lang.Object*", key.toString());
assertEquals(3, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float", key.get(1));
assertEquals("java.lang.Object[]", key.get(2));
}
@Test
public void createParameterTypesFromJvmModel_void() {
ActionParameterTypes key = this.provider.createParameterTypesFromJvmModel(false, new BasicEList<JvmFormalParameter>());
assertNotNull(key);
assertFalse(key.isVarArg());
assertTrue(key.isVoid());
assertTrue(key.isEmpty());
}
@Test
public void createParameterTypesFromJvmModel_noVarArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromJvmModel(false, this.jvmParameters);
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float,java.lang.Object[]", key.toString());
assertEquals(3, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float", key.get(1));
assertEquals("java.lang.Object[]", key.get(2));
}
@Test
public void createParameterTypesFromJvmModel_varArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromJvmModel(true, this.jvmParameters);
assertNotNull(key);
assertTrue(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float,java.lang.Object*", key.toString());
assertEquals(3, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float", key.get(1));
assertEquals("java.lang.Object[]", key.get(2));
}
@Test
public void createActionPrototype_void() {
ActionParameterTypes params = this.provider.createParameterTypesFromJvmModel(true, new BasicEList<JvmFormalParameter>());
ActionPrototype prototype = this.provider.createActionPrototype("myfct", params);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName());
assertSame(params, prototype.getParametersTypes());
}
@Test
public void createActionPrototype_noVarArg() {
ActionParameterTypes params = this.provider.createParameterTypesFromJvmModel(false, this.jvmParameters);
ActionPrototype prototype = this.provider.createActionPrototype("myfct", params);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName());
assertSame(params, prototype.getParametersTypes());
}
@Test
public void createActionPrototype_varArg() {
ActionParameterTypes params = this.provider.createParameterTypesFromJvmModel(true, this.jvmParameters);
ActionPrototype prototype = this.provider.createActionPrototype("myfct", params);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName());
assertSame(params, prototype.getParametersTypes());
}
@Test
public void createPrototypeFromSarlModel_void() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
EList<SarlFormalParameter> params = new BasicEList<>();
//
InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, false, params);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName().getActionName());
assertSameFormalParameters(params, prototype.getFormalParameters());
assertEquals("", prototype.getFormalParameterTypes().toString());
assertContainsStrings(
prototype.getParameterTypeAlternatives(),
"");
assertTrue(prototype.getInferredParameterTypes().isEmpty());
}
@Test
public void createPrototypeFromSarlModel_noVarArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
//
InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName().getActionName());
assertSameFormalParameters(this.sarlParameters, prototype.getFormalParameters());
assertEquals(
"java.lang.String,float,java.lang.Object",
prototype.getFormalParameterTypes().toString());
assertContainsStrings(
prototype.getParameterTypeAlternatives(),
"java.lang.String,float,java.lang.Object");
assertTrue(prototype.getInferredParameterTypes().isEmpty());
}
@Test
public void createPrototypeFromSarlModel_varArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
//
InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName().getActionName());
assertSameFormalParameters(this.sarlParameters, prototype.getFormalParameters());
assertEquals("java.lang.String,float,java.lang.Object*", prototype.getFormalParameterTypes().toString());
assertContainsStrings(
prototype.getParameterTypeAlternatives(),
"java.lang.String,float,java.lang.Object*");
assertTrue(prototype.getInferredParameterTypes().isEmpty());
}
@Test
public void createPrototypeFromJvmModel_void() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
EList<JvmFormalParameter> params = new BasicEList<>();
//
InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, false, params);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName().getActionName());
assertSameJvmFormalParameters(params, prototype.getFormalParameters());
assertEquals("", prototype.getFormalParameterTypes().toString());
assertContainsStrings(
prototype.getParameterTypeAlternatives(),
"");
assertTrue(prototype.getInferredParameterTypes().isEmpty());
}
@Test
public void createPrototypeFromJvmModel_noVarArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
//
InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, false, this.jvmParameters);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName().getActionName());
assertSameJvmFormalParameters(this.jvmParameters, prototype.getFormalParameters());
assertEquals(
"java.lang.String,float,java.lang.Object[]",
prototype.getFormalParameterTypes().toString());
assertContainsStrings(
prototype.getParameterTypeAlternatives(),
"java.lang.String,float,java.lang.Object[]");
assertTrue(prototype.getInferredParameterTypes().isEmpty());
}
@Test
public void createPrototypeFromJvmModel_varArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
//
InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, true, this.jvmParameters);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName().getActionName());
assertSameJvmFormalParameters(this.jvmParameters, prototype.getFormalParameters());
assertEquals("java.lang.String,float,java.lang.Object*", prototype.getFormalParameterTypes().toString());
assertContainsStrings(
prototype.getParameterTypeAlternatives(),
"java.lang.String,float,java.lang.Object*");
assertTrue(prototype.getInferredParameterTypes().isEmpty());
}
@Test
public void getPrototypesQualifiedActionName_noCreatedPrototype() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
//
Iterable<InferredPrototype> iterable = this.provider.getPrototypes(this.context, qn);
assertNotNull(iterable);
assertFalse(iterable.iterator().hasNext());
}
@Test
public void getPrototypesQualifiedActionName_createdPrototype_noVarArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters);
//
Iterable<InferredPrototype> iterable = this.provider.getPrototypes(this.context, qn);
assertNotNull(iterable);
Iterator<InferredPrototype> iterator = iterable.iterator();
assertTrue(iterator.hasNext());
InferredPrototype prototype = iterator.next();
assertSame(expected, prototype);
assertFalse(iterator.hasNext());
}
@Test
public void getPrototypesQualifiedActionName_createdPrototype_varArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters);
//
Iterable<InferredPrototype> iterable = this.provider.getPrototypes(this.context, qn);
assertNotNull(iterable);
Iterator<InferredPrototype> iterator = iterable.iterator();
assertTrue(iterator.hasNext());
InferredPrototype prototype = iterator.next();
assertSame(expected, prototype);
assertFalse(iterator.hasNext());
}
@Test
public void getPrototypesQualifiedActionNameActionParameterTypes_noCreatedPrototype() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters);
//
InferredPrototype prototype = this.provider.getPrototypes(this.context, qn, types);
assertNull(prototype);
}
@Test
public void getPrototypesQualifiedActionNameActionParameterTypes_createdPrototype_noVarArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters);
InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters);
//
InferredPrototype prototype = this.provider.getPrototypes(this.context, qn, types);
assertNotNull(prototype);
assertSame(expected, prototype);
}
@Test
public void getPrototypesQualifiedActionNameActionParameterTypes_createdPrototype_varArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(true, this.sarlParameters);
InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters);
//
InferredPrototype prototype = this.provider.getPrototypes(this.context, qn, types);
assertNotNull(prototype);
assertSame(expected, prototype);
}
@Test
public void resetPrototypes_noCreatedProtype() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters);
assertNotNull(types);
//
assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext());
this.context.release();
assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext());
}
@Test
public void resetPrototypes_createdProtype_noVarArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters);
assertNotNull(types);
InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters);
assertNotNull(prototype);
//
assertTrue(this.provider.getPrototypes(this.context, qn).iterator().hasNext());
this.context.release();
assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext());
}
@Test
public void resetPrototypes_createdProtype_varArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(true, this.sarlParameters);
assertNotNull(types);
InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters);
assertNotNull(prototype);
//
assertTrue(this.provider.getPrototypes(this.context, qn).iterator().hasNext());
this.context.release();
assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext());
}
}
/**
* @author $Author: sgalland$
* @version $FullVersion$
* @mavengroupid $GroupId$
* @mavenartifactid $ArtifactId$
*/
@Nested
@DisplayName("DefaultActionPrototypeProvider with default values")
public class DefaultValues extends AbstractSarlTest {
@Inject
private DefaultActionPrototypeProvider provider;
@Nullable
private IActionPrototypeContext context;
@Nullable
private FormalParameterProvider parameterProvider;
@Nullable
private EList<SarlFormalParameter> sarlParameters;
@Nullable
private EList<JvmFormalParameter> jvmParameters;
@BeforeEach
public void setUp() throws Exception {
this.context = this.provider.createContext();
this.parameterProvider = mock(FormalParameterProvider.class);
when(this.parameterProvider.getFormalParameterCount()).thenReturn(4);
when(this.parameterProvider.getFormalParameterName(ArgumentMatchers.anyInt())).thenAnswer((invocation) -> {
switch(((Integer) invocation.getArguments()[0]).intValue()) {
case 0:
return "firstarg";
case 1:
return "secondarg";
case 2:
return "thirdarg";
case 3:
return "fourtharg";
}
return null;
});
when(this.parameterProvider.getFormalParameterType(ArgumentMatchers.anyInt(),
ArgumentMatchers.anyBoolean())).thenAnswer((invocation) -> {
switch(((Integer) invocation.getArguments()[0]).intValue()) {
case 0:
return "java.lang.String";
case 1:
return "int";
case 2:
return "float";
case 3:
return "java.lang.Object[]";
}
return null;
});
when(this.parameterProvider.hasFormalParameterDefaultValue(ArgumentMatchers.anyInt())).thenAnswer((invocation) -> {
switch(((Integer) invocation.getArguments()[0]).intValue()) {
case 0:
case 2:
return Boolean.TRUE;
}
return Boolean.FALSE;
});
//
SarlFormalParameter p;
this.sarlParameters = new BasicEList<>();
p = mock(SarlFormalParameter.class);
when(p.getName()).thenReturn("firstarg");
JvmTypeReference ref = getType(getParseHelper(), "java.lang.String");
when(p.getParameterType()).thenReturn(ref);
when(p.getDefaultValue()).thenReturn(mock(XExpression.class));
this.sarlParameters.add(p);
p = mock(SarlFormalParameter.class);
when(p.getName()).thenReturn("secondarg");
ref = getType(getParseHelper(), "int");
when(p.getParameterType()).thenReturn(ref);
this.sarlParameters.add(p);
p = mock(SarlFormalParameter.class);
when(p.getName()).thenReturn("thirdarg");
ref = getType(getParseHelper(), "float");
when(p.getParameterType()).thenReturn(ref);
when(p.getDefaultValue()).thenReturn(mock(XExpression.class));
this.sarlParameters.add(p);
p = mock(SarlFormalParameter.class);
when(p.getName()).thenReturn("fourtharg");
ref = getType(getParseHelper(), "java.lang.Object");
when(p.getParameterType()).thenReturn(ref);
this.sarlParameters.add(p);
//
JvmFormalParameter jp;
this.jvmParameters = new BasicEList<>();
jp = mock(JvmFormalParameter.class);
when(jp.getName()).thenReturn("firstarg");
ref = getType(getParseHelper(), "java.lang.String");
when(jp.getParameterType()).thenReturn(ref);
JvmAnnotationType annotationType = mock(JvmAnnotationType.class);
when(annotationType.getQualifiedName()).thenReturn(DefaultValue.class.getName());
JvmAnnotationReference annotationRef = mock(JvmAnnotationReference.class);
when(annotationRef.getAnnotation()).thenReturn(annotationType);
when(jp.getAnnotations()).thenReturn(ECollections.singletonEList(annotationRef));
when(jp.eIsSet(ArgumentMatchers.any())).thenAnswer((invocation) -> {
if (Objects.equals(TypesPackage.Literals.JVM_ANNOTATION_TARGET__ANNOTATIONS,
invocation.getArguments()[0])) {
return Boolean.TRUE;
}
return Boolean.FALSE;
});
this.jvmParameters.add(jp);
jp = mock(JvmFormalParameter.class);
when(jp.getName()).thenReturn("secondarg");
ref = getType(getParseHelper(), "int");
when(jp.getParameterType()).thenReturn(ref);
when(jp.getAnnotations()).thenReturn(ECollections.<JvmAnnotationReference>emptyEList());
this.jvmParameters.add(jp);
jp = mock(JvmFormalParameter.class);
when(jp.getName()).thenReturn("thirdarg");
ref = getType(getParseHelper(), "float");
when(jp.getParameterType()).thenReturn(ref);
annotationType = mock(JvmAnnotationType.class);
when(annotationType.getQualifiedName()).thenReturn(DefaultValue.class.getName());
annotationRef = mock(JvmAnnotationReference.class);
when(annotationRef.getAnnotation()).thenReturn(annotationType);
when(jp.getAnnotations()).thenReturn(ECollections.singletonEList(annotationRef));
when(jp.eIsSet(ArgumentMatchers.any())).thenAnswer((invocation) -> {
if (Objects.equals(TypesPackage.Literals.JVM_ANNOTATION_TARGET__ANNOTATIONS,
invocation.getArguments()[0])) {
return Boolean.TRUE;
}
return Boolean.FALSE;
});
this.jvmParameters.add(jp);
jp = mock(JvmFormalParameter.class);
when(jp.getName()).thenReturn("fourtharg");
ref = getType(getParseHelper(), "java.lang.Object[]");
when(jp.getParameterType()).thenReturn(ref);
when(jp.getAnnotations()).thenReturn(ECollections.<JvmAnnotationReference>emptyEList());
this.jvmParameters.add(jp);
}
@Test
public void validateTypeOfVarArgInSarl() throws Exception {
SarlScript s = file(getParseHelper(), "agent Foo { def fooFct(a : float, b : Object*) {} }");
SarlFormalParameter param = (SarlFormalParameter) ((SarlAction) ((SarlAgent) s.getXtendTypes().get(0))
.getMembers().get(0)).getParameters().get(1);
assertNotNull(param);
assertEquals("java.lang.Object", param.getParameterType().getIdentifier());
}
@Test
public void createQualifiedActionName() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
final String xtextResourceID = container.eResource().getURI().toString();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
assertNotNull(qn);
assertEquals("myfct", qn.getActionName());
//xtextResourceID == "file:/path/to/io/sarl/tests/Stub"+index+".sarl"
assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index, qn.getContainerID());
assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index+"#myfct", qn.toString());
}
@Test
public void createConstructorQualifiedName() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
final String xtextResourceID = container.eResource().getURI().toString();
QualifiedActionName qn = this.provider.createConstructorQualifiedName(container);
assertNotNull(qn);
assertEquals("new", qn.getActionName());
//xtextResourceID == "file:/path/to/io/sarl/tests/Stub"+index+".sarl"
assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index, qn.getContainerID());
assertEquals(xtextResourceID + "/io.sarl.tests.Stub"+index+"#new", qn.toString());
}
@Test
public void createParameterTypesForVoid() {
ActionParameterTypes key = this.provider.createParameterTypesForVoid();
assertNotNull(key);
assertFalse(key.isVarArg());
assertTrue(key.isVoid());
assertEquals("", key.toString());
assertTrue(key.isEmpty());
}
@Test
public void createParameterTypes_varArgs() {
ActionParameterTypes key = this.provider.createParameterTypes(true, this.parameterProvider);
assertNotNull(key);
assertTrue(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,int,float,java.lang.Object*", key.toString());
assertEquals(4, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("int", key.get(1));
assertEquals("float", key.get(2));
assertEquals("java.lang.Object[]", key.get(3));
}
@Test
public void createParameterTypes_noVarArgs() {
ActionParameterTypes key = this.provider.createParameterTypes(false, this.parameterProvider);
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,int,float,java.lang.Object[]", key.toString());
assertEquals(4, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("int", key.get(1));
assertEquals("float", key.get(2));
assertEquals("java.lang.Object[]", key.get(3));
}
@Test
public void createParameterTypesFromString_empty() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("");
assertNotNull(key);
assertFalse(key.isVarArg());
assertTrue(key.isVoid());
assertEquals("", key.toString());
assertTrue(key.isEmpty());
}
@Test
public void createParameterTypesFromString_void() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("void");
assertNotNull(key);
assertFalse(key.isVarArg());
assertTrue(key.isVoid());
assertEquals("", key.toString());
assertTrue(key.isEmpty());
}
@Test
public void createParameterTypesFromString_Void() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.Void");
assertNotNull(key);
assertFalse(key.isVarArg());
assertTrue(key.isVoid());
assertEquals("", key.toString());
assertTrue(key.isEmpty());
}
@Test
public void createParameterTypesFromString_String_noVargArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String");
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String", key.toString());
assertEquals(1, key.size());
assertEquals("java.lang.String", key.get(0));
}
@Test
public void createParameterTypesFromString_StringFloat_noVargArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float");
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float", key.toString());
assertEquals(2, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float", key.get(1));
}
@Test
public void createParameterTypesFromString_StringFloatObject_noVargArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float,java.lang.Object");
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float,java.lang.Object", key.toString());
assertEquals(3, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float", key.get(1));
assertEquals("java.lang.Object", key.get(2));
}
@Test
public void createParameterTypesFromString_String_vargArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String*");
assertNotNull(key);
assertTrue(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String*", key.toString());
assertEquals(1, key.size());
assertEquals("java.lang.String[]", key.get(0));
}
@Test
public void createParameterTypesFromString_StringFloat_vargArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float*");
assertNotNull(key);
assertTrue(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float*", key.toString());
assertEquals(2, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float[]", key.get(1));
}
@Test
public void createParameterTypesFromString_StringFloatObject_vargArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float,java.lang.Object*");
assertNotNull(key);
assertTrue(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float,java.lang.Object*", key.toString());
assertEquals(3, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float", key.get(1));
assertEquals("java.lang.Object[]", key.get(2));
}
@Test
public void createParameterTypesFromString_String_noVargArg_array() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String[]");
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String[]", key.toString());
assertEquals(1, key.size());
assertEquals("java.lang.String[]", key.get(0));
}
@Test
public void createParameterTypesFromString_StringFloat_noVargArg_array() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float[]");
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float[]", key.toString());
assertEquals(2, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float[]", key.get(1));
}
@Test
public void createParameterTypesFromString_StringFloatObject_noVargArg_array() {
ActionParameterTypes key = this.provider.createParameterTypesFromString("java.lang.String,float,java.lang.Object[]");
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,float,java.lang.Object[]", key.toString());
assertEquals(3, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("float", key.get(1));
assertEquals("java.lang.Object[]", key.get(2));
}
@Test
public void createParameterTypesFromSarlModell_void() {
ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(false,
new BasicEList<SarlFormalParameter>());
assertNotNull(key);
assertFalse(key.isVarArg());
assertTrue(key.isVoid());
assertTrue(key.isEmpty());
}
@Test
public void createParameterTypesFromSarlModel_noVarArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters);
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,int,float,java.lang.Object", key.toString());
assertEquals(4, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("int", key.get(1));
assertEquals("float", key.get(2));
assertEquals("java.lang.Object", key.get(3));
}
@Test
public void createParameterTypesFromSarlModel_varArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromSarlModel(true, this.sarlParameters);
assertNotNull(key);
assertTrue(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,int,float,java.lang.Object*", key.toString());
assertEquals(4, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("int", key.get(1));
assertEquals("float", key.get(2));
assertEquals("java.lang.Object[]", key.get(3));
}
@Test
public void createParameterTypesFromJvmModel_void() {
ActionParameterTypes key = this.provider.createParameterTypesFromJvmModel(false, new BasicEList<JvmFormalParameter>());
assertNotNull(key);
assertFalse(key.isVarArg());
assertTrue(key.isVoid());
assertTrue(key.isEmpty());
}
@Test
public void createParameterTypesFromJvmModel_noVarArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromJvmModel(false, this.jvmParameters);
assertNotNull(key);
assertFalse(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,int,float,java.lang.Object[]", key.toString());
assertEquals(4, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("int", key.get(1));
assertEquals("float", key.get(2));
assertEquals("java.lang.Object[]", key.get(3));
}
@Test
public void createParameterTypesFromJvmModel_varArg() {
ActionParameterTypes key = this.provider.createParameterTypesFromJvmModel(true, this.jvmParameters);
assertNotNull(key);
assertTrue(key.isVarArg());
assertFalse(key.isVoid());
assertEquals("java.lang.String,int,float,java.lang.Object*", key.toString());
assertEquals(4, key.size());
assertEquals("java.lang.String", key.get(0));
assertEquals("int", key.get(1));
assertEquals("float", key.get(2));
assertEquals("java.lang.Object[]", key.get(3));
}
@Test
public void createActionPrototype_void() {
ActionParameterTypes params = this.provider.createParameterTypesFromJvmModel(true, new BasicEList<JvmFormalParameter>());
ActionPrototype prototype = this.provider.createActionPrototype("myfct", params);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName());
assertSame(params, prototype.getParametersTypes());
}
@Test
public void createActionPrototype_noVarArg() {
ActionParameterTypes params = this.provider.createParameterTypesFromJvmModel(false, this.jvmParameters);
ActionPrototype prototype = this.provider.createActionPrototype("myfct", params);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName());
assertSame(params, prototype.getParametersTypes());
}
@Test
public void createActionPrototype_varArg() {
ActionParameterTypes params = this.provider.createParameterTypesFromJvmModel(true, this.jvmParameters);
ActionPrototype prototype = this.provider.createActionPrototype("myfct", params);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName());
assertSame(params, prototype.getParametersTypes());
}
@Test
public void createPrototypeFromSarlModel_void() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
EList<SarlFormalParameter> params = new BasicEList<>();
//
InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, false, params);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName().getActionName());
assertSameFormalParameters(params, prototype.getFormalParameters());
assertEquals("", prototype.getFormalParameterTypes().toString());
assertContainsStrings(
prototype.getParameterTypeAlternatives(),
"");
assertTrue(prototype.getInferredParameterTypes().isEmpty());
}
@Test
public void createPrototypeFromSarlModel_noVarArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
//
InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName().getActionName());
assertSameFormalParameters(this.sarlParameters, prototype.getFormalParameters());
assertEquals(
"java.lang.String,int,float,java.lang.Object",
prototype.getFormalParameterTypes().toString());
assertContainsStrings(
prototype.getParameterTypeAlternatives(),
"java.lang.String,int,float,java.lang.Object",
"java.lang.String,int,java.lang.Object",
"int,float,java.lang.Object",
"int,java.lang.Object");
assertPrototypes(prototype.getOriginalParameterTypes(),
InferredStandardParameter.class,
"java.lang.String",
"firstarg",
InferredStandardParameter.class,
"int",
"secondarg",
InferredStandardParameter.class,
"float",
"thirdarg",
InferredStandardParameter.class,
"java.lang.Object",
"fourtharg");
assertPrototypes(prototype.getInferredParameterTypes(),
new Object[] {
InferredStandardParameter.class,
"java.lang.String",
"firstarg",
InferredStandardParameter.class,
"int",
"secondarg",
InferredValuedParameter.class,
"float",
"thirdarg",
"io.sarl.tests.Stub" + index + "#MYFCT_1",
InferredStandardParameter.class,
"java.lang.Object",
"fourtharg",
},
new Object[] {
InferredValuedParameter.class,
"java.lang.String",
"firstarg",
"io.sarl.tests.Stub" + index + "#MYFCT_0",
InferredStandardParameter.class,
"int",
"secondarg",
InferredStandardParameter.class,
"float",
"thirdarg",
InferredStandardParameter.class,
"java.lang.Object",
"fourtharg",
},
new Object[] {
InferredValuedParameter.class,
"java.lang.String",
"firstarg",
"io.sarl.tests.Stub" + index + "#MYFCT_0",
InferredStandardParameter.class,
"int",
"secondarg",
InferredValuedParameter.class,
"float",
"thirdarg",
"io.sarl.tests.Stub" + index + "#MYFCT_1",
InferredStandardParameter.class,
"java.lang.Object",
"fourtharg",
});
}
@Test
public void createPrototypeFromSarlModel_varArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
//
InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName().getActionName());
assertSameFormalParameters(this.sarlParameters, prototype.getFormalParameters());
assertEquals("java.lang.String,int,float,java.lang.Object*", prototype.getFormalParameterTypes().toString());
assertContainsStrings(
prototype.getParameterTypeAlternatives(),
"java.lang.String,int,float,java.lang.Object*",
"java.lang.String,int,java.lang.Object*",
"int,float,java.lang.Object*",
"int,java.lang.Object*");
assertPrototypes(prototype.getOriginalParameterTypes(),
InferredStandardParameter.class,
"java.lang.String",
"firstarg",
InferredStandardParameter.class,
"int",
"secondarg",
InferredStandardParameter.class,
"float",
"thirdarg",
InferredStandardParameter.class,
"java.lang.Object[]",
"fourtharg");
assertPrototypes(prototype.getInferredParameterTypes(),
new Object[] {
InferredStandardParameter.class,
"java.lang.String",
"firstarg",
InferredStandardParameter.class,
"int",
"secondarg",
InferredValuedParameter.class,
"float",
"thirdarg",
"io.sarl.tests.Stub" + index + "#MYFCT_1",
InferredStandardParameter.class,
"java.lang.Object[]",
"fourtharg",
},
new Object[] {
InferredValuedParameter.class,
"java.lang.String",
"firstarg",
"io.sarl.tests.Stub" + index + "#MYFCT_0",
InferredStandardParameter.class,
"int",
"secondarg",
InferredStandardParameter.class,
"float",
"thirdarg",
InferredStandardParameter.class,
"java.lang.Object[]",
"fourtharg",
},
new Object[] {
InferredValuedParameter.class,
"java.lang.String",
"firstarg",
"io.sarl.tests.Stub" + index + "#MYFCT_0",
InferredStandardParameter.class,
"int",
"secondarg",
InferredValuedParameter.class,
"float",
"thirdarg",
"io.sarl.tests.Stub" + index + "#MYFCT_1",
InferredStandardParameter.class,
"java.lang.Object[]",
"fourtharg",
});
}
@Test
public void createPrototypeFromJvmModel_void() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
EList<JvmFormalParameter> params = new BasicEList<>();
//
InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, false, params);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName().getActionName());
assertSameJvmFormalParameters(params, prototype.getFormalParameters());
assertEquals("", prototype.getFormalParameterTypes().toString());
assertContainsStrings(
prototype.getParameterTypeAlternatives(),
"");
assertTrue(prototype.getInferredParameterTypes().isEmpty());
}
@Test
public void createPrototypeFromJvmModel_noVarArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
//
InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, false, this.jvmParameters);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName().getActionName());
assertSameJvmFormalParameters(this.jvmParameters, prototype.getFormalParameters());
assertEquals(
"java.lang.String,int,float,java.lang.Object[]",
prototype.getFormalParameterTypes().toString());
assertContainsStrings(
prototype.getParameterTypeAlternatives(),
"java.lang.String,int,float,java.lang.Object[]",
"java.lang.String,int,java.lang.Object[]",
"int,float,java.lang.Object[]",
"int,java.lang.Object[]");
assertPrototypes(prototype.getOriginalParameterTypes(),
InferredStandardParameter.class,
"java.lang.String",
"firstarg",
InferredStandardParameter.class,
"int",
"secondarg",
InferredStandardParameter.class,
"float",
"thirdarg",
InferredStandardParameter.class,
"java.lang.Object[]",
"fourtharg");
assertPrototypes(prototype.getInferredParameterTypes(),
new Object[] {
InferredStandardParameter.class,
"java.lang.String",
"firstarg",
InferredStandardParameter.class,
"int",
"secondarg",
InferredValuedParameter.class,
"float",
"thirdarg",
"io.sarl.tests.Stub" + index + "#MYFCT_1",
InferredStandardParameter.class,
"java.lang.Object[]",
"fourtharg",
},
new Object[] {
InferredValuedParameter.class,
"java.lang.String",
"firstarg",
"io.sarl.tests.Stub" + index + "#MYFCT_0",
InferredStandardParameter.class,
"int",
"secondarg",
InferredStandardParameter.class,
"float",
"thirdarg",
InferredStandardParameter.class,
"java.lang.Object[]",
"fourtharg",
},
new Object[] {
InferredValuedParameter.class,
"java.lang.String",
"firstarg",
"io.sarl.tests.Stub" + index + "#MYFCT_0",
InferredStandardParameter.class,
"int",
"secondarg",
InferredValuedParameter.class,
"float",
"thirdarg",
"io.sarl.tests.Stub" + index + "#MYFCT_1",
InferredStandardParameter.class,
"java.lang.Object[]",
"fourtharg",
});
}
@Test
public void createPrototypeFromJvmModel_varArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
//
InferredPrototype prototype = this.provider.createPrototypeFromJvmModel(this.context, qn, true, this.jvmParameters);
assertNotNull(prototype);
assertEquals("myfct", prototype.getActionName().getActionName());
assertSameJvmFormalParameters(this.jvmParameters, prototype.getFormalParameters());
assertEquals(
"java.lang.String,int,float,java.lang.Object*",
prototype.getFormalParameterTypes().toString());
assertContainsStrings(
prototype.getParameterTypeAlternatives(),
"java.lang.String,int,float,java.lang.Object*",
"java.lang.String,int,java.lang.Object*",
"int,float,java.lang.Object*",
"int,java.lang.Object*");
assertPrototypes(prototype.getOriginalParameterTypes(),
InferredStandardParameter.class,
"java.lang.String",
"firstarg",
InferredStandardParameter.class,
"int",
"secondarg",
InferredStandardParameter.class,
"float",
"thirdarg",
InferredStandardParameter.class,
"java.lang.Object[]",
"fourtharg");
assertPrototypes(prototype.getInferredParameterTypes(),
new Object[] {
InferredStandardParameter.class,
"java.lang.String",
"firstarg",
InferredStandardParameter.class,
"int",
"secondarg",
InferredValuedParameter.class,
"float",
"thirdarg",
"io.sarl.tests.Stub" + index + "#MYFCT_1",
InferredStandardParameter.class,
"java.lang.Object[]",
"fourtharg",
},
new Object[] {
InferredValuedParameter.class,
"java.lang.String",
"firstarg",
"io.sarl.tests.Stub" + index + "#MYFCT_0",
InferredStandardParameter.class,
"int",
"secondarg",
InferredStandardParameter.class,
"float",
"thirdarg",
InferredStandardParameter.class,
"java.lang.Object[]",
"fourtharg",
},
new Object[] {
InferredValuedParameter.class,
"java.lang.String",
"firstarg",
"io.sarl.tests.Stub" + index + "#MYFCT_0",
InferredStandardParameter.class,
"int",
"secondarg",
InferredValuedParameter.class,
"float",
"thirdarg",
"io.sarl.tests.Stub" + index + "#MYFCT_1",
InferredStandardParameter.class,
"java.lang.Object[]",
"fourtharg",
});
}
@Test
public void getPrototypesQualifiedActionName_noCreatedPrototype() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
//
Iterable<InferredPrototype> iterable = this.provider.getPrototypes(this.context, qn);
assertNotNull(iterable);
assertFalse(iterable.iterator().hasNext());
}
@Test
public void getPrototypesQualifiedActionName_createdPrototype_noVarArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters);
//
Iterable<InferredPrototype> iterable = this.provider.getPrototypes(this.context, qn);
assertNotNull(iterable);
Iterator<InferredPrototype> iterator = iterable.iterator();
assertTrue(iterator.hasNext());
InferredPrototype prototype = iterator.next();
assertSame(expected, prototype);
assertFalse(iterator.hasNext());
}
@Test
public void getPrototypesQualifiedActionName_createdPrototype_varArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters);
//
Iterable<InferredPrototype> iterable = this.provider.getPrototypes(this.context, qn);
assertNotNull(iterable);
Iterator<InferredPrototype> iterator = iterable.iterator();
assertTrue(iterator.hasNext());
InferredPrototype prototype = iterator.next();
assertSame(expected, prototype);
assertFalse(iterator.hasNext());
}
@Test
public void getPrototypesQualifiedActionNameActionParameterTypes_noCreatedPrototype() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters);
//
InferredPrototype prototype = this.provider.getPrototypes(this.context, qn, types);
assertNull(prototype);
}
@Test
public void getPrototypesQualifiedActionNameActionParameterTypes_createdPrototype_noVarArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters);
InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters);
//
InferredPrototype prototype = this.provider.getPrototypes(this.context, qn, types);
assertNotNull(prototype);
assertSame(expected, prototype);
}
@Test
public void getPrototypesQualifiedActionNameActionParameterTypes_createdPrototype_varArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(true, this.sarlParameters);
InferredPrototype expected = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters);
//
InferredPrototype prototype = this.provider.getPrototypes(this.context, qn, types);
assertNotNull(prototype);
assertSame(expected, prototype);
}
@Test
public void resetPrototypes_noCreatedProtype() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters);
assertNotNull(types);
//
assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext());
this.context.release();
assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext());
}
@Test
public void resetPrototypes_createdProtype_noVarArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(false, this.sarlParameters);
assertNotNull(types);
InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, false, this.sarlParameters);
assertNotNull(prototype);
//
assertTrue(this.provider.getPrototypes(this.context, qn).iterator().hasNext());
this.context.release();
assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext());
}
@Test
public void resetPrototypes_createdProtype_varArg() {
JvmIdentifiableElement container = createJvmIdentifiableElementStub();
QualifiedActionName qn = this.provider.createQualifiedActionName(container, "myfct");
ActionParameterTypes types = this.provider.createParameterTypesFromSarlModel(true, this.sarlParameters);
assertNotNull(types);
InferredPrototype prototype = this.provider.createPrototypeFromSarlModel(this.context, qn, true, this.sarlParameters);
assertNotNull(prototype);
//
assertTrue(this.provider.getPrototypes(this.context, qn).iterator().hasNext());
this.context.release();
assertFalse(this.provider.getPrototypes(this.context, qn).iterator().hasNext());
}
}
}
|
{
"pile_set_name": "Github"
}
|
package de.fhpotsdam.unfolding.geo;
import processing.core.PApplet;
import processing.core.PVector;
import de.fhpotsdam.unfolding.core.Coordinate;
public abstract class AbstractProjection {
public float zoom;
public Transformation transformation;
public AbstractProjection() {
this(0);
}
public AbstractProjection(float zoom) {
this(zoom, new Transformation(1, 0, 0, 0, 1, 0));
}
public AbstractProjection(float zoom, Transformation transformation) {
this.zoom = zoom;
this.transformation = transformation;
}
public abstract PVector rawProject(PVector point);
public abstract PVector rawUnproject(PVector point);
public PVector project(PVector point) {
point = this.rawProject(point);
if (this.transformation != null) {
point = this.transformation.transform(point);
}
return point;
}
public PVector unproject(PVector point) {
if (this.transformation != null) {
point = this.transformation.untransform(point);
}
point = this.rawUnproject(point);
return point;
}
public Coordinate locationCoordinate(Location location) {
PVector point = new PVector(PApplet.PI * location.y / 180.0f, PApplet.PI * location.x / 180.0f);
point = this.project(point);
return new Coordinate(point.y, point.x, this.zoom);
}
public Location coordinateLocation(Coordinate coordinate) {
coordinate = coordinate.zoomTo(this.zoom);
PVector point = new PVector(coordinate.column, coordinate.row);
point = this.unproject(point);
return new Location(180.0f * point.y / PApplet.PI, 180.0f * point.x / PApplet.PI);
}
}
|
{
"pile_set_name": "Github"
}
|
package org.chat21.android.core.chat_groups.listeners;
import org.chat21.android.core.exception.ChatRuntimeException;
import org.chat21.android.core.chat_groups.models.ChatGroup;
/**
* Created by stefanodp91 on 24/01/18.
*/
public interface ChatGroupsListener {
void onGroupAdded(ChatGroup chatGroup, ChatRuntimeException e);
void onGroupChanged(ChatGroup chatGroup, ChatRuntimeException e);
void onGroupRemoved(ChatRuntimeException e);
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGUID>{59D12AB8-F55F-4EE4-99CC-76A51ACB3036}</ProjectGUID>
<Keyword>Win32Proj</Keyword>
<Platform>Win32</Platform>
<ProjectName>rdjpgcom</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.20506.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\Esenthel\ThirdPartyLibs\JpegTurbo\Windows32\Release\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">rdjpgcom.dir\Release\</IntDir>
<TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">rdjpgcom</TargetName>
<TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.exe</TargetExt>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</GenerateManifest>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>C:\Esenthel\ThirdPartyLibs\JpegTurbo\Windows32;C:\Esenthel\ThirdPartyLibs\JpegTurbo\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AssemblerListingLocation>Release/</AssemblerListingLocation>
<CompileAs>CompileAsC</CompileAs>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
<ExceptionHandling>
</ExceptionHandling>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<Optimization>MaxSpeed</Optimization>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;WITH_SIMD;CMAKE_INTDIR="Release";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ObjectFileName>$(IntDir)</ObjectFileName>
<DebugInformationFormat></DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;WITH_SIMD;CMAKE_INTDIR=\"Release\";%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>C:\Esenthel\ThirdPartyLibs\JpegTurbo\Windows32;C:\Esenthel\ThirdPartyLibs\JpegTurbo\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Midl>
<AdditionalIncludeDirectories>C:\Esenthel\ThirdPartyLibs\JpegTurbo\Windows32;C:\Esenthel\ThirdPartyLibs\JpegTurbo\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<OutputDirectory>$(ProjectDir)/$(IntDir)</OutputDirectory>
<HeaderFileName>%(Filename).h</HeaderFileName>
<TypeLibraryName>%(Filename).tlb</TypeLibraryName>
<InterfaceIdentifierFileName>%(Filename)_i.c</InterfaceIdentifierFileName>
<ProxyFileName>%(Filename)_p.c</ProxyFileName>
</Midl>
<Link>
<AdditionalOptions> /machine:X86 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<ImportLibrary>C:/Esenthel/ThirdPartyLibs/JpegTurbo/Windows32/Release/rdjpgcom.lib</ImportLibrary>
<ProgramDataBaseFile>C:/Esenthel/ThirdPartyLibs/JpegTurbo/Windows32/Release/rdjpgcom.pdb</ProgramDataBaseFile>
<SubSystem>Console</SubSystem>
<Version></Version>
</Link>
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemGroup>
<CustomBuild Include="C:\Esenthel\ThirdPartyLibs\JpegTurbo\lib\CMakeLists.txt">
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Building Custom Rule C:/Esenthel/ThirdPartyLibs/JpegTurbo/lib/CMakeLists.txt</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">setlocal
"C:\Program Files (x86)\CMake\bin\cmake.exe" -HC:/Esenthel/ThirdPartyLibs/JpegTurbo/lib -BC:/Esenthel/ThirdPartyLibs/JpegTurbo/Windows32 --check-stamp-file C:\Esenthel\ThirdPartyLibs\JpegTurbo\Windows32\CMakeFiles\generate.stamp
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:/Esenthel/ThirdPartyLibs/JpegTurbo/lib/CMakeLists.txt;C:\Esenthel\ThirdPartyLibs\JpegTurbo\lib\CMakeLists.txt;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeDetermineSystem.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeSystem.cmake.in;C:\Esenthel\ThirdPartyLibs\JpegTurbo\Windows32\CMakeFiles\3.3.1\CMakeSystem.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeSystemSpecificInitialize.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeDetermineCCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeDetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeDetermineCompilerId.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeCompilerIdDetection.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeParseArguments.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\ADSP-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\AppleClang-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\Clang-DetermineCompilerInternal.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\Borland-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\Clang-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\Clang-DetermineCompilerInternal.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\Compaq-C-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\Cray-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\Embarcadero-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\Fujitsu-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\GHS-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\GNU-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\HP-C-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\IAR-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\Intel-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\MIPSpro-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\MSVC-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\OpenWatcom-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\PathScale-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\PGI-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\SCO-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\SDCC-C-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\SunPro-C-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\TI-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\TinyCC-C-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\VisualAge-C-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\IBMCPP-C-DetermineVersionInternal.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\Watcom-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\XL-C-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\IBMCPP-C-DetermineVersionInternal.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\zOS-C-DetermineCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Compiler\IBMCPP-C-DetermineVersionInternal.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CompilerId\VS-10.vcxproj.in;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeFindBinUtils.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeClDeps.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeCCompiler.cmake.in;C:\Esenthel\ThirdPartyLibs\JpegTurbo\Windows32\CMakeFiles\3.3.1\CMakeCCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeSystemSpecificInformation.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeGenericSystem.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Platform\Windows.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Platform\WindowsPaths.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeCInformation.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Platform\Windows-MSVC-C.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\Platform\Windows-MSVC.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeDetermineRCCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeRCCompiler.cmake.in;C:\Esenthel\ThirdPartyLibs\JpegTurbo\Windows32\CMakeFiles\3.3.1\CMakeRCCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeRCInformation.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeTestRCCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeCommonLanguageInclude.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeTestCCompiler.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeTestCompilerCommon.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeDetermineCompilerABI.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeParseImplicitLinkInfo.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeCCompilerABI.c;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeDetermineCompileFeatures.cmake;C:\Program Files (x86)\CMake\share\cmake-3.3\Modules\CMakeCCompiler.cmake.in;C:\Esenthel\ThirdPartyLibs\JpegTurbo\Windows32\CMakeFiles\3.3.1\CMakeCCompiler.cmake;C:\Esenthel\ThirdPartyLibs\JpegTurbo\lib\win\jconfig.h.in;C:\Esenthel\ThirdPartyLibs\JpegTurbo\lib\win\jconfigint.h.in;C:\Esenthel\ThirdPartyLibs\JpegTurbo\lib\release\libjpeg-turbo.nsi.in;C:\Esenthel\ThirdPartyLibs\JpegTurbo\lib\CMakeLists.txt;%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">C:\Esenthel\ThirdPartyLibs\JpegTurbo\Windows32\CMakeFiles\generate.stamp</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkObjects>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<ClCompile Include="C:\Esenthel\ThirdPartyLibs\JpegTurbo\lib\rdjpgcom.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="C:/Esenthel/ThirdPartyLibs/JpegTurbo/Windows32/ZERO_CHECK.vcxproj">
<Project>587E5B54-BB39-4360-AD84-20B5A83F62AD</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.openapi.fileEditor.impl;
import com.intellij.ide.highlighter.HighlighterFactory;
import consulo.disposer.Disposable;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.fileEditor.ex.FileEditorWithProvider;
import consulo.logging.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.EditorFactory;
import com.intellij.openapi.editor.LogicalPosition;
import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.openapi.editor.highlighter.EditorHighlighter;
import com.intellij.openapi.fileEditor.*;
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
import com.intellij.openapi.fileEditor.impl.text.TextEditorPsiDataProvider;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.project.ProjectManagerAdapter;
import com.intellij.openapi.util.*;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
import com.intellij.testFramework.LightVirtualFile;
import com.intellij.util.IncorrectOperationException;
import com.intellij.util.containers.HashMap;
import consulo.fileEditor.impl.EditorComposite;
import consulo.fileEditor.impl.EditorWindow;
import consulo.fileEditor.impl.EditorsSplitters;
import consulo.fileEditor.impl.text.TextEditorProvider;
import consulo.ui.annotation.RequiredUIAccess;
import consulo.ui.UIAccess;
import org.jdom.Element;
import javax.annotation.Nonnull;
import javax.swing.*;
import java.awt.*;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
final class TestEditorManagerImpl extends FileEditorManagerEx implements Disposable {
private static final Logger LOG = Logger.getInstance(TestEditorManagerImpl.class);
private final TestEditorSplitter myTestEditorSplitter = new TestEditorSplitter();
private final Project myProject;
private int counter = 0;
private final Map<VirtualFile, Editor> myVirtualFile2Editor = new HashMap<>();
private VirtualFile myActiveFile;
private static final LightVirtualFile LIGHT_VIRTUAL_FILE = new LightVirtualFile("Dummy.java");
public TestEditorManagerImpl(@Nonnull Project project) {
myProject = project;
registerExtraEditorDataProvider(new TextEditorPsiDataProvider(), null);
project.getMessageBus().connect().subscribe(ProjectManager.TOPIC, new ProjectManagerAdapter() {
@Override
public void projectClosed(Project project, UIAccess uiAccess) {
if (project == myProject) {
closeAllFiles();
}
}
});
}
@Override
@Nonnull
public Pair<FileEditor[], FileEditorProvider[]> openFileWithProviders(@Nonnull final VirtualFile file,
final boolean focusEditor,
boolean searchForSplitter) {
final Ref<Pair<FileEditor[], FileEditorProvider[]>> result = new Ref<>();
CommandProcessor.getInstance().executeCommand(myProject, () -> result.set(openFileImpl3(file, focusEditor)), "", null);
return result.get();
}
private Pair<FileEditor[], FileEditorProvider[]> openFileImpl3(final VirtualFile file, boolean focusEditor) {
// for non-text editors. uml, etc
final FileEditorProvider provider = file.getUserData(FileEditorProvider.KEY);
if (provider != null && provider.accept(getProject(), file)) {
return Pair.create(new FileEditor[]{provider.createEditor(getProject(), file)}, new FileEditorProvider[]{provider});
}
//text editor
Editor editor = openTextEditor(new OpenFileDescriptor(myProject, file), focusEditor);
assert editor != null;
final FileEditor fileEditor = TextEditorProvider.getInstance().getTextEditor(editor);
final FileEditorProvider fileEditorProvider = getProvider();
Pair<FileEditor[], FileEditorProvider[]> result = Pair.create(new FileEditor[]{fileEditor}, new FileEditorProvider[]{fileEditorProvider});
modifyTabWell(new Runnable() {
@Override
public void run() {
myTestEditorSplitter.openAndFocusTab(file, fileEditor, fileEditorProvider);
}
});
return result;
}
private void modifyTabWell(Runnable tabWellModification) {
FileEditor lastFocusedEditor = myTestEditorSplitter.getFocusedFileEditor();
VirtualFile lastFocusedFile = myTestEditorSplitter.getFocusedFile();
FileEditorProvider oldProvider = myTestEditorSplitter.getProviderFromFocused();
tabWellModification.run();
FileEditor currentlyFocusedEditor = myTestEditorSplitter.getFocusedFileEditor();
VirtualFile currentlyFocusedFile = myTestEditorSplitter.getFocusedFile();
FileEditorProvider newProvider = myTestEditorSplitter.getProviderFromFocused();
final FileEditorManagerEvent event =
new FileEditorManagerEvent(this, lastFocusedFile, lastFocusedEditor, oldProvider, currentlyFocusedFile, currentlyFocusedEditor, newProvider);
final FileEditorManagerListener publisher = getProject().getMessageBus().syncPublisher(FileEditorManagerListener.FILE_EDITOR_MANAGER);
notifyPublisher(new Runnable() {
@Override
public void run() {
publisher.selectionChanged(event);
}
});
}
@RequiredUIAccess
@Nonnull
@Override
public Pair<FileEditor[], FileEditorProvider[]> openFileWithProviders(@Nonnull VirtualFile file,
boolean focusEditor,
@Nonnull EditorWindow window) {
return openFileWithProviders(file, focusEditor, false);
}
@Override
public boolean isInsideChange() {
return false;
}
@Nonnull
@Override
public ActionCallback notifyPublisher(@Nonnull Runnable runnable) {
runnable.run();
return ActionCallback.DONE;
}
@Override
public EditorsSplitters getSplittersFor(Component c) {
return null;
}
@Override
public void createSplitter(int orientation, EditorWindow window) {
String containerName = createNewTabbedContainerName();
myTestEditorSplitter.setActiveTabGroup(containerName);
}
private String createNewTabbedContainerName() {
counter++;
return "SplitTabContainer" + ((Object) counter).toString();
}
@Override
public void changeSplitterOrientation() {
}
@Override
public void flipTabs() {
}
@Override
public boolean tabsMode() {
return false;
}
@Override
public boolean isInSplitter() {
return false;
}
@Override
public boolean hasOpenedFile() {
return false;
}
@Override
public VirtualFile getCurrentFile() {
return myActiveFile;
}
@Override
public FileEditorWithProvider getSelectedEditorWithProvider(@Nonnull VirtualFile file) {
return null;
}
@Override
public boolean isChanged(@Nonnull EditorComposite editor) {
return false;
}
@Override
public EditorWindow getNextWindow(@Nonnull EditorWindow window) {
return null;
}
@Override
public EditorWindow getPrevWindow(@Nonnull EditorWindow window) {
return null;
}
@Override
public void addTopComponent(@Nonnull final FileEditor editor, @Nonnull final JComponent component) {
}
@Override
public void removeTopComponent(@Nonnull final FileEditor editor, @Nonnull final JComponent component) {
}
@Override
public void addBottomComponent(@Nonnull final FileEditor editor, @Nonnull final JComponent component) {
}
@Override
public void removeBottomComponent(@Nonnull final FileEditor editor, @Nonnull final JComponent component) {
}
@Override
public void closeAllFiles() {
for (VirtualFile file : new LinkedList<VirtualFile>(myVirtualFile2Editor.keySet())) {
closeFile(file);
}
}
private static FileEditorProvider getProvider() {
return new FileEditorProvider() {
@Override
public boolean accept(@Nonnull Project project, @Nonnull VirtualFile file) {
return false;
}
@Override
@Nonnull
public FileEditor createEditor(@Nonnull Project project, @Nonnull VirtualFile file) {
throw new IncorrectOperationException();
}
@Override
public void disposeEditor(@Nonnull FileEditor editor) {
}
@Override
@Nonnull
public FileEditorState readState(@Nonnull Element sourceElement, @Nonnull Project project, @Nonnull VirtualFile file) {
throw new IncorrectOperationException();
}
@Override
@Nonnull
public String getEditorTypeId() {
return "";
}
@Override
@Nonnull
public FileEditorPolicy getPolicy() {
throw new IncorrectOperationException();
}
};
}
@Override
public EditorWindow getCurrentWindow() {
return null;
}
@Nonnull
@Override
public AsyncResult<EditorWindow> getActiveWindow() {
return AsyncResult.done(null);
}
@Override
public void setCurrentWindow(EditorWindow window) {
}
@Override
public VirtualFile getFile(@Nonnull FileEditor editor) {
return LIGHT_VIRTUAL_FILE;
}
@Override
public void updateFilePresentation(@Nonnull VirtualFile file) {
}
@Override
public void unsplitWindow() {
}
@Override
public void unsplitAllWindow() {
}
@Override
@Nonnull
public EditorWindow[] getWindows() {
return new EditorWindow[0]; //To change body of implemented methods use File | Settings | File Templates.
}
@Override
public FileEditor getSelectedEditor(@Nonnull VirtualFile file) {
final Editor editor = getEditor(file);
return editor == null ? null : TextEditorProvider.getInstance().getTextEditor(editor);
}
@Override
public boolean isFileOpen(@Nonnull VirtualFile file) {
return getEditor(file) != null;
}
@Override
@Nonnull
public FileEditor[] getEditors(@Nonnull VirtualFile file) {
FileEditor e = getSelectedEditor(file);
if (e == null) return new FileEditor[0];
return new FileEditor[] {e};
}
@Nonnull
@Override
public FileEditor[] getAllEditors(@Nonnull VirtualFile file) {
return getEditors(file);
}
@Override
@Nonnull
public VirtualFile[] getSiblings(@Nonnull VirtualFile file) {
throw new UnsupportedOperationException();
}
@Override
public void dispose() {
closeAllFiles();
}
@Override
public void closeFile(@Nonnull final VirtualFile file) {
Editor editor = myVirtualFile2Editor.remove(file);
if (editor != null){
TextEditorProvider editorProvider = TextEditorProvider.getInstance();
editorProvider.disposeEditor(editorProvider.getTextEditor(editor));
EditorFactory.getInstance().releaseEditor(editor);
}
if (Comparing.equal(file, myActiveFile)) {
myActiveFile = null;
}
modifyTabWell(new Runnable() {
@Override
public void run() {
myTestEditorSplitter.closeFile(file);
}
});
}
@Override
public void closeFile(@Nonnull VirtualFile file, @Nonnull EditorWindow window) {
closeFile(file);
}
@Override
@Nonnull
public VirtualFile[] getSelectedFiles() {
return myActiveFile == null ? VirtualFile.EMPTY_ARRAY : new VirtualFile[]{myActiveFile};
}
@Override
@Nonnull
public FileEditor[] getSelectedEditors() {
return new FileEditor[0];
}
@Override
public Editor getSelectedTextEditor() {
return myActiveFile != null ? getEditor(myActiveFile) : null;
}
@Nonnull
@Override
public JComponent getComponent() {
return new JLabel();
}
@Override
@Nonnull
public VirtualFile[] getOpenFiles() {
return VfsUtilCore.toVirtualFileArray(myVirtualFile2Editor.keySet());
}
public Editor getEditor(VirtualFile file) {
return myVirtualFile2Editor.get(file);
}
@Override
@Nonnull
public FileEditor[] getAllEditors() {
FileEditor[] result = new FileEditor[myVirtualFile2Editor.size()];
int i = 0;
for (Map.Entry<VirtualFile, Editor> entry : myVirtualFile2Editor.entrySet()) {
TextEditor textEditor = TextEditorProvider.getInstance().getTextEditor(entry.getValue());
result[i++] = textEditor;
}
return result;
}
@Override
public void showEditorAnnotation(@Nonnull FileEditor editor, @Nonnull JComponent annotationComponent) {
}
@Override
public void removeEditorAnnotation(@Nonnull FileEditor editor, @Nonnull JComponent annotationComponent) {
}
@Override
public Editor openTextEditor(@Nonnull OpenFileDescriptor descriptor, boolean focusEditor) {
final VirtualFile file = descriptor.getFile();
Editor editor = myVirtualFile2Editor.get(file);
if (editor == null) {
PsiFile psiFile = PsiManager.getInstance(myProject).findFile(file);
LOG.assertTrue(psiFile != null, file);
Document document = PsiDocumentManager.getInstance(myProject).getDocument(psiFile);
LOG.assertTrue(document != null, psiFile);
editor = EditorFactory.getInstance().createEditor(document, myProject);
final EditorHighlighter highlighter = HighlighterFactory.createHighlighter(myProject, file);
((EditorEx) editor).setHighlighter(highlighter);
((EditorEx) editor).setFile(file);
myVirtualFile2Editor.put(file, editor);
}
if (descriptor.getOffset() >= 0){
editor.getCaretModel().moveToOffset(descriptor.getOffset());
}
else if (descriptor.getLine() >= 0 && descriptor.getColumn() >= 0){
editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(descriptor.getLine(), descriptor.getColumn()));
}
editor.getSelectionModel().removeSelection();
myActiveFile = file;
return editor;
}
@Override
public void addFileEditorManagerListener(@Nonnull FileEditorManagerListener listener) {
}
@Override
public void addFileEditorManagerListener(@Nonnull FileEditorManagerListener listener, @Nonnull Disposable parentDisposable) {
}
@Override
public void removeFileEditorManagerListener(@Nonnull FileEditorManagerListener listener) {
}
@Override
@Nonnull
public List<FileEditor> openEditor(@Nonnull OpenFileDescriptor descriptor, boolean focusEditor) {
return Collections.emptyList();
}
@Override
@Nonnull
public Project getProject() {
return myProject;
}
@Override
public JComponent getPreferredFocusedComponent() {
throw new UnsupportedOperationException();
}
@Override
@Nonnull
public Pair<FileEditor[], FileEditorProvider[]> getEditorsWithProviders(@Nonnull VirtualFile file) {
Pair<FileEditor, FileEditorProvider> editorAndProvider = myTestEditorSplitter.getEditorAndProvider(file);
FileEditor[] fileEditor = new FileEditor[0];
FileEditorProvider[] fileEditorProvider= new FileEditorProvider[0];
if (editorAndProvider != null) {
fileEditor = new FileEditor[] {editorAndProvider.first};
fileEditorProvider = new FileEditorProvider[]{editorAndProvider.second};
}
return Pair.create(fileEditor, fileEditorProvider);
}
@Override
public int getWindowSplitCount() {
return 0;
}
@Override
public boolean hasSplitOrUndockedWindows() {
return false;
}
@Nonnull
@Override
public EditorsSplitters getSplitters() {
throw new IncorrectOperationException();
}
@Nonnull
@Override
public AsyncResult<Void> getReady(@Nonnull Object requestor) {
return AsyncResult.resolved();
}
@Override
public void setSelectedEditor(@Nonnull VirtualFile file, @Nonnull String fileEditorProviderId) {
}
}
|
{
"pile_set_name": "Github"
}
|
package dev.lucasnlm.antimine.common.level.database.models
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
@Entity
data class Stats(
@PrimaryKey(autoGenerate = true)
val uid: Int,
@ColumnInfo(name = "duration")
val duration: Long,
@ColumnInfo(name = "mines")
val mines: Int,
@ColumnInfo(name = "victory")
val victory: Int,
@ColumnInfo(name = "width")
val width: Int,
@ColumnInfo(name = "height")
val height: Int,
@ColumnInfo(name = "openArea")
val openArea: Int,
)
|
{
"pile_set_name": "Github"
}
|
package com.gameloft9.demo.dataaccess.model.system;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class SysMenuTest implements Serializable{
private String id;
private String title;
private String href;
private String requestUrl;
private String code;
private String icon;
private String target;
private String parentId;
private int sort;
private String createUser;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private String updateUser;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
}
|
{
"pile_set_name": "Github"
}
|
apache-shiro-webapp-tutorial
============================
A [step-by-step tutorial](http://shiro.apache.org/webapp-tutorial.html) showing how to secure a web app with Apache Shiro.
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2_07) on Wed Jul 06 21:29:01 PDT 2005 -->
<TITLE>
JavaCodingStandardCheckerTokenManager (JCSC API)
</TITLE>
<META NAME="keywords" CONTENT="rj.tools.jcsc.JavaCodingStandardCheckerTokenManager class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="JavaCodingStandardCheckerTokenManager (JCSC API)";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JavaCodingStandardCheckerTokenManager.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html" title="interface in rj.tools.jcsc"><B>PREV CLASS</B></A>
<A HREF="../../../rj/tools/jcsc/MethodMetric.html" title="class in rj.tools.jcsc"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="JavaCodingStandardCheckerTokenManager.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
rj.tools.jcsc</FONT>
<BR>
Class JavaCodingStandardCheckerTokenManager</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>rj.tools.jcsc.JavaCodingStandardCheckerTokenManager</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html" title="interface in rj.tools.jcsc">JavaCodingStandardCheckerConstants</A></DD>
</DL>
<HR>
<DL>
<DT>public class <B>JavaCodingStandardCheckerTokenManager</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html" title="interface in rj.tools.jcsc">JavaCodingStandardCheckerConstants</A></DL>
<P>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected char</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#curChar">curChar</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.io.PrintStream</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#debugStream">debugStream</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../rj/tools/jcsc/JavaCharStream.html" title="class in rj.tools.jcsc">JavaCharStream</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#input_stream">input_stream</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#jjnewLexState">jjnewLexState</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#jjstrLiteralImages">jjstrLiteralImages</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#lexStateNames">lexStateNames</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_rj.tools.jcsc.JavaCodingStandardCheckerConstants"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from interface rj.tools.jcsc.<A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html" title="interface in rj.tools.jcsc">JavaCodingStandardCheckerConstants</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#_DEFAULT">_DEFAULT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#ABSTRACT">ABSTRACT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#ANDASSIGN">ANDASSIGN</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#ASSERT">ASSERT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#ASSIGN">ASSIGN</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#AT">AT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#BANG">BANG</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#BIT_AND">BIT_AND</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#BIT_OR">BIT_OR</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#BOOLEAN">BOOLEAN</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#BREAK">BREAK</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#BYTE">BYTE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#CASE">CASE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#CATCH">CATCH</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#CHAR">CHAR</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#CHARACTER_LITERAL">CHARACTER_LITERAL</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#CLASS">CLASS</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#COLON">COLON</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#COMMA">COMMA</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#CONST">CONST</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#CONTINUE">CONTINUE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#DECIMAL_LITERAL">DECIMAL_LITERAL</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#DECR">DECR</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#DEFAULT">DEFAULT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#DIGIT">DIGIT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#DO">DO</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#DOT">DOT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#DOUBLE">DOUBLE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#ELLIPSIS">ELLIPSIS</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#ELSE">ELSE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#ENUM">ENUM</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#EOF">EOF</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#EQ">EQ</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#EXPONENT">EXPONENT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#EXTENDS">EXTENDS</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#FALSE">FALSE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#FINAL">FINAL</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#FINALLY">FINALLY</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#FLOAT">FLOAT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#FLOATING_POINT_LITERAL">FLOATING_POINT_LITERAL</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#FOR">FOR</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#FORMAL_COMMENT">FORMAL_COMMENT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#GE">GE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#GOTO">GOTO</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#GT">GT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#HEX_LITERAL">HEX_LITERAL</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#HOOK">HOOK</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#IDENTIFIER">IDENTIFIER</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#IF">IF</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#IMPLEMENTS">IMPLEMENTS</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#IMPORT">IMPORT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#IN_FORMAL_COMMENT">IN_FORMAL_COMMENT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#IN_MULTI_LINE_COMMENT">IN_MULTI_LINE_COMMENT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#IN_SINGLE_LINE_COMMENT">IN_SINGLE_LINE_COMMENT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#INCR">INCR</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#INSTANCEOF">INSTANCEOF</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#INT">INT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#INTEGER_LITERAL">INTEGER_LITERAL</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#INTERFACE">INTERFACE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#LBRACE">LBRACE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#LBRACKET">LBRACKET</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#LE">LE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#LETTER">LETTER</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#LONG">LONG</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#LPAREN">LPAREN</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#LSHIFT">LSHIFT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#LSHIFTASSIGN">LSHIFTASSIGN</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#LT">LT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#MINUS">MINUS</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#MINUSASSIGN">MINUSASSIGN</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#MULTI_LINE_COMMENT">MULTI_LINE_COMMENT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#NATIVE">NATIVE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#NE">NE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#NEW">NEW</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#NULL">NULL</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#OCTAL_LITERAL">OCTAL_LITERAL</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#ORASSIGN">ORASSIGN</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#PACKAGE">PACKAGE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#PLUS">PLUS</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#PLUSASSIGN">PLUSASSIGN</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#PRIVATE">PRIVATE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#PROTECTED">PROTECTED</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#PUBLIC">PUBLIC</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#RBRACE">RBRACE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#RBRACKET">RBRACKET</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#REM">REM</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#REMASSIGN">REMASSIGN</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#RETURN">RETURN</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#RPAREN">RPAREN</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#RSIGNEDSHIFT">RSIGNEDSHIFT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#RSIGNEDSHIFTASSIGN">RSIGNEDSHIFTASSIGN</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#RUNSIGNEDSHIFT">RUNSIGNEDSHIFT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#RUNSIGNEDSHIFTASSIGN">RUNSIGNEDSHIFTASSIGN</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#SC_AND">SC_AND</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#SC_OR">SC_OR</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#SEMICOLON">SEMICOLON</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#SHORT">SHORT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#SINGLE_LINE_COMMENT">SINGLE_LINE_COMMENT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#SLASH">SLASH</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#SLASHASSIGN">SLASHASSIGN</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#STAR">STAR</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#STARASSIGN">STARASSIGN</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#STATIC">STATIC</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#STRICTFP">STRICTFP</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#STRING_LITERAL">STRING_LITERAL</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#SUPER">SUPER</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#SWITCH">SWITCH</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#SYNCHRONIZED">SYNCHRONIZED</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#THIS">THIS</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#THROW">THROW</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#THROWS">THROWS</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#TILDE">TILDE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#tokenImage">tokenImage</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#TRANSIENT">TRANSIENT</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#TRUE">TRUE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#TRY">TRY</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#VOID">VOID</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#VOLATILE">VOLATILE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#WHILE">WHILE</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#XOR">XOR</A>, <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html#XORASSIGN">XORASSIGN</A></CODE></TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#JavaCodingStandardCheckerTokenManager(rj.tools.jcsc.JavaCharStream)">JavaCodingStandardCheckerTokenManager</A></B>(<A HREF="../../../rj/tools/jcsc/JavaCharStream.html" title="class in rj.tools.jcsc">JavaCharStream</A> stream)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#JavaCodingStandardCheckerTokenManager(rj.tools.jcsc.JavaCharStream, int)">JavaCodingStandardCheckerTokenManager</A></B>(<A HREF="../../../rj/tools/jcsc/JavaCharStream.html" title="class in rj.tools.jcsc">JavaCharStream</A> stream,
int lexState)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../rj/tools/jcsc/Token.html" title="class in rj.tools.jcsc">Token</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#getNextToken()">getNextToken</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../rj/tools/jcsc/Token.html" title="class in rj.tools.jcsc">Token</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#jjFillToken()">jjFillToken</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#ReInit(rj.tools.jcsc.JavaCharStream)">ReInit</A></B>(<A HREF="../../../rj/tools/jcsc/JavaCharStream.html" title="class in rj.tools.jcsc">JavaCharStream</A> stream)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#ReInit(rj.tools.jcsc.JavaCharStream, int)">ReInit</A></B>(<A HREF="../../../rj/tools/jcsc/JavaCharStream.html" title="class in rj.tools.jcsc">JavaCharStream</A> stream,
int lexState)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#setDebugStream(java.io.PrintStream)">setDebugStream</A></B>(java.io.PrintStream ds)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#SwitchTo(int)">SwitchTo</A></B>(int lexState)</CODE>
<BR>
</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="debugStream"><!-- --></A><H3>
debugStream</H3>
<PRE>
public java.io.PrintStream <B>debugStream</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="jjstrLiteralImages"><!-- --></A><H3>
jjstrLiteralImages</H3>
<PRE>
public static final java.lang.String[] <B>jjstrLiteralImages</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="lexStateNames"><!-- --></A><H3>
lexStateNames</H3>
<PRE>
public static final java.lang.String[] <B>lexStateNames</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="jjnewLexState"><!-- --></A><H3>
jjnewLexState</H3>
<PRE>
public static final int[] <B>jjnewLexState</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="input_stream"><!-- --></A><H3>
input_stream</H3>
<PRE>
protected <A HREF="../../../rj/tools/jcsc/JavaCharStream.html" title="class in rj.tools.jcsc">JavaCharStream</A> <B>input_stream</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="curChar"><!-- --></A><H3>
curChar</H3>
<PRE>
protected char <B>curChar</B></PRE>
<DL>
<DL>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="JavaCodingStandardCheckerTokenManager(rj.tools.jcsc.JavaCharStream)"><!-- --></A><H3>
JavaCodingStandardCheckerTokenManager</H3>
<PRE>
public <B>JavaCodingStandardCheckerTokenManager</B>(<A HREF="../../../rj/tools/jcsc/JavaCharStream.html" title="class in rj.tools.jcsc">JavaCharStream</A> stream)</PRE>
<DL>
</DL>
<HR>
<A NAME="JavaCodingStandardCheckerTokenManager(rj.tools.jcsc.JavaCharStream, int)"><!-- --></A><H3>
JavaCodingStandardCheckerTokenManager</H3>
<PRE>
public <B>JavaCodingStandardCheckerTokenManager</B>(<A HREF="../../../rj/tools/jcsc/JavaCharStream.html" title="class in rj.tools.jcsc">JavaCharStream</A> stream,
int lexState)</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="setDebugStream(java.io.PrintStream)"><!-- --></A><H3>
setDebugStream</H3>
<PRE>
public void <B>setDebugStream</B>(java.io.PrintStream ds)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="ReInit(rj.tools.jcsc.JavaCharStream)"><!-- --></A><H3>
ReInit</H3>
<PRE>
public void <B>ReInit</B>(<A HREF="../../../rj/tools/jcsc/JavaCharStream.html" title="class in rj.tools.jcsc">JavaCharStream</A> stream)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="ReInit(rj.tools.jcsc.JavaCharStream, int)"><!-- --></A><H3>
ReInit</H3>
<PRE>
public void <B>ReInit</B>(<A HREF="../../../rj/tools/jcsc/JavaCharStream.html" title="class in rj.tools.jcsc">JavaCharStream</A> stream,
int lexState)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="SwitchTo(int)"><!-- --></A><H3>
SwitchTo</H3>
<PRE>
public void <B>SwitchTo</B>(int lexState)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="jjFillToken()"><!-- --></A><H3>
jjFillToken</H3>
<PRE>
protected <A HREF="../../../rj/tools/jcsc/Token.html" title="class in rj.tools.jcsc">Token</A> <B>jjFillToken</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getNextToken()"><!-- --></A><H3>
getNextToken</H3>
<PRE>
public <A HREF="../../../rj/tools/jcsc/Token.html" title="class in rj.tools.jcsc">Token</A> <B>getNextToken</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JavaCodingStandardCheckerTokenManager.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html" title="interface in rj.tools.jcsc"><B>PREV CLASS</B></A>
<A HREF="../../../rj/tools/jcsc/MethodMetric.html" title="class in rj.tools.jcsc"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="JavaCodingStandardCheckerTokenManager.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<center><i>(c) 1999-2005 by Ralph Jocham (rjocham72@netscape.net)<br>JCSC is released under the terms of the GNU General Public License</i></center>
</BODY>
</HTML>
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0) on Thu Sep 29 14:31:09 EDT 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class org.owasp.appsensor.integration.springsecurity.context.AppSensorSecurityContextRepository (appsensor-parent 2.3.0 API)</title>
<meta name="date" content="2016-09-29">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.owasp.appsensor.integration.springsecurity.context.AppSensorSecurityContextRepository (appsensor-parent 2.3.0 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="header">
<h2 title="Uses of Class org.owasp.appsensor.integration.springsecurity.context.AppSensorSecurityContextRepository" class="title">Uses of Class<br>org.owasp.appsensor.integration.springsecurity.context.AppSensorSecurityContextRepository</h2>
</div>
<div class="classUseContainer">No usage of org.owasp.appsensor.integration.springsecurity.context.AppSensorSecurityContextRepository</div>
<p class="legalCopy"><small>Copyright © 2016 <a href="http://www.owasp.org">The Open Web Application Security Project (OWASP)</a>. All rights reserved.</small></p>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
// Copyright 2017-2020 Fitbit, Inc
// SPDX-License-Identifier: Apache-2.0
package com.fitbit.goldengate.bindings.util
import com.fitbit.goldengate.bindings.BaseTest
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertTrue
import org.junit.Test
import java.util.Arrays
class MemoryDataSinkTest : BaseTest() {
private val data = byteArrayOf(0x01)
@Test
fun shouldCreateSink() {
MemoryDataSink().use { sink ->
assertNotNull(sink)
assertTrue(sink.thisPointer > 0)
}
}
@Test
fun canAttachDataSource() {
MemoryDataSink().use { sink ->
MemoryDataSource(data).use { source ->
sink.attach(source.thisPointer)
}
}
}
@Test
fun shouldReceiveDataSentFromSource() {
MemoryDataSink().use { sink ->
MemoryDataSource(data).use { source ->
// attach DataSource that will send data
sink.attach(source.thisPointer)
// start sending data from DataSource
source.start()
// verify that sink gets the data sent from source
assertTrue(Arrays.equals(sink.getBufferWithSleep(), data))
}
}
}
}
/**
* Sleep is added here as data in delivered on GG loop thread and synchronously checking can be
* flaky without this sleep
*/
fun MemoryDataSink.getBufferWithSleep(millis: Long = 100): ByteArray {
Thread.sleep(millis)
return getBuffer()
}
|
{
"pile_set_name": "Github"
}
|
server.port=8080
spring.application.name=order
management.endpoints.web.exposure.include=*
logging.level.org.springframework.boot.actuate.trace.WebRequestTraceFilter: TRACE
logging.level.com.ewolff.microservice.order.logic.OrderController: TRACE
logging.level.com.ewolff.microservice.order.RandomlyFailingFilter: TRACE
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:postgresql://postgres/dborder
spring.datasource.username=dbuser
spring.datasource.password=dbpass
spring.datasource.driver-class-name=org.postgresql.Driver
spring.sleuth.baggage.remote-fields=x-request-id,x-ot-span-context
|
{
"pile_set_name": "Github"
}
|
public class JniTest
{
private static void Test(
String name,
Object actual,
Object expected,
String actualAsString,
String expectedAsString)
{
if (!actual.equals(expected))
{
System.out.println(String.format(
"Test: %s failed\nExpected: \"%s\", Actual: \"%s\"",
name,
expected,
actual));
JniTest.exitCode = -1;
}
else
{
System.out.println(String.format("Test: %s passed", name));
}
}
private static void Test(
String name,
String actual,
String expected)
{
JniTest.Test(name, actual, expected, actual, expected);
}
public static void main(String[] args)
{
var actualVersion = JniWrapper.get_jni_version();
var expectedVersion = 0x000A0000;
JniTest.Test(
"Get JNI Version",
actualVersion,
expectedVersion,
String.format("0x%08X", actualVersion),
String.format("0x%08X", expectedVersion));
JniTest.Test(
"Read Native String Constant",
JniWrapper.read_constant_string(),
"Hello from C");
JniTest.Test(
"Write Java String to Native Library",
JniWrapper.write_string("Hello from Java"),
"Hello from Java");
JniTest.Test(
"Write Java Char Array to Native Library",
JniWrapper.write_char_array("Hello from Java".toCharArray()),
"Hello from Java");
var helper = new JniHelper();
JniTest.Test(
"Write String Member to Native Library",
JniWrapper.write_string_member(helper),
"Set from Java");
JniWrapper.set_string_member(helper);
JniTest.Test(
"Set String Member from Native Library",
helper.stringMember,
"Set from C");
JniWrapper.execute_java_function(helper);
JniTest.Test(
"Execeute Java Function from Native Library",
helper.stringMember,
"Hello, Managed World");
helper = JniWrapper.instantiate_java_class();
JniTest.Test(
"Instantiate Java Class",
helper.stringMember,
"Instantiated from C");
JniTest.Test(
"Call Native Library to Set System Time",
JniWrapper.set_and_write_time_in_seconds(1000),
"1000");
System.exit(exitCode);
}
public static int exitCode = 0;
}
|
{
"pile_set_name": "Github"
}
|
package com.oath.micro.server.application.registry;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
import cyclops.function.FluentFunctions;
import cyclops.reactive.ReactiveSeq;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ManifestLoader {
public final static ManifestLoader instance = new ManifestLoader();
private final Logger logger = LoggerFactory.getLogger(getClass());
Supplier<Map<String, String>> fn = FluentFunctions.of(this::manifest).memoize();
public Map<String, String> getManifest() {
return fn.get();
}
private Map<String, String> manifest() {
try {
return ReactiveSeq.of("META-INF/MANIFEST.MF")
.map(url -> this.getClass()
.getClassLoader()
.getResourceAsStream(url))
.map(this::getManifest)
.single()
.orElse(null);
} catch (Exception e) {
logger.warn("Warning : can't load manifest due to exception {}", e.getMessage());
}
return null;
}
public Map<String, String> getManifest(final InputStream input) {
final Map<String, String> retMap = new HashMap<String, String>();
try {
Manifest manifest = new Manifest();
manifest.read(input);
final Attributes attributes = manifest.getMainAttributes();
for (final Map.Entry attribute : attributes.entrySet()) {
retMap.put(attribute.getKey().toString(), attribute.getValue().toString());
}
} catch (final Exception ex) {
logger.error("Failed to load manifest ", ex);
}
return retMap;
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright (C) 2014 The SciGraph authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.scigraph.neo4j;
import static com.google.common.collect.Iterables.size;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import io.scigraph.neo4j.Graph;
import io.scigraph.neo4j.GraphBatchImpl;
import io.scigraph.neo4j.IdMap;
import io.scigraph.neo4j.RelationshipMap;
import java.io.File;
import java.io.IOException;
import java.util.Collections;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.mapdb.DB;
import org.mapdb.DBMaker;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;
import org.neo4j.graphdb.index.ReadableIndex;
import org.neo4j.unsafe.batchinsert.BatchInserter;
import org.neo4j.unsafe.batchinsert.BatchInserters;
public class GraphBatchImplMultipleLoadTest {
private static final RelationshipType TYPE = RelationshipType.withName("type");
@Rule
public TemporaryFolder folder = new TemporaryFolder();
String path;
GraphDatabaseService graphDb;
ReadableIndex<Node> nodeIndex;
DB maker;
@Before
public void setup() throws IOException {
path = folder.newFolder().getAbsolutePath();
maker = DBMaker.newMemoryDB().make();
}
Graph getBatchGraph() throws IOException {
BatchInserter inserter = BatchInserters.inserter(new File(path));
return new GraphBatchImpl(inserter, "uri", Collections.<String>emptySet(), Collections.<String>emptySet(),
new IdMap(maker), new RelationshipMap(maker));
}
GraphDatabaseService getGraphDB() {
graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(new File(path));
return graphDb;
}
@Test
public void testMultipleInserts() throws IOException {
Graph batchGraph = getBatchGraph();
long a = batchGraph.createNode("a");
long b = batchGraph.createNode("b");
batchGraph.createRelationship(a, b, TYPE);
batchGraph.shutdown();
batchGraph = getBatchGraph();
a = batchGraph.createNode("a");
long c = batchGraph.createNode("c");
batchGraph.createRelationship(a, c, TYPE);
batchGraph.shutdown();
GraphDatabaseService graphDb = getGraphDB();
try (Transaction tx = graphDb.beginTx()) {
Iterable<Node> nodes = graphDb.getAllNodes();
assertThat(size(nodes), is(3));
Iterable<Relationship> relationships = graphDb.getAllRelationships();
assertThat(size(relationships), is(2));
tx.success();
}
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.util.datasource;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import org.apache.commons.io.input.ReaderInputStream;
import net.sourceforge.pmd.util.datasource.internal.AbstractDataSource;
/**
* DataSource implementation to read data from a Reader.
*/
public class ReaderDataSource extends AbstractDataSource {
/**
* Reader
*/
private final Reader reader;
/**
* Real or pseudo filename or path name.
*
* <p>
* Including a file suffix mapped to the correct language helps assign the
* correct parser.
* </p>
*/
private String dataSourceName;
/**
* Create the DataSource from the Reader.
*/
public ReaderDataSource(Reader reader, String dataSourceName) {
this.reader = reader;
this.dataSourceName = dataSourceName;
}
/**
* Convert the Reader into an InputStream.
* <p>
* <strong>Note:</strong> This uses the default encoding.
* </p>
*
* @return Derived InputStream
* @throws IOException
*/
@Override
public InputStream getInputStream() throws IOException {
return new ReaderInputStream(reader);
}
/**
* Return the dataSourceName via the {@link DataSource} Interface method.
*
* <p>
* Both the parameters are ignored
* </p>
*
* @param shortNames
* ignored
* @param inputFileName
* ignored
* @return
*/
@Override
public String getNiceFileName(boolean shortNames, String inputFileName) {
return getDataSourceName();
}
/**
* @return the dataSourceName
*/
public String getDataSourceName() {
return dataSourceName;
}
/**
* @param dataSourceName
* the dataSourceName to set
*/
public void setDataSourceName(String dataSourceName) {
this.dataSourceName = dataSourceName;
}
@Override
public String toString() {
return new StringBuilder(ReaderDataSource.class.getSimpleName())
.append('[')
.append(dataSourceName)
.append(']')
.toString();
}
}
|
{
"pile_set_name": "Github"
}
|
# Provider for Java Print Service
sun.print.PrintServiceLookupProvider
|
{
"pile_set_name": "Github"
}
|
package com.forgeessentials.teleport;
import java.util.List;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.server.permission.DefaultPermissionLevel;
import net.minecraftforge.server.permission.PermissionAPI;
import com.forgeessentials.api.UserIdent;
import com.forgeessentials.commons.selections.WarpPoint;
import com.forgeessentials.core.commands.ForgeEssentialsCommandBase;
import com.forgeessentials.core.misc.TeleportHelper;
import com.forgeessentials.core.misc.TranslatedCommandException;
public class CommandTop extends ForgeEssentialsCommandBase
{
@Override
public String getName()
{
return "fetop";
}
@Override
public String[] getDefaultAliases()
{
return new String[] { "top" };
}
@Override
public String getUsage(ICommandSender sender)
{
return "/top <player> Teleport you or another player to the top of the world.";
}
@Override
public boolean canConsoleUseCommand()
{
return true;
}
@Override
public DefaultPermissionLevel getPermissionLevel()
{
return DefaultPermissionLevel.ALL;
}
@Override
public String getPermissionNode()
{
return TeleportModule.PERM_TOP;
}
@Override
public void processCommandPlayer(MinecraftServer server, EntityPlayerMP sender, String[] args) throws CommandException
{
if (args.length == 0)
{
top(sender);
}
else if (args.length == 1 && PermissionAPI.hasPermission(sender, TeleportModule.PERM_TOP_OTHERS))
{
EntityPlayerMP player = UserIdent.getPlayerByMatchOrUsername(sender, args[0]);
if (player != null)
{
top(player);
}
else
throw new TranslatedCommandException("Player %s does not exist, or is not online.", args[0]);
}
else
throw new TranslatedCommandException("Improper syntax. Please try this instead: <player>");
}
@Override
public void processCommandConsole(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if (args.length == 1)
{
EntityPlayerMP player = UserIdent.getPlayerByMatchOrUsername(sender, args[0]);
if (player != null)
{
top(player);
}
else
throw new TranslatedCommandException("Player %s does not exist, or is not online.", args[0]);
}
else
throw new TranslatedCommandException("Improper syntax. Please try this instead: <player>");
}
public void top(EntityPlayerMP player) throws CommandException
{
WarpPoint point = new WarpPoint(player);
point.setY(player.world.getPrecipitationHeight(player.getPosition()).getY());
while (player.world.getBlockState(point.getBlockPos()).getBlock() == Blocks.AIR)
{
point.setY(point.getY() - 1);
}
point.setY(point.getY() + 1);
TeleportHelper.teleport(player, point);
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if (args.length == 1)
{
return matchToPlayers(args);
}
else
{
return null;
}
}
}
|
{
"pile_set_name": "Github"
}
|
### filebench is a filesystem and storage benchmark that runs workloads
### specified using a Workload Model Language (WML). The intention is that
### an analyst can distil a production workload into a WML-equivalent and
### then execute it via filebench. It ships with a number of stock
### personalities.
###
### This configuration uses the filebench OLTP personality for a working
### set that is 2*RAM and uses buffered IO. The IO model should be similar to
### the Oracle 9i IO model and launches multiple reader, writer and logging
### processes. More can be read about the stock personalities at
### http://filebench.sourceforge.net/wiki/index.php/Pre-defined_personalities.
# MM Test Parameters
export MMTESTS="filebench"
# Test disk to setup (optional)
#export TESTDISK_RAID_DEVICES=
#export TESTDISK_RAID_MD_DEVICE=/dev/md0
#export TESTDISK_RAID_OFFSET=63
#export TESTDISK_RAID_SIZE=250019532
#export TESTDISK_RAID_TYPE=raid0
#export TESTDISK_PARTITION=/dev/sda6
#export TESTDISK_FILESYSTEM=xfs
#export TESTDISK_MKFS_PARAM="-f -d agcount=8"
#export TESTDISK_MOUNT_ARGS=inode64,delaylog,logbsize=262144,nobarrier
# List of monitors
export RUN_MONITOR=yes
export MONITORS_ALWAYS=
export MONITORS_GZIP="proc-vmstat top iotop"
export MONITORS_WITH_LATENCY="vmstat iostat"
export MONITOR_UPDATE_FREQUENCY=10
# filebench
export FILEBENCH_PERSONALITY=oltp
export FILEBENCH_ITERATIONS=3
export FILEBENCH_WORKING_SET=$((MEMTOTAL_BYTES*2))
export FILEBENCH_MIN_THREADS=1
export FILEBENCH_MAX_THREADS=1
|
{
"pile_set_name": "Github"
}
|
package com.bdc.ociney.view.textview;
import android.graphics.Paint;
import android.view.Gravity;
import android.widget.TextView;
/*!
*
* TextJustifyUtils.java
* @author Mathew Kurian
*
* From TextJustify-Android Library v1.0.2
* https://github.com/bluejamesbond/TextJustify-Android
*
* Please report any issues
* https://github.com/bluejamesbond/TextJustify-Android/issues
*
* Date: 12/13/2013 12:29:16 PM
*
*/
public class TextJustifyUtils
{
// Please use run(...) instead
public static void justify(TextView textView)
{
Paint paint = new Paint();
String [] blocks;
float spaceOffset = 0;
float textWrapWidth = 0;
int spacesToSpread;
float wrappedEdgeSpace;
String block;
String [] lineAsWords;
String wrappedLine;
String smb = "";
Object [] wrappedObj;
// Pull widget properties
paint.setColor(textView.getCurrentTextColor());
paint.setTypeface(textView.getTypeface());
paint.setTextSize(textView.getTextSize());
textWrapWidth = textView.getWidth();
spaceOffset = paint.measureText(" ");
blocks = textView.getText().toString().split("((?<=\n)|(?=\n))");
if(textWrapWidth < 20)
{
return;
}
for(int i = 0; i < blocks.length; i++)
{
block = blocks[i];
if(block.length() == 0)
{
continue;
}
else if(block.equals("\n"))
{
smb += block;
continue;
}
block = block.trim();
if(block.length() == 0) continue;
wrappedObj = TextJustifyUtils.createWrappedLine(block, paint, spaceOffset, textWrapWidth);
wrappedLine = ((String) wrappedObj[0]);
wrappedEdgeSpace = (Float) wrappedObj[1];
lineAsWords = wrappedLine.split(" ");
spacesToSpread = (int) (wrappedEdgeSpace != Float.MIN_VALUE ? wrappedEdgeSpace/spaceOffset : 0);
for(String word : lineAsWords)
{
smb += word + " ";
if(--spacesToSpread > 0)
{
smb += " ";
}
}
smb = smb.trim();
if(blocks[i].length() > 0)
{
blocks[i] = blocks[i].substring(wrappedLine.length());
if(blocks[i].length() > 0)
{
smb += "\n";
}
i--;
}
}
textView.setGravity(Gravity.LEFT);
textView.setText(smb);
}
protected static Object [] createWrappedLine(String block, Paint paint, float spaceOffset, float maxWidth)
{
float cacheWidth = maxWidth;
float origMaxWidth = maxWidth;
String line = "";
for(String word : block.split("\\s"))
{
cacheWidth = paint.measureText(word);
maxWidth -= cacheWidth;
if(maxWidth <= 0)
{
return new Object[] { line, maxWidth + cacheWidth + spaceOffset };
}
line += word + " ";
maxWidth -= spaceOffset;
}
if(paint.measureText(block) <= origMaxWidth)
{
return new Object[] { block, Float.MIN_VALUE };
}
return new Object[] { line, maxWidth };
}
final static String SYSTEM_NEWLINE = "\n";
final static float COMPLEXITY = 5.12f; //Reducing this will increase efficiency but will decrease effectiveness
final static Paint p = new Paint();
/* @author Mathew Kurian */
public static void run(final TextView tv, float origWidth) {
String s = tv.getText().toString();
p.setTypeface(tv.getTypeface());
String [] splits = s.split(SYSTEM_NEWLINE);
float width = origWidth - 5;
for(int x = 0; x<splits.length;x++)
if(p.measureText(splits[x])>width){
splits[x] = wrap(splits[x], width, p);
String [] microSplits = splits[x].split(SYSTEM_NEWLINE);
for(int y = 0; y<microSplits.length-1;y++)
microSplits[y] = justify(removeLast(microSplits[y], " "), width, p);
StringBuilder smb_internal = new StringBuilder();
for(int z = 0; z<microSplits.length;z++)
smb_internal.append(microSplits[z]+((z+1<microSplits.length) ? SYSTEM_NEWLINE : ""));
splits[x] = smb_internal.toString();
}
final StringBuilder smb = new StringBuilder();
for(String cleaned : splits)
smb.append(cleaned+SYSTEM_NEWLINE);
tv.setGravity(Gravity.LEFT);
tv.setText(smb);
}
private static String wrap(String s, float width, Paint p){
String [] str = s.split("\\s"); //regex
StringBuilder smb = new StringBuilder(); //save memory
smb.append(SYSTEM_NEWLINE);
for(int x = 0; x<str.length; x++){
float length = p.measureText(str[x]);
String [] pieces = smb.toString().split(SYSTEM_NEWLINE);
try{
if(p.measureText(pieces[pieces.length-1])+length>width)
smb.append(SYSTEM_NEWLINE);
}catch(Exception e){}
smb.append(str[x] + " ");
}
return smb.toString().replaceFirst(SYSTEM_NEWLINE, "");
}
private static String removeLast(String s, String g){
if(s.contains(g)){
int index = s.lastIndexOf(g);
int indexEnd = index + g.length();
if(index == 0) return s.substring(1);
else if(index == s.length()-1) return s.substring(0, index);
else
return s.substring(0, index) + s.substring(indexEnd);
}
return s;
}
private static String justifyOperation(String s, float width, Paint p){
float holder = (float) (COMPLEXITY*Math.random());
while(s.contains(Float.toString(holder)))
holder = (float) (COMPLEXITY*Math.random());
String holder_string = Float.toString(holder);
float lessThan = width;
int timeOut = 100;
int current = 0;
while(p.measureText(s)<lessThan&¤t<timeOut) {
s = s.replaceFirst(" ([^"+holder_string+"])", " "+holder_string+"$1");
lessThan = p.measureText(holder_string)+lessThan-p.measureText(" ");
current++;
}
String cleaned = s.replaceAll(holder_string, " ");
return cleaned;
}
private static String justify(String s, float width, Paint p){
while(p.measureText(s)<width){
s = justifyOperation(s,width, p);
}
return s;
}
}
|
{
"pile_set_name": "Github"
}
|
parameters:
nelmio_security.external_redirects.whitelist: ~
services:
nelmio_security.external_redirect_listener:
class: Nelmio\SecurityBundle\EventListener\ExternalRedirectListener
arguments:
- '%nelmio_security.external_redirects.abort%'
- '%nelmio_security.external_redirects.override%'
- '%nelmio_security.external_redirects.forward_as%'
- '@?nelmio_security.external_redirect.target_validator'
- '@?logger'
- '@?router'
tags:
- { name: kernel.event_listener, event: kernel.response, method: onKernelResponse }
- { name: monolog.logger, channel: security }
nelmio_security.external_redirect.target_validator:
alias: nelmio_security.external_redirect.target_validator.whitelist
nelmio_security.external_redirect.target_validator.whitelist:
public: false
class: Nelmio\SecurityBundle\ExternalRedirect\WhitelistBasedTargetValidator
arguments:
- '%nelmio_security.external_redirects.whitelist%'
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.zeppelin.utils;
import java.net.InetAddress;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
import org.apache.zeppelin.conf.ZeppelinConfiguration;
public class CorsUtils {
public static Boolean isValidOrigin(String sourceHost, ZeppelinConfiguration conf)
throws UnknownHostException, URISyntaxException {
String sourceUriHost = "";
if (sourceHost != null && !sourceHost.isEmpty()) {
sourceUriHost = new URI(sourceHost).getHost();
sourceUriHost = (sourceUriHost == null) ? "" : sourceUriHost.toLowerCase();
}
sourceUriHost = sourceUriHost.toLowerCase();
String currentHost = InetAddress.getLocalHost().getHostName().toLowerCase();
return conf.getAllowedOrigins().contains("*")
|| currentHost.equals(sourceUriHost)
|| "localhost".equals(sourceUriHost)
|| conf.getAllowedOrigins().contains(sourceHost);
}
}
|
{
"pile_set_name": "Github"
}
|
package com.doublechaintech.retailscm.trainingcoursetype;
//import com.doublechaintech.retailscm.EntityNotFoundException;
import com.doublechaintech.retailscm.RetailscmException;
import com.doublechaintech.retailscm.Message;
import java.util.List;
public class TrainingCourseTypeManagerException extends RetailscmException {
private static final long serialVersionUID = 1L;
public TrainingCourseTypeManagerException(String string) {
super(string);
}
public TrainingCourseTypeManagerException(Message message) {
super(message);
}
public TrainingCourseTypeManagerException(List<Message> messageList) {
super(messageList);
}
}
|
{
"pile_set_name": "Github"
}
|
package org.ovirt.engine.ui.common;
import com.google.gwt.user.cellview.client.DataGrid;
public interface DataGridPopupTableResources extends DataGrid.Resources {
interface Style extends DataGrid.Style {
}
@Override
@Source({ DataGrid.Style.DEFAULT_CSS, "org/ovirt/engine/ui/common/css/TabDataGrid.css",
"org/ovirt/engine/ui/common/css/PopupDataGrid.css" })
Style dataGridStyle();
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!-- SPDX-License-Identifier: Apache-2.0 -->
<!-- Copyright Contributors to the ODPi Egeria project. -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>discovery-engine</artifactId>
<groupId>org.odpi.egeria</groupId>
<version>2.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<scm>
<connection>scm:git:git://github.com/odpi/egeria.git</connection>
<developerConnection>scm:git:ssh://github.com/odpi/egeria.git</developerConnection>
<url>http://github.com/odpi/egeria/tree/master</url>
</scm>
<name>Discovery Engine OMAS with Spring</name>
<description>
Spring-based REST API for the Discovery Engine Open Metadata Access Service (OMAS).
</description>
<artifactId>discovery-engine-spring</artifactId>
<dependencies>
<dependency>
<groupId>org.odpi.egeria</groupId>
<artifactId>ffdc-services</artifactId>
</dependency>
<dependency>
<groupId>org.odpi.egeria</groupId>
<artifactId>ocf-metadata-api</artifactId>
</dependency>
<dependency>
<groupId>org.odpi.egeria</groupId>
<artifactId>odf-metadata-api</artifactId>
</dependency>
<dependency>
<groupId>org.odpi.egeria</groupId>
<artifactId>discovery-engine-server</artifactId>
</dependency>
<dependency>
<groupId>org.odpi.egeria</groupId>
<artifactId>open-discovery-framework</artifactId>
</dependency>
<!-- Spring for REST APIs -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
</dependencies>
</project>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*
* DESCRIPTION
* Clear of an image to a specific color.
* -- VIS version low level functions.
*
* NOTE
* These functions are separated from mlib_v_ImageClear.c
* for structure clarity.
*/
#include <vis_proto.h>
#include <mlib_image.h>
#include <mlib_v_ImageClear_f.h>
/***************************************************************/
#define PREPAREVARS(type, chan) \
type *pimg = (type *) mlib_ImageGetData(img); \
mlib_s32 img_height = mlib_ImageGetHeight(img); \
mlib_s32 img_width = mlib_ImageGetWidth(img); \
mlib_s32 img_stride = mlib_ImageGetStride(img) / sizeof(type); \
mlib_s32 i, l, j; \
mlib_s32 emask; \
mlib_d64 dcolor, *dpimg; \
\
if ((img_width * chan) == img_stride) { \
img_width *= img_height; \
img_height = 1; \
}
/***************************************************************/
#define STRIP(pd, color, w, h, chan, data_type) \
for (l = 0; l < chan; l++) { \
data_type color_i = color[l]; \
for (i = 0; i < h; i++) { \
for (j = 0; j < w; j++) pd[i*img_stride+l+j*chan] = color_i; \
} \
}
/***************************************************************/
void mlib_v_ImageClear_BIT_1(mlib_image *img,
const mlib_s32 *color)
{
mlib_u8 *pimg = (mlib_u8 *) mlib_ImageGetData(img);
mlib_s32 img_height = mlib_ImageGetHeight(img);
mlib_s32 img_width = mlib_ImageGetWidth(img);
mlib_s32 img_stride = mlib_ImageGetStride(img);
mlib_s32 img_bitoff = mlib_ImageGetBitOffset(img);
mlib_s32 i, j, b_j, k;
mlib_u8 bcolor0, bmask, emask, src;
mlib_d64 dcolor, *dpimg;
mlib_u32 color0;
if (img_width == img_stride * 8) {
img_width *= img_height;
img_height = 1;
}
color0 = ((color[0] & 1) << 31) >> 31;
bcolor0 = color0 & 0xFF;
dcolor = vis_to_double_dup(color0);
for (i = 0, j = 0; i < img_height; i++) {
mlib_u8 *pimg_row = pimg + i * img_stride, *pimg_row_end;
if (img_bitoff + img_width <= 8) {
bmask = (0xFF >> (8 - img_width)) << (8 - img_bitoff - img_width);
src = pimg_row[0];
pimg_row[0] = (src & ~bmask) | (color0 & bmask);
continue;
}
else {
bmask = 0xFF >> img_bitoff;
src = pimg_row[0];
pimg_row[0] = (src & ~bmask) | (color0 & bmask);
pimg_row++;
j = 8 - img_bitoff;
b_j = (img_width - j) / 8;
}
if (b_j < 16) {
mlib_s32 ii;
for (ii = 0; ii < b_j; ii++)
pimg_row[ii] = bcolor0;
pimg_row += ii;
j += ii << 3;
if (j < img_width) {
bmask = (0xFF << (8 - (img_width - j))) & 0xFF;
src = pimg_row[0];
pimg_row[0] = (src & ~bmask) | (color0 & bmask);
}
continue;
}
pimg_row_end = pimg_row + b_j - 1;
dpimg = (mlib_d64 *) vis_alignaddr(pimg_row, 0);
emask = vis_edge8(pimg_row, pimg_row_end);
vis_pst_8(dcolor, dpimg++, emask);
k = (mlib_addr) dpimg - (mlib_addr) pimg_row;
for (; k < (b_j - 8); k += 8)
*dpimg++ = dcolor;
emask = vis_edge8(dpimg, pimg_row_end);
vis_pst_8(dcolor, dpimg, emask);
j += b_j << 3;
if (j < img_width) {
pimg_row = (mlib_u8 *) (pimg_row_end + 1);
bmask = (0xFF << (8 - (img_width - j))) & 0xFF;
src = pimg_row[0];
pimg_row[0] = (src & ~bmask) | (color0 & bmask);
}
}
}
/***************************************************************/
void mlib_v_ImageClear_BIT_2(mlib_image *img,
const mlib_s32 *color)
{
mlib_u8 *pimg = (mlib_u8 *) mlib_ImageGetData(img); /* pointer to the data of img-image */
mlib_s32 img_height = mlib_ImageGetHeight(img); /* height of source image */
mlib_s32 img_width = mlib_ImageGetWidth(img) << 1; /* width of source image */
mlib_s32 img_stride = mlib_ImageGetStride(img); /* elements to next row */
mlib_s32 img_bitoff = mlib_ImageGetBitOffset(img); /* bits to first byte */
mlib_s32 i, j, b_j, k; /* indicies */
mlib_u8 bcolor0, bmask, emask, src;
mlib_d64 dcolor, *dpimg;
mlib_u32 color0 = color[0] & 1, color1 = color[1] & 1;
if (img_width == img_stride * 8) {
img_width *= img_height;
img_height = 1;
}
color1 = (color0 << 1) | color1;
color1 = (color1 << 2) | color1;
color1 = (color1 << 4) | color1;
color0 = ((color1 << 1) & 0xFE) | color0;
bcolor0 = ((img_bitoff & 1) == 0) ? color1 : color0;
color0 = (bcolor0 << 8) | bcolor0;
color0 = (color0 << 16) | color0;
dcolor = vis_to_double_dup(color0);
for (i = 0, j = 0; i < img_height; i++) {
mlib_u8 *pimg_row = pimg + i * img_stride, *pimg_row_end;
if (img_bitoff + img_width <= 8) {
bmask = (0xFF >> (8 - img_width)) << (8 - img_bitoff - img_width);
src = pimg_row[0];
pimg_row[0] = (src & ~bmask) | (color0 & bmask);
continue;
}
else {
bmask = 0xFF >> img_bitoff;
src = pimg_row[0];
pimg_row[0] = (src & ~bmask) | (color0 & bmask);
pimg_row++;
j = 8 - img_bitoff;
b_j = (img_width - j) / 8;
}
if (b_j < 16) {
mlib_s32 ii;
for (ii = 0; ii < b_j; ii++)
pimg_row[ii] = bcolor0;
pimg_row += ii;
j += ii << 3;
if (j < img_width) {
bmask = (0xFF << (8 - (img_width - j))) & 0xFF;
src = pimg_row[0];
pimg_row[0] = (src & ~bmask) | (color0 & bmask);
}
continue;
}
pimg_row_end = pimg_row + b_j - 1;
dpimg = (mlib_d64 *) vis_alignaddr(pimg_row, 0);
emask = vis_edge8(pimg_row, pimg_row_end);
vis_pst_8(dcolor, dpimg++, emask);
k = (mlib_addr) dpimg - (mlib_addr) pimg_row;
for (; k < (b_j - 8); k += 8)
*dpimg++ = dcolor;
emask = vis_edge8(dpimg, pimg_row_end);
vis_pst_8(dcolor, dpimg, emask);
j += b_j << 3;
if (j < img_width) {
pimg_row = (mlib_u8 *) (pimg_row_end + 1);
bmask = (0xFF << (8 - (img_width - j))) & 0xFF;
src = pimg_row[0];
pimg_row[0] = (src & ~bmask) | (color0 & bmask);
}
}
}
/***************************************************************/
void mlib_v_ImageClear_BIT_3(mlib_image *img,
const mlib_s32 *color)
{
mlib_u8 *pimg = (mlib_u8 *) mlib_ImageGetData(img); /* pointer to the data of img-image */
mlib_s32 img_height = mlib_ImageGetHeight(img); /* height of source image */
mlib_s32 img_width = mlib_ImageGetWidth(img) * 3; /* width of source image */
mlib_s32 img_stride = mlib_ImageGetStride(img); /* elements to next row */
mlib_s32 img_bitoff = mlib_ImageGetBitOffset(img); /* bits to first byte */
mlib_s32 i, j, b_j, k, bit_shift; /* indicies */
mlib_u8 bcolor, bmask, emask, src;
mlib_d64 dcolor0, dcolor1, dcolor2, *dpimg;
mlib_d64 dcolor00, dcolor11, dcolor22;
mlib_u32 color0 = color[0] & 1, color1 = color[1] & 1, color2 = color[2] & 1;
mlib_u32 col0, col1, col2;
if (img_width == img_stride * 8) {
img_width *= img_height;
img_height = 1;
}
col0 = (color0 << 3) | (color1 << 2) | (color2 << 1) | color0;
col1 = (col0 >> 1) | (color2 << 3);
col2 = (col1 >> 1) | (color1 << 3);
color0 = (col0 << 4) | col2;
color1 = (col1 << 4) | col0;
color2 = (col2 << 4) | col1;
color0 = (color0 << 24) | (color1 << 16) | (color2 << 8) | color0;
color1 = (color0 << 8) | color1;
color2 = (color1 << 8) | color2;
dcolor0 = vis_to_double(color0, color1);
dcolor1 = vis_to_double(color2, color0);
dcolor2 = vis_to_double(color1, color2);
for (i = 0; i < img_height; i++) {
mlib_u8 *pimg_row = pimg + i * img_stride, *pimg_row_end;
if (img_bitoff + img_width <= 8) {
bmask = (0xFF >> (8 - img_width)) << (8 - img_bitoff - img_width);
src = pimg_row[0];
bcolor = (color0 >> img_bitoff) & 0xFF;
pimg_row[0] = (src & ~bmask) | (bcolor & bmask);
continue;
}
else {
bmask = 0xFF >> img_bitoff;
src = pimg_row[0];
bcolor = (color0 >> img_bitoff) & 0xFF;
bit_shift = (((mlib_addr) pimg_row & 7) << 3) + img_bitoff;
pimg_row[0] = (src & ~bmask) | (bcolor & bmask);
pimg_row++;
j = 8 - img_bitoff;
b_j = (img_width - j) / 8;
}
pimg_row_end = pimg_row + b_j - 1;
dpimg = (mlib_d64 *) ((mlib_addr) pimg_row & ~7);
vis_alignaddr((void *)(bit_shift % 3), 0);
dcolor22 = vis_faligndata(dcolor0, dcolor1);
dcolor00 = vis_faligndata(dcolor1, dcolor2);
dcolor11 = vis_faligndata(dcolor2, dcolor0);
emask = vis_edge8(pimg_row, pimg_row_end);
if ((mlib_addr) pimg_row & 7)
vis_pst_8(dcolor22, dpimg++, emask);
k = (mlib_addr) dpimg - (mlib_addr) pimg_row;
for (; k <= (b_j - 24); k += 24) {
dpimg[0] = dcolor00;
dpimg[1] = dcolor11;
dpimg[2] = dcolor22;
dpimg += 3;
}
if (k < b_j) {
if (k < (b_j - 8)) {
*dpimg++ = dcolor00;
if (k < (b_j - 16)) {
*dpimg++ = dcolor11;
dcolor00 = dcolor22;
}
else
dcolor00 = dcolor11;
}
emask = vis_edge8(dpimg, pimg_row_end);
vis_pst_8(dcolor00, dpimg, emask);
}
j = img_width - j - (b_j << 3);
if (j > 0) {
pimg_row = (mlib_u8 *) (pimg_row_end + 1);
bmask = (0xFF << (8 - j)) & 0xFF;
bcolor = (color0 >> j) & 0xFF;
src = pimg_row[0];
pimg_row[0] = (src & ~bmask) | (bcolor & bmask);
}
}
}
/***************************************************************/
void mlib_v_ImageClear_BIT_4(mlib_image *img,
const mlib_s32 *color)
{
mlib_u8 *pimg = (mlib_u8 *) mlib_ImageGetData(img); /* pointer to the data of img-image */
mlib_s32 img_height = mlib_ImageGetHeight(img); /* height of source image */
mlib_s32 img_width = mlib_ImageGetWidth(img) << 2; /* width of source image */
mlib_s32 img_stride = mlib_ImageGetStride(img); /* elements to next row */
mlib_s32 img_bitoff = mlib_ImageGetBitOffset(img); /* bits to first byte */
mlib_s32 i, j, b_j, k; /* indicies */
mlib_u8 bcolor0, bmask, emask, src;
mlib_d64 dcolor, *dpimg;
mlib_u32 color0 = color[0] & 1, color1 = color[1] & 1, color2 = color[2] & 1, color3 = color[3] & 1;
if (img_width == img_stride * 8) {
img_width *= img_height;
img_height = 1;
}
color0 = (color0 << 3) | (color1 << 2) | (color2 << 1) | color3;
color0 = (color0 << 4) | color0;
color3 = (color0 << 1) | (color0 >> 7);
color2 = (color0 << 2) | (color0 >> 6);
color1 = (color0 << 3) | (color0 >> 5);
bcolor0 = (img_bitoff & 2) ? ((img_bitoff & 1) ? color3 : color2) : ((img_bitoff & 1) ? color1 : color0);
color0 = (bcolor0 << 24) | (bcolor0 << 16) | (bcolor0 << 8) | bcolor0;
dcolor = vis_to_double_dup(color0);
for (i = 0, j = 0; i < img_height; i++) {
mlib_u8 *pimg_row = pimg + i * img_stride, *pimg_row_end;
if (img_bitoff + img_width <= 8) {
bmask = (0xFF >> (8 - img_width)) << (8 - img_bitoff - img_width);
src = pimg_row[0];
pimg_row[0] = (src & ~bmask) | (color0 & bmask);
continue;
}
else {
bmask = 0xFF >> img_bitoff;
src = pimg_row[0];
pimg_row[0] = (src & ~bmask) | (color0 & bmask);
pimg_row++;
j = 8 - img_bitoff;
b_j = (img_width - j) / 8;
}
if (b_j < 16) {
mlib_s32 ii;
for (ii = 0; ii < b_j; ii++)
pimg_row[ii] = bcolor0;
pimg_row += ii;
j += ii << 3;
if (j < img_width) {
bmask = (0xFF << (8 - (img_width - j))) & 0xFF;
src = pimg_row[0];
pimg_row[0] = (src & ~bmask) | (color0 & bmask);
}
continue;
}
pimg_row_end = pimg_row + b_j - 1;
dpimg = (mlib_d64 *) vis_alignaddr(pimg_row, 0);
emask = vis_edge8(pimg_row, pimg_row_end);
vis_pst_8(dcolor, dpimg++, emask);
k = (mlib_addr) dpimg - (mlib_addr) pimg_row;
for (; k < (b_j - 8); k += 8)
*dpimg++ = dcolor;
emask = vis_edge8(dpimg, pimg_row_end);
vis_pst_8(dcolor, dpimg, emask);
j += b_j << 3;
if (j < img_width) {
pimg_row = (mlib_u8 *) (pimg_row_end + 1);
bmask = (0xFF << (8 - (img_width - j))) & 0xFF;
src = pimg_row[0];
pimg_row[0] = (src & ~bmask) | (color0 & bmask);
}
}
}
/***************************************************************/
void mlib_v_ImageClear_U8_1(mlib_image *img,
const mlib_s32 *color)
{
mlib_u32 color0 = color[0] & 0xFF;
PREPAREVARS(mlib_u8, 1);
if (img_width < 16) {
STRIP(pimg, color, img_width, img_height, 1, mlib_u8);
return;
}
color0 |= (color0 << 8);
color0 |= (color0 << 16);
dcolor = vis_to_double_dup(color0);
for (i = 0; i < img_height; i++) {
mlib_u8 *pimg_row = pimg + i * img_stride, *pimg_row_end = pimg_row + img_width - 1;
dpimg = (mlib_d64 *) vis_alignaddr(pimg_row, 0);
emask = vis_edge8(pimg_row, pimg_row_end);
vis_pst_8(dcolor, dpimg++, emask);
j = (mlib_addr) dpimg - (mlib_addr) pimg_row;
for (; j < (img_width - 8); j += 8)
*dpimg++ = dcolor;
emask = vis_edge8(dpimg, pimg_row_end);
vis_pst_8(dcolor, dpimg, emask);
}
}
/***************************************************************/
void mlib_v_ImageClear_U8_2(mlib_image *img,
const mlib_s32 *color)
{
mlib_u32 color0 = color[0] & 0xFF, color1 = color[1] & 0xFF;
mlib_d64 dcolor0;
PREPAREVARS(mlib_u8, 2);
if (img_width < 8) {
STRIP(pimg, color, img_width, img_height, 2, mlib_u8);
return;
}
color0 = (color0 << 8) | color1;
color0 |= (color0 << 16);
dcolor0 = vis_to_double_dup(color0);
for (i = 0; i < img_height; i++) {
mlib_u8 *pimg_row = pimg + i * img_stride, *pimg_row_end = pimg_row + img_width * 2 - 1;
dpimg = (mlib_d64 *) vis_alignaddr(pimg_row, 0);
emask = vis_edge8(pimg_row, pimg_row_end);
dcolor = vis_faligndata(dcolor0, dcolor0);
vis_pst_8(dcolor, dpimg++, emask);
j = (mlib_addr) dpimg - (mlib_addr) pimg_row;
for (; j < (img_width * 2 - 8); j += 8)
*dpimg++ = dcolor;
emask = vis_edge8(dpimg, pimg_row_end);
vis_pst_8(dcolor, dpimg, emask);
}
}
/***************************************************************/
void mlib_v_ImageClear_U8_3(mlib_image *img,
const mlib_s32 *color)
{
mlib_u32 color0 = color[0] & 0xFF, color1 = color[1] & 0xFF, color2 = color[2] & 0xFF, col;
mlib_d64 dcolor1, dcolor2, dcolor00, dcolor11, dcolor22;
PREPAREVARS(mlib_u8, 3);
if (img_width < 16) {
STRIP(pimg, color, img_width, img_height, 3, mlib_u8);
return;
}
col = (color0 << 16) | (color1 << 8) | color2;
color0 = (col << 8) | color0;
color1 = (color0 << 8) | color1;
color2 = (color1 << 8) | color2;
dcolor = vis_to_double(color0, color1);
dcolor1 = vis_to_double(color2, color0);
dcolor2 = vis_to_double(color1, color2);
for (i = 0; i < img_height; i++) {
mlib_u8 *pimg_row = pimg + i * img_stride, *pimg_row_end = pimg_row + img_width * 3 - 1;
dpimg = (mlib_d64 *) ((mlib_addr) pimg_row & ~7);
vis_alignaddr((void *)(-(mlib_addr) pimg_row), 8);
dcolor22 = vis_faligndata(dcolor2, dcolor);
dcolor00 = vis_faligndata(dcolor, dcolor1);
dcolor11 = vis_faligndata(dcolor1, dcolor2);
emask = vis_edge8(pimg_row, pimg_row_end);
if ((mlib_addr) pimg_row & 7)
vis_pst_8(dcolor22, dpimg++, emask);
j = (mlib_addr) dpimg - (mlib_addr) pimg_row;
for (; j < (img_width * 3 - 24); j += 24) {
dpimg[0] = dcolor00;
dpimg[1] = dcolor11;
dpimg[2] = dcolor22;
dpimg += 3;
}
if (j < (img_width * 3 - 8)) {
*dpimg++ = dcolor00;
if (j < (img_width * 3 - 16)) {
*dpimg++ = dcolor11;
dcolor00 = dcolor22;
}
else
dcolor00 = dcolor11;
}
emask = vis_edge8(dpimg, pimg_row_end);
vis_pst_8(dcolor00, dpimg, emask);
}
}
/***************************************************************/
void mlib_v_ImageClear_U8_4(mlib_image *img,
const mlib_s32 *color)
{
mlib_u32 color0 = color[0] & 0xFF, color1 = color[1] & 0xFF, color2 = color[2] & 0xFF, color3 = color[3] & 0xFF;
mlib_d64 dcolor0;
PREPAREVARS(mlib_u8, 4);
if (img_width < 4) {
STRIP(pimg, color, img_width, img_height, 4, mlib_u8);
return;
}
color0 = (color0 << 24) | (color1 << 16) | (color2 << 8) | color3;
dcolor0 = vis_to_double_dup(color0);
for (i = 0; i < img_height; i++) {
mlib_u8 *pimg_row = pimg + i * img_stride, *pimg_row_end = pimg_row + img_width * 4 - 1;
dpimg = (mlib_d64 *) ((mlib_addr) pimg_row & ~7);
vis_alignaddr((void *)(-(mlib_addr) pimg_row), 8);
emask = vis_edge8(pimg_row, pimg_row_end);
dcolor = vis_faligndata(dcolor0, dcolor0);
vis_pst_8(dcolor, dpimg++, emask);
j = (mlib_addr) dpimg - (mlib_addr) pimg_row;
for (; j < (img_width * 4 - 8); j += 8)
*dpimg++ = dcolor;
emask = vis_edge8(dpimg, pimg_row_end);
vis_pst_8(dcolor, dpimg, emask);
}
}
/***************************************************************/
void mlib_v_ImageClear_S16_1(mlib_image *img,
const mlib_s32 *color)
{
mlib_u32 color0 = color[0] & 0xFFFF;
PREPAREVARS(mlib_s16, 1);
if (img_width < 8) {
STRIP(pimg, color, img_width, img_height, 1, mlib_s16);
return;
}
color0 |= (color0 << 16);
dcolor = vis_to_double_dup(color0);
for (i = 0; i < img_height; i++) {
mlib_s16 *pimg_row = pimg + i * img_stride, *pimg_row_end = pimg_row + img_width - 1;
dpimg = (mlib_d64 *) vis_alignaddr(pimg_row, 0);
emask = vis_edge16(pimg_row, pimg_row_end);
vis_pst_16(dcolor, dpimg++, emask);
j = (mlib_s16 *) dpimg - pimg_row;
for (; j < (img_width - 4); j += 4)
*dpimg++ = dcolor;
emask = vis_edge16(dpimg, pimg_row_end);
vis_pst_16(dcolor, dpimg, emask);
}
}
/***************************************************************/
void mlib_v_ImageClear_S16_2(mlib_image *img,
const mlib_s32 *color)
{
mlib_u32 color0 = color[0] & 0xFFFF, color1 = color[1] & 0xFFFF;
mlib_d64 dcolor0;
PREPAREVARS(mlib_s16, 2);
if (img_width < 4) {
STRIP(pimg, color, img_width, img_height, 2, mlib_s16);
return;
}
color0 = (color0 << 16) | color1;
dcolor0 = vis_to_double_dup(color0);
for (i = 0; i < img_height; i++) {
mlib_s16 *pimg_row = pimg + i * img_stride, *pimg_row_end = pimg_row + img_width * 2 - 1;
dpimg = (mlib_d64 *) vis_alignaddr(pimg_row, 0);
emask = vis_edge16(pimg_row, pimg_row_end);
dcolor = vis_faligndata(dcolor0, dcolor0);
vis_pst_16(dcolor, dpimg++, emask);
j = (mlib_s16 *) dpimg - pimg_row;
for (; j < (img_width * 2 - 4); j += 4)
*dpimg++ = dcolor;
emask = vis_edge16(dpimg, pimg_row_end);
vis_pst_16(dcolor, dpimg, emask);
}
}
/***************************************************************/
void mlib_v_ImageClear_S16_3(mlib_image *img,
const mlib_s32 *color)
{
mlib_u32 color0 = color[0] & 0xFFFF, color1 = color[1] & 0xFFFF, color2 = color[2] & 0xFFFF, col0, col1, col2;
mlib_d64 dcolor1, dcolor2, dcolor00, dcolor11, dcolor22;
PREPAREVARS(mlib_s16, 3);
if (img_width < 8) {
STRIP(pimg, color, img_width, img_height, 3, mlib_s16);
return;
}
col0 = (color0 << 16) | color1;
col1 = (color2 << 16) | color0;
col2 = (color1 << 16) | color2;
dcolor = vis_to_double(col0, col1);
dcolor1 = vis_to_double(col2, col0);
dcolor2 = vis_to_double(col1, col2);
for (i = 0; i < img_height; i++) {
mlib_s16 *pimg_row = pimg + i * img_stride, *pimg_row_end = pimg_row + img_width * 3 - 1;
dpimg = (mlib_d64 *) ((mlib_addr) pimg_row & ~7);
vis_alignaddr((void *)(-(mlib_addr) pimg_row), 8);
dcolor22 = vis_faligndata(dcolor2, dcolor);
dcolor00 = vis_faligndata(dcolor, dcolor1);
dcolor11 = vis_faligndata(dcolor1, dcolor2);
emask = vis_edge16(pimg_row, pimg_row_end);
if ((mlib_addr) pimg_row & 7)
vis_pst_16(dcolor22, dpimg++, emask);
j = (mlib_s16 *) dpimg - pimg_row;
for (; j < (img_width * 3 - 12); j += 12) {
dpimg[0] = dcolor00;
dpimg[1] = dcolor11;
dpimg[2] = dcolor22;
dpimg += 3;
}
if (j < (img_width * 3 - 4)) {
*dpimg++ = dcolor00;
if (j < (img_width * 3 - 8)) {
*dpimg++ = dcolor11;
dcolor00 = dcolor22;
}
else
dcolor00 = dcolor11;
}
emask = vis_edge16(dpimg, pimg_row_end);
vis_pst_16(dcolor00, dpimg, emask);
}
}
/***************************************************************/
void mlib_v_ImageClear_S16_4(mlib_image *img,
const mlib_s32 *color)
{
mlib_u32 color0 = color[0] & 0xFFFF, color1 = color[1] & 0xFFFF, color2 = color[2] & 0xFFFF, color3 = color[3] & 0xFFFF;
mlib_d64 dcolor0;
PREPAREVARS(mlib_s16, 4);
if (img_width < 2) {
STRIP(pimg, color, img_width, img_height, 4, mlib_s16);
return;
}
color0 = (color0 << 16) | color1;
color1 = (color2 << 16) | color3;
dcolor0 = vis_to_double(color0, color1);
for (i = 0; i < img_height; i++) {
mlib_s16 *pimg_row = pimg + i * img_stride, *pimg_row_end = pimg_row + img_width * 4 - 1;
dpimg = (mlib_d64 *) ((mlib_addr) pimg_row & ~7);
vis_alignaddr((void *)(-(mlib_addr) pimg_row), 8);
emask = vis_edge16(pimg_row, pimg_row_end);
dcolor = vis_faligndata(dcolor0, dcolor0);
vis_pst_16(dcolor, dpimg++, emask);
j = (mlib_s16 *) dpimg - pimg_row;
for (; j < (img_width * 4 - 4); j += 4)
*dpimg++ = dcolor;
emask = vis_edge16(dpimg, pimg_row_end);
vis_pst_16(dcolor, dpimg, emask);
}
}
/***************************************************************/
void mlib_v_ImageClear_S32_1(mlib_image *img,
const mlib_s32 *color)
{
mlib_u32 color0 = color[0];
PREPAREVARS(mlib_s32, 1);
if (img_width < 4) {
STRIP(pimg, color, img_width, img_height, 1, mlib_s32);
return;
}
dcolor = vis_to_double_dup(color0);
for (i = 0; i < img_height; i++) {
mlib_s32 *pimg_row = pimg + i * img_stride, *pimg_row_end = pimg_row + img_width - 1;
dpimg = (mlib_d64 *) vis_alignaddr(pimg_row, 0);
emask = vis_edge32(pimg_row, pimg_row_end);
vis_pst_32(dcolor, dpimg++, emask);
j = (mlib_s32 *) dpimg - pimg_row;
for (; j <= (img_width - 2); j += 2)
*dpimg++ = dcolor;
if (j < img_width) {
emask = vis_edge32(dpimg, pimg_row_end);
vis_pst_32(dcolor, dpimg, emask);
}
}
}
/***************************************************************/
void mlib_v_ImageClear_S32_2(mlib_image *img,
const mlib_s32 *color)
{
mlib_u32 color0 = color[0], color1 = color[1];
mlib_d64 dcolor0;
PREPAREVARS(mlib_s32, 2);
if (img_width < 2) {
STRIP(pimg, color, img_width, img_height, 2, mlib_s32);
return;
}
dcolor0 = vis_to_double(color0, color1);
for (i = 0; i < img_height; i++) {
mlib_s32 *pimg_row = pimg + i * img_stride, *pimg_row_end = pimg_row + img_width * 2 - 1;
dpimg = (mlib_d64 *) vis_alignaddr(pimg_row, 0);
emask = vis_edge32(pimg_row, pimg_row_end);
dcolor = vis_faligndata(dcolor0, dcolor0);
vis_pst_32(dcolor, dpimg++, emask);
j = (mlib_s32 *) dpimg - pimg_row;
for (; j < (img_width * 2 - 2); j += 2)
*dpimg++ = dcolor;
emask = vis_edge32(dpimg, pimg_row_end);
vis_pst_32(dcolor, dpimg, emask);
}
}
/***************************************************************/
void mlib_v_ImageClear_S32_3(mlib_image *img,
const mlib_s32 *color)
{
mlib_u32 color0 = color[0], color1 = color[1], color2 = color[2];
mlib_d64 dcolor1, dcolor2, dcolor00, dcolor11, dcolor22;
PREPAREVARS(mlib_s32, 3);
if (img_width < 2) {
STRIP(pimg, color, img_width, img_height, 3, mlib_s32);
return;
}
dcolor = vis_to_double(color0, color1);
dcolor1 = vis_to_double(color2, color0);
dcolor2 = vis_to_double(color1, color2);
for (i = 0; i < img_height; i++) {
mlib_s32 *pimg_row = pimg + i * img_stride, *pimg_row_end = pimg_row + img_width * 3 - 1;
dpimg = (mlib_d64 *) ((mlib_addr) pimg_row & ~7);
vis_alignaddr((void *)(-(mlib_addr) pimg_row), 8);
dcolor22 = vis_faligndata(dcolor2, dcolor);
dcolor00 = vis_faligndata(dcolor, dcolor1);
dcolor11 = vis_faligndata(dcolor1, dcolor2);
emask = vis_edge32(pimg_row, pimg_row_end);
if ((mlib_addr) pimg_row & 7)
vis_pst_32(dcolor22, dpimg++, emask);
j = (mlib_s32 *) dpimg - pimg_row;
for (; j < (img_width * 3 - 6); j += 6) {
dpimg[0] = dcolor00;
dpimg[1] = dcolor11;
dpimg[2] = dcolor22;
dpimg += 3;
}
if (j < (img_width * 3 - 2)) {
*dpimg++ = dcolor00;
if (j < (img_width * 3 - 4)) {
*dpimg++ = dcolor11;
dcolor00 = dcolor22;
}
else
dcolor00 = dcolor11;
}
emask = vis_edge32(dpimg, pimg_row_end);
vis_pst_32(dcolor00, dpimg, emask);
}
}
/***************************************************************/
void mlib_v_ImageClear_S32_4(mlib_image *img,
const mlib_s32 *color)
{
mlib_u32 color0 = color[0], color1 = color[1], color2 = color[2], color3 = color[3];
mlib_d64 dcolor0, dcolor00, dcolor0_, dcolor00_, dcolor1;
PREPAREVARS(mlib_s32, 4);
if (img_width < 2) {
STRIP(pimg, color, img_width, img_height, 4, mlib_s32);
return;
}
dcolor0 = vis_to_double(color2, color3);
dcolor00 = vis_to_double(color0, color1);
vis_alignaddr((void *)0, 4);
dcolor0_ = vis_faligndata(dcolor0, dcolor00);
dcolor00_ = vis_faligndata(dcolor00, dcolor0);
for (i = 0; i < img_height; i++) {
mlib_s32 *pimg_row = pimg + i * img_stride, *pimg_row_end = pimg_row + img_width * 4 - 1;
dpimg = (mlib_d64 *) ((mlib_addr) pimg_row & ~7);
vis_alignaddr((void *)(-(mlib_addr) pimg_row), 4);
emask = vis_edge32(pimg_row, pimg_row_end);
dcolor = vis_faligndata(dcolor0_, dcolor00_);
dcolor1 = vis_faligndata(dcolor00_, dcolor0_);
vis_pst_32(dcolor, dpimg++, emask);
*dpimg++ = dcolor1;
j = (mlib_s32 *) dpimg - pimg_row;
for (; j <= (img_width * 4 - 4); j += 4) {
dpimg[0] = dcolor;
dpimg[1] = dcolor1;
dpimg += 2;
}
if (j < (img_width * 4)) {
emask = vis_edge32(dpimg, pimg_row_end);
vis_pst_32(dcolor, dpimg, emask);
}
}
}
/***************************************************************/
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.security.spec;
import java.security.GeneralSecurityException;
/**
* This is the exception for invalid parameter specifications.
*
* @author Jan Luehe
*
*
* @see java.security.AlgorithmParameters
* @see AlgorithmParameterSpec
* @see DSAParameterSpec
*
* @since 1.2
*/
public class InvalidParameterSpecException extends GeneralSecurityException {
@java.io.Serial
private static final long serialVersionUID = -970468769593399342L;
/**
* Constructs an InvalidParameterSpecException with no detail message. A
* detail message is a String that describes this particular
* exception.
*/
public InvalidParameterSpecException() {
super();
}
/**
* Constructs an InvalidParameterSpecException with the specified detail
* message. A detail message is a String that describes this
* particular exception.
*
* @param msg the detail message.
*/
public InvalidParameterSpecException(String msg) {
super(msg);
}
}
|
{
"pile_set_name": "Github"
}
|
<!--
Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<p><a id="ref-realms" name="ref-realms"></a><a id="GHCOM00097" name="GHCOM00097"></a></p>
<h4><a id="sthref197" name="sthref197"></a>Realms</h4>
<a name="BEGIN" id="BEGIN"></a>
<p>The GlassFish Server comes preconfigured with three realms: <code>file</code>, <code>certificate</code>, and <code>admin-realm</code>. It is also possible to create <code>ldap</code>, <code>JDBC</code>, <code>solaris</code>, and custom realms. Generally, you will have one realm of each type on a server, but on the GlassFish Server there are two file realms: <code>file</code> and <code>admin-realm</code>. These are two realms of the same type used for two different purposes. It is also possible to have a different certificate database for each virtual server on your system.</p>
<p>Use the Realms page to configure realms.</p>
<p>For each realm, the following information is provided.</p>
<dl>
<dt>Name</dt>
<dd>
<p>The name of the realm.</p>
</dd>
<dt>Class Name</dt>
<dd>
<p>The class name for the realm.</p>
</dd>
</dl>
<p>The Realms table also contains the following options.</p>
<dl>
<dt>New</dt>
<dd>
<p>Button to create a new realm.</p>
</dd>
<dt>Delete</dt>
<dd>
<p>Button to delete one or more selected realms.</p>
</dd>
</dl>
<a id="GHCOM429" name="GHCOM429"></a>
<h5>Related Tasks</h5>
<ul>
<li>
<p><a href="task-realmnew.html">To Create a Realm</a></p>
</li>
<li>
<p><a href="task-realmedit.html">To Edit a Realm</a></p>
</li>
<li>
<p><a href="task-todeleterealm.html">To Delete a Realm</a></p>
</li>
<li>
<p><a href="task-createcustomrealm.html">To Create a Custom Realm</a></p>
</li>
</ul>
<a id="GHCOM430" name="GHCOM430"></a>
<h5>Related asadmin Commands</h5>
<ul>
<li>
<p><a href="http://www.oracle.com/pls/topic/lookup?ctx=E26576_01&id=GSRFM00015"><code>create-auth-realm</code>(1)</a></p>
</li>
<li>
<p><a href="http://www.oracle.com/pls/topic/lookup?ctx=E26576_01&id=GSRFM00066"><code>delete-auth-realm</code>(1)</a></p>
</li>
<li>
<p><a href="http://www.oracle.com/pls/topic/lookup?ctx=E26576_01&id=GSRFM00150"><code>list-auth-realms</code>(1)</a></p>
</li>
</ul>
<small>Copyright © 2005, 2017, Oracle and/or its affiliates. All rights reserved. <a href="docinfo.html">Legal Notices</a></small>
|
{
"pile_set_name": "Github"
}
|
(ns playphraseme.api.route-functions.user.modify-user
(:require [playphraseme.api.queries.user.registered-user :as users]
[buddy.hashers :as hashers]
[ring.util.http-response :as respond]))
(defn modify-user
"Update user info (`:email`/`:name`/`:password`)"
[current-user-info name password email]
(let [new-email (if (empty? email) (str (:email current-user-info)) email)
new-name (if (empty? name) (str (:name current-user-info)) name)
new-password (if (empty? password) (:password current-user-info) (hashers/encrypt password))
new-user-info (users/update-registered-user! (:id current-user-info)
{:email new-email
:name new-name
:password new-password
:refresh_token (:refresh_token current-user-info)})]
(respond/ok {:id (:id current-user-info) :email new-email :name new-name})))
(defn modify-user-response
"User is allowed to update attributes for a user if the requester is
modifying attributes associated with its own id or has admin permissions."
[request id name password email]
(let [auth (get-in request [:identity :permissions])
current-user-info (users/get-registered-user-by-id id)
admin? (.contains auth "admin")
modifying-self? (= (str id) (get-in request [:identity :id]))
admin-or-self? (or admin? modifying-self?)
modify? (and admin-or-self? (not-empty current-user-info))]
(cond
modify? (modify-user current-user-info name password email)
(not admin?) (respond/unauthorized {:error "Not authorized"})
(empty? current-user-info) (respond/not-found {:error "Userid does not exist"}))))
|
{
"pile_set_name": "Github"
}
|
<!--
Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 only, as
published by the Free Software Foundation. Oracle designates this
particular file as subject to the "Classpath" exception as provided
by Oracle in the LICENSE file that accompanied this code.
This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
version 2 for more details (a copy is included in the LICENSE file that
accompanied this code).
You should have received a copy of the GNU General Public License version
2 along with this work; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<body bgcolor="white">
Provides interfaces and classes for transferring data
between and within applications. It defines the notion of a
"transferable" object, which is an object capable of being
transferred between or within applications. An object identifies
itself as being transferable by implementing the Transferable
interface.
<p>
It also provides a clipboard mechanism, which is an object that
temporarily holds a transferable object that can be transferred
between or within an application. The clipboard is typically used
for copy and paste operations. Although it is possible to create
a clipboard to use within an application, most applications will
use the system clipboard to ensure the data can be transferred
across applications running on the platform.
<!--
<h2>Package Specification</h2>
##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
<ul>
<li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
</ul>
<h2>Related Documentation</h2>
For overviews, tutorials, examples, guides, and tool documentation, please see:
<ul>
<li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
</ul>
-->
@since JDK1.1
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2011-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.glowroot.agent.tests.app;
public class LevelTwo {
private final RuntimeException exception;
public LevelTwo() {
this(null);
}
LevelTwo(RuntimeException e) {
exception = e;
}
// this method corresponds to LevelTwoAspect
public void call(String arg1, String arg2) {
new LevelThree(exception).call(arg1 + "y", arg2 + "y");
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2013 Matt T. Proud
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package pbutil provides record length-delimited Protocol Buffer streaming.
package pbutil
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright 2006 StartNet s.r.o.
*
* Distributed under MIT license
*/
package cz.startnet.utils.pgdiff.parsers;
import cz.startnet.utils.pgdiff.Resources;
import cz.startnet.utils.pgdiff.schema.PgColumn;
import cz.startnet.utils.pgdiff.schema.PgDatabase;
import cz.startnet.utils.pgdiff.schema.PgSchema;
import cz.startnet.utils.pgdiff.schema.PgType;
import java.text.MessageFormat;
import javax.xml.parsers.ParserConfigurationException;
/**
* Parses CREATE TABLE statements.
*
* @author fordfrog
*/
public class CreateTypeParser {
/**
* Parses CREATE TYPE statement.
*
* @param database database
* @param statement CREATE TYPE statement
*/
public static void parse(final PgDatabase database,
final String statement) {
final Parser parser = new Parser(statement);
parser.expect("CREATE", "TYPE");
final String typeName = parser.parseIdentifier();
final PgType type = new PgType(ParserUtils.getObjectName(typeName));
final String schemaName
= ParserUtils.getSchemaName(typeName, database);
final PgSchema schema = database.getSchema(schemaName);
if (schema == null) {
throw new RuntimeException(MessageFormat.format(
Resources.getString("CannotFindSchema"), schemaName,
statement));
}
schema.addType(type);
parser.expect("AS");
if (parser.expectOptional("ENUM")) {
type.setIsEnum(true);
}
parser.expect("(");
while (!parser.expectOptional(")")) {
if (type.getIsEnum()) {
String name = parser.getExpression();
type.addEnumValue(name);
if (parser.expectOptional(")")) {
break;
} else {
parser.expect(",");
}
} else {
parseColumn(parser, type);
if (parser.expectOptional(")")) {
break;
} else {
parser.expect(",");
}
}
}
while (!parser.expectOptional(";")) {
}
}
/**
* Parses column definition.
*
* @param parser parser
* @param type type
*/
private static void parseColumn(final Parser parser, final PgType type) {
final PgColumn column = new PgColumn(
ParserUtils.getObjectName(parser.parseIdentifier()));
type.addColumn(column);
column.parseDefinition(parser.getExpression());
}
/**
* Creates a new instance of CreateTableParser.
*/
private CreateTypeParser() {
}
}
|
{
"pile_set_name": "Github"
}
|
package com.direwolf20.buildinggadgets.common.containers;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.inventory.container.Slot;
import javax.annotation.Nullable;
public abstract class BaseContainer extends Container {
public BaseContainer(@Nullable ContainerType<?> p_i50105_1_, int p_i50105_2_) {
super(p_i50105_1_, p_i50105_2_);
}
protected void addPlayerSlots(PlayerInventory playerInventory, int inX, int inY) {
// Slots for the hotbar
for (int row = 0; row < 9; ++ row) {
int x = inX + row * 18;
int y = inY + 86;
addSlot(new Slot(playerInventory, row, x, y));
}
// Slots for the main inventory
for (int row = 1; row < 4; ++ row) {
for (int col = 0; col < 9; ++ col) {
int x = inX + col * 18;
int y = row * 18 + (inY + 10);
addSlot(new Slot(playerInventory, col + row * 9, x, y));
}
}
}
protected void addPlayerSlots(PlayerInventory playerInventory) {
addPlayerSlots(playerInventory, 8, 56);
}
}
|
{
"pile_set_name": "Github"
}
|
[
new EntersBattlefieldTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPayedCost payedCost) {
if (payedCost.isKicked() == false) {
game.doAction(new AddTriggerAction(permanent, AtEndOfTurnTrigger.Sacrifice));
}
return MagicEvent.NONE;
}
}
]
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.