buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public List<Event> loadData() throws Exception {
try {
List<Event> events = new ArrayList<Event>(service.pageUserReceivedEvents(user.getLogin(), false)
.next());
// Remove any events that can't be rendered
... | public List<Event> loadData() throws Exception {
try {
List<Event> events = new ArrayList<Event>(service.pageUserReceivedEvents(user.getLogin(), false)
.next());
// Remove any events that can't be rendered
... |
@Override public ClusterState execute(ClusterState currentState) {
if (currentState.nodes().nodeExists(node.id())) {
// no change, the node already exists in the cluster
logger.warn("Received an existing node [{}]", node);
... | @Override public ClusterState execute(ClusterState currentState) {
if (currentState.nodes().nodeExists(node.id())) {
// no change, the node already exists in the cluster
logger.warn("Received a join request for an existing node [{}]", n... |
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case id.apply:
String comment = ((EditText) findViewById(id.et_comment)).getText().toString();
Intent intent = new Intent();
intent.putExtra(GitHubIntents.EXTRA_COMMENT, comment);
... | public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case id.apply:
String comment = ((EditText) findViewById(id.et_comment)).getText().toString();
Intent intent = new Intent();
intent.putExtra(GitHubIntents.EXTRA_COMMENT_BODY, comment... |
public void touchMoved(NSSet touches, UIEvent event) {
toTouchEvents(touches, event);
}
void processEvents() {
synchronized(touchEvents) {
justTouched = false;
for(TouchEvent event: touchEvents) {
currentEvent = event;
switch(event.phase) {
case UITouchPhase.Began:
if(inputProcessor != n... | public void touchMoved(NSSet touches, UIEvent event) {
toTouchEvents(touches, event);
}
void processEvents() {
synchronized(touchEvents) {
justTouched = false;
for(TouchEvent event: touchEvents) {
currentEvent = event;
switch(event.phase) {
case UITouchPhase.Began:
if(inputProcessor != n... |
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
// if all are defaults, no sense to write it at all
if (fieldType.stored() == Defaults.FIELD_TYPE.stored() &&
fieldType.indexed() == Defaults.FIELD_TYPE.indexed() && path == Defaults.PATH) ... | public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
// if all are defaults, no sense to write it at all
if (fieldType.stored() == Defaults.FIELD_TYPE.stored() &&
fieldType.indexed() == Defaults.FIELD_TYPE.indexed() && path == Defaults.PATH) ... |
public IndexFieldData<?> build(Index index, Settings indexSettings, FieldMapper<?> mapper, IndexFieldDataCache cache,
CircuitBreakerService breakerService, MapperService mapperService) {
// Ignore Circuit Breaker
final FieldMapper.Names fieldNames =... | public IndexFieldData<?> build(Index index, Settings indexSettings, FieldMapper<?> mapper, IndexFieldDataCache cache,
CircuitBreakerService breakerService, MapperService mapperService) {
// Ignore Circuit Breaker
final FieldMapper.Names fieldNames =... |
private <T> T failIfFieldMappingNotFound(String name, T fieldMapping) {
if (allowUnmappedFields) {
return fieldMapping;
} else {
Version indexCreatedVersion = indexQueryParser.getIndexCreatedVersion();
if (fieldMapping == null && indexCreatedVersion.onOrAfter(Vers... | private <T> T failIfFieldMappingNotFound(String name, T fieldMapping) {
if (allowUnmappedFields) {
return fieldMapping;
} else {
Version indexCreatedVersion = indexQueryParser.getIndexCreatedVersion();
if (fieldMapping == null && indexCreatedVersion.onOrAfter(Vers... |
protected Settings nodeSettings(int nodeOrdinal) {
return ImmutableSettings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(AssertingLocalTransport.ASSERTING_TRANSPORT_MIN_VERSION_KEY, Version.V_1_4_0_Beta).build();
}
| protected Settings nodeSettings(int nodeOrdinal) {
return ImmutableSettings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(AssertingLocalTransport.ASSERTING_TRANSPORT_MIN_VERSION_KEY, Version.V_1_4_0_Beta1).build();
}
|
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeString(clusterName);
out.writeVInt(activePrimaryShards);
out.writeVInt(activeShards);
out.writeVInt(relocatingShards);
out.writeVInt(initializingShards);
out.writeVInt(unas... | public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeString(clusterName);
out.writeVInt(activePrimaryShards);
out.writeVInt(activeShards);
out.writeVInt(relocatingShards);
out.writeVInt(initializingShards);
out.writeVInt(unas... |
public static void main (String[] argv) {
JoglApplicationConfiguration config = new JoglApplicationConfiguration();
new JoglApplication(new com.badlogic.gdx.tests.CullTest(), config);
}
| public static void main (String[] argv) {
JoglApplicationConfiguration config = new JoglApplicationConfiguration();
new JoglApplication(new com.badlogic.gdx.tests.InputTest(), config);
}
|
public static void main (String[] argv) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
new LwjglApplication(new com.badlogic.gdx.tests.CullTest(), config);
}
| public static void main (String[] argv) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
new LwjglApplication(new com.badlogic.gdx.tests.InputTest(), config);
}
|
@Override public void create () {
mesh = new Mesh(true, 3, 0, new VertexAttribute(Usage.Position, 3, "a_Position"), new VertexAttribute(Usage.ColorPacked, 4,
"a_Color"), new VertexAttribute(Usage.TextureCoordinates, 2, "a_texCoords"));
float c1 = Color.toFloatBits(255, 0, 0, 255);
float c2 = Color.toFloatBits... | @Override public void create () {
mesh = new Mesh(true, 3, 0, new VertexAttribute(Usage.Position, 3, "a_Position"), new VertexAttribute(Usage.ColorPacked, 4,
"a_Color"), new VertexAttribute(Usage.TextureCoordinates, 2, "a_texCoords"));
float c1 = Color.toFloatBits(255, 0, 0, 255);
float c2 = Color.toFloatBits... |
public BitmapFont (BitmapFontData data, TextureRegion region, boolean integer) {
this.region = region == null ? new TextureRegion(new Texture(Gdx.files.internal(data.imagePath), false)) : region;
this.flipped = data.flipped;
this.integer = integer;
this.data = data;
load(data);
ownsTexture = region != null... | public BitmapFont (BitmapFontData data, TextureRegion region, boolean integer) {
this.region = region == null ? new TextureRegion(new Texture(Gdx.files.internal(data.imagePath), false)) : region;
this.flipped = data.flipped;
this.integer = integer;
this.data = data;
load(data);
ownsTexture = region == null... |
public void testMultiPhraseCutoff() throws ElasticsearchException, IOException {
/*
* MultiPhraseQuery can literally kill an entire node if there are too many terms in the
* query. We cut off and extract terms if there are more than 16 terms in the query
*/
assertAcked(pre... | public void testMultiPhraseCutoff() throws ElasticsearchException, IOException {
/*
* MultiPhraseQuery can literally kill an entire node if there are too many terms in the
* query. We cut off and extract terms if there are more than 16 terms in the query
*/
assertAcked(pre... |
@Inject public AnalysisService(Index index, @IndexSettings Settings indexSettings,
@Nullable Map<String, AnalyzerProviderFactory> analyzerFactoryFactories,
@Nullable Map<String, TokenizerFactoryFactory> tokenizerFactoryFactories,
... | @Inject public AnalysisService(Index index, @IndexSettings Settings indexSettings,
@Nullable Map<String, AnalyzerProviderFactory> analyzerFactoryFactories,
@Nullable Map<String, TokenizerFactoryFactory> tokenizerFactoryFactories,
... |
protected ClusterBlockException checkBlock(TypesExistsRequest request, ClusterState state) {
return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA, state.metaData().concreteIndices(request.indicesOptions(), request.indices()));
}
| protected ClusterBlockException checkBlock(TypesExistsRequest request, ClusterState state) {
return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA, request.indices());
}
|
public void testInvalidAggregationName() throws Exception {
Matcher matcher = Pattern.compile("[^\\[\\]>]+").matcher("");
String name;
SecureRandom rand = new SecureRandom();
int len = randomIntBetween(1, 5);
char[] word = new char[len];
while(true) {
for... | public void testInvalidAggregationName() throws Exception {
Matcher matcher = Pattern.compile("[a-zA-Z0-9\\-_]+").matcher("");
String name;
SecureRandom rand = new SecureRandom();
int len = randomIntBetween(1, 5);
char[] word = new char[len];
while(true) {
... |
public static void assertNoTimeout(ClusterHealthResponse response) {
assertThat("ClusterHealthResponse has timed out - returned: [" + response + "]", response.isTimedOut(), is(false));
}
| public static void assertNoTimeout(ClusterHealthResponse response) {
assertThat("ClusterHealthResponse has timed out - returned status: [" + response.getStatus() + "]", response.isTimedOut(), is(false));
}
|
public void advanceToFieldName() throws IOException, RestTestParseException {
XContentParser.Token token = parser.currentToken();
//we are in the beginning, haven't called nextToken yet
if (token == null) {
token = parser.nextToken();
}
if (token == XContentParser... | public void advanceToFieldName() throws IOException, RestTestParseException {
XContentParser.Token token = parser.currentToken();
//we are in the beginning, haven't called nextToken yet
if (token == null) {
token = parser.nextToken();
}
if (token == XContentParser... |
private static void clearThreadLocalMap(Object map, Field internalTableField) throws NoSuchMethodException, IllegalAccessException, NoSuchFieldException, InvocationTargetException {
if (map != null) {
Method mapRemove = map.getClass().getDeclaredMethod("remove", ThreadLocal.class);
m... | private static void clearThreadLocalMap(Object map, Field internalTableField) throws NoSuchMethodException, IllegalAccessException, NoSuchFieldException, InvocationTargetException {
if (map != null) {
Method mapRemove = map.getClass().getDeclaredMethod("remove", ThreadLocal.class);
m... |
public void setPasswordCharacter (char passwordCharacter) {
this.passwordCharacter = passwordCharacter;
updateDisplayText();
}
| public void setPasswordCharacter (char passwordCharacter) {
this.passwordCharacter = passwordCharacter;
if(passwordMode) updateDisplayText();
}
|
public FsIndexStore(Index index, @IndexSettings Settings indexSettings, IndexService indexService, NodeEnvironment nodeEnv) {
super(index, indexSettings, indexService);
if (nodeEnv.hasNodeFile()) {
this.location = new File(new File(nodeEnv.nodeFile(), "indices"), index.name());
}... | public FsIndexStore(Index index, @IndexSettings Settings indexSettings, IndexService indexService, NodeEnvironment nodeEnv) {
super(index, indexSettings, indexService);
if (nodeEnv.hasNodeFile()) {
this.location = new File(new File(nodeEnv.nodeLocation(), "indices"), index.name());
... |
@Inject public FsTranslog(ShardId shardId, @IndexSettings Settings indexSettings, NodeEnvironment nodeEnv) {
super(shardId, indexSettings);
this.location = new File(new File(new File(new File(nodeEnv.nodeFile(), "indices"), shardId.index().name()), Integer.toString(shardId.id())), "translog");
... | @Inject public FsTranslog(ShardId shardId, @IndexSettings Settings indexSettings, NodeEnvironment nodeEnv) {
super(shardId, indexSettings);
this.location = new File(new File(new File(new File(nodeEnv.nodeLocation(), "indices"), shardId.index().name()), Integer.toString(shardId.id())), "translog");
... |
protected ClusterBlockException checkBlock(TypesExistsRequest request, ClusterState state) {
return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA, request.indices());
}
| protected ClusterBlockException checkBlock(TypesExistsRequest request, ClusterState state) {
return state.blocks().indicesBlockedException(ClusterBlockLevel.METADATA, state.metaData().concreteIndices(request.indicesOptions(), request.indices()));
}
|
@Override public Facet facet() {
return new InternalCountAndTotalHistogramFacet(facetName, "_na", "_na", -1, comparatorType, counts, totals);
}
| @Override public Facet facet() {
return new InternalCountAndTotalHistogramFacet(facetName, comparatorType, counts, totals);
}
|
@Override public Facet facet() {
return new InternalRangeFacet(facetName, "_na", "_na", entries);
}
| @Override public Facet facet() {
return new InternalRangeFacet(facetName, entries);
}
|
@Override public Facet facet() {
return new InternalStatisticalFacet(facetName, "_na", min, max, total, sumOfSquares, count);
}
| @Override public Facet facet() {
return new InternalStatisticalFacet(facetName, min, max, total, sumOfSquares, count);
}
|
@Override public Facet reduce(String name, List<Facet> facets) {
if (facets.size() == 1) {
return facets.get(0);
}
double min = Double.NaN;
double max = Double.NaN;
double total = 0;
double sumOfSquares = 0;
long count = 0;
for (Facet face... | @Override public Facet reduce(String name, List<Facet> facets) {
if (facets.size() == 1) {
return facets.get(0);
}
double min = Double.NaN;
double max = Double.NaN;
double total = 0;
double sumOfSquares = 0;
long count = 0;
for (Facet face... |
@Override public Facet facet() {
return new InternalStringTermsFacet(facetName, "_index", comparatorType, size, Sets.newHashSet(new InternalStringTermsFacet.StringEntry(indexName, count)), 0);
}
| @Override public Facet facet() {
return new InternalStringTermsFacet(facetName, comparatorType, size, Sets.newHashSet(new InternalStringTermsFacet.StringEntry(indexName, count)), 0);
}
|
public void build (String outputDir, String appName, String packageName, String mainClass) {
Project project = new Project();
String packageDir = packageName.replace('.', '/');
// root dir/gradle files
project.files.add(new ProjectFile("build.gradle", true));
project.files.add(new ProjectFile("settings.g... | public void build (String outputDir, String appName, String packageName, String mainClass) {
Project project = new Project();
String packageDir = packageName.replace('.', '/');
// root dir/gradle files
project.files.add(new ProjectFile("build.gradle", true));
project.files.add(new ProjectFile("settings.g... |
private void loadLayer(TiledMap map, Element element) {
if (element.getName().equals("Layer")) {
String id = element.getAttribute("Id");
String visible = element.getAttribute("Visible");
Element dimensions = element.getChildByName("Dimensions");
String layerSize = dimensions.getAttribute("LayerSize")... | private void loadLayer(TiledMap map, Element element) {
if (element.getName().equals("Layer")) {
String id = element.getAttribute("Id");
String visible = element.getAttribute("Visible");
Element dimensions = element.getChildByName("Dimensions");
String layerSize = dimensions.getAttribute("LayerSize")... |
public void render (int[] layers) {
spriteBatch.begin();
for (int layerIdx : layers) {
MapLayer layer = map.getLayers().getLayer(layerIdx);
if (layer.isVisible()) {
if (layer instanceof TiledMapTileLayer) {
renderTileLayer((TiledMapTileLayer) layer);
} else {
for (MapObject object : layer.g... | public void render (int[] layers) {
spriteBatch.begin();
for (int layerIdx : layers) {
MapLayer layer = map.getLayers().get(layerIdx);
if (layer.isVisible()) {
if (layer instanceof TiledMapTileLayer) {
renderTileLayer((TiledMapTileLayer) layer);
} else {
for (MapObject object : layer.getObj... |
public void create() {
float w = Gdx.graphics.getWidth();
float h = Gdx.graphics.getHeight();
camera = new OrthographicCamera();
camera.setToOrtho(false, (w / h) * 320, 320);
camera.update();
cameraController = new OrthoCamController(camera);
Gdx.input.setInputProcessor(cameraController);
fon... | public void create() {
float w = Gdx.graphics.getWidth();
float h = Gdx.graphics.getHeight();
camera = new OrthographicCamera();
camera.setToOrtho(false, (w / h) * 320, 320);
camera.update();
cameraController = new OrthoCamController(camera);
Gdx.input.setInputProcessor(cameraController);
fon... |
public Vector2 getLocalAnchorB () {
return localAnchorB.set(joint.getLocalAnchorB().x, joint.getLocalAnchorB().y);
}
| public Vector2 getLocalAnchorB () {
return localAnchorA.set(joint.getLocalAnchorB().x, joint.getLocalAnchorB().y);
}
|
private ExecutorHolder build(String name, String defaultType, @Nullable Settings settings, Settings defaultSettings) {
if (settings == null) {
settings = ImmutableSettings.Builder.EMPTY_SETTINGS;
}
String type = settings.get("type", defaultType);
ThreadFactory threadFacto... | private ExecutorHolder build(String name, String defaultType, @Nullable Settings settings, Settings defaultSettings) {
if (settings == null) {
settings = ImmutableSettings.Builder.EMPTY_SETTINGS;
}
String type = settings.get("type", defaultType);
ThreadFactory threadFacto... |
@Override public Query fieldQuery(String value, QueryParseContext context) {
return new AllTermQuery(termFactory.createTerm(value));
}
| @Override public Query fieldQuery(String value, QueryParseContext context) {
return new AllTermQuery(names().createIndexNameTerm(value));
}
|
public Term term(String value) {
return termFactory.createTerm(value);
}
| public Term term(String value) {
return names().createIndexNameTerm(value);
}
|
public Term term(String uid) {
return termFactory.createTerm(uid);
}
| public Term term(String uid) {
return names().createIndexNameTerm(uid);
}
|
@Override public Query fuzzyQuery(String value, double minSim, int prefixLength, int maxExpansions) {
return new FuzzyQuery(termFactory.createTerm(value), (float) minSim, prefixLength, maxExpansions);
}
| @Override public Query fuzzyQuery(String value, double minSim, int prefixLength, int maxExpansions) {
return new FuzzyQuery(names().createIndexNameTerm(value), (float) minSim, prefixLength, maxExpansions);
}
|
public UidFilter(Collection<String> types, List<String> ids, BloomCache bloomCache) {
this.bloomCache = bloomCache;
this.uids = new ArrayList<Term>(types.size() * ids.size());
for (String type : types) {
for (String id : ids) {
uids.add(new Term(UidFieldMapper.NAM... | public UidFilter(Collection<String> types, List<String> ids, BloomCache bloomCache) {
this.bloomCache = bloomCache;
this.uids = new ArrayList<Term>(types.size() * ids.size());
for (String type : types) {
for (String id : ids) {
uids.add(UidFieldMapper.TERM_FACTORY... |
public static Map<String, Object> filter(Map<String, Object> map, String[] includes, String[] excludes) {
Map<String, Object> result = Maps.newHashMap();
filter(map, result, includes, excludes, new StringBuilder());
return result;
}
| public static Map<String, Object> filter(Map<String, Object> map, String[] includes, String[] excludes) {
Map<String, Object> result = Maps.newHashMap();
filter(map, result, includes == null ? Strings.EMPTY_ARRAY : includes, excludes == null ? Strings.EMPTY_ARRAY : excludes, new StringBuilder());
... |
public static void main (String[] args) throws Exception {
new NativeCodeGenerator().generate();
String[] excludes = { };
String[] headers = { "libjpeg/", "giflib/", "../../../gdx/jni/gdx2d/" };
BuildTarget win32home = BuildTarget.newDefaultTarget(TargetOs.Windows, false);
win32home.compilerPrefix = ""... | public static void main (String[] args) throws Exception {
new NativeCodeGenerator().generate();
String[] excludes = { };
String[] headers = { "libjpeg/", "giflib/", "../../../gdx/jni/gdx2d/" };
BuildTarget win32home = BuildTarget.newDefaultTarget(TargetOs.Windows, false);
win32home.compilerPrefix = ""... |
public void onRemoval(RemovalNotification<Key, AtomicFieldData> notification) {
if (notification.getKey() != null) {
IndexFieldCache indexCache = notification.getKey().indexCache;
notification.getKey().listener.onUnload(indexCache.fieldNames, indexCache.fieldDataType, notification.wa... | public void onRemoval(RemovalNotification<Key, AtomicFieldData> notification) {
if (notification.getKey() != null && notification.getKey().listener != null) {
IndexFieldCache indexCache = notification.getKey().indexCache;
notification.getKey().listener.onUnload(indexCache.fieldNames,... |
protected ClusterStateResponse masterOperation(ClusterStateRequest request, ClusterState state) throws ElasticSearchException {
ClusterState currentState = clusterService.state();
ClusterState.Builder builder = newClusterStateBuilder();
if (!request.filterNodes()) {
builder.nodes... | protected ClusterStateResponse masterOperation(ClusterStateRequest request, ClusterState state) throws ElasticSearchException {
ClusterState currentState = clusterService.state();
ClusterState.Builder builder = newClusterStateBuilder();
if (!request.filterNodes()) {
builder.nodes... |
void onFailure(String message);
/*
* Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Versio... | void onFailure(String message);
/*
* Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Versio... |
public void simpleMinimumMasterNodes() throws Exception {
logger.info("--> cleaning nodes");
buildNode("node1", settingsBuilder().put("gateway.type", "local"));
buildNode("node2", settingsBuilder().put("gateway.type", "local"));
cleanAndCloseNodes();
Settings settings = set... | public void simpleMinimumMasterNodes() throws Exception {
logger.info("--> cleaning nodes");
buildNode("node1", settingsBuilder().put("gateway.type", "local"));
buildNode("node2", settingsBuilder().put("gateway.type", "local"));
cleanAndCloseNodes();
Settings settings = set... |
@Override public void renameFile(String from, String to) throws IOException {
doRenameFile(from, to);
synchronized (mutex) {
StoreFileMetaData fromMetaData = filesMetadata.get(from); // we should always find this one
StoreFileMetaData toMetaData = new StoreFileMetaData(fromMe... | @Override public void renameFile(String from, String to) throws IOException {
doRenameFile(from, to);
synchronized (mutex) {
StoreFileMetaData fromMetaData = filesMetadata.get(from); // we should always find this one
StoreFileMetaData toMetaData = new StoreFileMetaData(to, fr... |
static private Pattern minimalPattern = Pattern.compile("[a-zA-Z0-9_$][^:}\\], ]*");
| static private Pattern minimalPattern = Pattern.compile("[a-zA-Z_$][^:}\\], ]*");
|
public WrapperQueryBuilder(String source) {
this.source = source.getBytes(Charsets.UTF_8);
this.offset = 0;
this.length = source.length();
}
| public WrapperQueryBuilder(String source) {
this.source = source.getBytes(Charsets.UTF_8);
this.offset = 0;
this.length = this.source.length;
}
|
public RecoveryResponse newInstance() {
return new RecoveryResponse();
}
}).txGet();
if (shard.state() == IndexShardState.CLOSED) {
removeAndCleanOnGoingRecovery(recoveryStatus);
listener.onIgnoreRecovery(false, ... | public RecoveryResponse newInstance() {
return new RecoveryResponse();
}
}).txGet();
if (shard.state() == IndexShardState.CLOSED) {
removeAndCleanOnGoingRecovery(recoveryStatus);
listener.onIgnoreRecovery(false, ... |
public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException {
XContentParser parser = parseContext.parser();
Query query = null;
boolean queryFound = false;
float boost = 1.0f;
String childType = null;
ScoreType scoreType = ScoreType.... | public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException {
XContentParser parser = parseContext.parser();
Query query = null;
boolean queryFound = false;
float boost = 1.0f;
String childType = null;
ScoreType scoreType = ScoreType.... |
public void awaitTermination() throws InterruptedException {
latch.wait();
}
};
}
}
| public void awaitTermination() throws InterruptedException {
latch.await();
}
};
}
}
|
public static void main (String[] argv) {
new JoglApplication(new com.badlogic.gdx.tests.Gdx2DTest(), "Debug Test", 480, 320, false);
}
| public static void main (String[] argv) {
new JoglApplication(new com.badlogic.gdx.tests.ShaderMultitextureTest(), "Debug Test", 480, 320, true);
}
|
@Override public boolean touchUp(int x, int y, int pointer) {
last.set(-1, -1);
return false;
}
} | @Override public boolean touchUp(int x, int y, int pointer, int button) {
last.set(-1, -1);
return false;
}
} |
public void draw (Batch batch, float parentAlpha) {
validate();
Color color = tempColor.set(getColor());
color.a *= parentAlpha;
if (style.background != null) {
batch.setColor(color.r, color.g, color.b, color.a);
style.background.draw(batch, getX(), getY(), getWidth(), getHeight());
}
if (style.fontC... | public void draw (Batch batch, float parentAlpha) {
validate();
Color color = tempColor.set(getColor());
color.a *= parentAlpha;
if (style.background != null) {
batch.setColor(color.r, color.g, color.b, color.a);
style.background.draw(batch, getX(), getY(), getWidth(), getHeight());
}
if (style.fontC... |
protected void drawBackground (Batch batch, float parentAlpha, float x, float y) {
float width = getWidth(), height = getHeight();
float padTop = getPadTop();
super.drawBackground(batch, parentAlpha, x, y);
// Draw button table.
buttonTable.getColor().a = getColor().a;
buttonTable.pack();
buttonTable.s... | protected void drawBackground (Batch batch, float parentAlpha, float x, float y) {
float width = getWidth(), height = getHeight();
float padTop = getPadTop();
super.drawBackground(batch, parentAlpha, x, y);
// Draw button table.
buttonTable.getColor().a = getColor().a;
buttonTable.pack();
buttonTable.s... |
public IndicesFilterCache(Settings settings, ThreadPool threadPool, CacheRecycler cacheRecycler, NodeSettingsService nodeSettingsService) {
super(settings);
this.threadPool = threadPool;
this.cacheRecycler = cacheRecycler;
this.size = componentSettings.get("size", "20%");
thi... | public IndicesFilterCache(Settings settings, ThreadPool threadPool, CacheRecycler cacheRecycler, NodeSettingsService nodeSettingsService) {
super(settings);
this.threadPool = threadPool;
this.cacheRecycler = cacheRecycler;
this.size = componentSettings.get("size", "10%");
thi... |
public Class<? extends DirectoryService> shardDirectory() {
return MockRamDirecorySerivce.class;
}
| public Class<? extends DirectoryService> shardDirectory() {
return MockRamDirectoryService.class;
}
|
public void testHasChildQueryWithNestedInnerObjects() throws Exception {
client().admin().indices().prepareCreate("test")
.setSettings(
ImmutableSettings.settingsBuilder()
.put("index.number_of_shards", 1)
... | public void testHasChildQueryWithNestedInnerObjects() throws Exception {
client().admin().indices().prepareCreate("test")
.setSettings(
ImmutableSettings.settingsBuilder()
.put("index.number_of_shards", 1)
... |
private final StoreRateLimiting.Listener rateListener;
XFSIndexOutput(FSDirectory parent, String name, RateLimiter rateLimiter, StoreRateLimiting.Listener rateListener) throws IOException {
super(parent, name);
this.rateLimiter = rateLimiter;
this.rateListener = rateListener;
}
| private final StoreRateLimiting.Listener rateListener;
XFSIndexOutput(FSDirectory parent, String name, RateLimiter rateLimiter, StoreRateLimiting.Listener rateListener) throws IOException {
super(parent, name, null /* we have our own rate limiter */);
this.rateLimiter = rateLimiter;
thi... |
public Object clone() {
ByteBufferIndexInput cloned = (ByteBufferIndexInput) super.clone();
cloned.file.incRef(); // inc ref on cloned one
if (currentBuffer != EMPTY_BUFFER) {
cloned.currentBuffer = currentBuffer.asReadOnlyBuffer();
cloned.currentBuffer.position(curre... | public IndexInput clone() {
ByteBufferIndexInput cloned = (ByteBufferIndexInput) super.clone();
cloned.file.incRef(); // inc ref on cloned one
if (currentBuffer != EMPTY_BUFFER) {
cloned.currentBuffer = currentBuffer.asReadOnlyBuffer();
cloned.currentBuffer.position(c... |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(layout.gist_view, null);
headerView = inflater.inflate(layout.gist_header, null);
headerHolder = new GistHeaderViewHolder(headerView, avatarHelper);
load... | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(layout.gist_view, null);
headerView = inflater.inflate(layout.gist_header, null);
headerHolder = new GistHeaderViewHolder(headerView);
loadingView = infl... |
public static String[] splitStringToArray(final CharSequence s, final char c) {
if (s.length() == 0) {
return Strings.EMPTY_ARRAY;
}
int count = 1;
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == c) {
count++;
}
}
... | public static String[] splitStringToArray(final CharSequence s, final char c) {
if (s == null || s.length() == 0) {
return Strings.EMPTY_ARRAY;
}
int count = 1;
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == c) {
count++;
... |
private void applyNewOrUpdatedShards(final ClusterChangedEvent event) throws ElasticSearchException {
if (!indicesService.changesAllowed())
return;
RoutingTable routingTable = event.state().routingTable();
RoutingNode routingNodes = event.state().readOnlyRoutingNodes().nodesToSh... | private void applyNewOrUpdatedShards(final ClusterChangedEvent event) throws ElasticSearchException {
if (!indicesService.changesAllowed())
return;
RoutingTable routingTable = event.state().routingTable();
RoutingNode routingNodes = event.state().readOnlyRoutingNodes().nodesToSh... |
public static <T extends Custom> Custom.Factory<T> lookupFactorySafe(String type) throws ElasticSearchIllegalArgumentException {
Custom.Factory<T> factory = customFactories.get(type);
if (factory == null) {
throw new ElasticSearchIllegalArgumentException("No custom index metadata factoy ... | public static <T extends Custom> Custom.Factory<T> lookupFactorySafe(String type) throws ElasticSearchIllegalArgumentException {
Custom.Factory<T> factory = customFactories.get(type);
if (factory == null) {
throw new ElasticSearchIllegalArgumentException("No custom index metadata factory... |
private void processKeys () {
float x0 = (Gdx.input.getX(0) / (float)Gdx.graphics.getWidth()) * 480;
float x1 = (Gdx.input.getX(1) / (float)Gdx.graphics.getWidth()) * 480;
float y0 = 320 - (Gdx.input.getY(0) / (float)Gdx.graphics.getHeight()) * 320;
float y1 = 320 - (Gdx.input.getY(1) / (float)Gdx.graphics.get... | private void processKeys () {
float x0 = (Gdx.input.getX(0) / (float)Gdx.graphics.getWidth()) * 480;
float x1 = (Gdx.input.getX(1) / (float)Gdx.graphics.getWidth()) * 480;
float y0 = 320 - (Gdx.input.getY(0) / (float)Gdx.graphics.getHeight()) * 320;
float y1 = 320 - (Gdx.input.getY(1) / (float)Gdx.graphics.get... |
public static void main (String[] argv) {
new JoglApplication(new com.badlogic.gdx.tests.UITest(), "Debug Test", 480, 320, false);
}
| public static void main (String[] argv) {
new JoglApplication(new com.badlogic.gdx.tests.MeshMultitextureTest(), "Debug Test", 480, 320, false);
}
|
public GlobalOrdinalsSignificantTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Bytes.WithOrdinals.FieldData valuesSource,
long estimatedBucketCount, long maxOrd, BucketCountThresholds bucketCountThresholds,
... | public GlobalOrdinalsSignificantTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Bytes.WithOrdinals.FieldData valuesSource,
long estimatedBucketCount, long maxOrd, BucketCountThresholds bucketCountThresholds,
... |
public SignificantLongTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Numeric valuesSource, @Nullable ValueFormat format,
long estimatedBucketCount, BucketCountThresholds bucketCountThresholds,
AggregationContext aggregationContext, Aggregator parent, Significant... | public SignificantLongTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Numeric valuesSource, @Nullable ValueFormat format,
long estimatedBucketCount, BucketCountThresholds bucketCountThresholds,
AggregationContext aggregationContext, Aggregator parent, Significant... |
public SignificantStringTermsAggregator(String name, AggregatorFactories factories, ValuesSource valuesSource,
long estimatedBucketCount, BucketCountThresholds bucketCountThresholds,
IncludeExclude includeExclude, AggregationContext aggregationContext, Aggregator parent,
Signific... | public SignificantStringTermsAggregator(String name, AggregatorFactories factories, ValuesSource valuesSource,
long estimatedBucketCount, BucketCountThresholds bucketCountThresholds,
IncludeExclude includeExclude, AggregationContext aggregationContext, Aggregator parent,
Signific... |
public void recover(boolean indexShouldExists, RecoveryStatus recoveryStatus) throws IndexShardGatewayRecoveryException {
recoveryStatus.index().startTime(System.currentTimeMillis());
recoveryStatus.updateStage(RecoveryStatus.Stage.INDEX);
long version = -1;
long translogId = -1;
... | public void recover(boolean indexShouldExists, RecoveryStatus recoveryStatus) throws IndexShardGatewayRecoveryException {
recoveryStatus.index().startTime(System.currentTimeMillis());
recoveryStatus.updateStage(RecoveryStatus.Stage.INDEX);
long version = -1;
long translogId = -1;
... |
public int docFreq(Term term) {
int df = dfs.dfMap().get(term);
if (df == -1) {
throw new IllegalArgumentException("df for term " + term.text() + " not available");
}
return df;
}
| public int docFreq(Term term) {
int df = dfs.dfMap().get(term);
if (df == -1) {
throw new IllegalArgumentException("df for term " + term + " not available");
}
return df;
}
|
private final static ImmutableMap<Tuple<String, String>, IndexFieldData.Builder> buildersByTypeAndFormat;
static {
buildersByType = MapBuilder.<String, IndexFieldData.Builder>newMapBuilder()
.put("string", new ConcreteBytesRefIndexFieldData.Builder())
.put("float", new F... | private final static ImmutableMap<Tuple<String, String>, IndexFieldData.Builder> buildersByTypeAndFormat;
static {
buildersByType = MapBuilder.<String, IndexFieldData.Builder>newMapBuilder()
.put("string", new PagedBytesIndexFieldData.Builder())
.put("float", new FloatAr... |
static public void load () {
if (nativesLoaded) return;
String vm = System.getProperty("java.vm.name");
if (vm == null || !vm.contains("Dalvik")) {
if (isWindows) {
nativesLoaded = loadLibrary("gdx.dll", "gdx64.dll");
} else if (isMac) {
nativesLoaded = loadLibrary("libgdx.dylib", "libgdx.dylib");... | static public void load () {
if (nativesLoaded) return;
String vm = System.getProperty("java.vm.name");
if (vm == null || !vm.contains("Dalvik")) {
if (isWindows) {
nativesLoaded = loadLibrary("gdx.dll", "gdx-64.dll");
} else if (isMac) {
nativesLoaded = loadLibrary("libgdx.dylib", "libgdx.dylib")... |
@Override public void run() {
recoveryStatus = new RecoveryStatus();
recoveryStatus.updateStage(RecoveryStatus.Stage.INIT);
try {
logger.debug("starting recovery from {} ...", shardGateway);
shardGateway.recover(recover... | @Override public void run() {
recoveryStatus = new RecoveryStatus();
recoveryStatus.updateStage(RecoveryStatus.Stage.INIT);
try {
logger.debug("starting recovery from {} ...", shardGateway);
shardGateway.recover(recover... |
public void reset () {
emissionDelta = 0;
durationTimer = 0;
start();
}
| public void reset () {
emissionDelta = 0;
durationTimer = duration;
start();
}
|
public void onClick(View v) {
Folder clicked = folder;
for (int i = index; i < segments.length - 1; i++) {
clicked = clicked.parent;
if (clicked == null)
return;
... | public void onClick(View v) {
Folder clicked = folder;
for (int i = index; i < segments.length - 1; i++) {
clicked = clicked.parent;
if (clicked == null)
return;
... |
public boolean keyTyped (InputEvent event, char character) {
if (disabled) return false;
final BitmapFont font = style.font;
Stage stage = getStage();
if (stage != null && stage.getKeyboardFocus() == TextField.this) {
if (character == BACKSPACE && (cursor > 0 || hasSelection)) {
if (!has... | public boolean keyTyped (InputEvent event, char character) {
if (disabled) return false;
final BitmapFont font = style.font;
Stage stage = getStage();
if (stage != null && stage.getKeyboardFocus() == TextField.this) {
if (character == BACKSPACE && (cursor > 0 || hasSelection)) {
if (!has... |
public static CharArraySet parseStopWords(Environment env, Settings settings, CharArraySet defaultStopWords, Version version, boolean ignore_case) {
String value = settings.get("stopwords");
if (value != null) {
if ("_none_".equals(value)) {
return CharArraySet.EMPTY_SET;... | public static CharArraySet parseStopWords(Environment env, Settings settings, CharArraySet defaultStopWords, Version version, boolean ignore_case) {
String value = settings.get("stopwords");
if (value != null) {
if ("_none_".equals(value)) {
return CharArraySet.EMPTY_SET;... |
protected String getId(Event resource) {
return resource.getId();
}
} | protected Object getId(Event resource) {
return resource.getId();
}
} |
protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, Params params) throws IOException {
builder.field("type", contentType());
if (includeDefaults || !names.name().equals(names.indexNameClean())) {
builder.field("index_name", names.indexNameClean());
}... | protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, Params params) throws IOException {
builder.field("type", contentType());
if (includeDefaults || !names.name().equals(names.indexNameClean())) {
builder.field("index_name", names.indexNameClean());
}... |
@Override protected void doXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject(QueryStringQueryParser.NAME);
builder.field("query", queryString);
if (defaultField != null) {
builder.field("default_field", defaultField);
}
if (... | @Override protected void doXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject(QueryStringQueryParser.NAME);
builder.field("query", queryString);
if (defaultField != null) {
builder.field("default_field", defaultField);
}
if (... |
public BackgroundIndexer(String index, String type, Client client) {
this(index, type, client, RandomizedTest.scaledRandomIntBetween(3, 10));
}
| public BackgroundIndexer(String index, String type, Client client) {
this(index, type, client, RandomizedTest.scaledRandomIntBetween(2, 5));
}
|
public void execute(SearchContext context) {
FieldSelector fieldSelector = buildFieldSelectors(context);
InternalSearchHit[] hits = new InternalSearchHit[context.docIdsToLoadSize()];
for (int index = 0; index < context.docIdsToLoadSize(); index++) {
int docId = context.docIdsToL... | public void execute(SearchContext context) {
FieldSelector fieldSelector = buildFieldSelectors(context);
InternalSearchHit[] hits = new InternalSearchHit[context.docIdsToLoadSize()];
for (int index = 0; index < context.docIdsToLoadSize(); index++) {
int docId = context.docIdsToL... |
@Override public void recover(RecoveryStatus recoveryStatus) throws IndexShardGatewayRecoveryException {
recoveryStatus().index().startTime(System.currentTimeMillis());
// in the none case, we simply start the shard
// clean the store, there should be nothing there...
try {
... | @Override public void recover(RecoveryStatus recoveryStatus) throws IndexShardGatewayRecoveryException {
recoveryStatus().index().startTime(System.currentTimeMillis());
// in the none case, we simply start the shard
// clean the store, there should be nothing there...
try {
... |
public void render() {
super.render();
fps.log();
}
| public void render() {
super.render();
// fps.log();
}
|
public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException {
XContentParser parser = parseContext.parser();
XContentParser.Token token = parser.nextToken();
if (token != XContentParser.Token.FIELD_NAME) {
throw new QueryParsingException(parseCon... | public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException {
XContentParser parser = parseContext.parser();
XContentParser.Token token = parser.nextToken();
if (token != XContentParser.Token.FIELD_NAME) {
throw new QueryParsingException(parseCon... |
private Query newTermQuery(@Nullable FieldMapper mapper, Term term) {
if (fuzziness != null) {
if (mapper != null) {
Query query = mapper.fuzzyQuery(term.text(), fuzziness, fuzzyPrefixLength, maxExpansions);
if (query instanceof FuzzyQuery) {
Q... | private Query newTermQuery(@Nullable FieldMapper mapper, Term term) {
if (fuzziness != null) {
if (mapper != null) {
Query query = mapper.fuzzyQuery(term.text(), fuzziness, fuzzyPrefixLength, maxExpansions, transpositions);
if (query instanceof FuzzyQuery) {
... |
@Override public Query fieldQuery(String value, QueryParseContext context) {
return new AllTermQuery(new Term(names.indexName(), value));
}
| @Override public Query fieldQuery(String value, QueryParseContext context) {
return new AllTermQuery(termFactory.createTerm(value));
}
|
@Override public Term term(String value) {
return new Term(names.indexName(), value);
}
| @Override public Term term(String value) {
return termFactory.createTerm(value);
}
|
@Override public Term term(String uid) {
return new Term(names.indexName(), uid);
}
| @Override public Term term(String uid) {
return termFactory.createTerm(uid);
}
|
public void create () {
// load the koala frames, split them, and assign them to Animations
koalaTexture = new Texture("data/maps/tiled/super-koalio/koalio.png");
TextureRegion[] regions = TextureRegion.split(koalaTexture, 18, 26)[0];
stand = new Animation(0, regions[0]);
jump = new Animation(0, regions[1]);... | public void create () {
// load the koala frames, split them, and assign them to Animations
koalaTexture = new Texture("data/maps/tiled/super-koalio/koalio.png");
TextureRegion[] regions = TextureRegion.split(koalaTexture, 18, 26)[0];
stand = new Animation(0, regions[0]);
jump = new Animation(0, regions[1]);... |
public static void main( String[] argv )
{
JoglApplication app = new JoglApplication( "Float Test", 480, 320, false);
app.getGraphics().setRenderListener( new com.badlogic.gdx.tests.BitmapFontTest() );
}
| public static void main( String[] argv )
{
JoglApplication app = new JoglApplication( "BitmapFont Test", 480, 320, false);
app.getGraphics().setRenderListener( new com.badlogic.gdx.tests.BitmapFontTest() );
}
|
protected ShardSegments shardOperation(IndexShardSegmentRequest request) throws ElasticsearchException {
InternalIndexService indexService = (InternalIndexService) indicesService.indexServiceSafe(request.shardId().getIndex());
InternalIndexShard indexShard = (InternalIndexShard) indexService.shardSa... | protected ShardSegments shardOperation(IndexShardSegmentRequest request) throws ElasticsearchException {
InternalIndexService indexService = (InternalIndexService) indicesService.indexServiceSafe(request.shardId().getIndex());
InternalIndexShard indexShard = (InternalIndexShard) indexService.shardSa... |
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(layout.pager_with_title);
gist = store.getGist(gistId);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitl... | protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(layout.pager_with_title);
gist = store.getGist(gistId);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitl... |
public FixHtmlHelpDialog(JFrame parent) {
super(parent, true);
initComponents();
Style.registerCssClasses(rootPanel, ".rootPanel");
Style.registerCssClasses(num1, ".helpNumber");
Style.registerCssClasses(num2, ".helpNumber");
Style.registerCssClasses(num3, ".helpNumber");
Style.apply(getC... | public FixHtmlHelpDialog(JFrame parent) {
super(parent, true);
initComponents();
Style.registerCssClasses(rootPanel, ".rootPanel");
Style.registerCssClasses(num1, ".helpNumber");
Style.registerCssClasses(num2, ".helpNumber");
Style.registerCssClasses(num3, ".helpNumber");
Style.apply(getC... |
public ImportHelpDialog(JFrame parent) {
super(parent, true);
initComponents();
Style.registerCssClasses(rootPanel, ".rootPanel");
Style.registerCssClasses(num1, ".helpNumber");
Style.registerCssClasses(num2, ".helpNumber");
Style.registerCssClasses(num3, ".helpNumber");
Style.registerCss... | public ImportHelpDialog(JFrame parent) {
super(parent, true);
initComponents();
Style.registerCssClasses(rootPanel, ".rootPanel");
Style.registerCssClasses(num1, ".helpNumber");
Style.registerCssClasses(num2, ".helpNumber");
Style.registerCssClasses(num3, ".helpNumber");
Style.registerCss... |
@Override public ParsedDocument parse(SourceToParse source, @Nullable ParseListener listener) throws MapperParsingException {
ParseContext context = cache.get().get();
if (source.type() != null && !source.type().equals(this.type)) {
throw new MapperParsingException("Type mismatch, provi... | @Override public ParsedDocument parse(SourceToParse source, @Nullable ParseListener listener) throws MapperParsingException {
ParseContext context = cache.get().get();
if (source.type() != null && !source.type().equals(this.type)) {
throw new MapperParsingException("Type mismatch, provi... |
private static ImmutableMap<String, String> replacements = new MapBuilder<String, String>()
.put("console", "org.elasticsearch.common.logging.log4j.ConsoleAppender")
.put("async", "org.apache.log4j.AsyncAppender")
.put("dailyRollingFile", "org.apache.log4j.DailyRollingFileAppende... | private static ImmutableMap<String, String> replacements = new MapBuilder<String, String>()
.put("console", "org.elasticsearch.common.logging.log4j.ConsoleAppender")
.put("async", "org.apache.log4j.AsyncAppender")
.put("dailyRollingFile", "org.apache.log4j.DailyRollingFileAppende... |
public Map<SearchShardTarget, ExtTIntArrayList> docIdsToLoad(ShardDoc[] shardDocs) {
Map<SearchShardTarget, ExtTIntArrayList> result = Maps.newHashMap();
for (ShardDoc shardDoc : shardDocs) {
ExtTIntArrayList list = result.get(shardDoc.shardTarget());
if (list == null) {
... | public Map<SearchShardTarget, ExtTIntArrayList> docIdsToLoad(ShardDoc[] shardDocs) {
Map<SearchShardTarget, ExtTIntArrayList> result = Maps.newHashMap();
for (ShardDoc shardDoc : shardDocs) {
ExtTIntArrayList list = result.get(shardDoc.shardTarget());
if (list == null) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.