buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
public void execute(RoutingAllocation allocation) throws ElasticSearchException { DiscoveryNode discoNode = allocation.nodes().resolveNode(node); MutableShardRouting shardRouting = null; for (MutableShardRouting routing : allocation.routingNodes().unassigned()) { if (routing.sha...
public void execute(RoutingAllocation allocation) throws ElasticSearchException { DiscoveryNode discoNode = allocation.nodes().resolveNode(node); MutableShardRouting shardRouting = null; for (MutableShardRouting routing : allocation.routingNodes().unassigned()) { if (routing.sha...
public void testRandomDecisions() { RandomAllocationDecider randomAllocationDecider = new RandomAllocationDecider(getRandom()); AllocationService strategy = new AllocationService(settingsBuilder().build(), new AllocationDeciders(ImmutableSettings.EMPTY, new HashSet<AllocationDecider>...
public void testRandomDecisions() { RandomAllocationDecider randomAllocationDecider = new RandomAllocationDecider(getRandom()); AllocationService strategy = new AllocationService(settingsBuilder().build(), new AllocationDeciders(ImmutableSettings.EMPTY, new HashSet<AllocationDecider>...
public void testRebalanceOnlyAfterAllShardsAreActive() { AllocationService strategy = new AllocationService(settingsBuilder() .put("cluster.routing.allocation.concurrent_recoveries", 10) .put("cluster.routing.allocation.allow_rebalance", "always") .put("cluste...
public void testRebalanceOnlyAfterAllShardsAreActive() { AllocationService strategy = new AllocationService(settingsBuilder() .put("cluster.routing.allocation.concurrent_recoveries", 10) .put("cluster.routing.allocation.allow_rebalance", "always") .put("cluste...
public InternalTopHits(String name, InternalSearchHits searchHits) { this.name = name; this.searchHits = searchHits; this.topDocs = new TopDocs(0, Lucene.EMPTY_SCORE_DOCS, 0); }
public InternalTopHits(String name, InternalSearchHits searchHits) { this.name = name; this.searchHits = searchHits; this.topDocs = Lucene.EMPTY_TOP_DOCS; }
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(name).field(type); sourceBuilder.toXContent(builder, params); return builder.endObject(); }
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(name).field(type); sourceBuilder().toXContent(builder, params); return builder.endObject(); }
public static InternalSearchResponse empty() { return new InternalSearchResponse(new InternalSearchHits(new InternalSearchHit[0], 0, 0), null, null, null, false); }
public static InternalSearchResponse empty() { return new InternalSearchResponse(InternalSearchHits.empty(), null, null, null, false); }
public void click (Actor actor); }
public void click (Actor actor, float x, float y); }
public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException { Terms terms = context.reader().terms(term.field()); if (terms == null) { return null; } TermsEnum termsEnum = terms.iterator(null); if (!termsEnum.seekExact(term.bytes(...
public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException { Terms terms = context.reader().terms(term.field()); if (terms == null) { return null; } TermsEnum termsEnum = terms.iterator(null); if (!termsEnum.seekExact(term.bytes(...
protected void loadTileset (AtlasTiledMap map, Element element, FileHandle tmxFile, AtlasResolver resolver, AtlasTiledMapLoaderParameters parameter) { if (element.getName().equals("tileset")) { String name = element.get("name", null); int firstgid = element.getIntAttribute("firstgid", 1); int tilewidth = ...
protected void loadTileset (AtlasTiledMap map, Element element, FileHandle tmxFile, AtlasResolver resolver, AtlasTiledMapLoaderParameters parameter) { if (element.getName().equals("tileset")) { String name = element.get("name", null); int firstgid = element.getIntAttribute("firstgid", 1); int tilewidth = ...
public Table addCell(Object value, String attributes) { if (!inHeaders) { if (currentCells.size() == headers.size()) { throw new ElasticSearchIllegalArgumentException("can't add more cells to a row than the header"); } } Map<String, String> mAttr; ...
public Table addCell(Object value, String attributes) { if (!inHeaders) { if (currentCells.size() == headers.size()) { throw new ElasticSearchIllegalArgumentException("can't add more cells to a row than the header"); } } Map<String, String> mAttr; ...
public void onFailure(Throwable t) { logger.debug("failed to delete template [{}]", t, request.name()); listener.onFailure(t); } }); }
public void onFailure(Throwable t) { logger.debug("failed to put template [{}]", t, request.name()); listener.onFailure(t); } }); }
public void destroyBody(Body body) { jniDestroyBody( body.addr, body.addr ); this.bodies.remove( body.addr ); for( int i = 0; i < body.getFixtureList().size(); i++ ) this.fixtures.remove(body.getFixtureList().get(i).addr); for( int i = 0; i < body.getJointList().size(); i++ ) this.joints.remove(body.get...
public void destroyBody(Body body) { jniDestroyBody( addr, body.addr ); this.bodies.remove( body.addr ); for( int i = 0; i < body.getFixtureList().size(); i++ ) this.fixtures.remove(body.getFixtureList().get(i).addr); for( int i = 0; i < body.getJointList().size(); i++ ) this.joints.remove(body.getJoint...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
package org.elasticsearch.common.collect; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache Lic...
package org.elasticsearch.common.collect; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache Lic...
package org.elasticsearch.common.collect; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache Lic...
package org.elasticsearch.common.collect; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache Lic...
package org.elasticsearch.common.io; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache License,...
package org.elasticsearch.common.io; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache License,...
package org.elasticsearch.common.io.compression; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apa...
package org.elasticsearch.common.io.compression; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apa...
package org.elasticsearch.common.io.stream; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache L...
package org.elasticsearch.common.io.stream; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache L...
package org.elasticsearch.common.lease; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache Licen...
package org.elasticsearch.common.lease; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache Licen...
import org.elasticsearch.common.util.concurrent.ThreadSafe; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you un...
import org.elasticsearch.common.util.concurrent.ThreadSafe; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you un...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
package org.elasticsearch.common.util.concurrent; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Ap...
package org.elasticsearch.common.util.concurrent; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Ap...
package org.elasticsearch.common.util.concurrent; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Ap...
package org.elasticsearch.common.util.concurrent; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Ap...
* http://creativecommons.org/licenses/publicdomain */ package org.elasticsearch.util.concurrent.highscalelib;
* http://creativecommons.org/licenses/publicdomain */ package org.elasticsearch.common.util.concurrent.highscalelib;
* http://creativecommons.org/licenses/publicdomain */ /* WARNING: MACHINE GENERATED FILE! DO NOT EDIT!*/ package org.elasticsearch.util.concurrent.highscalelib;
* http://creativecommons.org/licenses/publicdomain */ /* WARNING: MACHINE GENERATED FILE! DO NOT EDIT!*/ package org.elasticsearch.common.util.concurrent.highscalelib;
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
import org.elasticsearch.common.io.stream.Streamable; /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under th...
public HeaderFileProcessor () { header = new FileHandle("data/licence-header.txt").readString(); addInputSuffix(".java"); setFlattenOutput(false); setRecursive(true); }
public HeaderFileProcessor () { header = new FileHandle("assets/licence-header.txt").readString(); addInputSuffix(".java"); setFlattenOutput(false); setRecursive(true); }
public static void main (String[] argv) { LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); config.useGL20 = false; config.vSyncEnabled = true; new LwjglApplication(new ShapeRendererTest(), config); }
public static void main (String[] argv) { LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); config.useGL20 = true; config.vSyncEnabled = true; new LwjglApplication(new ShapeRendererTest(), config); }
public String readUTF() throws IOException { int utflen = readUnsignedShort(); if (utflen == 0) { return ""; } if (chararr.length < utflen) { chararr = new char[utflen * 2]; } char[] chararr = this.chararr; byte[] bytearr = buf; ...
public String readUTF() throws IOException { int utflen = readInt(); if (utflen == 0) { return ""; } if (chararr.length < utflen) { chararr = new char[utflen * 2]; } char[] chararr = this.chararr; byte[] bytearr = buf; int endPo...
public AllocationDeciders(Settings settings, NodeSettingsService nodeSettingsService) { this(settings, ImmutableSet.<AllocationDecider>builder() .add(new SameShardAllocationDecider(settings)) .add(new FilterAllocationDecider(settings, nodeSettingsService)) .ad...
public AllocationDeciders(Settings settings, NodeSettingsService nodeSettingsService) { this(settings, ImmutableSet.<AllocationDecider>builder() .add(new SameShardAllocationDecider(settings)) .add(new FilterAllocationDecider(settings, nodeSettingsService)) .ad...
public Shape fetch(String id, String type, String index, String shapeField) throws IOException { GetResponse response = client.get(new GetRequest(index, type, id).preference("_local")).actionGet(); if (!response.exists()) { throw new ElasticSearchIllegalArgumentException("Shape with ID [...
public Shape fetch(String id, String type, String index, String shapeField) throws IOException { GetResponse response = client.get(new GetRequest(index, type, id).preference("_local").operationThreaded(false)).actionGet(); if (!response.exists()) { throw new ElasticSearchIllegalArgumentE...
public synchronized boolean update () { try { if (tasks.size() == 0) { // first check if there's nothing left to load if (preloadQueue.size == 0) return true; nextTask(); // second check if we tried to load an asset that's already loaded and the queue became empty. if (preloadQueue.size == 0) ...
public synchronized boolean update () { try { if (tasks.size() == 0) { // first check if there's nothing left to load if (preloadQueue.size == 0) return true; nextTask(); // second check if we tried to load an asset that's already loaded and the queue became empty. if (preloadQueue.size == 0 |...
@Override protected ShardStatus shardOperation(IndexShardStatusRequest request) throws ElasticSearchException { InternalIndexService indexService = (InternalIndexService) indicesService.indexServiceSafe(request.index()); InternalIndexShard indexShard = (InternalIndexShard) indexService.shard(request...
@Override protected ShardStatus shardOperation(IndexShardStatusRequest request) throws ElasticSearchException { InternalIndexService indexService = (InternalIndexService) indicesService.indexServiceSafe(request.index()); InternalIndexShard indexShard = (InternalIndexShard) indexService.shardSafe(req...
public <IFD extends IndexFieldData> IFD getForField(FieldMapper mapper) { return getForField(mapper.names(), mapper.fieldDataType2()); }
public <IFD extends IndexFieldData> IFD getForField(FieldMapper mapper) { return getForField(mapper.names(), mapper.fieldDataType()); }
public boolean changesAllowed(); IndicesStats stats();
public boolean changesAllowed(); NodeIndicesStats stats();
public interface ShardIterator extends ShardsIterator, Comparable<ShardIterator> { /* * Licensed to Elasticsearch 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...
public interface ShardIterator extends ShardsIterator, Comparable<ShardIterator> { /* * Licensed to Elasticsearch 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...
@Override public void sendResponse(Throwable error) throws IOException { ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); ChannelBufferOutputStream os = new ChannelBufferOutputStream(buffer); os.write(LENGTH_PLACEHOLDER); os.writeLong(requestId); byte status = 0; ...
@Override public void sendResponse(Throwable error) throws IOException { ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(512, channel.getConfig().getBufferFactory()); ChannelBufferOutputStream os = new ChannelBufferOutputStream(buffer); os.write(LENGTH_PLACEHOLDER); os.writeLong...
public Query getFieldQuery(String field, String queryText, boolean quoted) throws ParseException { FieldQueryExtension fieldQueryExtension = fieldQueryExtensions.get(field); if (fieldQueryExtension != null) { return fieldQueryExtension.query(parseContext, queryText); } Co...
public Query getFieldQuery(String field, String queryText, boolean quoted) throws ParseException { FieldQueryExtension fieldQueryExtension = fieldQueryExtensions.get(field); if (fieldQueryExtension != null) { return fieldQueryExtension.query(parseContext, queryText); } Co...
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(name); builder.field("doc_count", subsetSize); builder.startArray(CommonFields.BUCKETS); for (InternalSignificantTerms.Bucket bucket : buckets) { //There is ...
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(name); builder.field("doc_count", subsetSize); builder.startArray(CommonFields.BUCKETS); for (InternalSignificantTerms.Bucket bucket : buckets) { //There is ...
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(name); builder.startArray(CommonFields.BUCKETS); for (InternalTerms.Bucket bucket : buckets) { builder.startObject(); builder.field(CommonFields.KEY, ((B...
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(name); builder.startArray(CommonFields.BUCKETS); for (InternalTerms.Bucket bucket : buckets) { builder.startObject(); builder.utf8Field(CommonFields.KEY,...
@Override public void writeByte(byte b) throws IOException { out.write(b); }
@Override public void writeByte(byte b) throws IOException { out.writeByte(b); }
public void render() { frameBuffer.begin(); Gdx.graphics.getGL20().glViewport( 0, 0, frameBuffer.getWidth(), frameBuffer.getHeight() ); Gdx.graphics.getGL20().glClearColor( 0f, 1f, 0f, 1 ); Gdx.graphics.getGL20().glClear( GL20.GL_COLOR_BUFFER_BIT ); Gdx.graphics.getGL20().glEnable( GL20.GL_TEXTURE_2D...
public void render() { frameBuffer.begin(); Gdx.graphics.getGL20().glViewport( 0, 0, frameBuffer.getWidth(), frameBuffer.getHeight() ); Gdx.graphics.getGL20().glClearColor( 0f, 1f, 0f, 1 ); Gdx.graphics.getGL20().glClear( GL20.GL_COLOR_BUFFER_BIT ); Gdx.graphics.getGL20().glEnable( GL20.GL_TEXTURE_2D...
public static Mesh create(boolean isStatic, final Mesh[] meshes, final Matrix4[] transformations) { if (transformations != null && transformations.length < meshes.length) throw new IllegalArgumentException("Not enough transformations specified"); final VertexAttributes attributes = meshes[0].getVertexAttributes...
public static Mesh create(boolean isStatic, final Mesh[] meshes, final Matrix4[] transformations) { if (transformations != null && transformations.length < meshes.length) throw new IllegalArgumentException("Not enough transformations specified"); final VertexAttributes attributes = meshes[0].getVertexAttributes...
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...
public SearchContextMissingException(long id) { super("No search context found for id [" + id + "], timed out"); this.id = id; }
public SearchContextMissingException(long id) { super("No search context found for id [" + id + "]"); this.id = id; }
public BulletEntity shoot(final String what, final float x, final float y, final float impulse) { // Shoot a box Ray ray = camera.getPickRay(x, y); BulletEntity entity = world.add(what, ray.origin.x, ray.origin.y, ray.origin.z); entity.color.set(0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.ran...
public BulletEntity shoot(final String what, final float x, final float y, final float impulse) { // Shoot a box Ray ray = camera.getPickRay(x, y); BulletEntity entity = world.add(what, ray.origin.x, ray.origin.y, ray.origin.z); entity.color.set(0.5f + 0.5f * (float)Math.random(), 0.5f + 0.5f * (float)Math.ran...
private void displayIssue(Issue issue) { ((TextView) findViewById(id.tv_issue_title)).setText(issue.getTitle()); String reported = "<b>" + issue.getUser().getLogin() + "</b> " + Time.relativeTimeFor(issue.getCreatedAt()); TextView creation = (TextView) findViewById(id.tv_issue_creation); ...
private void displayIssue(Issue issue) { ((TextView) findViewById(id.tv_issue_title)).setText(issue.getTitle()); String reported = "<b>" + issue.getUser().getLogin() + "</b> " + Time.relativeTimeFor(issue.getCreatedAt()); TextView creation = (TextView) findViewById(id.tv_issue_creation); ...
public AudioRecorder newAudioRecoder (int samplingRate, boolean isMono) { // BOZO - Write OpenAL recorder. return new JavaSoundAudioRecorder(samplingRate, isMono); } }
public AudioRecorder newAudioRecorder (int samplingRate, boolean isMono) { // BOZO - Write OpenAL recorder. return new JavaSoundAudioRecorder(samplingRate, isMono); } }
public PercolateShardResponse(BytesRef[] matches, List<Map<String, HighlightField>> hls, long count, float[] scores, PercolateContext context, String index, int shardId) { super(index, shardId); this.matches = matches; this.hls = hls; this.count = count; this.scores = scores;...
public PercolateShardResponse(BytesRef[] matches, List<Map<String, HighlightField>> hls, long count, float[] scores, PercolateContext context, String index, int shardId) { super(index, shardId); this.matches = matches; this.hls = hls; this.count = count; this.scores = scores;...
private void dismissProgress() { if (progress != null) progress.hide(); }
private void dismissProgress() { if (progress != null) progress.dismiss(); }
private void flush () { // opaque is sorted front to back // transparent is sorted back to front drawableManager.drawables.sort(); for (int i = drawableManager.drawables.size - 1; i >= 0; i--) { final Drawable drawable = drawableManager.drawables.get(i); final Vector3 center = drawable.sortCenter; ...
private void flush () { // opaque is sorted front to back // transparent is sorted back to front drawableManager.drawables.sort(); for (int i = drawableManager.drawables.size - 1; i >= 0; i--) { final Drawable drawable = drawableManager.drawables.get(i); final Vector3 center = drawable.sortCenter; ...
public SearchContextHighlight(Collection<Field> fields) { assert fields != null; this.fields = Maps.newHashMap(); for (Field field : fields) { this.fields.put(field.field, field); } }
public SearchContextHighlight(Collection<Field> fields) { assert fields != null; this.fields = new LinkedHashMap<String, Field>(fields.size()); for (Field field : fields) { this.fields.put(field.field, field); } }
public ThreadPool(Settings settings) { super(settings); Map<String, Settings> groupSettings = settings.getGroups("threadpool"); Map<String, ExecutorHolder> executors = Maps.newHashMap(); executors.put(Names.CACHED, build(Names.CACHED, "cached", groupSettings.get(Names.CACHED), sett...
public ThreadPool(Settings settings) { super(settings); Map<String, Settings> groupSettings = settings.getGroups("threadpool"); Map<String, ExecutorHolder> executors = Maps.newHashMap(); executors.put(Names.CACHED, build(Names.CACHED, "cached", groupSettings.get(Names.CACHED), sett...
public void draw (TextureRegion region, int x, int y) { int width = region.getRegionWidth(); if (width < 0) width = -width; spriteBatch.draw(region, x, y, width, -region.getRegionHeight()); }
public void draw (TextureRegion region, int x, int y) { int width = region.getRegionWidth(); if (width < 0) width = -width; spriteBatch.draw(region, x, y, width, region.getRegionHeight()); }
private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoResponse nodesInfo, NodesStatsResponse nodesStats) { boolean fullId = req.paramAsBoolean("full_id", false); DiscoveryNodes nodes = state.getState().nodes(); String masterId = nodes.masterNodeId(); Table t...
private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoResponse nodesInfo, NodesStatsResponse nodesStats) { boolean fullId = req.paramAsBoolean("full_id", false); DiscoveryNodes nodes = state.getState().nodes(); String masterId = nodes.masterNodeId(); Table t...
public void render( ) { // we update the game state so things move. updateGame(); // First we clear the screen GL10 gl = Gdx.graphics.getGL10(); gl.glViewport( 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight() ); gl.glClear( GL10.GL_COLOR_BUFFER_BIT ); // Next we update the camera and set t...
public void render( ) { // we update the game state so things move. updateGame(); // First we clear the screen GL10 gl = Gdx.graphics.getGL10(); gl.glViewport( 0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight() ); gl.glClear( GL10.GL_COLOR_BUFFER_BIT ); // Next we update the camera and set t...
public void render () { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); Gdx.gl.glEnable(GL10.GL_TEXTURE_2D); camera.update(); currTexture = hwMipMap.isChecked ? textureHW : textureSW; currTexture.bind(); currTexture.setFilter(TextureFilter.valueOf(minFilter.getSelection()), TextureFilter.valueOf(magFilter.getS...
public void render () { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); Gdx.gl.glEnable(GL10.GL_TEXTURE_2D); camera.update(); currTexture = hwMipMap.isChecked() ? textureHW : textureSW; currTexture.bind(); currTexture.setFilter(TextureFilter.valueOf(minFilter.getSelection()), TextureFilter.valueOf(magFilter.ge...
public static void main (String[] argv) { // if(argv.length != 1 && argv.length != 2) { // System.out.println("StillModelViewer <filename> ?<texture-filename>"); // System.exit(-1); // } // new JoglApplication(new StillModelViewer(argv[0], argv.length==2?argv[1]:null), "StillModel Viewer", 800, 480, false); // new Jog...
public static void main (String[] argv) { // if(argv.length != 1 && argv.length != 2) { // System.out.println("StillModelViewer <filename> ?<texture-filename>"); // System.exit(-1); // } // new JoglApplication(new StillModelViewer(argv[0], argv.length==2?argv[1]:null), "StillModel Viewer", 800, 480, false); // new Jog...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { byte value; float boost = context.fieldBoost(this); if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { byte value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { String dateAsString = null; Long value = null; float boost = context.fieldBoost(this); if (context.externalValueSet()) { Object externalValue = context.externalValue(); ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { String dateAsString = null; Long value = null; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (e...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { double value; float boost = context.fieldBoost(this); if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { double value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { i...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { float value; float boost = context.fieldBoost(this); if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { float value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { int value; float boost = context.fieldBoost(this); if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { int value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if (...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { long value; float boost = context.fieldBoost(this); if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { long value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { short value; float boost = context.fieldBoost(this); if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { short value; float boost = this.boost; if (context.externalValueSet()) { Object externalValue = context.externalValue(); if (externalValue == null) { if...
protected void parseCreateField(ParseContext context, List<Field> fields) throws IOException { ValueAndBoost valueAndBoost = parseCreateFieldForString(context, nullValue, context.fieldBoost(this)); if (valueAndBoost.value() == null) { return; } if (ignoreAbove > 0 && valu...
protected void parseCreateField(ParseContext context, List<Field> fields) throws IOException { ValueAndBoost valueAndBoost = parseCreateFieldForString(context, nullValue, boost); if (valueAndBoost.value() == null) { return; } if (ignoreAbove > 0 && valueAndBoost.value().l...
protected void parseCreateField(ParseContext context, List<Field> fields) throws IOException { ValueAndBoost valueAndBoost = StringFieldMapper.parseCreateFieldForString(context, null /* Out null value is an int so we convert*/, context.fieldBoost(this)); if (valueAndBoost.value() == null && nullValu...
protected void parseCreateField(ParseContext context, List<Field> fields) throws IOException { ValueAndBoost valueAndBoost = StringFieldMapper.parseCreateFieldForString(context, null /* Out null value is an int so we convert*/, boost); if (valueAndBoost.value() == null && nullValue() == null) { ...
public void parse(ParseContext context) throws IOException { try { ShapeBuilder shape = ShapeBuilder.parse(context.parser()); if (shape == null) { return; } Field[] fields = defaultStrategy.createIndexableFields(shape.build()); if (...
public void parse(ParseContext context) throws IOException { try { ShapeBuilder shape = ShapeBuilder.parse(context.parser()); if (shape == null) { return; } Field[] fields = defaultStrategy.createIndexableFields(shape.build()); if (...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { String ipAsString; if (context.externalValueSet()) { ipAsString = (String) context.externalValue(); if (ipAsString == null) { ipAsString = nullValue; ...
protected void innerParseCreateField(ParseContext context, List<Field> fields) throws IOException { String ipAsString; if (context.externalValueSet()) { ipAsString = (String) context.externalValue(); if (ipAsString == null) { ipAsString = nullValue; ...
public FieldComparator<?> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { assert fieldname.equals(indexFieldData.getFieldNames().indexName()); byte dMissingValue; if (missingValue == null || "_last".equals(missingValue)) { dMissin...
public FieldComparator<?> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { assert fieldname.equals(indexFieldData.getFieldNames().indexName()); byte dMissingValue; if (missingValue == null || "_last".equals(missingValue)) { dMissin...
public FieldComparator<?> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { assert fieldname.equals(indexFieldData.getFieldNames().indexName()); double dMissingValue; if (missingValue == null || "_last".equals(missingValue)) { dMiss...
public FieldComparator<?> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { assert fieldname.equals(indexFieldData.getFieldNames().indexName()); double dMissingValue; if (missingValue == null || "_last".equals(missingValue)) { dMiss...
public FieldComparator<?> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { assert fieldname.equals(indexFieldData.getFieldNames().indexName()); float dMissingValue; if (missingValue == null || "_last".equals(missingValue)) { dMissi...
public FieldComparator<?> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { assert fieldname.equals(indexFieldData.getFieldNames().indexName()); float dMissingValue; if (missingValue == null || "_last".equals(missingValue)) { dMissi...
public FieldComparator<?> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { assert fieldname.equals(indexFieldData.getFieldNames().indexName()); int dMissingValue; if (missingValue == null || "_last".equals(missingValue)) { dMissing...
public FieldComparator<?> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { assert fieldname.equals(indexFieldData.getFieldNames().indexName()); int dMissingValue; if (missingValue == null || "_last".equals(missingValue)) { dMissing...
public FieldComparator<?> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { assert fieldname.equals(indexFieldData.getFieldNames().indexName()); long dMissingValue; if (missingValue == null || "_last".equals(missingValue)) { dMissin...
public FieldComparator<?> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { assert fieldname.equals(indexFieldData.getFieldNames().indexName()); long dMissingValue; if (missingValue == null || "_last".equals(missingValue)) { dMissin...
public FieldComparator<?> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { assert fieldname.equals(indexFieldData.getFieldNames().indexName()); short dMissingValue; if (missingValue == null || "_last".equals(missingValue)) { dMissi...
public FieldComparator<?> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { assert fieldname.equals(indexFieldData.getFieldNames().indexName()); short dMissingValue; if (missingValue == null || "_last".equals(missingValue)) { dMissi...
public boolean isEmpty() { return size() != 0; }
public boolean isEmpty() { return size() == 0; }
public View getView(int position, View convertView, ViewGroup parent) { Comment comment = getItem(position); View commentRoot = activity.getLayoutInflater().inflate(layout.gist_view_comment_item, null); final TextView bodyView = (TextView) commentRoot.findViewById(id.tv_gist_comment_body); ...
public View getView(int position, View convertView, ViewGroup parent) { Comment comment = getItem(position); View commentRoot = activity.getLayoutInflater().inflate(layout.gist_view_comment_item, null); final TextView bodyView = (TextView) commentRoot.findViewById(id.tv_gist_comment_body); ...
@Test public void testTimestampAsDate() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type") .startObject("properties").startObject("date_field").field("type", "date").endObject().endObject() .endObject().endObject().string(); ...
@Test public void testTimestampAsDate() throws Exception { String mapping = XContentFactory.jsonBuilder().startObject().startObject("type") .startObject("properties").startObject("date_field").field("type", "date").endObject().endObject() .endObject().endObject().string(); ...
@Test public void testSimple() throws Exception { String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/dynamictemplate/genericstore/test-mapping.json"); DocumentMapper docMapper = MapperTests.newParser().parse(mapping); byte[] json = copyToBytesFromClasspath("/org/elas...
@Test public void testSimple() throws Exception { String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/dynamictemplate/genericstore/test-mapping.json"); DocumentMapper docMapper = MapperTests.newParser().parse(mapping); byte[] json = copyToBytesFromClasspath("/org/elas...
@Test public void testSimple() throws Exception { String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/dynamictemplate/pathmatch/test-mapping.json"); DocumentMapper docMapper = MapperTests.newParser().parse(mapping); byte[] json = copyToBytesFromClasspath("/org/elastic...
@Test public void testSimple() throws Exception { String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/dynamictemplate/pathmatch/test-mapping.json"); DocumentMapper docMapper = MapperTests.newParser().parse(mapping); byte[] json = copyToBytesFromClasspath("/org/elastic...
public JavaSoundAudioDevice (int samplingRate, boolean isMono) { this.isMono = isMono; try { AudioFormat format = new AudioFormat(samplingRate, 16, isMono ? 1 : 2, true, false); line = AudioSystem.getSourceDataLine(format); line.open(format, Math.min(1024, samplingRate / 10) * 2); line.start(); } ca...
public JavaSoundAudioDevice (int samplingRate, boolean isMono) { this.isMono = isMono; try { AudioFormat format = new AudioFormat(samplingRate, 16, isMono ? 1 : 2, true, false); line = AudioSystem.getSourceDataLine(format); line.open(format, Math.min(2048, samplingRate / 5) * 2); line.start(); } cat...
private void setupGraphics( Application app ) { // // We first construct the paddle mesh which consists of // four 2D vertices forming a vertically elongated rectangle // constructed around the origin. We don't use colors, normals // texture coordinates or indices. Note that we use a fixed // point Mesh h...
private void setupGraphics( Application app ) { // // We first construct the paddle mesh which consists of // four 2D vertices forming a vertically elongated rectangle // constructed around the origin. We don't use colors, normals // texture coordinates or indices. Note that we use a fixed // point Mesh h...
public void onItemClick(AdapterView<?> list, View view, int position, long id) { Gist gist = (Gist) list.getItemAtPosition(position); startActivityForResult(ViewGistActivity.createIntent(gist.getId()), REQUEST_VIEW); }
public void onItemClick(AdapterView<?> list, View view, int position, long id) { Gist gist = (Gist) list.getItemAtPosition(position); startActivityForResult(ViewGistActivity.createIntent(gist), REQUEST_VIEW); }
public void testRepoApi() throws Exception { RepositoryService service = new RepositoryService(); for (Repository repo : service.getRepositories("git")) { Log.d(TAG, repo.getName() + " Watchers: " + repo.getWatchers()); } }
public void testRepoApi() throws Exception { RepositoryService service = new RepositoryService(); for (Repository repo : service.getRepositories("defunkt")) { Log.d(TAG, repo.getName() + " Watchers: " + repo.getWatchers()); } }
package org.elasticsearch; /* * 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, Version 2.0...
package org.elasticsearch; /* * 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, Version 2.0...
package org.elasticsearch.common.settings.bar; /* * 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 ...
package org.elasticsearch.common.settings.bar; /* * 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 ...
package org.elasticsearch.common.settings.foo; /* * 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 ...
package org.elasticsearch.common.settings.foo; /* * 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 ...
public static final String COMPRESS = "compress"; } boolean doesContainerExist(String container); void removeContainer(String container) throws URISyntaxException, StorageException; void createContainer(String container) throws URISyntaxException, StorageException; void deleteFiles(Strin...
public static final String COMPRESS = "compress"; } boolean doesContainerExist(String container); void removeContainer(String container) throws URISyntaxException, StorageException; void createContainer(String container) throws URISyntaxException, StorageException; void deleteFiles(Strin...
public RoutingService(Settings settings, ThreadPool threadPool, ClusterService clusterService, AllocationService allocationService) { super(settings); this.threadPool = threadPool; this.clusterService = clusterService; this.allocationService = allocationService; this.schedule...
public RoutingService(Settings settings, ThreadPool threadPool, ClusterService clusterService, AllocationService allocationService) { super(settings); this.threadPool = threadPool; this.clusterService = clusterService; this.allocationService = allocationService; this.schedule...
public interface ArrayValueMapperParser { /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache Lic...
public interface ArrayValueMapperParser { /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you under the Apache Lic...
public interface IncludeInAllMapper extends XContentMapper { /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you u...
public interface IncludeInAllMapper extends XContentMapper { /* * Licensed to Elastic Search and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Elastic Search licenses this * file to you u...
@Override public Collection<Class<? extends Module>> indexModules() { Collection<Class<? extends Module>> modules = newArrayList(); modules.add(MapperAttachmentsIndexModule.class); return modules; }
@Override public Collection<Class<? extends Module>> indexModules() { Collection<Class<? extends Module>> modules = newArrayList(); modules.add(AttachmentsIndexModule.class); return modules; }
@BeforeTest public void setupMapperParser() { mapperParser = new XContentDocumentMapperParser(new Index("test"), new AnalysisService(new Index("test"))); mapperParser.putTypeParser(XContentAttachmentMapper.CONTENT_TYPE, new XContentAttachmentMapper.TypeParser()); }
@BeforeTest public void setupMapperParser() { mapperParser = new XContentDocumentMapperParser(new Index("test"), new AnalysisService(new Index("test"))); mapperParser.putTypeParser(AttachmentMapper.CONTENT_TYPE, new AttachmentMapper.TypeParser()); }