buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public String buildText() {
reset();
FastCharArrayWriter writer = FastCharArrayWriter.Cached.cached();
for (Entry entry : entries) {
writer.append(entry.reader());
writer.append(' ');
}
| public String buildText() {
reset();
FastCharArrayWriter writer = new FastCharArrayWriter();
for (Entry entry : entries) {
writer.append(entry.reader());
writer.append(' ');
}
|
public static void clearReferencesThreadLocals() {
try {
Thread[] threads = getThreads();
// Make the fields in the Thread class that store ThreadLocals
// accessible
Field threadLocalsField = Thread.class.getDeclaredField("threadLocals");
threadLo... | public static void clearReferencesThreadLocals() {
try {
Thread[] threads = getThreads();
// Make the fields in the Thread class that store ThreadLocals
// accessible
Field threadLocalsField = Thread.class.getDeclaredField("threadLocals");
threadLo... |
public void moveToBackup() {
if (!primary) {
throw new IllegalShardRoutingStateException(this, "Already primary, can't move to backup");
}
primary = false;
}
}
| public void moveFromPrimary() {
if (!primary) {
throw new IllegalShardRoutingStateException(this, "Already primary, can't move to backup");
}
primary = false;
}
}
|
private boolean electPrimaries(RoutingNodes routingNodes) {
boolean changed = false;
for (MutableShardRouting shardEntry : routingNodes.unassigned()) {
if (shardEntry.primary() && !shardEntry.assignedToNode()) {
boolean elected = false;
// primary and not ... | private boolean electPrimaries(RoutingNodes routingNodes) {
boolean changed = false;
for (MutableShardRouting shardEntry : routingNodes.unassigned()) {
if (shardEntry.primary() && !shardEntry.assignedToNode()) {
boolean elected = false;
// primary and not ... |
public static void main (String[] argv) {
// if(argv.length != 1 && argv.length != 2) {
// System.out.println("KeyframedModelViewer <filename> ?<texture-filename>");
// System.exit(-1);
// }
new LwjglApplication(new SkeletonModelViewer("data/models/robot-mesh.xml", "data/models/robot.jpg"), "SkeletonModel Viewer", 8... | public static void main (String[] argv) {
// if(argv.length != 1 && argv.length != 2) {
// System.out.println("KeyframedModelViewer <filename> ?<texture-filename>");
// System.exit(-1);
// }
new LwjglApplication(new SkeletonModelViewer("data/robot-mesh.xml", "data/robot.jpg"), "SkeletonModel Viewer", 800, 480,
fa... |
public float apply (float a) {
return a * a * a * (a * (a * 6 - 15) + 10);
}
};
| public float apply (float a) {
return MathUtils.clamp(a * a * a * (a * (a * 6 - 15) + 10), 0, 1);
}
};
|
public void render () {
Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
if (Gdx.input.isTouched()) {
Vector2 stageCoords = Vector2.tmp;
stage.screenToStageCoordinates(stageCoords.set(Gdx.input... | public void render () {
Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 1);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
if (Gdx.input.isTouched()) {
Vector2 stageCoords = Vector2.tmp;
stage.screenToStageCoordinates(stageCoords.set(Gdx.input... |
@Override public void display (GLAutoDrawable arg0) {
synchronized (this) {
if (!paused) {
updateTimes();
synchronized (((JoglApplication)Gdx.app).runnables) {
List<Runnable> runnables = ((JoglApplication)Gdx.app).runnables;
for(int i = 0; i < runnables.size(); i++) {
runnables.get(i).run(... | @Override public void display (GLAutoDrawable arg0) {
synchronized (this) {
if (!paused) {
updateTimes();
synchronized (((JoglApplication)Gdx.app).runnables) {
List<Runnable> runnables = ((JoglApplication)Gdx.app).runnables;
for(int i = 0; i < runnables.size(); i++) {
runnables.get(i).run(... |
public static boolean isComplete(Repository repository) {
return repository.isFork() || repository.getForks() != 0;
}
| public static boolean isComplete(Repository repository) {
return repository.isFork() || repository.getForks() > 0;
}
|
@Override protected GroupShardsIterator shards(BroadcastPingRequest request, String[] concreteIndices, ClusterState clusterState) {
return clusterService.operationRouting().searchShards(clusterState, concreteIndices, request.queryHint(), null, null);
}
| @Override protected GroupShardsIterator shards(BroadcastPingRequest request, String[] concreteIndices, ClusterState clusterState) {
return clusterService.operationRouting().searchShards(clusterState, request.indices(), concreteIndices, request.queryHint(), null, null);
}
|
protected Settings nodeSettings(int nodeOrdinal) {
ImmutableSettings.Builder settingsBuilder = ImmutableSettings.settingsBuilder();
settingsBuilder.put(super.nodeSettings(nodeOrdinal));
try {
File directory = temporaryFolder.newFolder();
settingsBuilder.put("path.con... | protected Settings nodeSettings(int nodeOrdinal) {
ImmutableSettings.Builder settingsBuilder = ImmutableSettings.settingsBuilder();
settingsBuilder.put(super.nodeSettings(nodeOrdinal));
try {
File directory = temporaryFolder.newFolder();
settingsBuilder.put("path.con... |
public static void main (String[] argv) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
new LwjglApplication(new com.badlogic.gdx.tests.SpriteCacheTest(), config);
}
| public static void main (String[] argv) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
new LwjglApplication(new com.badlogic.gdx.tests.InputTest(), config);
}
|
@Test public void testParseToJsonAndParse() throws Exception {
String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/json/simple/test-mapping.json");
JsonDocumentMapper docMapper = (JsonDocumentMapper) new JsonDocumentMapperParser(new AnalysisService(new Index("test"))).parse(m... | @Test public void testParseToJsonAndParse() throws Exception {
String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/json/simple/test-mapping.json");
JsonDocumentMapper docMapper = (JsonDocumentMapper) new JsonDocumentMapperParser(new AnalysisService(new Index("test"))).parse(m... |
public void create () {
batch = new SpriteBatch();
camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
camera.position.set(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2, 0);
camera.update();
Pixmap pixmap1 = new Pixmap(Gdx.files.internal("data/badlogic.jpg"))... | public void create () {
batch = new SpriteBatch();
camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
camera.position.set(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2, 0);
camera.update();
Pixmap pixmap1 = new Pixmap(Gdx.files.internal("data/badlogic.jpg"))... |
public FieldComparator<BytesRef> setNextReader(AtomicReaderContext context) throws IOException {
docTerms = indexFieldData.load(context).getBytesValues();
if (docTerms.isMultiValued()) {
docTerms = new MultiValuedBytesWrapper(docTerms, sortMode);
}
return this;
}
| public FieldComparator<BytesRef> setNextReader(AtomicReaderContext context) throws IOException {
docTerms = indexFieldData.load(context).getBytesValues(false);
if (docTerms.isMultiValued()) {
docTerms = new MultiValuedBytesWrapper(docTerms, sortMode);
}
return this;
}... |
public Strings getScriptValues() {
return new ScriptDocValues.Strings(getBytesValues());
}
| public Strings getScriptValues() {
return new ScriptDocValues.Strings(getBytesValues(false));
}
|
public PercolateShardResponse doPercolate(PercolateShardRequest request, PercolateContext context) {
Engine.Searcher percolatorSearcher = context.indexShard().acquireSearcher("percolate");
try {
MatchAndSort matchAndSort = QueryCollector.matchAndSort(logger, context);
... | public PercolateShardResponse doPercolate(PercolateShardRequest request, PercolateContext context) {
Engine.Searcher percolatorSearcher = context.indexShard().acquireSearcher("percolate");
try {
MatchAndSort matchAndSort = QueryCollector.matchAndSort(logger, context);
... |
public void setNextReader(AtomicReaderContext context) throws IOException {
// we use the UID because id might not be indexed
values = idFieldData.load(context).getBytesValues();
if (facetCollector != null) {
facetCollector.setNextReader(context);
}
}
| public void setNextReader(AtomicReaderContext context) throws IOException {
// we use the UID because id might not be indexed
values = idFieldData.load(context).getBytesValues(true);
if (facetCollector != null) {
facetCollector.setNextReader(context);
}
}
|
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case id.refresh:
forceRefresh();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
| public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case id.m_refresh:
forceRefresh();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
|
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case id.apply:
String comment = commentText.getText().toString();
if (!TextUtils.isEmpty(comment))
createComment(comment);
return true;
default:
r... | public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case id.m_apply:
String comment = commentText.getText().toString();
if (!TextUtils.isEmpty(comment))
createComment(comment);
return true;
default:
... |
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case id.random_gist:
randomGist();
return true;
case android.R.id.home:
Intent intent = new Intent(this, HomeActivity.class);
intent.addFlags(FLAG_ACTIVITY_CLEAR_... | public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case id.m_random:
randomGist();
return true;
case android.R.id.home:
Intent intent = new Intent(this, HomeActivity.class);
intent.addFlags(FLAG_ACTIVITY_CLEAR_TOP... |
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case id.create_gist:
startActivityForResult(new Intent(getActivity(), CreateGistActivity.class), GIST_CREATE);
return true;
default:
return super.onOptionsItemSelected(item);... | public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case id.m_create:
startActivityForResult(new Intent(getActivity(), CreateGistActivity.class), GIST_CREATE);
return true;
default:
return super.onOptionsItemSelected(item);
... |
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
Intent intent = new Intent(this, GistsActivity.class);
intent.addFlags(FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
... | public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
Intent intent = new Intent(this, GistsActivity.class);
intent.addFlags(FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_SINGLE_TOP);
startActivity(intent);
... |
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case id.apply_filter:
Intent intent = new Intent();
intent.putExtra(EXTRA_ISSUE_FILTER, filter);
setResult(RESULT_OK, intent);
finish();
return true;
... | public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case id.m_apply:
Intent intent = new Intent();
intent.putExtra(EXTRA_ISSUE_FILTER, filter);
setResult(RESULT_OK, intent);
finish();
return true;
defau... |
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case id.search:
onSearchRequested();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
| public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case id.m_search:
onSearchRequested();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
|
public void testSignInIsDisabled() throws Throwable {
View loginMenu = view(id.login);
assertFalse(loginMenu.isEnabled());
final EditText login = editText(id.et_login);
final EditText password = editText(id.et_password);
focus(login);
send("loginname");
assertEquals("loginname", login.getText().toString(... | public void testSignInIsDisabled() throws Throwable {
View loginMenu = view(id.m_login);
assertFalse(loginMenu.isEnabled());
final EditText login = editText(id.et_login);
final EditText password = editText(id.et_password);
focus(login);
send("loginname");
assertEquals("loginname", login.getText().toStrin... |
public static void main (String[] argv) {
new AngleApplication(new com.badlogic.gdx.tests.gles2.SimpleVertexShader(), "Angle Test", 480, 320, true);
}
| public static void main (String[] argv) {
new AngleApplication(new com.badlogic.gdx.tests.InputTest(), "Angle Test", 480, 320, false);
}
|
package com.badlogic.gdx.backends.android;
/*
* Copyright 2013 Jaroslaw Wisniewski <j.wisniewski@appsisle.com>
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org... | package com.badlogic.gdx.backends.android;
/*
* Copyright 2013 Jaroslaw Wisniewski <j.wisniewski@appsisle.com>
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org... |
public Vector3 getCenter (Vector3 out) {
return out.set(cnt);
}
| public Vector3 getCenter (Vector3 out) {
return cnt;
}
|
public void fieldMappers(FieldMapper... fieldMappers) {
for (FieldMapper mapper : fieldMappers) {
fieldMapper(mapper);
}
}
} | public void fieldMappers(Iterable<FieldMapper> fieldMappers) {
for (FieldMapper mapper : fieldMappers) {
fieldMapper(mapper);
}
}
} |
protected BoostFieldMapper(String name, String indexName, int precisionStep, float boost, FieldType fieldType, Boolean docValues, Float nullValue,
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider, @Nullable Settings fieldDataSettings, Settings indexSe... | protected BoostFieldMapper(String name, String indexName, int precisionStep, float boost, FieldType fieldType, Boolean docValues, Float nullValue,
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider, @Nullable Settings fieldDataSettings, Settings indexSe... |
protected TTLFieldMapper(FieldType fieldType, EnabledAttributeMapper enabled, long defaultTTL, Explicit<Boolean> ignoreMalformed,
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
@Nullable Settings fieldDataSettings, Settin... | protected TTLFieldMapper(FieldType fieldType, EnabledAttributeMapper enabled, long defaultTTL, Explicit<Boolean> ignoreMalformed,
PostingsFormatProvider postingsProvider, DocValuesFormatProvider docValuesProvider,
@Nullable Settings fieldDataSettings, Settin... |
public Mesh end() {
if (this.attributes == null)
throw new RuntimeException("Call begin() first");
endpart();
final Mesh mesh = new Mesh(true, vertices.size / stride, indices.size, attributes);
mesh.setVertices(vertices.items, 0, vertices.size);
mesh.setIndices(indices.items, 0, indices.size);
for... | public Mesh end() {
if (this.attributes == null)
throw new RuntimeException("Call begin() first");
endpart();
final Mesh mesh = new Mesh(true, vertices.size, indices.size, attributes);
mesh.setVertices(vertices.items, 0, vertices.size);
mesh.setIndices(indices.items, 0, indices.size);
for (MeshPar... |
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(layout.pager_with_title);
gist = store.getGist(gistId);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitl... | protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(layout.pager_with_title);
gist = store.getGist(gistId);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitl... |
public void create () {
stage = new Stage(0, 0, false);
font = new BitmapFont();
Gdx.input.setInputProcessor(stage);
Gdx.graphics.setVSync(false);
container = new Table();
stage.addActor(container);
container.getTableLayout().debug();
Table table = new Table();
FlickScrollPane scroll = new Flic... | public void create () {
stage = new Stage(0, 0, false);
font = new BitmapFont();
Gdx.input.setInputProcessor(stage);
Gdx.graphics.setVSync(false);
container = new Table();
stage.addActor(container);
container.getTableLayout().debug();
Table table = new Table();
FlickScrollPane scroll = new Flic... |
protected Response shardOperation(Request request, int shardId) throws ElasticSearchException {
// TODO: Look into combining the shard req's docs into one in memory index.
Response response = new Response();
response.items = new ArrayList<Response.Item>(request.items.size());
for (Re... | protected Response shardOperation(Request request, int shardId) throws ElasticSearchException {
// TODO: Look into combining the shard req's docs into one in memory index.
Response response = new Response();
response.items = new ArrayList<Response.Item>(request.items.size());
for (Re... |
public Client nodeClient() {
ensureOpen();
if (clientNode == null) {
String name = buildNodeName();
String settingsSource = getClass().getName().replace('.', '/') + ".yml";
Settings finalSettings = settingsBuilder().loadFromClasspath(settingsSource).put(defaultSet... | public Client nodeClient() {
ensureOpen();
if (clientNode == null) {
String name = "client_" + buildNodeName();
String settingsSource = getClass().getName().replace('.', '/') + ".yml";
Settings finalSettings = settingsBuilder().loadFromClasspath(settingsSource).pu... |
@Inject public AbstractCompoundWordTokenFilterFactory(Index index, @IndexSettings Settings indexSettings, Environment env, @Assisted String name, @Assisted Settings settings) {
super(index, indexSettings, name, settings);
minWordSize = settings.getAsInt("min_word_size", CompoundWordTokenFilterBase.... | @Inject public AbstractCompoundWordTokenFilterFactory(Index index, @IndexSettings Settings indexSettings, Environment env, @Assisted String name, @Assisted Settings settings) {
super(index, indexSettings, name, settings);
minWordSize = settings.getAsInt("min_word_size", CompoundWordTokenFilterBase.... |
public Weight createWeight(IndexSearcher searcher) throws IOException {
SearchContext searchContext = SearchContext.current();
BytesRefHash parentIds = new BytesRefHash(512, searchContext.bigArrays());
ParentIdCollector collector = new ParentIdCollector(parentType, parentChildIndexFieldData,... | public Weight createWeight(IndexSearcher searcher) throws IOException {
SearchContext searchContext = SearchContext.current();
BytesRefHash parentIds = new BytesRefHash(512, searchContext.bigArrays());
ParentIdCollector collector = new ParentIdCollector(parentType, parentChildIndexFieldData,... |
public Weight createWeight(IndexSearcher searcher) throws IOException {
SearchContext searchContext = SearchContext.current();
final Query childQuery;
if (rewrittenChildQuery == null) {
childQuery = rewrittenChildQuery = searcher.rewrite(originalChildQuery);
} else {
... | public Weight createWeight(IndexSearcher searcher) throws IOException {
SearchContext searchContext = SearchContext.current();
final Query childQuery;
if (rewrittenChildQuery == null) {
childQuery = rewrittenChildQuery = searcher.rewrite(originalChildQuery);
} else {
... |
public Weight createWeight(IndexSearcher searcher) throws IOException {
SearchContext searchContext = SearchContext.current();
BytesRefHash parentIds = new BytesRefHash(512, searchContext.bigArrays());
ParentIdsCollector collector = new ParentIdsCollector(parentType, parentChildIndexFieldDat... | public Weight createWeight(IndexSearcher searcher) throws IOException {
SearchContext searchContext = SearchContext.current();
BytesRefHash parentIds = new BytesRefHash(512, searchContext.bigArrays());
ParentIdsCollector collector = new ParentIdsCollector(parentType, parentChildIndexFieldDat... |
public Weight createWeight(IndexSearcher searcher) throws IOException {
SearchContext searchContext = SearchContext.current();
ParentIdAndScoreCollector collector = new ParentIdAndScoreCollector(searchContext, parentChildIndexFieldData, parentType);
final Query parentQuery;
if (rewr... | public Weight createWeight(IndexSearcher searcher) throws IOException {
SearchContext searchContext = SearchContext.current();
ParentIdAndScoreCollector collector = new ParentIdAndScoreCollector(searchContext, parentChildIndexFieldData, parentType);
final Query parentQuery;
if (rewr... |
@Test public void testSimpleStringTerms() throws Exception {
IndexStatus indexStatus = client.admin().indices().status(indicesStatus("test")).actionGet().index("test");
// verify no freqs
logger.info("Verify no freqs");
TermsResponse termsResponse = client.prepareTerms("test").setFi... | @Test public void testSimpleStringTerms() throws Exception {
IndexStatus indexStatus = client.admin().indices().prepareStatus("test").execute().actionGet().index("test");
// verify no freqs
logger.info("Verify no freqs");
TermsResponse termsResponse = client.prepareTerms("test").set... |
protected ShardStats shardOperation(IndexShardStatsRequest request) throws ElasticSearchException {
InternalIndexService indexService = (InternalIndexService) indicesService.indexServiceSafe(request.index());
InternalIndexShard indexShard = (InternalIndexShard) indexService.shardSafe(request.shardId... | protected ShardStats shardOperation(IndexShardStatsRequest request) throws ElasticSearchException {
InternalIndexService indexService = (InternalIndexService) indicesService.indexServiceSafe(request.index());
InternalIndexShard indexShard = (InternalIndexShard) indexService.shardSafe(request.shardId... |
private void setupShadowMap() {
shadowMap = new FrameBuffer(Format.RGBA8888, 512, 512, true);
lightCam = new PerspectiveCamera(67, shadowMap.getWidth(), shadowMap.getHeight());
lightCam.position.set(-10, 10, 0);
lightCam.lookAt(0, 0, 0);
lightCam.update();
shadowGenShader = new ShaderProgram(Gdx.file... | private void setupShadowMap() {
shadowMap = new FrameBuffer(Format.RGBA8888, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true);
lightCam = new PerspectiveCamera(67, shadowMap.getWidth(), shadowMap.getHeight());
lightCam.position.set(-10, 10, 0);
lightCam.lookAt(0, 0, 0);
lightCam.update();
shado... |
public static Texture loadTexture(String file) {
return Gdx.graphics.newTexture(Gdx.files.internal(file), TextureFilter.Nearest, TextureFilter.Nearest, TextureWrap.ClampToEdge, TextureWrap.ClampToEdge);
}
| public static Texture loadTexture(String file) {
return new Texture(Gdx.files.internal(file));
}
|
private void load () {
try {
tiles = Gdx.graphics.newTexture( Gdx.files.getFileHandle("data/tiles-3.png", FileType.Internal),
TextureFilter.MipMapLinearNearest, TextureFilter.Nearest,
TextureWrap.ClampToEdge, TextureWrap.ClampToEdge );
TextureAtlas atlas = new TextureAtlas(tile... | private void load () {
try {
tiles = Gdx.graphics.newTexture( Gdx.files.getFileHandle("data/tiles-3.png", FileType.Internal),
TextureFilter.MipMapLinearNearest, TextureFilter.Nearest,
TextureWrap.ClampToEdge, TextureWrap.ClampToEdge );
TextureAtlas atlas = new TextureAtlas(tile... |
private void buildValues(XContentBuilder builder, Terms curTerms, int termFreq) throws IOException {
if (!(curTerms.hasPayloads() || curTerms.hasOffsets() || curTerms.hasPositions())) {
return;
}
builder.startArray(FieldStrings.TOKENS);
for (int i = 0; i < termFreq; i++)... | private void buildValues(XContentBuilder builder, Terms curTerms, int termFreq) throws IOException {
if (!(curTerms.hasPayloads() || curTerms.hasOffsets() || curTerms.hasPositions())) {
return;
}
builder.startArray(FieldStrings.TOKENS);
for (int i = 0; i < termFreq; i++)... |
public static Module combine(Module... modules) {
return combine(ImmutableSet.of(modules));
}
| public static Module combine(Module... modules) {
return combine(ImmutableSet.copyOf(modules));
}
|
public FileHandle child (String name) {
return new GwtFileHandle(preloader, file.isEmpty() ? "" : (file + (file.endsWith("/") ? "" : "/")) + name, FileType.Internal);
}
| public FileHandle child (String name) {
return new GwtFileHandle(preloader, (file.isEmpty() ? "" : (file + (file.endsWith("/") ? "" : "/"))) + name, FileType.Internal);
}
|
private boolean isText (String extension) {
return extension.equals("json") || extension.equals("xml") || extension.equals("txt") || extension.equals("glsl")
|| extension.equals("fnt") || extension.equals("pack") || extension.equals("obj");
}
| private boolean isText (String extension) {
return extension.equals("json") || extension.equals("xml") || extension.equals("txt") || extension.equals("glsl")
|| extension.equals("fnt") || extension.equals("pack") || extension.equals("obj") || extension.equals("atlas");
}
|
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... |
public SignificantStringTerms buildAggregation(long owningBucketOrdinal) {
assert owningBucketOrdinal == 0;
if (globalOrdinals == null) { // no context in this reader
return buildEmptyAggregation();
}
final int size;
if (bucketCountThresholds.getMinDocCount() == ... | public SignificantStringTerms buildAggregation(long owningBucketOrdinal) {
assert owningBucketOrdinal == 0;
if (globalOrdinals == null) { // no context in this reader
return buildEmptyAggregation();
}
final int size;
if (bucketCountThresholds.getMinDocCount() == ... |
public Engine.Searcher acquireSearcher() {
readAllowed();
return engine.searcher();
}
| public Engine.Searcher acquireSearcher() {
readAllowed();
return engine.acquireSearcher();
}
|
public InternalNode(Settings pSettings, boolean loadConfigSettings) throws ElasticSearchException {
Tuple<Settings, Environment> tuple = InternalSettingsPerparer.prepareSettings(pSettings, loadConfigSettings);
ESLogger logger = Loggers.getLogger(Node.class, tuple.v1().get("name"));
logger.i... | public InternalNode(Settings pSettings, boolean loadConfigSettings) throws ElasticSearchException {
Tuple<Settings, Environment> tuple = InternalSettingsPerparer.prepareSettings(pSettings, loadConfigSettings);
ESLogger logger = Loggers.getLogger(Node.class, tuple.v1().get("name"));
logger.i... |
@BeforeClass public void setupQueryParser() throws IOException {
Settings settings = ImmutableSettings.settingsBuilder()
.put("index.cache.filter.type", "none")
.build();
Index index = new Index("test");
Injector injector = new ModulesBuilder().add(
... | @BeforeClass public void setupQueryParser() throws IOException {
Settings settings = ImmutableSettings.settingsBuilder()
.put("index.cache.filter.type", "none")
.build();
Index index = new Index("test");
Injector injector = new ModulesBuilder().add(
... |
@Test public void testCustomInjection() {
Settings settings = settingsBuilder()
.put("index.queryparser.query.my.type", MyJsonQueryParser.class)
.put("index.queryparser.query.my.param1", "value1")
.put("index.queryparser.filter.my.type", MyJsonFilterParser.cla... | @Test public void testCustomInjection() {
Settings settings = settingsBuilder()
.put("index.queryparser.query.my.type", MyJsonQueryParser.class)
.put("index.queryparser.query.my.param1", "value1")
.put("index.queryparser.filter.my.type", MyJsonFilterParser.cla... |
@Override public void processXContentFilterParsers(XContentFilterParsersBindings bindings) {
bindings.processXContentQueryFilter("my", PluginJsonFilterParser.class);
}
});
Index index = new Index("test");
Injector injector = new ModulesBuilder().add(
... | @Override public void processXContentFilterParsers(XContentFilterParsersBindings bindings) {
bindings.processXContentQueryFilter("my", PluginJsonFilterParser.class);
}
});
Index index = new Index("test");
Injector injector = new ModulesBuilder().add(
... |
private void testSimpleConfiguration(Settings settings) {
Index index = new Index("test");
Injector injector = Guice.createInjector(
new IndexSettingsModule(settings),
new IndexNameModule(index),
new AnalysisModule(settings));
AnalysisService ... | private void testSimpleConfiguration(Settings settings) {
Index index = new Index("test");
Injector injector = Guice.createInjector(
new IndexSettingsModule(settings),
new IndexNameModule(index),
new AnalysisModule(settings));
AnalysisService ... |
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... |
public RestTestSuite parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException {
XContentParser parser = parseContext.parser();
parser.nextToken();
assert parser.currentToken() == XContentParser.Token.START_OBJECT;
RestTestSuite restTestSuite = new Re... | public RestTestSuite parse(RestTestSuiteParseContext parseContext) throws IOException, RestTestParseException {
XContentParser parser = parseContext.parser();
parser.nextToken();
assert parser.currentToken() == XContentParser.Token.START_OBJECT;
RestTestSuite restTestSuite = new Re... |
public void testDuelESLucene() throws Exception {
AbstractTermVectorTests.TestFieldSetting[] testFieldSettings = getFieldSettings();
createIndexBasedOnFieldSettings("test", testFieldSettings);
//we generate as many docs as many shards we have
TestDoc[] testDocs = generateTestDocs(get... | public void testDuelESLucene() throws Exception {
AbstractTermVectorTests.TestFieldSetting[] testFieldSettings = getFieldSettings();
createIndexBasedOnFieldSettings("test", "alias", testFieldSettings);
//we generate as many docs as many shards we have
TestDoc[] testDocs = generateTes... |
public FacetCollector parse(String facetName, XContentParser parser, SearchContext context) throws IOException {
String field = null;
int size = 10;
String[] fieldsNames = null;
ImmutableSet<BytesRef> excluded = ImmutableSet.of();
String regex = null;
String regexFla... | public FacetCollector parse(String facetName, XContentParser parser, SearchContext context) throws IOException {
String field = null;
int size = 10;
String[] fieldsNames = null;
ImmutableSet<BytesRef> excluded = ImmutableSet.of();
String regex = null;
String regexFla... |
private String getSharedLibFilename (TargetOs os, boolean is64Bit, String sharedLibName) {
// generate shared lib prefix and suffix, determine jni platform headers directory
String libPrefix = "";
String libSuffix = "";
if (os == TargetOs.Windows) {
libSuffix = (is64Bit ? "64" : "") + ".dll";
}
if (os =... | private String getSharedLibFilename (TargetOs os, boolean is64Bit, String sharedLibName) {
// generate shared lib prefix and suffix, determine jni platform headers directory
String libPrefix = "";
String libSuffix = "";
if (os == TargetOs.Windows) {
libSuffix = (is64Bit ? "64" : "") + ".dll";
}
if (os =... |
protected void loadTileset (TiledMap map, Element element, FileHandle tmxFile, AtlasResolver resolver,
AtlasTiledMapLoaderParameters parameter) {
if (element.getName().equals("tileset")) {
String name = element.get("name", null);
int firstgid = element.getIntAttribute("firstgid", 1);
int tilewidth = eleme... | protected void loadTileset (TiledMap map, Element element, FileHandle tmxFile, AtlasResolver resolver,
AtlasTiledMapLoaderParameters parameter) {
if (element.getName().equals("tileset")) {
String name = element.get("name", null);
int firstgid = element.getIntAttribute("firstgid", 1);
int tilewidth = eleme... |
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", "g3d/fighter.g3db"
};
|
public void touchUp (ActorEvent event, float x, float y, int pointer, int button) {
if (pointer == 0 && isOver(event.getContextActor(), x, y)) clicked(event, x, y);
super.touchUp(event, x, y, pointer, button);
}
| public void touchUp (ActorEvent event, float x, float y, int pointer, int button) {
if (pointer == 0 && button == getButton() && isOver(event.getContextActor(), x, y)) clicked(event, x, y);
super.touchUp(event, x, y, pointer, button);
}
|
private static ImmutableMap<String, String> replacements = new MapBuilder<String, String>()
.put("console", "org.elasticsearch.util.logging.log4j.ConsoleAppender")
.put("async", "org.apache.log4j.AsyncAppender")
.put("dailyRollingFile", "org.apache.log4j.DailyRollingFileAppender"... | private static ImmutableMap<String, String> replacements = new MapBuilder<String, String>()
.put("console", "org.elasticsearch.util.logging.log4j.ConsoleAppender")
.put("async", "org.apache.log4j.AsyncAppender")
.put("dailyRollingFile", "org.apache.log4j.DailyRollingFileAppender"... |
@Override public long count(float minScore, byte[] querySource, int querySourceOffset, int querySourceLength,
@Nullable String queryParserName, String... types) throws ElasticSearchException {
readAllowed();
IndexQueryParser queryParser = queryParserService.defaultInd... | @Override public long count(float minScore, byte[] querySource, int querySourceOffset, int querySourceLength,
@Nullable String queryParserName, String... types) throws ElasticSearchException {
readAllowed();
IndexQueryParser queryParser = queryParserService.defaultInd... |
public boolean writeSamples (int numSamples, float[] buffer) {
if (format.getChannels() == 1) {
int remainingSamples = Math.min(samples.length, writtenSamples + numSamples / 2);
for (int i = writtenSamples, j = 0; i < remainingSamples; i++, j += 2) {
buffer[j] += samples[i] * volume;
buffer[j + 1... | public boolean writeSamples (int numSamples, float[] buffer) {
if (format.getChannels() == 1) {
int remainingSamples = Math.min(samples.length, writtenSamples + numSamples / 2);
for (int i = writtenSamples, j = 0; i < remainingSamples; i++, j += 2) {
buffer[j] += samples[i] * volume;
buffer[j + 1... |
public LwjglMusic (LwjglFileHandle handle) throws UnsupportedAudioFileException, IOException, LineUnavailableException {
this.file = handle.getFile();
openAudioInputStream();
AudioFormat audioFormat = ain.getFormat();
line = AudioSystem.getSourceDataLine(audioFormat);
line.open(audioFormat); // FIXME reduce... | public LwjglMusic (LwjglFileHandle handle) throws UnsupportedAudioFileException, IOException, LineUnavailableException {
this.file = handle.getFile();
openAudioInputStream();
AudioFormat audioFormat = ain.getFormat();
line = AudioSystem.getSourceDataLine(audioFormat);
line.open(audioFormat); // FIXME reduce... |
public void setClipRect (Rect rect) {
if (rendering) spriteBatch.renderMesh();
if (rect == null) {
Gdx.gl.glDisable(GL10.GL_SCISSOR_TEST);
hasScissor = false;
} else {
Gdx.gl.glScissor(rect.getX(), Gdx.graphics.getHeight() - rect.getBottom(), rect.getWidth(), rect.getHeight());
if (!hasScissor) {
... | public void setClipRect (Rect rect) {
if (rendering) spriteBatch.flush();
if (rect == null) {
Gdx.gl.glDisable(GL10.GL_SCISSOR_TEST);
hasScissor = false;
} else {
Gdx.gl.glScissor(rect.getX(), Gdx.graphics.getHeight() - rect.getBottom(), rect.getWidth(), rect.getHeight());
if (!hasScissor) {
Gdx.... |
public enum FileType {
Internal, External, Absolut
}
| public enum FileType {
Internal, External, Absolute
}
|
public void destroyFixture(Fixture fixture)
{
jniDestroyFixture( addr, fixture.addr );
this.world.fixtures.remove(fixture);
this.fixtures.remove(fixture);
}
| public void destroyFixture(Fixture fixture)
{
jniDestroyFixture( addr, fixture.addr );
this.world.fixtures.remove(fixture.addr);
this.fixtures.remove(fixture);
}
|
@Override public Iterable<? extends Module> spawnModules() {
return ImmutableList.of(Modules.createModule(settings.getAsClass("transport.type", CachedThreadPoolModule.class, "org.elasticsearch.threadpool.", "ThreadPoolModule"), settings));
}
| @Override public Iterable<? extends Module> spawnModules() {
return ImmutableList.of(Modules.createModule(settings.getAsClass("threadpool.type", CachedThreadPoolModule.class, "org.elasticsearch.threadpool.", "ThreadPoolModule"), settings));
}
|
@Inject public ScalingThreadPool(Settings settings) {
super(settings);
this.min = componentSettings.getAsInt("min", 10);
this.max = componentSettings.getAsInt("max", 100);
this.keepAlive = componentSettings.getAsTime("keep_alive", timeValueSeconds(60));
this.scheduledSize = c... | @Inject public ScalingThreadPool(Settings settings) {
super(settings);
this.min = componentSettings.getAsInt("min", 10);
this.max = componentSettings.getAsInt("max", 100);
this.keepAlive = componentSettings.getAsTime("keep_alive", timeValueSeconds(60));
this.scheduledSize = c... |
public static ESLogger getLogger(ESLogger parentLogger, String s) {
return getLogger(parentLogger.getName() + s, parentLogger.getPrefix());
}
| public static ESLogger getLogger(ESLogger parentLogger, String s) {
return ESLoggerFactory.getLogger(parentLogger.getPrefix(), getLoggerName(parentLogger.getName() + s));
}
|
public void execute(SearchContext context) {
ResetFieldSelector fieldSelector;
List<String> extractFieldNames = null;
boolean sourceRequested = false;
if (!context.hasFieldNames()) {
if (context.hasPartialFields()) {
// partial fields need the source, so f... | public void execute(SearchContext context) {
ResetFieldSelector fieldSelector;
List<String> extractFieldNames = null;
boolean sourceRequested = false;
if (!context.hasFieldNames()) {
if (context.hasPartialFields()) {
// partial fields need the source, so f... |
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 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... |
public static boolean runTest (String testName) {
GdxTest test = GdxTests.newTest(testName);
if (test == null) {
return false;
}
JglfwApplicationConfiguration config = new JglfwApplicationConfiguration();
config.width = 640;
config.height = 480;
config.title = testName;
config.useGL20 = test.needsGL... | public static boolean runTest (String testName) {
GdxTest test = GdxTests.newTest(testName);
if (test == null) {
return false;
}
JglfwApplicationConfiguration config = new JglfwApplicationConfiguration();
config.width = 640;
config.height = 480;
config.title = testName;
config.useGL20 = test.needsGL... |
public int read () throws IOException {
if (pos == blob.length()) return -1;
return blob.get(pos++);
}
}
| public int read () throws IOException {
if (pos == blob.length()) return -1;
return blob.get(pos++) & 0xff;
}
}
|
public Cube(Map map, float x, float y) {
this.map = map;
this.pos.x = x;
this.pos.y = y;
this.bounds.x = pos.x + 0.2f;
this.bounds.y = pos.y + 0.2f;
this.bounds.width = this.bounds.height = 0.60f;
}
| public Cube(Map map, float x, float y) {
this.map = map;
this.pos.x = x;
this.pos.y = y;
this.bounds.x = pos.x + 0.2f;
this.bounds.y = pos.y + 0.2f;
this.bounds.width = this.bounds.height = 1.0f;
}
|
public static void main(String[] args) throws Exception {
Settings settings = settingsBuilder()
.put("index.engine.robin.refreshInterval", "-1")
.put("gateway.type", "local")
.put(SETTING_NUMBER_OF_SHARDS, 1)
.put(SETTING_NUMBER_OF_REPLICAS, 0)... | public static void main(String[] args) throws Exception {
Settings settings = settingsBuilder()
.put("index.engine.robin.refreshInterval", "-1")
.put("gateway.type", "local")
.put(SETTING_NUMBER_OF_SHARDS, 1)
.put(SETTING_NUMBER_OF_REPLICAS, 0)... |
public static void main(String[] args) throws Exception {
Settings settings = settingsBuilder()
.put("index.engine.robin.refreshInterval", "-1")
.put("gateway.type", "local")
.put(SETTING_NUMBER_OF_SHARDS, 1)
.put(SETTING_NUMBER_OF_REPLICAS, 0)... | public static void main(String[] args) throws Exception {
Settings settings = settingsBuilder()
.put("index.engine.robin.refreshInterval", "-1")
.put("gateway.type", "local")
.put(SETTING_NUMBER_OF_SHARDS, 1)
.put(SETTING_NUMBER_OF_REPLICAS, 0)... |
public void begin (final Camera camera, final RenderContext context) {
this.context = context;
this.camera = camera;
context.setDepthTest(true, GL10.GL_LEQUAL);
Gdx.gl10.glMatrixMode(GL10.GL_PROJECTION);
Gdx.gl10.glLoadMatrixf(camera.combined.val, 0);
Gdx.gl10.glMatrixMode(GL10.GL_MODELVIEW);
}
| public void begin (final Camera camera, final RenderContext context) {
this.context = context;
this.camera = camera;
context.setDepthTest(GL10.GL_LEQUAL, 0, 1, true);
Gdx.gl10.glMatrixMode(GL10.GL_PROJECTION);
Gdx.gl10.glLoadMatrixf(camera.combined.val, 0);
Gdx.gl10.glMatrixMode(GL10.GL_MODELVIEW);
}
|
protected Shader createShader(final Renderable renderable) {
Gdx.app.log("DefaultShaderProvider", "Creating new shader");
if (Gdx.graphics.isGL20Available()) {
return new DefaultShader(vertexShader, fragmentShader, renderable.material, renderable.mesh.getVertexAttributes(), renderable.lights != null, r... | protected Shader createShader(final Renderable renderable) {
Gdx.app.log("DefaultShaderProvider", "Creating new shader");
if (Gdx.graphics.isGL20Available()) {
return new DefaultShader(vertexShader, fragmentShader, renderable, renderable.lights != null, renderable.lights != null && renderable.lights.fo... |
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 Sha... | 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 Sha... |
protected PrimaryResponse<BulkShardResponse, BulkShardRequest> shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) {
final BulkShardRequest request = shardRequest.request;
IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shard... | protected PrimaryResponse<BulkShardResponse, BulkShardRequest> shardOperationOnPrimary(ClusterState clusterState, PrimaryOperationRequest shardRequest) {
final BulkShardRequest request = shardRequest.request;
IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.request.index()).shard... |
public ShardReplicationOperationRequest(T request) {
super(request);
this.timeout = request.timeout();
this.index = request.index();
this.threadedOperation = request.threadedOperation;
this.replicationType = request.replicationType();
this.consistencyLevel = request.c... | public ShardReplicationOperationRequest(T request) {
super(request);
this.timeout = request.timeout();
this.index = request.index();
this.threadedOperation = request.operationThreaded();
this.replicationType = request.replicationType();
this.consistencyLevel = request... |
public MoreLikeThisRequest searchSource(SearchSourceBuilder sourceBuilder) {
BytesStream bos = sourceBuilder.buildAsUnsafeBytes(Requests.CONTENT_TYPE);
this.searchSource = bos.underlyingBytes();
this.searchSourceOffset = 0;
this.searchSourceLength = bos.size();
this.searchSou... | public MoreLikeThisRequest searchSource(SearchSourceBuilder sourceBuilder) {
BytesStream bos = sourceBuilder.buildAsBytesStream(Requests.CONTENT_TYPE);
this.searchSource = bos.underlyingBytes();
this.searchSourceOffset = 0;
this.searchSourceLength = bos.size();
this.searchSou... |
public static void main(String[] args) throws Exception {
System.setProperty("es.logger.prefix", "");
Settings settings = ImmutableSettings.settingsBuilder().build();
Node[] nodes = new Node[5];
for (int i = 0; i < nodes.length; i++) {
nodes[i] = NodeBuilder.nodeBuilder... | public static void main(String[] args) throws Exception {
System.setProperty("es.logger.prefix", "");
Settings settings = ImmutableSettings.settingsBuilder().build();
Node[] nodes = new Node[5];
for (int i = 0; i < nodes.length; i++) {
nodes[i] = NodeBuilder.nodeBuilder... |
public boolean isTouched (int pointer) {
if (pointer == 0)
return touchDown;
else
return false;
}
void processEvents () {
synchronized (this) {
justTouched = false;
if (processor != null) {
InputProcessor processor = this.processor;
int len = keyEvents.size();
for (int i = 0; i < len... | public boolean isTouched (int pointer) {
if (pointer == 0)
return touchDown;
else
return false;
}
void processEvents () {
synchronized (this) {
justTouched = false;
if (processor != null) {
InputProcessor processor = this.processor;
int len = keyEvents.size();
for (int i = 0; i < len... |
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 boolean touchDragged (float x, float y, int pointer) {
if (pointer > 1) return false;
if (longPressFired) return false;
// handle pinch zoom
if (pinching) {
if (pointer == 0)
pointer1.set(x, y);
else
pointer2.set(x, y);
if (listener != null) {
boolean result = listener.pinch(initia... | public boolean touchDragged (float x, float y, int pointer) {
if (pointer > 1) return false;
if (longPressFired) return false;
// handle pinch zoom
if (pinching) {
if (pointer == 0)
pointer1.set(x, y);
else
pointer2.set(x, y);
if (listener != null) {
boolean result = listener.pinch(initia... |
public void run() {
List<User> orgs;
try {
orgs = cache.requestAndStore(persistedOrgs);
syncResult.stats.numUpdates++;
} catch (IOException e) {
syncResult.stats.numIoExceptions++;
Log.d(TAG, "Exception requesting users and orgs", e);
... | public void run() {
List<User> orgs;
try {
orgs = cache.requestAndStore(persistedOrgs);
syncResult.stats.numUpdates++;
} catch (IOException e) {
syncResult.stats.numIoExceptions++;
Log.d(TAG, "Exception requesting users and orgs", e);
... |
public static void main (String[] argv) {
new JoglApplication(new com.badlogic.gdx.tests.CullTest(), "Debug Test", 480, 320, false);
}
| public static void main (String[] argv) {
new JoglApplication(new com.badlogic.gdx.tests.PickingTest(), "Debug Test", 480, 320, false);
}
|
public GetResult innerGet(String type, String id, String[] gFields, boolean realtime) throws ElasticSearchException {
boolean loadSource = gFields == null || gFields.length > 0;
Engine.GetResult get = null;
if (type == null || type.equals("_all")) {
for (String typeX : mapperServ... | public GetResult innerGet(String type, String id, String[] gFields, boolean realtime) throws ElasticSearchException {
boolean loadSource = gFields == null || gFields.length > 0;
Engine.GetResult get = null;
if (type == null || type.equals("_all")) {
for (String typeX : mapperServ... |
public void execute(SearchContext context) {
ResetFieldSelector fieldSelector;
List<String> extractFieldNames = null;
boolean sourceRequested = false;
if (!context.hasFieldNames()) {
if (context.hasPartialFields()) {
// partial fields need the source, so f... | public void execute(SearchContext context) {
ResetFieldSelector fieldSelector;
List<String> extractFieldNames = null;
boolean sourceRequested = false;
if (!context.hasFieldNames()) {
if (context.hasPartialFields()) {
// partial fields need the source, so f... |
void reset();
/*
* Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "Lic... | void reset();
/*
* Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "Lic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.