buggy_function
stringlengths
1
391k
fixed_function
stringlengths
0
392k
public void testPagination() throws Exception { int size = randomIntBetween(0, 10); int from = randomIntBetween(0, 10); SearchResponse response = client().prepareSearch("idx").setTypes("type") .addAggregation(terms("terms") .executionHint(rando...
public void testPagination() throws Exception { int size = randomIntBetween(1, 10); int from = randomIntBetween(0, 10); SearchResponse response = client().prepareSearch("idx").setTypes("type") .addAggregation(terms("terms") .executionHint(rando...
public void run () { Gdx.app.log("TimerTest", "ping"); } }, 1, 1); }
public void run () { Gdx.app.log("TimerTest", "ping"); } }, 0, 1); }
public enum TextureDataType { Pixmap, Compressed, Float, }
public enum TextureDataType { Pixmap, Compressed, }
protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new MultitouchTest(), config); }
protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new BulletTestCollection(), config); }
public static void main (String[] argv) { new JoglApplication(new com.badlogic.gdx.tests.ShaderMultitextureTest(), "Debug Test", 480, 320, true); }
public static void main (String[] argv) { new JoglApplication(new com.badlogic.gdx.tests.SpritePerformanteTest2(), "Debug Test", 800, 600, false); }
@Override public void actionPerformed (ActionEvent e) { String testName = (String)list.getSelectedValue(); GdxTest test = GdxTests.newTest(testName); new JoglApplication(test, testName, 480, 320, test.needsGL20()); } }); add(pane, BorderLayout.CENTER); add(button, BorderLayout.SOUTH); ...
@Override public void actionPerformed (ActionEvent e) { String testName = (String)list.getSelectedValue(); GdxTest test = GdxTests.newTest(testName); new JoglApplication(test, testName, 800, 600, test.needsGL20()); } }); add(pane, BorderLayout.CENTER); add(button, BorderLayout.SOUTH); ...
public void initialize(ApplicationListener listener, AndroidApplicationConfiguration config) { graphics = new AndroidGraphicsLiveWallpaper(this, config.useGL20, config.resolutionStrategy==null?new FillResolutionStrategy():config.resolutionStrategy); input = AndroidInputFactory.newAndroidInput(this, this.getService...
public void initialize(ApplicationListener listener, AndroidApplicationConfiguration config) { graphics = new AndroidGraphicsLiveWallpaper(this, config.useGL20, config.resolutionStrategy==null?new FillResolutionStrategy():config.resolutionStrategy); input = AndroidInputFactory.newAndroidInput(this, this.getService...
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++; } ...
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++; } ...
public static void main (String[] argv) { // this is only here for me to debug native code faster new SharedLibraryLoader("../../extensions/gdx-audio/libs/gdx-audio-natives.jar").load("gdx-audio"); new SharedLibraryLoader("../../extensions/gdx-image/libs/gdx-image-natives.jar").load("gdx-image"); new SharedLib...
public static void main (String[] argv) { // this is only here for me to debug native code faster new SharedLibraryLoader("../../extensions/gdx-audio/libs/gdx-audio-natives.jar").load("gdx-audio"); new SharedLibraryLoader("../../extensions/gdx-image/libs/gdx-image-natives.jar").load("gdx-image"); new SharedLib...
private static void formatFollow(Event event, StyledText main, StyledText details) { main.bold(event.getActor().getLogin()); main.append(" started following "); main.append(((FollowPayload) event.getPayload()).getTarget().getLogin()); }
private static void formatFollow(Event event, StyledText main, StyledText details) { main.bold(event.getActor().getLogin()); main.append(" started following "); main.bold(((FollowPayload) event.getPayload()).getTarget().getLogin()); }
public String mappingType(String dynamicType) { return mapping.containsKey("type") ? mapping.get("type").toString() : dynamicType; }
public String mappingType(String dynamicType) { return mapping.containsKey("type") ? mapping.get("type").toString().replace("{dynamic_type}", dynamicType).replace("{dynamicType}", dynamicType) : dynamicType; }
public void error (String fileName, Class type, Throwable throwable); }
public void error (AssetDescriptor asset, Throwable throwable); }
private void handleTaskError (Throwable t) { log.error("Error loading asset.", t); if (tasks.isEmpty()) throw new GdxRuntimeException(t); // pop the faulty task from the stack AssetLoadingTask task = tasks.pop(); AssetDescriptor assetDesc = task.assetDesc; // remove all dependencies if (task.dependenc...
private void handleTaskError (Throwable t) { log.error("Error loading asset.", t); if (tasks.isEmpty()) throw new GdxRuntimeException(t); // pop the faulty task from the stack AssetLoadingTask task = tasks.pop(); AssetDescriptor assetDesc = task.assetDesc; // remove all dependencies if (task.dependenc...
public float[] getVertices () { if (dirty) { dirty = false; float[] vertices = this.vertices; float localX = -originX; float localY = -originY; float localX2 = localX + width; float localY2 = localY + height; float worldOriginX = this.x - localX; float worldOriginY = this.y - localY; if (...
public float[] getVertices () { if (dirty) { dirty = false; float[] vertices = this.vertices; float localX = -originX; float localY = -originY; float localX2 = localX + width; float localY2 = localY + height; float worldOriginX = this.x - localX; float worldOriginY = this.y - localY; if (...
private void writeImages (File packFile, Array<Page> pages) { File packDir = packFile.getParentFile(); String imageName = packFile.getName(); int dotIndex = imageName.indexOf('.'); if (dotIndex != -1) imageName = imageName.substring(0, dotIndex); int fileIndex = 0; for (Page page : pages) { int width =...
private void writeImages (File packFile, Array<Page> pages) { File packDir = packFile.getParentFile(); String imageName = packFile.getName(); int dotIndex = imageName.lastIndexOf('.'); if (dotIndex != -1) imageName = imageName.substring(0, dotIndex); int fileIndex = 0; for (Page page : pages) { int wid...
@Inject public OsService(Settings settings, OsProbe probe) { super(settings); this.probe = probe; this.refreshInterval = componentSettings.getAsTime("refresh_interval", TimeValue.timeValueSeconds(5)); this.info = probe.osInfo(); this.info.refreshInterval = refreshInterval.m...
@Inject public OsService(Settings settings, OsProbe probe) { super(settings); this.probe = probe; this.refreshInterval = componentSettings.getAsTime("refresh_interval", TimeValue.timeValueSeconds(1)); this.info = probe.osInfo(); this.info.refreshInterval = refreshInterval.m...
@Inject public ProcessService(Settings settings, ProcessProbe probe) { super(settings); this.probe = probe; this.refreshInterval = componentSettings.getAsTime("refresh_interval", TimeValue.timeValueSeconds(5)); this.info = probe.processInfo(); this.info.refreshInterval = re...
@Inject public ProcessService(Settings settings, ProcessProbe probe) { super(settings); this.probe = probe; this.refreshInterval = componentSettings.getAsTime("refresh_interval", TimeValue.timeValueSeconds(1)); this.info = probe.processInfo(); this.info.refreshInterval = re...
@Override protected String transportAction() { return TransportActions.Admin.Indices.CLOSE; }
@Override protected String transportAction() { return TransportActions.Admin.Indices.EXISTS; }
protected void configure() { bind(MergeSchedulerProvider.class) .to(settings.getAsClass(TYPE, ConcurrentMergeSchedulerProvider.class, "org.elasticsearch.index.scheduler.", "MergeSchedulerProvider")) .asEagerSingleton();
protected void configure() { bind(MergeSchedulerProvider.class) .to(settings.getAsClass(TYPE, ConcurrentMergeSchedulerProvider.class, "org.elasticsearch.index.merge.scheduler.", "MergeSchedulerProvider")) .asEagerSingleton();
protected void renderWorld () { softBody.getVertices(mesh.getVerticesBuffer(), softBody.getNodeCount(), mesh.getVertexSize(), 0); softBody.getWorldTransform(instance.transform); modelBatch.begin(camera); world.render(modelBatch, lights); modelBatch.render(lights, instance); modelBatch.end(); }
protected void renderWorld () { softBody.getVertices(mesh.getVerticesBuffer(), softBody.getNodeCount(), mesh.getVertexSize(), 0); softBody.getWorldTransform(instance.transform); modelBatch.begin(camera); world.render(modelBatch, lights); modelBatch.render(instance, lights); modelBatch.end(); }
public void render () { if ((dbgTimer += Gdx.graphics.getDeltaTime()) >= 1f) { dbgTimer -= 1f; // Gdx.app.log("Test", "FPS: "+Gdx.graphics.getFramesPerSecond()+", binds: "+exclusiveTextures.getBindCount()+", reused: "+exclusiveTextures.getReuseCount()); // exclusiveTextures.resetCounts(); } GL20 gl = Gd...
public void render () { if ((dbgTimer += Gdx.graphics.getDeltaTime()) >= 1f) { dbgTimer -= 1f; // Gdx.app.log("Test", "FPS: "+Gdx.graphics.getFramesPerSecond()+", binds: "+exclusiveTextures.getBindCount()+", reused: "+exclusiveTextures.getReuseCount()); // exclusiveTextures.resetCounts(); } GL20 gl = Gd...
public void render () { Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); cam.update(); shapeRenderer.setProjectionMatrix(cam.combined); shapeRenderer.begin(ShapeType.Line); shapeRenderer.setColor(Color.RED); ...
public void render () { Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); cam.update(); shapeRenderer.setProjectionMatrix(cam.combined); shapeRenderer.begin(ShapeType.Line); shapeRenderer.setColor(Color.RED); ...
@Override public RecoveryResponse newInstance() { return new RecoveryResponse(); } }).txGet(); if (shard.state() == IndexShardState.CLOSED) { listener.onIgnoreRecovery(false, "shard closed, stop recovery"); retur...
@Override public RecoveryResponse newInstance() { return new RecoveryResponse(); } }).txGet(); if (shard.state() == IndexShardState.CLOSED) { listener.onIgnoreRecovery(false, "shard closed, stop recovery"); retur...
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Object item = parent.getItemAtPosition(position); if (item instanceof GistFile) startActivity(ViewGistFileActivity.createIntent(gist, (GistFile) item)); }
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Object item = parent.getItemAtPosition(position); if (item instanceof GistFile) startActivity(ViewGistFilesActivity.createIntent(gist, position - 1)); }
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...
@Inject public ThreadPool(Settings settings) { super(settings); Map<String, Settings> groupSettings = settings.getGroups("threadpool"); Map<String, Executor> executors = Maps.newHashMap(); executors.put(Names.CACHED, build(Names.CACHED, "cached", groupSettings.get(Names.CACHED), se...
@Inject public ThreadPool(Settings settings) { super(settings); Map<String, Settings> groupSettings = settings.getGroups("threadpool"); Map<String, Executor> executors = Maps.newHashMap(); executors.put(Names.CACHED, build(Names.CACHED, "cached", groupSettings.get(Names.CACHED), se...
public void initialize (ApplicationListener listener, AndroidApplicationConfiguration config) { graphics = new AndroidGraphics(this, config, config.resolutionStrategy == null ? new FillResolutionStrategy() : config.resolutionStrategy); input = new AndroidInput(this, graphics.view, config); audio = new Android...
public void initialize (ApplicationListener listener, AndroidApplicationConfiguration config) { graphics = new AndroidGraphics(this, config, config.resolutionStrategy == null ? new FillResolutionStrategy() : config.resolutionStrategy); input = new AndroidInput(this, graphics.view, config); audio = new Android...
public void fieldMappers(Iterable<FieldMapper> fieldMappers) { for (FieldMapper mapper : fieldMappers) { fieldMapper(mapper); } } }
public void fieldMappers(List<FieldMapper> fieldMappers) { for (FieldMapper mapper : fieldMappers) { fieldMapper(mapper); } } }
public void postParse(ParseContext context) throws IOException { Analyzer analyzer = context.docMapper().mappers().indexAnalyzer(); if (path != null) { String value = null; List<IndexableField> fields = context.doc().getFields(); for (int i = 0, fieldsSize = field...
public void postParse(ParseContext context) throws IOException { Analyzer analyzer = context.docMapper().mappers().indexAnalyzer(); if (path != null) { String value = null; List<IndexableField> fields = context.doc().getFields(); for (int i = 0, fieldsSize = field...
private CharSequence formatDelete(Event event) { SpannableStringBuilder builder = new SpannableStringBuilder(); builder.append(event.getActor().getLogin()); builder.setSpan(new StyleSpan(BOLD), 0, builder.length(), SPAN_EXCLUSIVE_EXCLUSIVE); DeletePayload payload = (DeletePayload) ...
private CharSequence formatDelete(Event event) { SpannableStringBuilder builder = new SpannableStringBuilder(); builder.append(event.getActor().getLogin()); builder.setSpan(new StyleSpan(BOLD), 0, builder.length(), SPAN_EXCLUSIVE_EXCLUSIVE); DeletePayload payload = (DeletePayload) ...
private void checkCapacity(int len) { if(len> bits.length) { long[] newBits = new long[len+1]; System.arraycopy(bits, 0, newBits, 0, bits.length); bits = newBits; } }
private void checkCapacity(int len) { if(len>=bits.length) { long[] newBits = new long[len+1]; System.arraycopy(bits, 0, newBits, 0, bits.length); bits = newBits; } }
@Inject public NettyHttpServerTransport(Settings settings) { super(settings); SizeValue maxContentLength = componentSettings.getAsSize("max_content_length", new SizeValue(100, SizeUnit.MB)); this.workerCount = componentSettings.getAsInt("worker_count", Runtime.getRuntime().availableProcessor...
@Inject public NettyHttpServerTransport(Settings settings) { super(settings); SizeValue maxContentLength = componentSettings.getAsSize("max_content_length", new SizeValue(100, SizeUnit.MB)); this.workerCount = componentSettings.getAsInt("worker_count", Runtime.getRuntime().availableProcessor...
public BitmapFontCache (BitmapFont font) { this.font = font; }
public BitmapFontCache (BitmapFont font) { this(font, true); }
public void setEnvironment (String name) { if (name == null) return; if (cubemap != null) { cubemap.dispose(); cubemap = null; } if (name.equals("<none>")) { if (lights.has(CubemapAttribute.EnvironmentMap)) { lights.remove(CubemapAttribute.EnvironmentMap); shaderProvider.clear(); } } else...
public void setEnvironment (String name) { if (name == null) return; if (cubemap != null) { cubemap.dispose(); cubemap = null; } if (name.equals("<none>")) { if (lights.has(CubemapAttribute.EnvironmentMap)) { lights.remove(CubemapAttribute.EnvironmentMap); shaderProvider.clear(); } } else...
public static final List<Class<? extends GdxTest>> tests = new ArrayList<Class<? extends GdxTest>>(Arrays.asList( AnimationTest.class, AccelerometerTest.class, ActionTest.class, ActionSequenceTest.class, LetterBoxTest3.class, GroupTest.class, AlphaTest.class, AtlasIssueTest.class, AssetManagerTest.class, FilterPer...
public static final List<Class<? extends GdxTest>> tests = new ArrayList<Class<? extends GdxTest>>(Arrays.asList( AnimationTest.class, AccelerometerTest.class, ActionTest.class, ActionSequenceTest.class, LetterBoxTest3.class, GroupTest.class, AlphaTest.class, AtlasIssueTest.class, AssetManagerTest.class, FilterPer...
public SearchLookup lookup() { SearchContext current = SearchContext.current(); if (current != null) { return current.lookup(); } if (lookup == null) { lookup = new SearchLookup(mapperService(), indexCache().fieldData()); } return lookup; }...
public SearchLookup lookup() { SearchContext current = SearchContext.current(); if (current != null) { return current.lookup(); } if (lookup == null) { lookup = new SearchLookup(mapperService(), indexCache().fieldData(), null); } return lookup;...
public SearchScript search(MapperService mapperService, FieldDataCache fieldDataCache, String lang, String script, @Nullable Map<String, Object> vars) { return search(compile(lang, script), new SearchLookup(mapperService, fieldDataCache), vars); }
public SearchScript search(MapperService mapperService, FieldDataCache fieldDataCache, String lang, String script, @Nullable Map<String, Object> vars) { return search(compile(lang, script), new SearchLookup(mapperService, fieldDataCache, null), vars); }
public float getTotalHeight () { return getTopHeight() + getBottomHeight() + patches[MIDDLE_LEFT].getRegionHeight(); }
public float getTotalHeight () { return getTopHeight() + getBottomHeight() + patches[MIDDLE_CENTER].getRegionHeight(); }
public static void main( String[] argv ) { new JoglApplication( new com.badlogic.gdx.tests.VertexBufferObjectShaderTest(), "Debug Test", 480, 320, true ); }
public static void main( String[] argv ) { new JoglApplication( new com.badlogic.gdx.tests.MeshTest(), "Debug Test", 480, 320, false ); }
protected GroupShardsIterator shards(ValidateRequest request, String[] concreteIndices, ClusterState clusterState) { // Hard-code routing to limit request to a single shard. Map<String, Set<String>> routingMap = clusterState.metaData().resolveSearchRouting("0", request.indices()); return clu...
protected GroupShardsIterator shards(ValidateRequest request, String[] concreteIndices, ClusterState clusterState) { // Hard-code routing to limit request to a single shard. Map<String, Set<String>> routingMap = clusterState.metaData().resolveSearchRouting("0", request.indices()); return clu...
public static final List<Class<? extends GdxTest>> tests = new ArrayList<Class<? extends GdxTest>>(Arrays.asList( AnimationTest.class, AccelerometerTest.class, ActionTest.class, ActionSequenceTest.class, GroupTest.class, AlphaTest.class, AtlasIssueTest.class, AssetManagerTest.class, FilterPerformanceTest.class, ...
public static final List<Class<? extends GdxTest>> tests = new ArrayList<Class<? extends GdxTest>>(Arrays.asList( AnimationTest.class, AccelerometerTest.class, ActionTest.class, ActionSequenceTest.class, GroupTest.class, AlphaTest.class, AtlasIssueTest.class, AssetManagerTest.class, FilterPerformanceTest.class, ...
public void exit (InputEvent event, float x, float y, int pointer, Actor toActor) { super.exit(event, x, y, pointer, toActor); if (toActor == null || !toActor.isDescendant(Tree.this)) setOverNode(null); } }); }
public void exit (InputEvent event, float x, float y, int pointer, Actor toActor) { super.exit(event, x, y, pointer, toActor); if (toActor == null || !toActor.isDescendantOf(Tree.this)) setOverNode(null); } }); }
public boolean isOver (Actor actor, float x, float y) { Actor hit = actor.hit(x, y, true); if (hit == null || !hit.isDescendant(actor)) { if (touchDownX == -1 && touchDownY == -1) return false; return Math.abs(x - touchDownX) < tapSquareSize && Math.abs(y - touchDownY) < tapSquareSize; } return true; }
public boolean isOver (Actor actor, float x, float y) { Actor hit = actor.hit(x, y, true); if (hit == null || !hit.isDescendantOf(actor)) { if (touchDownX == -1 && touchDownY == -1) return false; return Math.abs(x - touchDownX) < tapSquareSize && Math.abs(y - touchDownY) < tapSquareSize; } return true; ...
public void build (String outputDir, String appName, String packageName, String mainClass) { Project project = new Project(); String packageDir = packageName.replace('.', '/'); // root dir/gradle files project.files.add(new ProjectFile("build.gradle", true)); project.files.add(new ProjectFile("settings.g...
public void build (String outputDir, String appName, String packageName, String mainClass) { Project project = new Project(); String packageDir = packageName.replace('.', '/'); // root dir/gradle files project.files.add(new ProjectFile("build.gradle", true)); project.files.add(new ProjectFile("settings.g...
public void updateViewFor(final Comment comment) { bodyViewer.setHtml(comment.getBodyHtml()); authorView.setText(comment.getUser().getLogin()); dateView.setText(Time.relativeTimeFor(comment.getUpdatedAt())); avatarView.setBackgroundDrawable(null); avatarHelper.bind(avatarView...
public void updateViewFor(final Comment comment) { bodyViewer.setHtml(comment.getBodyHtml()); authorView.setText(comment.getUser().getLogin()); dateView.setText(Time.relativeTimeFor(comment.getUpdatedAt())); avatarView.setImageDrawable(null); avatarHelper.bind(avatarView, com...
private boolean updateParticle (int index, float delta, int deltaMillis) { Particle particle = particles[index]; int life = particle.currentLife - deltaMillis; if (life <= 0) return false; particle.currentLife = life; float percent = 1 - particle.currentLife / (float)particle.life; int updateFlags = this....
private boolean updateParticle (int index, float delta, int deltaMillis) { Particle particle = particles[index]; int life = particle.currentLife - deltaMillis; if (life <= 0) return false; particle.currentLife = life; float percent = 1 - particle.currentLife / (float)particle.life; int updateFlags = this....
public IOSApplication (ApplicationListener listener, IOSApplicationConfiguration config) { this.listener = listener; this.config = config; } final boolean didFinishLaunching (UIApplication uiApp, NSDictionary options) { Gdx.app = this; this.uiApp = uiApp; // enable or disable screen dimming UIApplicat...
public IOSApplication (ApplicationListener listener, IOSApplicationConfiguration config) { this.listener = listener; this.config = config; } final boolean didFinishLaunching (UIApplication uiApp, NSDictionary options) { Gdx.app = this; this.uiApp = uiApp; // enable or disable screen dimming UIApplicat...
@Inject public ByteBufferCache(Settings settings) { super(settings); this.bufferSizeInBytes = (int) componentSettings.getAsBytesSize("buffer_size", new ByteSizeValue(100, ByteSizeUnit.KB)).bytes(); long cacheSizeInBytes = componentSettings.getAsBytesSize("cache_size", new ByteSizeValue(20, ...
@Inject public ByteBufferCache(Settings settings) { super(settings); this.bufferSizeInBytes = (int) componentSettings.getAsBytesSize("buffer_size", new ByteSizeValue(100, ByteSizeUnit.KB)).bytes(); long cacheSizeInBytes = componentSettings.getAsBytesSize("cache_size", new ByteSizeValue(200,...
public ClusterState execute(ClusterState currentState) throws Exception { boolean indexCreated = false; String failureReason = null; try { validate(request, currentState); for (Alias alias : request.aliases()) { ...
public ClusterState execute(ClusterState currentState) throws Exception { boolean indexCreated = false; String failureReason = null; try { validate(request, currentState); for (Alias alias : request.aliases()) { ...
public CharSequence getPageTitle(int position) { switch (position) { case 0: return resources.getString(string.dashboard_watched); case 1: return resources.getString(string.dashboard_assigned); case 2: return resources.getString(string.dashboard_cr...
public CharSequence getPageTitle(final int position) { switch (position) { case 0: return resources.getString(string.dashboard_watched); case 1: return resources.getString(string.dashboard_assigned); case 2: return resources.getString(string.dashbo...
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 static void main( String[] argv ) { new JoglApplication( new com.badlogic.gdx.tests.IsometricTileTest(), "Debug Test", 960, 640, false ); }
public static void main( String[] argv ) { new JoglApplication( new com.badlogic.gdx.tests.OrthoCamTest(), "Debug Test", 600, 320, false ); }
@Override public String toString() { return "ping_response target [" + target + "], master [" + master + "]"; }
@Override public String toString() { return "ping_response{target [" + target + "], master [" + master + "], cluster_name[" + clusterName.value() + "]}"; }
public static final String TRANSLOG_ID_KEY = "translog_id"; void updateBuffer(ByteSizeValue bufferSize); void closeWithDelete(); /** * Returns the id of the current transaction log. */ long currentId(); /** * Returns the number of operations in the transaction log. */ ...
public static final String TRANSLOG_ID_KEY = "translog_id"; void updateBuffer(ByteSizeValue bufferSize); void closeWithDelete(); /** * Returns the id of the current transaction log. */ long currentId(); /** * Returns the number of operations in the transaction log. */ ...
public static Type fromString(String type) throws ElasticsearchIllegalArgumentException { if (SIMPLE.name().equalsIgnoreCase(type)) { return SIMPLE; } else if (BUFFERED.name().equalsIgnoreCase(type)) { return BUFFERED; } throw new E...
public static Type fromString(String type) throws ElasticsearchIllegalArgumentException { if (SIMPLE.name().equalsIgnoreCase(type)) { return SIMPLE; } else if (BUFFERED.name().equalsIgnoreCase(type)) { return BUFFERED; } throw new E...
public static void main (String[] argv) { LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); new LwjglApplication(new com.badlogic.gdx.tests.InputTest(), config); }
public static void main (String[] argv) { LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); new LwjglApplication(new com.badlogic.gdx.tests.IntegerBitmapFontTest(), config); }
public void run () { graphics.setVSync(graphics.config.vSyncEnabled); LwjglApplication.this.mainLoop(); } }; mainLoopThread.start(); } void mainLoop () { try { graphics.setupDisplay(); } catch (LWJGLException e) { throw new GdxRuntimeException(e); } listener.create(); listener.resi...
public void run () { graphics.setVSync(graphics.config.vSyncEnabled); LwjglApplication.this.mainLoop(); } }; mainLoopThread.start(); } void mainLoop () { try { graphics.setupDisplay(); } catch (LWJGLException e) { throw new GdxRuntimeException(e); } listener.create(); listener.resi...
protected float update(float delta) { if (loopCount != 0 && animation != null) { final float diff = speed * delta; time += diff; int loops = (int)Math.abs(time / duration); if (time < 0f) { loops++; while (time < 0f) time += duration; } time = Math.abs(time % duration); ...
protected float update(float delta) { if (loopCount != 0 && animation != null) { final float diff = speed * delta; time += diff; int loops = (int)Math.abs(time / duration); if (time < 0f) { loops++; while (time < 0f) time += duration; } time = Math.abs(time % duration); ...
@Override public int compareBottom(int doc) { return bottom - currentFieldData.shortValue(doc); }
@Override public int compareBottom(int doc) { return bottom - currentFieldData.byteValue(doc); }
public void create () { Settings.load(); Assets.load(); setScreen(new GameScreen(this)); fps = new FPSLogger(); }
public void create () { Settings.load(); Assets.load(); setScreen(new MainMenuScreen(this)); fps = new FPSLogger(); }
public int skip(int count) { int total = count = Math.min(available, count); available -= total; readPosition = (readPosition + total) % buffer.length; return total; }
public int skip(int count) { int total = Math.min(available, count); available -= total; readPosition = (readPosition + total) % buffer.length; return total; }
private ArgumentType getArgumentType (Parameter parameter) { String[] typeTokens = parameter.getType().toString().split("\\."); String type = typeTokens[typeTokens.length - 1]; int arrayDim = 0; for (int i = 0; i < type.length(); i++) { if (type.charAt(i) == '[') arrayDim++; } type = type.replace("[", "...
private ArgumentType getArgumentType (Parameter parameter) { String[] typeTokens = parameter.getType().toString().split("\\."); String type = typeTokens[typeTokens.length - 1]; int arrayDim = 0; for (int i = 0; i < type.length(); i++) { if (type.charAt(i) == '[') arrayDim++; } type = type.replace("[", "...
public Matrix4 setToLookAt (Vector3 position, Vector3 target, Vector3 up) { tmpVec.set(target).sub(position); setToLookAt(tmpVec, up); this.mul(tmpMat.setToTranslation(position.tmp().scl(-1))); return this; }
public Matrix4 setToLookAt (Vector3 position, Vector3 target, Vector3 up) { tmpVec.set(target).sub(position); setToLookAt(tmpVec, up); this.mul(tmpMat.setToTranslation(-position.x, -position.y, -position.z)); return this; }
public Settings (Settings settings) { fast = settings.fast; rotation = settings.rotation; pot = settings.pot; minWidth = settings.minWidth; minHeight = settings.minHeight; maxWidth = settings.maxWidth; maxHeight = settings.maxHeight; paddingX = settings.paddingX; paddingY = settings.padding...
public Settings (Settings settings) { fast = settings.fast; rotation = settings.rotation; pot = settings.pot; minWidth = settings.minWidth; minHeight = settings.minHeight; maxWidth = settings.maxWidth; maxHeight = settings.maxHeight; paddingX = settings.paddingX; paddingY = settings.padding...
public LwjglAppletTest () { super(new AnimationTest(), false); }
public LwjglAppletTest () { super(new AnimationTest()); }
public boolean accelerometerMoved (Controller controller, int accelerometerIndex, Vector3 value) { // not printing this as we get to many values return false; } }); } void print (String message) { String[] lines = console.getItems().toArray(); String[] newLines = new String[lines.length + 1]; S...
public boolean accelerometerMoved (Controller controller, int accelerometerIndex, Vector3 value) { // not printing this as we get to many values return false; } }); } void print (String message) { String[] lines = console.getItems().toArray(String.class); String[] newLines = new String[lines.leng...
public void writeTo(final StreamOutput out) throws IOException { out.writeVInt(termStatistics.size()); for (Map.Entry<Term, TermStatistics> termTermStatisticsEntry : termStatistics.entrySet()) { Term term = termTermStatisticsEntry.getKey(); out.writeString(term.field()); ...
public void writeTo(final StreamOutput out) throws IOException { out.writeVInt(termStatistics.size()); for (Map.Entry<Term, TermStatistics> termTermStatisticsEntry : termStatistics.entrySet()) { Term term = termTermStatisticsEntry.getKey(); out.writeString(term.field()); ...
private void build () { if (!Gdx.graphics.isGL20Available()) throw new GdxRuntimeException("GL2 is required."); GL20 gl = Gdx.graphics.getGL20(); // iOS uses a different framebuffer handle! (not necessarily 0) if (!defaultFramebufferHandleInitialized) { defaultFramebufferHandleInitialized = true; if ...
private void build () { if (!Gdx.graphics.isGL20Available()) throw new GdxRuntimeException("GL2 is required."); GL20 gl = Gdx.graphics.getGL20(); // iOS uses a different framebuffer handle! (not necessarily 0) if (!defaultFramebufferHandleInitialized) { defaultFramebufferHandleInitialized = true; if ...
protected NumericTokenizer(Reader reader, NumericTokenStream numericTokenStream, char[] buffer, Object extra) throws IOException { super(numericTokenStream, reader); this.numericTokenStream = numericTokenStream; this.extra = extra; this.buffer = buffer; }
protected NumericTokenizer(Reader reader, NumericTokenStream numericTokenStream, char[] buffer, Object extra) throws IOException { super(reader); this.numericTokenStream = numericTokenStream; this.extra = extra; this.buffer = buffer; }
public int compare(TextFragment o1, TextFragment o2) { return Math.round(o2.getScore() - o1.getScore()); } }); } String[] fragments = null; // numbe...
public int compare(TextFragment o1, TextFragment o2) { return Math.round(o2.getScore() - o1.getScore()); } }); } String[] fragments = null; // numbe...
public void create () { modelBatch = new ModelBatch(); lights = new Lights(); lights.ambientLight.set(0.4f, 0.4f, 0.4f, 1f); lights.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -1f, 0f)); cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.position.set(10f, 1...
public void create () { modelBatch = new ModelBatch(); lights = new Lights(); lights.ambientLight.set(0.4f, 0.4f, 0.4f, 1f); lights.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f)); cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.position.set(1...
public DirectionalShadowLight (int shadowMapWidth, int shadowMapHeight, float shadowViewportWidth, float shadowViewportHeight, float shadowNear, float shadowFar) { fbo = new FrameBuffer(Format.RGBA8888, shadowMapWidth, shadowMapHeight, true); cam = new OrthographicCamera(shadowViewportWidth, shadowViewportHeight...
public DirectionalShadowLight (int shadowMapWidth, int shadowMapHeight, float shadowViewportWidth, float shadowViewportHeight, float shadowNear, float shadowFar) { fbo = new FrameBuffer(Format.RGBA8888, shadowMapWidth, shadowMapHeight, true); cam = new OrthographicCamera(shadowViewportWidth, shadowViewportHeight...
public float getScrollWidth () { return areaWidth; }
public float getScrollWidth () { return areaHeight; }
public static final FormatDateTimeFormatter[] DATE_TIME_FORMATTERS = new FormatDateTimeFormatter[]{ DateFieldMapper.Defaults.DATE_TIME_FORMATTER, Joda.forPattern("yyyy/MM/dd HH:mm:ss||yyyy/MM/dd") };
public static final FormatDateTimeFormatter[] DATE_TIME_FORMATTERS = new FormatDateTimeFormatter[]{ DateFieldMapper.Defaults.DATE_TIME_FORMATTER, Joda.forPattern("yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z") };
@Override public void toJson(JsonBuilder builder, Params params) throws IOException { rootObjectMapper.toJson(builder, params, allFieldMapper); } }
@Override public void toJson(JsonBuilder builder, Params params) throws IOException { rootObjectMapper.toJson(builder, params, allFieldMapper, sourceFieldMapper); } }
public void render () { GL20 gl = Gdx.gl20; gl.glClearColor(0.7f, 0.7f, 0.7f, 1); gl.glClear(GL20.GL_COLOR_BUFFER_BIT); if (wait > 0) wait -= Gdx.graphics.getDeltaTime(); else { t += speed * Gdx.graphics.getDeltaTime(); zt += zspeed * Gdx.graphics.getDeltaTime(); while (t >= 1f) { currentPat...
public void render () { GL20 gl = Gdx.graphics.getGL20(); gl.glClearColor(0.7f, 0.7f, 0.7f, 1); gl.glClear(GL20.GL_COLOR_BUFFER_BIT); if (wait > 0) wait -= Gdx.graphics.getDeltaTime(); else { t += speed * Gdx.graphics.getDeltaTime(); zt += zspeed * Gdx.graphics.getDeltaTime(); while (t >= 1f) { ...
public void render () { GL20 gl = Gdx.gl20; gl.glClearColor(0.7f, 0.7f, 0.7f, 1); gl.glClear(GL20.GL_COLOR_BUFFER_BIT); float begin = 0; float end = 0; float draw1 = 0; float draw2 = 0; float drawText = 0; long start = TimeUtils.nanoTime(); spriteBatch.begin(); begin = (TimeUtils.nanoTime() - s...
public void render () { GL20 gl = Gdx.graphics.getGL20(); gl.glClearColor(0.7f, 0.7f, 0.7f, 1); gl.glClear(GL20.GL_COLOR_BUFFER_BIT); float begin = 0; float end = 0; float draw1 = 0; float draw2 = 0; float drawText = 0; long start = TimeUtils.nanoTime(); spriteBatch.begin(); begin = (TimeUtils....
public static void main (String[] argv) { new AngleApplication(new com.badlogic.gdx.tests.VertexBufferObjectShaderTest(), "Angle Test", 480, 320, false); }
public static void main (String[] argv) { new AngleApplication(new com.badlogic.gdx.tests.MeshShaderTest(), "Angle Test", 480, 320, false); }
protected String models[] = new String[] { "car.obj", "cube.obj", "scene.obj", "scene2.obj", "sphere.obj", "wheel.obj", "g3d/head.g3db", "g3d/knight.g3dj", "g3d/knight.g3db", "g3d/ship.obj", "g3d/teapot.g3db" };
protected String models[] = new String[] { "car.obj", "cube.obj", "scene.obj", "scene2.obj", "sphere.obj", "wheel.obj", "g3d/head.g3db", "g3d/knight.g3dj", "g3d/knight.g3db", "g3d/teapot.g3db" };
public void insert (int index, short value) { if (index > size) throw new IndexOutOfBoundsException("index can't be > size: " + index + " > " + size); short[] items = this.items; if (size == items.length) items = resize(Math.max(8, (int)(size * 1.75f))); if (ordered) System.arraycopy(items, index, items, in...
public void insert (int index, short value) { if (index >= size) throw new IndexOutOfBoundsException("index can't be >= size: " + index + " >= " + size); short[] items = this.items; if (size == items.length) items = resize(Math.max(8, (int)(size * 1.75f))); if (ordered) System.arraycopy(items, index, items,...
private void loadLayer(TiledMap map, Element element) { if (element.getName().equals("Layer")) { String id = element.getAttribute("Id"); String visible = element.getAttribute("Visible"); Element dimensions = element.getChildByName("Dimensions"); String layerSize = dimensions.getAttribute("LayerSize")...
private void loadLayer(TiledMap map, Element element) { if (element.getName().equals("Layer")) { String id = element.getAttribute("Id"); String visible = element.getAttribute("Visible"); Element dimensions = element.getChildByName("Dimensions"); String layerSize = dimensions.getAttribute("LayerSize")...
public void render (int[] layers) { spriteBatch.begin(); for (int layerIdx : layers) { MapLayer layer = map.getLayers().get(layerIdx); if (layer.isVisible()) { if (layer instanceof TiledMapTileLayer) { renderTileLayer((TiledMapTileLayer) layer); } else { for (MapObject object : layer.getObj...
public void render (int[] layers) { spriteBatch.begin(); for (int layerIdx : layers) { MapLayer layer = map.getLayers().getLayer(layerIdx); if (layer.isVisible()) { if (layer instanceof TiledMapTileLayer) { renderTileLayer((TiledMapTileLayer) layer); } else { for (MapObject object : layer.g...
public void create() { float w = Gdx.graphics.getWidth(); float h = Gdx.graphics.getHeight(); camera = new OrthographicCamera(); camera.setToOrtho(false, (w / h) * 320, 320); camera.update(); cameraController = new OrthoCamController(camera); Gdx.input.setInputProcessor(cameraController); fon...
public void create() { float w = Gdx.graphics.getWidth(); float h = Gdx.graphics.getHeight(); camera = new OrthographicCamera(); camera.setToOrtho(false, (w / h) * 320, 320); camera.update(); cameraController = new OrthoCamController(camera); Gdx.input.setInputProcessor(cameraController); fon...
public static final List<Class<? extends GdxTest>> tests = new ArrayList<Class<? extends GdxTest>>(Arrays.asList( AnimationTest.class, AccelerometerTest.class, ActionTest.class, ActionSequenceTest.class, GroupTest.class, AlphaTest.class, AtlasIssueTest.class, AssetManagerTest.class, FilterPerformanceTest.class, ...
public static final List<Class<? extends GdxTest>> tests = new ArrayList<Class<? extends GdxTest>>(Arrays.asList( AnimationTest.class, AccelerometerTest.class, ActionTest.class, ActionSequenceTest.class, GroupTest.class, AlphaTest.class, AtlasIssueTest.class, AssetManagerTest.class, FilterPerformanceTest.class, ...
public static final List<Class<? extends GdxTest>> tests = new ArrayList<Class<? extends GdxTest>>(Arrays.asList( AnimationTest.class, AccelerometerTest.class, ActionTest.class, ActionSequenceTest.class, GroupTest.class, AlphaTest.class, AtlasIssueTest.class, AssetManagerTest.class, FilterPerformanceTest.class, ...
public static final List<Class<? extends GdxTest>> tests = new ArrayList<Class<? extends GdxTest>>(Arrays.asList( AnimationTest.class, AccelerometerTest.class, ActionTest.class, ActionSequenceTest.class, GroupTest.class, AlphaTest.class, AtlasIssueTest.class, AssetManagerTest.class, FilterPerformanceTest.class, ...
public Ray getPickRay (float screenX, float screenY) { return camera.getPickRay(screenX, screenY, screenX, screenY, screenWidth, screenHeight); }
public Ray getPickRay (float screenX, float screenY) { return camera.getPickRay(screenX, screenY, this.screenX, this.screenY, screenWidth, screenHeight); }
public TokenStream create(TokenStream tokenStream) { if ("arabic".equalsIgnoreCase(language)) { return new ArabicStemFilter(tokenStream); } else if ("armenian".equalsIgnoreCase(language)) { return new SnowballFilter(tokenStream, new ArmenianStemmer()); } else if ("bas...
public TokenStream create(TokenStream tokenStream) { if ("arabic".equalsIgnoreCase(language)) { return new ArabicStemFilter(tokenStream); } else if ("armenian".equalsIgnoreCase(language)) { return new SnowballFilter(tokenStream, new ArmenianStemmer()); } else if ("bas...
public void testNodeNotReachableFromMaster() throws Exception { startCluster(3); String masterNode = internalCluster().getMasterName(); String nonMasterNode = null; while (nonMasterNode == null) { nonMasterNode = randomFrom(internalCluster().getNodeNames()); ...
public void testNodeNotReachableFromMaster() throws Exception { startCluster(3); String masterNode = internalCluster().getMasterName(); String nonMasterNode = null; while (nonMasterNode == null) { nonMasterNode = randomFrom(internalCluster().getNodeNames()); ...
public static KeyframedModel loadKeyframedModel(InputStream stream) { BufferedReader in = new BufferedReader(new InputStreamReader(stream)); lineNum = 1; try { String version = readString(in); if(!version.equals("g3dt-keyframed-1.0")) throw new GdxRuntimeException("incorrect version"); int numMeshes ...
public static KeyframedModel loadKeyframedModel(InputStream stream) { BufferedReader in = new BufferedReader(new InputStreamReader(stream)); lineNum = 1; try { String version = readString(in); if(!version.equals("g3dt-keyframed-1.0")) throw new GdxRuntimeException("incorrect version"); int numMeshes ...
private KeyframedModel buildModel (MD2Header header, MD2Triangle[] triangles, float[] texCoords, MD2Frame[] frames) { ArrayList<VertexIndices> vertCombos = new ArrayList<VertexIndices>(); short[] indices = new short[triangles.length * 3]; int idx = 0; short vertIdx = 0; for (int i = 0; i < triangles.length; ...
private KeyframedModel buildModel (MD2Header header, MD2Triangle[] triangles, float[] texCoords, MD2Frame[] frames) { ArrayList<VertexIndices> vertCombos = new ArrayList<VertexIndices>(); short[] indices = new short[triangles.length * 3]; int idx = 0; short vertIdx = 0; for (int i = 0; i < triangles.length; ...
@Override public void render () { Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1); Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); Gdx.gl.glEnable(GL10.GL_DEPTH_TEST); Gdx.gl.glEnable(GL10.GL_TEXTURE_2D); Gdx.gl.glEnable(GL10.GL_LIGHTING); Gdx.gl.glEnable(GL10.GL_COLOR_MATERIAL); cam.u...
@Override public void render () { Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1); Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); Gdx.gl.glEnable(GL10.GL_DEPTH_TEST); Gdx.gl.glEnable(GL10.GL_TEXTURE_2D); Gdx.gl.glEnable(GL10.GL_LIGHTING); Gdx.gl.glEnable(GL10.GL_COLOR_MATERIAL); cam.u...
public static void assertNoFailures(BroadcastOperationResponse response) { assertThat("Unexpectd ShardFailures: " + Arrays.toString(response.getShardFailures()), response.getFailedShards(), equalTo(0)); assertVersionSerializable(response); }
public static void assertNoFailures(BroadcastOperationResponse response) { assertThat("Unexpected ShardFailures: " + Arrays.toString(response.getShardFailures()), response.getFailedShards(), equalTo(0)); assertVersionSerializable(response); }
public void testAddingParentToExistingMapping() throws ElasticsearchException, IOException { createIndex("test"); ensureGreen(); PutMappingResponse putMappingResponse = client().admin().indices().preparePutMapping("test").setType("child").setSource("number", "type=integer") ...
public void testAddingParentToExistingMapping() throws ElasticsearchException, IOException { createIndex("test"); ensureGreen(); PutMappingResponse putMappingResponse = client().admin().indices().preparePutMapping("test").setType("child").setSource("number", "type=integer") ...
@Override protected boolean touchUp (float x, float y, int pointer) { if (!touchable) return false; if (focusedActor != null) { point.x = x; point.y = y; focusedActor[pointer].toLocalCoordinates(point); focusedActor[pointer].touchUp(point.x, point.y, pointer); return true; } int len = children...
@Override protected boolean touchUp (float x, float y, int pointer) { if (!touchable) return false; if (focusedActor[pointer] != null) { point.x = x; point.y = y; focusedActor[pointer].toLocalCoordinates(point); focusedActor[pointer].touchUp(point.x, point.y, pointer); return true; } int len =...
public static Bitmap roundCornersAndOverlayOnWhite(final Bitmap source, final int radius) { int width = source.getWidth(); int height = source.getHeight(); Paint paint = new Paint(); paint.setAntiAlias(true); paint.setColor(WHITE); Bitmap whiteRoundedRectangle = Bit...
public static Bitmap roundCornersAndOverlayOnWhite(final Bitmap source, final float radius) { int width = source.getWidth(); int height = source.getHeight(); Paint paint = new Paint(); paint.setAntiAlias(true); paint.setColor(WHITE); Bitmap whiteRoundedRectangle = B...
@Override public void doXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(TextQueryParser.NAME); builder.startObject(name); builder.field("text", text); if (type != null) { builder.field("type", type.toString().toLowerCase()); ...
@Override public void doXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject(TextQueryParser.NAME); builder.startObject(name); builder.field("query", text); if (type != null) { builder.field("type", type.toString().toLowerCase()); ...
public void testVectorHighlighter() throws Exception { Directory dir = new RAMDirectory(); IndexWriter indexWriter = new IndexWriter(dir, new IndexWriterConfig(Lucene.VERSION, Lucene.STANDARD_ANALYZER)); indexWriter.addDocument(doc().add(field("_id", "1")).add(field("content", "the big bad ...
public void testVectorHighlighter() throws Exception { Directory dir = new RAMDirectory(); IndexWriter indexWriter = new IndexWriter(dir, new IndexWriterConfig(Lucene.VERSION, Lucene.STANDARD_ANALYZER)); indexWriter.addDocument(doc().add(field("_id", "1")).add(field("content", "the big bad ...
public static long count(IndexSearcher searcher, Query query) throws IOException { TotalHitCountCollector countCollector = new TotalHitCountCollector(); // we don't need scores, so wrap it in a constant score query if (!(query instanceof ConstantScoreQuery)) { query = new Constan...
public static long count(IndexSearcher searcher, Query query) throws IOException { TotalHitCountCollector countCollector = new TotalHitCountCollector(); // we don't need scores, so wrap it in a constant score query if (!(query instanceof ConstantScoreQuery)) { query = new XLucene...
public Query termQuery(Object value, @Nullable QueryParseContext context) { if (fieldType.indexed() || context == null) { return super.termQuery(value, context); } // no need for constant score filter, since we don't cache the filter, and it always takes deletes into account ...
public Query termQuery(Object value, @Nullable QueryParseContext context) { if (fieldType.indexed() || context == null) { return super.termQuery(value, context); } // no need for constant score filter, since we don't cache the filter, and it always takes deletes into account ...
private ParsedQuery parse(QueryParseContext parseContext, XContentParser parser) throws IOException, QueryParsingException { parseContext.reset(parser); Query query = parseContext.parseInnerQuery(); if (query == null) { query = Queries.NO_MATCH_QUERY; }
private ParsedQuery parse(QueryParseContext parseContext, XContentParser parser) throws IOException, QueryParsingException { parseContext.reset(parser); Query query = parseContext.parseInnerQuery(); if (query == null) { query = Queries.newMatchNoDocsQuery(); }