buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
@Override protected void beforeLocalFork() { if (querySourceUnsafe) { querySource = Arrays.copyOfRange(querySource, querySourceOffset, querySourceLength); querySourceOffset = 0; querySourceUnsafe = false; } }
@Override protected void beforeLocalFork() { if (querySourceUnsafe) { querySource = Arrays.copyOfRange(querySource, querySourceOffset, querySourceOffset + querySourceLength); querySourceOffset = 0; querySourceUnsafe = false; } }
public DeleteByQueryRequest indices(String... indices) { this.indices = indices; return this; } /** * The query source to execute. */ byte[] querySource() { if (querySourceUnsafe || querySourceOffset > 0) { querySource = Arrays.copyOfRange(querySource, quer...
public DeleteByQueryRequest indices(String... indices) { this.indices = indices; return this; } /** * The query source to execute. */ byte[] querySource() { if (querySourceUnsafe || querySourceOffset > 0) { querySource = Arrays.copyOfRange(querySource, quer...
public byte[] source() { if (sourceUnsafe || sourceOffset > 0) { source = Arrays.copyOfRange(source, sourceOffset, sourceLength); sourceOffset = 0; sourceUnsafe = false; } return source; }
public byte[] source() { if (sourceUnsafe || sourceOffset > 0) { source = Arrays.copyOfRange(source, sourceOffset, sourceOffset + sourceLength); sourceOffset = 0; sourceUnsafe = false; } return source; }
public float boostTerms() { return this.boostTerms; } void beforeLocalFork() { if (searchSourceUnsafe) { searchSource = Arrays.copyOfRange(searchSource, searchSourceOffset, searchSourceLength); searchSourceOffset = 0; searchSourceUnsafe = false; }...
public float boostTerms() { return this.boostTerms; } void beforeLocalFork() { if (searchSourceUnsafe) { searchSource = Arrays.copyOfRange(searchSource, searchSourceOffset, searchSourceOffset + searchSourceLength); searchSourceOffset = 0; searchSourceUnsa...
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { assertThat("found a temporary recovery file: " + file, file.getFileName().toString(), not(startsWith("recovery."))); return ...
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { assertThat("found a temporary recovery file: " + file, file.getFileName().toString(), not(startsWith("recovery."))); return ...
public void draw (SpriteBatch batch, float parentAlpha) { if (widget == null) return; validate(); // Setup transform for this group. applyTransform(batch, computeTransform()); if (scrollX) hKnobBounds.x = hScrollBounds.x + (int)((hScrollBounds.width - hKnobBounds.width) * getScrollPercentX()); if (scrol...
public void draw (SpriteBatch batch, float parentAlpha) { if (widget == null) return; validate(); // Setup transform for this group. applyTransform(batch, computeTransform()); if (scrollX) hKnobBounds.x = hScrollBounds.x + (int)((hScrollBounds.width - hKnobBounds.width) * getScrollPercentX()); if (scrol...
public void circle(float radius, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float tangentX, float tangentY, float tangentZ, float binormalX, float binormalY, float binormalZ, int divisions, float angleFrom, float angleTo) { ellipse(radius, radius, 0, 0, centerX, cent...
public void circle(float radius, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float tangentX, float tangentY, float tangentZ, float binormalX, float binormalY, float binormalZ, int divisions, float angleFrom, float angleTo) { ellipse(radius*2, radius*2, 0, 0, centerX, ...
private void computeSize () { sizeInvalid = false; Toolkit toolkit = this.toolkit; ArrayList<Cell> cells = this.cells; if (cells.size() > 0 && !cells.get(cells.size() - 1).endRow) endRow(); columnMinWidth = ensureSize(columnMinWidth, columns); rowMinHeight = ensureSize(rowMinHeight, rows); columnPrefW...
private void computeSize () { sizeInvalid = false; Toolkit toolkit = this.toolkit; ArrayList<Cell> cells = this.cells; if (cells.size() > 0 && !cells.get(cells.size() - 1).endRow) endRow(); columnMinWidth = ensureSize(columnMinWidth, columns); rowMinHeight = ensureSize(rowMinHeight, rows); columnPrefW...
public void draw( Pixmap bmp, int x, int y ) { if( isManaged && invalidated ) rebuild( ); if( gl10 != null ) gl10.glBindTexture( GL10.GL_TEXTURE_2D, textureHandle ); else gl20.glBindTexture( GL10.GL_TEXTURE_2D, textureHandle ); Bitmap bitmap = (Bitmap)bmp.getNativePixmap(); if( isManaged ) { ...
public void draw( Pixmap bmp, int x, int y ) { if( isManaged && invalidated ) rebuild( ); if( gl10 != null ) gl10.glBindTexture( GL10.GL_TEXTURE_2D, textureHandle ); else gl20.glBindTexture( GL10.GL_TEXTURE_2D, textureHandle ); Bitmap bitmap = (Bitmap)bmp.getNativePixmap(); if( isManaged ) { ...
public int compare(int slot1, int slot2) { final long v1 = values[slot1]; final long v2 = values[slot2]; return compare(v1, v2); }
public int compare(int slot1, int slot2) { final long v1 = values[slot1]; final long v2 = values[slot2]; return Long.compare(v1, v2); }
public int compareTo(Snapshot o) { return Longs.compare(startTime, ((BlobStoreSnapshot) o).startTime); }
public int compareTo(Snapshot o) { return Long.compare(startTime, ((BlobStoreSnapshot) o).startTime); }
protected int compare(int node) { final double centroid = mean(node); int cmp = Double.compare(tmpCentroid, centroid); if (cmp == 0) { cmp = Longs.compare(tmpId, ids[node]); } return cmp; }
protected int compare(int node) { final double centroid = mean(node); int cmp = Double.compare(tmpCentroid, centroid); if (cmp == 0) { cmp = Long.compare(tmpId, ids[node]); } return cmp; }
public void rotateAround (Vector3 point, Vector3 axis, float angle) { tmpVec.set(point); tmpVec.sub(position); translate(tmpVec); rotate(axis, angle); tmpVec.rotate(axis, angle); translate(tmpVec.set(-tmpVec.x, -tmpVec.y, -tmpVec.z)); }
public void rotateAround (Vector3 point, Vector3 axis, float angle) { tmpVec.set(point); tmpVec.sub(position); translate(tmpVec); rotate(axis, angle); tmpVec.rotate(axis, angle); translate(-tmpVec.x, -tmpVec.y, -tmpVec.z); }
public static boolean localNode(Settings settings) { if (settings.get("node.local") != null) { return settings.getAsBoolean("node.local", false); } if (settings.get("node.mode") != null) { String nodeMode = settings.get("node.mode"); if ("local".equals(nod...
public static boolean localNode(Settings settings) { if (settings.get("node.local") != null) { return settings.getAsBoolean("node.local", false); } if (settings.get("node.mode") != null) { String nodeMode = settings.get("node.mode"); if ("local".equals(nod...
public static void main (String[] argv) { new JoglApplication(new com.badlogic.gdx.tests.PickingTest(), "Debug Test", 480, 320, false); }
public static void main (String[] argv) { new JoglApplication(new com.badlogic.gdx.tests.UITest(), "Debug Test", 480, 320, false); }
@Override public void render () { GL10 gl = Gdx.graphics.getGL10(); gl.glClear(GL10.GL_COLOR_BUFFER_BIT); ui.act(Gdx.graphics.getDeltaTime()); ui.draw(); }
@Override public void render () { GL10 gl = Gdx.graphics.getGL10(); gl.glClear(GL10.GL_COLOR_BUFFER_BIT); ui.act(Math.min(Gdx.graphics.getDeltaTime(), 1 / 30.0f)); ui.draw(); }
@Test public void testFailedSearchWithWrongQuery() throws Exception { logger.info("Start Testing failed search with wrong query"); startNode("server1"); client("server1").admin().indices().create(createIndexRequest("test")).actionGet(); for (int i = 0; i < 100; i++) { in...
@Test public void testFailedSearchWithWrongQuery() throws Exception { logger.info("Start Testing failed search with wrong query"); startNode("server1"); client("server1").admin().indices().create(createIndexRequest("test")).actionGet(); for (int i = 0; i < 100; i++) { in...
public static List<NetworkInterface> getAllAvailableInterfaces() throws SocketException { List<NetworkInterface> allInterfaces = new ArrayList<NetworkInterface>(); for (Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); interfaces.hasMoreElements(); ) { N...
public static List<NetworkInterface> getAllAvailableInterfaces() throws SocketException { List<NetworkInterface> allInterfaces = new ArrayList<NetworkInterface>(); for (Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); interfaces.hasMoreElements(); ) { N...
public float range; //my plan is to use linear fall-off: intesity = clamp(1 - (distance / range) }
public float intesity; }
public void create() { Gdx.graphics.setVSync(false); long start = System.nanoTime(); model = ModelLoaderRegistry .loadStillModel(Gdx.files.internal(fileName)); Gdx.app.log("StillModelViewer", "loading took: " + (System.nanoTime() - start) / 1000000000.0f); for (StillSubMesh mesh : model.subMeshes) {...
public void create() { Gdx.graphics.setVSync(false); long start = System.nanoTime(); model = ModelLoaderRegistry .loadStillModel(Gdx.files.internal(fileName)); Gdx.app.log("StillModelViewer", "loading took: " + (System.nanoTime() - start) / 1000000000.0f); for (StillSubMesh mesh : model.subMeshes) {...
private void uploadImageData(Pixmap pixmap) { if(enforcePotImages && Gdx.gl20 == null && (!MathUtils.isPowerOfTwo(data.getWidth()) || !MathUtils.isPowerOfTwo(data.getHeight()))) throw new GdxRuntimeException("texture width and height must be powers of two"); boolean disposePixmap = false; if(data.getFormat...
private void uploadImageData(Pixmap pixmap) { if(enforcePotImages && Gdx.gl20 == null && (!MathUtils.isPowerOfTwo(data.getWidth()) || !MathUtils.isPowerOfTwo(data.getHeight()))) throw new GdxRuntimeException("texture width and height must be powers of two"); boolean disposePixmap = false; if(data.getFormat...
public void drawDebug (SpriteBatch batch) { if (getDebug() == DEBUG_NONE || debugRects == null) return; if (debugRenderer == null) { if (Gdx.graphics.isGL20Available()) debugRenderer = new ImmediateModeRenderer20(64, false, true, 0); else debugRenderer = new ImmediateModeRenderer10(64); } Table ...
public void drawDebug (SpriteBatch batch) { if (getDebug() == DEBUG_NONE || debugRects == null) return; if (debugRenderer == null) { if (Gdx.graphics.isGL20Available()) debugRenderer = new ImmediateModeRenderer20(64, false, true, 0); else debugRenderer = new ImmediateModeRenderer10(64); } Table ...
public void create () { super.create(); final Model barModel = ModelBuilder.createBox(10f, 1f, 1f, new NewMaterial(new ColorAttribute(ColorAttribute.Diffuse, Color.WHITE)), new VertexAttributes(new VertexAttribute(Usage.Position, 3, ShaderProgram.POSITION_ATTRIBUTE), new VertexAttribute(Usage.Normal, 3, ShaderPro...
public void create () { super.create(); final Model barModel = modelBuilder.createBox(10f, 1f, 1f, new NewMaterial(new ColorAttribute(ColorAttribute.Diffuse, Color.WHITE)), new VertexAttributes(new VertexAttribute(Usage.Position, 3, ShaderProgram.POSITION_ATTRIBUTE), new VertexAttribute(Usage.Normal, 3, ShaderPro...
protected Model createCapsuleModel(float radius, float height) { final float hh = radius + 0.5f * height; // return ModelBuilder return ModelBuilder.createCylinder(radius * 2, hh * 2f, radius * 2f, 16, new NewMaterial(new ColorAttribute(ColorAttribute.Diffuse, Color.WHITE)), new VertexAttributes(new VertexAttrib...
protected Model createCapsuleModel(float radius, float height) { final float hh = radius + 0.5f * height; // return ModelBuilder return modelBuilder.createCylinder(radius * 2, hh * 2f, radius * 2f, 16, new NewMaterial(new ColorAttribute(ColorAttribute.Diffuse, Color.WHITE)), new VertexAttributes(new VertexAttrib...
public float dst2 (float x, float y, float z) { final float a = x - this.x; final float b = y - this.y; final float c = z - this.z; return a * a + b * b + c * b; }
public float dst2 (float x, float y, float z) { final float a = x - this.x; final float b = y - this.y; final float c = z - this.z; return a * a + b * b + c * c; }
public String indexUUID() { return indexSettings.get(IndexMetaData.SETTING_UUID); }
public String indexUUID() { return indexSettings.get(IndexMetaData.SETTING_UUID, IndexMetaData.INDEX_UUID_NA_VALUE); }
public void writeValue (Object value, Class knownType, Class elementType) { try { if (value == null) { writer.value(null); return; } if ((knownType != null && knownType.isPrimitive()) || knownType == String.class || knownType == Integer.class || knownType == Boolean.class || knownType == Float....
public void writeValue (Object value, Class knownType, Class elementType) { try { if (value == null) { writer.value(null); return; } if ((knownType != null && knownType.isPrimitive()) || knownType == String.class || knownType == Integer.class || knownType == Boolean.class || knownType == Float....
protected String transportAction() { return TransportActions.Admin.Indices.VALIDATE_QUERY; }
protected String transportAction() { return TransportActions.Admin.Indices.Validate.QUERY; }
protected String action() { return TransportActions.Admin.Indices.DELETE_INDEX_TEMPLATE; }
protected String action() { return TransportActions.Admin.Indices.Template.DELETE; }
protected String action() { return TransportActions.Admin.Indices.PUT_INDEX_TEMPLATE; }
protected String action() { return TransportActions.Admin.Indices.Template.PUT; }
protected String action() { return TransportActions.Admin.Indices.VALIDATE_QUERY; }
protected String action() { return TransportActions.Admin.Indices.Validate.QUERY; }
public void render () { // first we update the world. For simplicity // we use the delta time provided by the Graphics // instance. Normally you'll want to fix the time // step. long start = System.nanoTime(); world.step(Gdx.graphics.getDeltaTime(), 8, 3); float updateTime = (System.nanoTime() - start) /...
public void render () { // first we update the world. For simplicity // we use the delta time provided by the Graphics // instance. Normally you'll want to fix the time // step. long start = System.nanoTime(); world.step(Gdx.graphics.getDeltaTime(), 8, 3); float updateTime = (System.nanoTime() - start) /...
public void render () { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); world.step(Math.min(0.032f, Gdx.graphics.getDeltaTime()), 3, 4); cam.update(); cam.apply(Gdx.gl10); renderer.render(world); }
public void render () { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); world.step(Math.min(0.032f, Gdx.graphics.getDeltaTime()), 3, 4); cam.update(); cam.apply(Gdx.gl10); renderer.render(world, cam.combined); }
public void render () { // update the world with a fixed time step long startTime = System.nanoTime(); world.step(Gdx.app.getGraphics().getDeltaTime(), 3, 3); float updateTime = (System.nanoTime() - startTime) / 1000000000.0f; startTime = System.nanoTime(); // clear the screen and setup the projection mat...
public void render () { // update the world with a fixed time step long startTime = System.nanoTime(); world.step(Gdx.app.getGraphics().getDeltaTime(), 3, 3); float updateTime = (System.nanoTime() - startTime) / 1000000000.0f; startTime = System.nanoTime(); // clear the screen and setup the projection mat...
public void build (String outputDir, String appName, String packageName, String mainClass, String sdkLocation) { Project project = new Project(); String packageDir = packageName.replace('.', '/'); String sdkPath = sdkLocation.replace('\\', '/'); if(isSdkLocationValid(sdkLocation)) { System.out.println("A...
public void build (String outputDir, String appName, String packageName, String mainClass, String sdkLocation) { Project project = new Project(); String packageDir = packageName.replace('.', '/'); String sdkPath = sdkLocation.replace('\\', '/'); if(!isSdkLocationValid(sdkLocation)) { System.out.println("...
private native void jniGetContactList (long addr, long[] contacts); /* b2World* world = (b2World*)addr; b2Contact* contact = world->GetContactList(); int i = 0; while( contact != 0 ) { contacts[i++] = (long)contact; contact = contact->GetNext();
private native void jniGetContactList (long addr, long[] contacts); /* b2World* world = (b2World*)addr; b2Contact* contact = world->GetContactList(); int i = 0; while( contact != 0 ) { contacts[i++] = (long long)contact; contact = contact->GetNext();
public void choose (T item) { if (item == null) throw new IllegalArgumentException("item cannot be null."); if (isDisabled) return; if (selected.size > 0 && rangeSelect && multiple && (Gdx.input.isKeyPressed(Keys.SHIFT_LEFT) || Gdx.input.isKeyPressed(Keys.SHIFT_RIGHT))) { int low = items.indexOf(getLastSel...
public void choose (T item) { if (item == null) throw new IllegalArgumentException("item cannot be null."); if (isDisabled) return; if (selected.size > 0 && rangeSelect && multiple && (Gdx.input.isKeyPressed(Keys.SHIFT_LEFT) || Gdx.input.isKeyPressed(Keys.SHIFT_RIGHT))) { int low = items.indexOf(getLastSel...
@Override public ClusterState execute(ClusterState currentState) { RoutingTable routingTable = currentState.routingTable(); IndexRoutingTable indexRoutingTable = routingTable.index(shardRouting.index()); // if there is no routing table, the index has been dele...
@Override public ClusterState execute(ClusterState currentState) { RoutingTable routingTable = currentState.routingTable(); IndexRoutingTable indexRoutingTable = routingTable.index(shardRouting.index()); // if there is no routing table, the index has been dele...
public void draw (SpriteBatch spriteBatch) { spriteBatch.draw(font.getTextureRegion().getTexture(), vertices, 0, idx); }
public void draw (SpriteBatch spriteBatch) { spriteBatch.draw(font.getRegion().getTexture(), vertices, 0, idx); }
@Override public void create () { cam = new OrthographicCamera(); cam.setViewport(480, 320); camController = new OrthoCamController(cam); Gdx.input.setInputProcessor(camController); renderer = new ImmediateModeRenderer(); texture = Gdx.graphics.newTexture(Gdx.files.internal("data/isotile.png"), ...
@Override public void create () { cam = new OrthographicCamera(); cam.setViewport(480, 320); camController = new OrthoCamController(cam); Gdx.input.setInputProcessor(camController); renderer = new ImmediateModeRenderer(); texture = Gdx.graphics.newTexture(Gdx.files.internal("data/isotile.png"), ...
public boolean keyDown (int keycode) { ParticleEmitter emitter = emitters.get(emitterIndex); if (keycode == Input.Keys.KEYCODE_DPAD_UP) particleCount += 5; else if (keycode == Input.Keys.KEYCODE_DPAD_DOWN) particleCount -= 5; else if (keycode == Input.Keys.KEYCODE_SPACE) { emitterIndex...
public boolean keyDown (int keycode) { ParticleEmitter emitter = emitters.get(emitterIndex); if (keycode == Input.Keys.KEYCODE_DPAD_UP) particleCount += 5; else if (keycode == Input.Keys.KEYCODE_DPAD_DOWN) particleCount -= 5; else if (keycode == Input.Keys.KEYCODE_SPACE) { emitterIndex...
public void create() { cam = new OrthographicCamera(); cam.setViewport(480, 320); cam.getPosition().set(WIDTH*32/2, HEIGHT*32/2,0); camController = new OrthoCamController(cam); Gdx.input.setInputProcessor(camController); texture = Gdx.graphics.newTexture(Gdx.files.internal("data/tiles.png"), TextureFilt...
public void create() { cam = new OrthographicCamera(); cam.setViewport(480, 320); cam.getPosition().set(WIDTH*32/2, HEIGHT*32/2,0); camController = new OrthoCamController(cam); Gdx.input.setInputProcessor(camController); texture = Gdx.graphics.newTexture(Gdx.files.internal("data/tiles.png"), TextureFilt...
public InputStream read () { if (type == FileType.Classpath || (type == FileType.Internal && !file.exists())) { InputStream input = FileHandle.class.getResourceAsStream("/" + file.getPath().replace('\\', '/')); if (input == null) throw new GdxRuntimeException("File not found: " + file + " (" + type + ")"); ...
public InputStream read () { if (type == FileType.Classpath || (type == FileType.Internal && !file.exists()) || (type == FileType.Local && !file.exists())) { InputStream input = FileHandle.class.getResourceAsStream("/" + file.getPath().replace('\\', '/')); if (input == null) throw new GdxRuntimeException("File...
public String toString () { String name = this.name; if (name == null) { name = getClass().getName(); int dotIndex = name.lastIndexOf('.'); if (dotIndex != -1) name = name.substring(dotIndex + 1); } return name; } }
public String toString () { String name = this.name; if (name == null) { name = getClass().getName(); int dotIndex = name.lastIndexOf('.'); if (dotIndex != -1) name = name.substring(dotIndex + 1); } return name + " " + x + "," + y + " " + width + "x" + height; } }
public Mesh(boolean isStatic, int maxVertices, int maxIndices, VertexAttribute... attributes) { if (isStatic && (Gdx.gl11 != null || Gdx.gl20 != null)) { vertices = new VertexBufferObject(isStatic, maxVertices, attributes); indices = new IndexBufferObject(isStatic, maxIndices); isVertexArray = false; }...
public Mesh(boolean isStatic, int maxVertices, int maxIndices, VertexAttribute... attributes) { if (Gdx.gl20 != null || (isStatic && Gdx.gl11 != null)) { vertices = new VertexBufferObject(isStatic, maxVertices, attributes); indices = new IndexBufferObject(isStatic, maxIndices); isVertexArray = false; }...
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startArray(Fields.TASKS); for (PendingClusterTask pendingClusterTask : this) { builder.startObject(); builder.field(Fields.INSERT_ORDER, pendingClusterTask.insertOrder()); ...
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startArray(Fields.TASKS); for (PendingClusterTask pendingClusterTask : this) { builder.startObject(); builder.field(Fields.INSERT_ORDER, pendingClusterTask.insertOrder()); ...
public void testSimpleFunctionScoreParsingWorks() throws IOException, ExecutionException, InterruptedException { assertAcked(prepareCreate("test").addMapping( "type1", jsonBuilder().startObject() .startObject("type1") .startObj...
public void testSimpleFunctionScoreParsingWorks() throws IOException, ExecutionException, InterruptedException { assertAcked(prepareCreate("test").addMapping( "type1", jsonBuilder().startObject() .startObject("type1") .startObj...
public synchronized BulkProcessor add(BytesReference data, boolean contentUnsafe, @Nullable String defaultIndex, @Nullable String defaultType, @Nullable Object payload) throws Exception { bulkRequest.add(data, contentUnsafe, defaultIndex, defaultType, payload); executeIfNeeded();
public synchronized BulkProcessor add(BytesReference data, boolean contentUnsafe, @Nullable String defaultIndex, @Nullable String defaultType, @Nullable Object payload) throws Exception { bulkRequest.add(data, contentUnsafe, defaultIndex, defaultType, payload, true); executeIfNeeded();
public void setIndices (short[] indices, int offset, int count) { isDirty = true; buffer.clear(); buffer.put(indices); buffer.flip(); byteBuffer.position(0); byteBuffer.limit(count << 1); if (isBound) { if (Gdx.gl11 != null) { GL11 gl = Gdx.gl11; // gl.glBufferData(GL11.GL_ELEMENT_ARRAY_BUFFER, b...
public void setIndices (short[] indices, int offset, int count) { isDirty = true; buffer.clear(); buffer.put(indices, offset, count); buffer.flip(); byteBuffer.position(0); byteBuffer.limit(count << 1); if (isBound) { if (Gdx.gl11 != null) { GL11 gl = Gdx.gl11; // gl.glBufferData(GL11.GL_ELEMENT_...
public double addEstimateBytesAndMaybeBreak(long bytes, String label) throws CircuitBreakingException { // short-circuit on no data allowed, immediately throwing an exception if (memoryBytesLimit == 0) { circuitBreak(label, bytes); } long newUsed; // If there is ...
public double addEstimateBytesAndMaybeBreak(long bytes, String label) throws CircuitBreakingException { // short-circuit on no data allowed, immediately throwing an exception if (memoryBytesLimit == 0) { circuitBreak(label, bytes); } long newUsed; // If there is ...
public double addEstimateBytesAndMaybeBreak(long bytes, String label) throws CircuitBreakingException { // short-circuit on no data allowed, immediately throwing an exception if (memoryBytesLimit == 0) { circuitBreak(label, bytes); } long newUsed; // If there is ...
public double addEstimateBytesAndMaybeBreak(long bytes, String label) throws CircuitBreakingException { // short-circuit on no data allowed, immediately throwing an exception if (memoryBytesLimit == 0) { circuitBreak(label, bytes); } long newUsed; // If there is ...
public void setToOrtho (boolean yDown, float viewportWidth, float viewportHeight) { if (yDown) { up.set(0, -1, 0); direction.set(0, 0, 1); } position.set(viewportWidth / 2.0f, viewportHeight / 2.0f, 0); this.viewportWidth = viewportWidth; this.viewportHeight = viewportHeight; update(); }
public void setToOrtho (boolean yDown, float viewportWidth, float viewportHeight) { if (yDown) { up.set(0, -1, 0); direction.set(0, 0, 1); } position.set(zoom * viewportWidth / 2.0f, zoom * viewportHeight / 2.0f, 0); this.viewportWidth = viewportWidth; this.viewportHeight = viewportHeight; update(); ...
public boolean exists () { switch (type) { case Internal: if (file().exists()) return true; // Fall through. case Classpath: return FileHandle.class.getResource("/" + file.getPath().replace('\\', '/')) != null; } return file().exists(); }
public boolean exists () { switch (type) { case Internal: if (file.exists()) return true; // Fall through. case Classpath: return FileHandle.class.getResource("/" + file.getPath().replace('\\', '/')) != null; } return file().exists(); }
public void draw (SpriteBatch batch, float parentAlpha) { if (widget == null) return; validate(); // Setup transform for this group. applyTransform(batch, computeTransform()); if (scrollX) hKnobBounds.x = hScrollBounds.x + (int)((hScrollBounds.width - hKnobBounds.width) * getScrollPercentX()); if (scrol...
public void draw (SpriteBatch batch, float parentAlpha) { if (widget == null) return; validate(); // Setup transform for this group. applyTransform(batch, computeTransform()); if (scrollX) hKnobBounds.x = hScrollBounds.x + (int)((hScrollBounds.width - hKnobBounds.width) * getScrollPercentX()); if (scrol...
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; float boost = 1.0f; String scriptLang = null; Map<String, Object> vars = null; FiltersFunction...
@Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); Query query = null; float boost = 1.0f; String scriptLang = null; Map<String, Object> vars = null; FiltersFunction...
public FieldComparator<Double> setNextReader(AtomicReaderContext context) throws IOException { script.setNextReader(context.reader()); return this; }
public FieldComparator<Double> setNextReader(AtomicReaderContext context) throws IOException { script.setNextReader(context); return this; }
public FieldComparator<String> setNextReader(AtomicReaderContext context) throws IOException { script.setNextReader(context.reader()); return this; }
public FieldComparator<String> setNextReader(AtomicReaderContext context) throws IOException { script.setNextReader(context); return this; }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (LongFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); valueScript.setNextReader(context.reader()); }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (LongFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); valueScript.setNextReader(context); }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { super.doSetNextReader(context); script.setNextReader(context.reader()); }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { super.doSetNextReader(context); script.setNextReader(context); }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (NumericFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); valueScript.setNextReader(context.reader()); }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (NumericFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); valueScript.setNextReader(context); }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { script.setNextReader(context.reader()); }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { script.setNextReader(context); }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (ByteFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context.reader()); } }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (ByteFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context); } }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (DoubleFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context.reader()); } }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (DoubleFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context); } }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (FloatFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context.reader()); } }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (FloatFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context); } }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (IntFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context.reader()); } }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (IntFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context); } }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (LongFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context.reader()); } }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (LongFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context); } }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (LongFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context.reader()); }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (LongFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context); }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (ShortFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context.reader()); } }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = (ShortFieldData) fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context); } }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { for (int i = 0; i < indexFieldsNames.length; i++) { fieldsData[i] = fieldDataCache.cache(fieldsDataType[i], context.reader(), indexFieldsNames[i]); } if (script != null) { script.setNextR...
protected void doSetNextReader(AtomicReaderContext context) throws IOException { for (int i = 0; i < indexFieldsNames.length; i++) { fieldsData[i] = fieldDataCache.cache(fieldsDataType[i], context.reader(), indexFieldsNames[i]); } if (script != null) { script.setNextR...
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context.reader()); }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { fieldData = fieldDataCache.cache(fieldDataType, context.reader(), indexFieldName); if (script != null) { script.setNextReader(context); }
protected void doSetNextReader(AtomicReaderContext context) throws IOException { keyFieldData = (NumericFieldData) fieldDataCache.cache(keyFieldDataType, context.reader(), keyFieldName); if (script != null) { script.setNextReader(context.reader()); } else { aggregator...
protected void doSetNextReader(AtomicReaderContext context) throws IOException { keyFieldData = (NumericFieldData) fieldDataCache.cache(keyFieldDataType, context.reader(), keyFieldName); if (script != null) { script.setNextReader(context); } else { aggregator.valueFie...
protected void doSetNextReader(AtomicReaderContext context) throws IOException { keyFieldData = fieldDataCache.cache(keyFieldDataType, context.reader(), keyFieldName); if (script != null) { script.setNextReader(context.reader()); } else { aggregator.valueFieldData = (...
protected void doSetNextReader(AtomicReaderContext context) throws IOException { keyFieldData = fieldDataCache.cache(keyFieldDataType, context.reader(), keyFieldName); if (script != null) { script.setNextReader(context); } else { aggregator.valueFieldData = (NumericFi...
public ResourceLoadingIndicator(final Context context, final int loadingResId) { this.context = context; view = LayoutInflater.from(context).inflate(layout.load_item, null); textView = (TextView) view.findViewById(id.tv_loading); this.loadingResId = loadingResId; }
public ResourceLoadingIndicator(final Context context, final int loadingResId) { this.context = context; view = LayoutInflater.from(context).inflate(layout.loading_item, null); textView = (TextView) view.findViewById(id.tv_loading); this.loadingResId = loadingResId; }
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = inflater.inflate(layout.gist_view, null); headerView = inflater.inflate(layout.gist_header, null); created = (TextView) headerView.findViewById(id.tv_gist_creation); updat...
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = inflater.inflate(layout.gist_view, null); headerView = inflater.inflate(layout.gist_header, null); created = (TextView) headerView.findViewById(id.tv_gist_creation); updat...
public void onClick(View v) { if (issue != null) stateTask.confirm(STATE_OPEN.equals(issue.getState())); } }); titleText = (TextView) headerView.findViewById(id.tv_issue_title); createdText = (TextView) headerView.findViewById(id.tv_is...
public void onClick(View v) { if (issue != null) stateTask.confirm(STATE_OPEN.equals(issue.getState())); } }); titleText = (TextView) headerView.findViewById(id.tv_issue_title); createdText = (TextView) headerView.findViewById(id.tv_is...
static public Resolution choose (Resolution... descriptors) { if (descriptors == null) throw new IllegalArgumentException("descriptors cannot be null."); int w = Gdx.graphics.getWidth(), h = Gdx.graphics.getHeight(); // Prefer the shortest side. Resolution best = descriptors[0]; if (w < h) { for (int i =...
static public Resolution choose (Resolution... descriptors) { if (descriptors == null) throw new IllegalArgumentException("descriptors cannot be null."); int w = Gdx.graphics.getWidth(), h = Gdx.graphics.getHeight(); // Prefer the shortest side. Resolution best = descriptors[0]; if (w < h) { for (int i =...
import org.elasticsearch.test.junit.listeners.ReproduceInfoPrinter; /* * 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 ...
import org.elasticsearch.test.junit.listeners.ReproduceInfoPrinter; /* * 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 ...
package org.elasticsearch.test.junit.annotations; /* * 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 Apach...
package org.elasticsearch.test.junit.annotations; /* * 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 Apach...
package org.elasticsearch.test.junit.annotations; /* * 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 Apach...
package org.elasticsearch.test.junit.annotations; /* * 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 Apach...
public String path () { return file.getPath(); }
public String path () { return file.getPath().replace('\\', '/'); }
public static void main(String[] args) throws Exception { // generate C/C++ code new NativeCodeGenerator().generate("src", "bin", "jni"); // generate build scripts, for win32 only // custom target for testing purposes BuildTarget win32home = BuildTarget.newDefaultTarget(TargetOs.Windows, false); win32ho...
public static void main(String[] args) throws Exception { // generate C/C++ code new NativeCodeGenerator().generate(); // generate build scripts, for win32 only // custom target for testing purposes BuildTarget win32home = BuildTarget.newDefaultTarget(TargetOs.Windows, false); win32home.compilerPrefix =...
protected Field innerParseCreateField(ParseContext context) throws IOException, AlreadyExpiredException { if (enabledState.enabled && !context.sourceToParse().flyweight()) { long ttl = context.sourceToParse().ttl(); if (ttl <= 0 && defaultTTL > 0) { // no ttl provided so we use the d...
protected Field innerParseCreateField(ParseContext context) throws IOException, AlreadyExpiredException { if (enabledState.enabled && !context.sourceToParse().flyweight()) { long ttl = context.sourceToParse().ttl(); if (ttl <= 0 && defaultTTL > 0) { // no ttl provided so we use the d...
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...
@Override protected void doExecute(SearchRequest searchRequest, ActionListener<SearchResponse> listener) { // optimize search type for cases where there is only one shard group to search on if (optimizeSingleShard && searchRequest.searchType() != SCAN && searchRequest.searchType() != COUNT) { ...
@Override protected void doExecute(SearchRequest searchRequest, ActionListener<SearchResponse> listener) { // optimize search type for cases where there is only one shard group to search on if (optimizeSingleShard && searchRequest.searchType() != SCAN && searchRequest.searchType() != COUNT) { ...
public enum GraphicsType { AndroidGL, LWJGL, Angle, WebGL, iOSGL }
public enum GraphicsType { AndroidGL, LWJGL, Angle, WebGL, iOSGL, JGLFW }
public abstract void process(RestRequest request, RestChannel channel, RestFilterChain filterChain); }
public abstract void process(RestRequest request, RestChannel channel, RestFilterChain filterChain) throws Exception; }
void handleRequest(RestRequest request, RestChannel channel) throws Exception; /* * 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 unde...
void handleRequest(RestRequest request, RestChannel channel) throws Exception; /* * 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 unde...
private void parseMeshes (ModelData model, JsonValue json) { JsonValue meshes = json.require("meshes"); model.meshes.ensureCapacity(meshes.size()); for (JsonValue mesh = meshes.child(); mesh != null; mesh = mesh.next()) { ModelMesh jsonMesh = new ModelMesh(); String id = mesh.getString("id", ""); ...
private void parseMeshes (ModelData model, JsonValue json) { JsonValue meshes = json.require("meshes"); model.meshes.ensureCapacity(meshes.size()); for (JsonValue mesh = meshes.child(); mesh != null; mesh = mesh.next()) { ModelMesh jsonMesh = new ModelMesh(); String id = mesh.getString("id", ""); ...
public void run () { longPressFired = listener.longPress(pointer1.x, pointer1.y); } };
public void run () { if (listener.longPress(pointer1.x, pointer1.y)) longPressFired = true; } };
public SizeFieldMapper(boolean enabled, Field.Store store) { super(new Names(Defaults.NAME), Defaults.PRECISION_STEP, Defaults.INDEX, store, Defaults.BOOST, Defaults.OMIT_NORMS, Defaults.OMIT_TERM_FREQ_AND_POSITIONS, Defaults.NULL_VALUE); this.enabled = enabled; }
public SizeFieldMapper(boolean enabled, Field.Store store) { super(new Names(Defaults.NAME), Defaults.PRECISION_STEP, Defaults.FUZZY_FACTOR, Defaults.INDEX, store, Defaults.BOOST, Defaults.OMIT_NORMS, Defaults.OMIT_TERM_FREQ_AND_POSITIONS, Defaults.NULL_VALUE); this.enabled = enabled; }
protected ShardFlushResponse shardOperation(ShardFlushRequest request) throws ElasticSearchException { IndexShard indexShard = indicesService.indexServiceSafe(request.index()).shardSafe(request.shardId()); indexShard.flush(new Engine.Flush().refresh(request.refresh()).full(request.full()).force(requ...
protected ShardFlushResponse shardOperation(ShardFlushRequest request) throws ElasticSearchException { IndexShard indexShard = indicesService.indexServiceSafe(request.index()).shardSafe(request.shardId()); indexShard.flush(new Engine.Flush().refresh(request.refresh()).type(request.full() ? Engine.Fl...
public GistListAdapter(AvatarLoader avatarHelper, LayoutInflater inflater, Gist[] elements) { super(layout.gist_list_item, inflater, elements); this.avatarHelper = avatarHelper; }
public GistListAdapter(AvatarLoader avatarHelper, LayoutInflater inflater, Gist[] elements) { super(layout.gist_item, inflater, elements); this.avatarHelper = avatarHelper; }
public FilterListAdapter(LayoutInflater inflater, IssueFilter[] elements, AvatarLoader avatars) { super(layout.issue_filter_list_item, inflater, elements); this.avatars = avatars; }
public FilterListAdapter(LayoutInflater inflater, IssueFilter[] elements, AvatarLoader avatars) { super(layout.issue_filter_item, inflater, elements); this.avatars = avatars; }
public RepositoryListAdapter(LayoutInflater inflater, Repository[] elements, AtomicReference<User> account, AtomicReference<RecentRepositories> recent) { super(layout.repo_list_item, inflater, elements); this.account = account; this.recent = recent; }
public RepositoryListAdapter(LayoutInflater inflater, Repository[] elements, AtomicReference<User> account, AtomicReference<RecentRepositories> recent) { super(layout.repo_item, inflater, elements); this.account = account; this.recent = recent; }
public SearchRepositoryListAdapter(LayoutInflater inflater, SearchRepository[] elements) { super(layout.repo_list_item, inflater, elements); }
public SearchRepositoryListAdapter(LayoutInflater inflater, SearchRepository[] elements) { super(layout.repo_search_item, inflater, elements); }
public UserRepositoryListAdapter(LayoutInflater inflater, Repository[] elements, User user) { super(layout.repo_list_item, inflater, elements); login = user.getLogin(); }
public UserRepositoryListAdapter(LayoutInflater inflater, Repository[] elements, User user) { super(layout.repo_item, inflater, elements); login = user.getLogin(); }
public UserListAdapter(final LayoutInflater inflater, final User[] elements, final AvatarLoader avatarHelper) { super(layout.user_list_item, inflater, elements); this.avatarHelper = avatarHelper; }
public UserListAdapter(final LayoutInflater inflater, final User[] elements, final AvatarLoader avatarHelper) { super(layout.user_item, inflater, elements); this.avatarHelper = avatarHelper; }
public SearchSourceBuilder fetchSource(@Nullable String include, @Nullable String exclude) { return fetchSource(include == null ? Strings.EMPTY_ARRAY : new String[]{include}, include == null ? Strings.EMPTY_ARRAY : new String[]{exclude}); }
public SearchSourceBuilder fetchSource(@Nullable String include, @Nullable String exclude) { return fetchSource(include == null ? Strings.EMPTY_ARRAY : new String[]{include}, exclude == null ? Strings.EMPTY_ARRAY : new String[]{exclude}); }
private void checkNextLevel () { if (invaders.size() == 0 && ship.lives > 0) { blocks.clear(); shots.clear(); shipShot = null; Vector3 shipPosition = ship.position; int lives = ship.lives; populate(); ship.position.set(shipPosition); ship.lives = lives; multiplier += 0.1f; wave++; } ...
private void checkNextLevel () { if (invaders.size() == 0 && ship.lives > 0) { blocks.clear(); shots.clear(); shipShot = null; Vector3 shipPosition = ship.position; int lives = ship.lives; populate(); ship.position.set(shipPosition); ship.lives = lives; multiplier += 0.2f; wave++; } ...
public static CharSequence encode(String html, ImageGetter imageGetter) { if (html == null) return ""; if (html.length() == 0) return html; // These add extra padding that should be styled explicitly html = html.replace("<p>", ""); html = html.replace(...
public static CharSequence encode(String html, ImageGetter imageGetter) { if (html == null) return ""; if (html.length() == 0) return html; // These add extra padding that should be styled explicitly html = html.replace("<p>", ""); html = html.replace(...